1.0.7 • Published 11 months ago

bitget-node-api v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

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)
1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago