npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bitdo2

v1.0.20

Published

A cryptocurrency order-rule executor

Downloads

33

Readme

BitDo2

Build Status npm npm

NOTE: BitDo2 is still under development, and can't execute rules quite yet. It can display and track your holding history to a local database. Please wait a little bit longer until it can execute rules.

A cryptocurrency automated trader (not an intelligent trader!) and set of utilities.

The intention of this is to provide a configurable platform for performing automated trades at preset points.

Installing

Make sure to use at least node 6.x. You can always find the version of node I'm using in the .nvmrc file.

If you get an error about installing/loading the exchanges or plugins, make sure you're running an up-to-date version of npm. You can update npm by running npm update -g npm.

npm install -g bitdo2

Configuration

You will need a file bitdo.conf that contains your exchange configuration.

It should look something like this (Fill in your own secrets):

exchanges:
  gdax:
    passphrase: xxx
    key: yyy
    b64secret: zzz
  bittrex:
    apikey: www
    apisecret: ddd
  robinhood:
    username: xxx
    password: yyy
verbose: false

Usage

Along with being a platform library, there are several utilities you can use that ship with bitdo2.

Using as a Library

By default, you can use bitdo2 as a library in your own applications. It exports the common exchange abstraction, so you can operate on various exchanges without having to worry about their specific APIs.

eg.

const bitdo2 = require('bitdo2');
bitdo2.createExchange('gdax', {... config ...});

OR

bitdo2.createFromConfig({
  gdax: {
    ...
  },
  bittrex: {
    ...
  }
});

UI

Run: bitdo-ui

Make sure you have configuration in the current directory.

You will be presented with a UI showing your current holdings and orders.

Watch

Run: bitdo-watch --help

Watches prices or orders for completion or failure cases. Meant to be chained with something else, eg:

# Watch an order and alert
bitdo-watch -p gdax:BTC-USD --crosses 20000 --timeout 1d && notify-send "Bitcoin crossed 20000!" || notify-send "Bitcoin didnt cross after a day"

# Trigger an order when a price dips below a value
bitdo-watch -p gdax:BTC-USD --below 18000 --timeout 1d && bitdo-order buy -p gdax:BTC-USD --price 18000 --amount 0.1 || echo "Order timed out"

# And can even be chained for more complex scenarios (Crosses below, then back up)
bitdo-watch -p gdax:BTC-USD --below 18000 && bitdo-watch -p gdax:BTC-USD --above 18500 || bitdo-order ...

Order

Run: bitdo-order --help

This allows you to execute buy/sell/trail orders via command line on any configured exchanges.

DO SO AT YOUR OWN RISK!

Recorder

Run: bitdo-recorder

This will (by default) poll your holdings in exchanges and write them to a sqlite DB so you can track them over time.

Uses Sequelize to write to DB, so can use any database it supports (mysql, postgres, etc)

Plugins

There are two abstracted parts of bitdo2 that support plugins: exchanges and plugins

Exchanges

Although bitdo2 comes with a set of exchanges builtin (though internally, they're just plugins), you can extend this by creating a global package (or installing a global package) with the name bitdo-exchange-XXX, where XXX is the name of your exchange.

When loading, bitdo will search for a local exchange first, and if one is not found, will check the global packages.

If you want to implement a new exchange, look at the plugin constract for required methods and contracts.

Plugins

Some pieces of bitdo use plugins to extend the application without needing to pull the dependencies into the main app.

Similar to the exchange, these plugins will first be loaded internally, and then searched for in the global node modules with the pattern bitdo-plugin-XXX.

To develop a plugin look at plugin contract

License

Copyright (c) 2017 Christopher LaPointe

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.