UNPKG

kucoin-universal-sdk

Version:
33 lines 1.93 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const model_get_margin_risk_limit_resp_1 = require("./model_get_margin_risk_limit_resp"); const model_get_margin_risk_limit_req_1 = require("./model_get_margin_risk_limit_req"); const common_1 = require("../../../model/common"); describe('Auto Test', () => { test('getMarginRiskLimit request test', () => { /** * getMarginRiskLimit * Get Margin Risk Limit * /api/v3/margin/currencies */ let data = '{"isIsolated": true, "currency": "BTC", "symbol": "BTC-USDT"}'; let req = model_get_margin_risk_limit_req_1.GetMarginRiskLimitReq.fromJson(data); expect(Object.values(req).every((value) => value === null || value === undefined)).toBe(false); console.log(req); }); test('getMarginRiskLimit response test', () => { /** * getMarginRiskLimit * Get Margin Risk Limit * /api/v3/margin/currencies */ let data = '{\n "code": "200000",\n "data": [\n {\n "timestamp": 1729678659275,\n "currency": "BTC",\n "borrowMaxAmount": "75.15",\n "buyMaxAmount": "217.12",\n "holdMaxAmount": "217.12",\n "borrowCoefficient": "1",\n "marginCoefficient": "1",\n "precision": 8,\n "borrowMinAmount": "0.001",\n "borrowMinUnit": "0.0001",\n "borrowEnabled": true\n }\n ]\n}\n'; let commonResp = common_1.RestResponse.fromJson(data); let resp = model_get_margin_risk_limit_resp_1.GetMarginRiskLimitResp.fromObject(commonResp.data); if (commonResp.data !== null) { expect(Object.values(resp).every((value) => value === null || value === undefined)).toBe(false); console.log(resp); } }); }); //# sourceMappingURL=api_risk_limit.test.js.map