Skip to content

tech-api/spots_nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to Bibox Spots Client 👋

Version License: MIT

Bibox平台现货Nodejs版本SDK

Dependency

需要 node v14+

Usage

// 如果出现网络问题,你可能需要代理或者重设client的相关地址参数

// 新建客户端对象 公开的api可以不传apiKey与secretKey
const { BiboxSpotsClient  } = require( "../../biboxFuturesClient" );
const apiKey = "Your apiKey";
const secretKey = "Your secretKey";
const client = new BiboxSpotsClient( apiKey, secretKey );
        
// 公开的api 获取kline
let res = await client.getCandlestick( "BTC_USDT", TimeInterval.DAILY, 10 );
console.log( res );

// 用户的api 转入或转出现货账户
await client.transferIn( "IRIS", 10 );
await client.transferOut( "IRIS", 10 );

// 用户的api 下单
let orderId = await client.placeLimitOrder( {
    symbol: "IRIS_USDT",
    quantity: 20,
    price: 0.0517,
    tradeSide: TradeSide.BID,
} );
console.log( orderId );

// 公开的订阅 订阅kline
client.subscribeCandlestick( "BTC_USD", TimeInterval.ONE_MINUTE, ( data ) => {
    console.log( "BTC_USDT", data );
} );

// 用户的订阅 用户资产数据
client.subscribeAccount(  ( data ) => {
    console.log( data );
} );

// 更多的可以参考测试用例

Author

👤 Biboxcom

Show your support

Give a ⭐️ if this project helped you!

About

Nodejs SDK for Bibox Spots API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •