kucoin-universal-sdk
Version:
Official KuCoin Universal SDK.
32 lines • 1.71 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const model_index_price_event_1 = require("./model_index_price_event");
const model_mark_price_event_1 = require("./model_mark_price_event");
const common_1 = require("../../../model/common");
describe('Auto Test', () => {
test('indexPrice response test', () => {
/**
* indexPrice
* Index Price
* /indexPrice/indicator/index:_symbol_,_symbol_
*/
let data = '{"id":"5c24c5da03aa673885cd67a0","type":"message","topic":"/indicator/index:USDT-BTC","subject":"tick","data":{"symbol":"USDT-BTC","granularity":5000,"timestamp":1551770400000,"value":0.0001092}}';
let commonResp = common_1.WsMessage.fromJson(data);
let resp = model_index_price_event_1.IndexPriceEvent.fromObject(commonResp.data);
expect(Object.values(resp).every((value) => value === null || value === undefined)).toBe(false);
console.log(resp);
});
test('markPrice response test', () => {
/**
* markPrice
* Mark Price
* /markPrice/indicator/markPrice:_symbol_,_symbol_
*/
let data = '{"id":"5c24c5da03aa673885cd67aa","type":"message","topic":"/indicator/markPrice:USDT-BTC","subject":"tick","data":{"symbol":"USDT-BTC","granularity":5000,"timestamp":1551770400000,"value":0.0001093}}';
let commonResp = common_1.WsMessage.fromJson(data);
let resp = model_mark_price_event_1.MarkPriceEvent.fromObject(commonResp.data);
expect(Object.values(resp).every((value) => value === null || value === undefined)).toBe(false);
console.log(resp);
});
});
//# sourceMappingURL=ws_margin_public.test.js.map