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