Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
btc-china-fork
Advanced tools
Readme
A node.js wrapper for the Trading and Market APIs exposed by bitcoin exchange BTC China. You will need have a registered account with BTC China and generated API keys to access the private methods.
Please contact support@btcchina.com if you are having trouble opening and account or generating an API key.
npm install btc-china
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:
var BTCChina = require('btc-china');
// Test public data APIs
var publicClient = new BTCChina();
publicClient.getTicker(console.log, 'BTCCNY');
publicClient.getOrderBook(console.log, 'BTCCNY');
// get 2 trades since 1 minute ago
var since1Minute = new Date().getTime() / 1000 - 60;
//publicClient.getHistoryData(console.log, {limit: 2, since: since1Minute, sincetype: 'time' });
// WARNING never commit your API keys into a public repository.
var key = 'your-api-key';
var secret = 'your-api-secret';
var privateClient = new BTCChina(key, secret);
privateClient.getAccountInfo(console.log, 'all');
// add limit orders
privateClient.createOrder2(console.log, 'buy', 999, 0.0001, 'BTCCNY');
privateClient.createOrder2(console.log, 'sell', 8888, 0.0002, 'BTCCNY');
// add market order
privateClient.createOrder2(console.log, 'buy', null, 0.0001, 'BTCCNY');
// cancel an order
privateClient.cancelOrder(console.log, 1);
// get your open orders
privateClient.getOrders(console.log);
Please see exmaples.js for more examples
FAQs
Node.js API wrapper to BTCC (formally BTC China) bitcoin exchange
The npm package btc-china-fork receives a total of 17 weekly downloads. As such, btc-china-fork popularity was classified as not popular.
We found that btc-china-fork demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.