This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 1,000,000+ packages pre-installed, including
btc-markets with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
This library is a node.js wrapper for the private and public methods exposed by the BTC Markets API. You will need to have a registered account with BTC Markets and generated API keys to access the private methods.
Please contact firstname.lastname@example.org if you are having trouble opening an account or generating an API key.
npm install btc-markets
This library has bee upgraded to be written in TypeScript and use promises. If you want the old version that used to callbacks, then use v0.0.10.
Other changes are:
The first parameter to each API function is a callback function which is passed error and data objects.
The error object is an instance of VError which is an extension of the standard Error object. The three main properties are:
Do not commit your API keys into public source code repositories. These can be in code, config files or IDE config files used to run tests or processes.
If you can't avoid committing API keys into your repo then use something like git-crypt.
Most cloud providers now offer solutions for securely storing API keys. For example:
And while I'm at it, make sure you enable two-factor authentication. Your account is easy to hack without 2FA enabled. You have been warned!
If you'd like to thank me for this library, you can always donate some of your crypto trading profits to:
The following is from examples.js