bitget-node-api
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

Instructions

Install

npm i bitget-api-node

API

const bitgetApi = require('bitget-api-node')
const { test, describe, expect } = require('@jest/globals')

const apiKey = ''
const secretKey = ''
const passphrase = ''
describe('test accounts', () => {
  test('accounts', () => {
    const mixAccountApi = new bitgetApi.default.MixAccountApi(apiKey, secretKey, passphrase)
    mixAccountApi.accounts('umcbl').then((data) => {
      console.info(data)
    })
  })
})

websocket

var bitgetApi = require('bitget-api-node')

const apiKey = ''
const secretKey = ''
const passphrase = ''
//Implementation class for processing messages
class ListennerObj extends bitgetApi.Listenner {
  reveice(message) {
    console.info('>>>' + message)
  }
}

const listenner = new ListennerObj()
const bitgetWsClient = new bitgetApi.BitgetWsClient(listenner, apiKey, secretKey, passphrase)
const subArr = new Array()

const subscribeOne = new bitgetApi.SubscribeReq('mc', 'ticker', 'BTCUSD')
const subscribeTow = new bitgetApi.SubscribeReq('SP', 'candle1W', 'BTCUSDT')

subArr.push(subscribeOne)
subArr.push(subscribeTow)

bitgetWsClient.subscribe(subArr)

Dependents (0)

Package Sidebar

Install

npm i bitget-node-api

Weekly Downloads

1

Version

1.0.7

License

MIT

Unpacked Size

257 kB

Total Files

160

Last publish

Collaborators

  • gorgev