UNPKG

kucoin-universal-sdk

Version:
103 lines 4.48 kB
"use strict"; // Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.CrossMarginPositionEventCallbackWrapper = exports.CrossMarginPositionEvent = void 0; const class_transformer_1 = require("class-transformer"); const common_1 = require("../../../model/common"); class CrossMarginPositionEvent { constructor() { // @ts-ignore this.debtRatio = null; // @ts-ignore this.totalAsset = null; // @ts-ignore this.marginCoefficientTotalAsset = null; // @ts-ignore this.totalDebt = null; // @ts-ignore this.assetList = null; // @ts-ignore this.debtList = null; // @ts-ignore this.timestamp = null; // @ts-ignore this.type = null; } setCommonResponse(response) { this.commonResponse = response; } /** * Convert the object to a JSON string. */ toJson() { return JSON.stringify((0, class_transformer_1.instanceToPlain)(this)); } /** * Create an object from a JSON string. */ static fromJson(input) { return this.fromObject(JSON.parse(input)); } /** * Create an object from Js Object. */ static fromObject(jsonObject) { return (0, class_transformer_1.plainToClassFromExist)(new CrossMarginPositionEvent(), jsonObject); } } exports.CrossMarginPositionEvent = CrossMarginPositionEvent; __decorate([ (0, class_transformer_1.Exclude)(), __metadata("design:type", common_1.WsMessage) ], CrossMarginPositionEvent.prototype, "commonResponse", void 0); (function (CrossMarginPositionEvent) { let TypeEnum; (function (TypeEnum) { /** * When the debt ratio exceeds the liquidation threshold and the position is frozen, the system will push this event. */ TypeEnum[TypeEnum["FROZEN_FL"] = 'FROZEN_FL'] = "FROZEN_FL"; /** * When the liquidation is finished and the position returns to “EFFECTIVE” status, the system will push this event. */ TypeEnum[TypeEnum["UNFROZEN_FL"] = 'UNFROZEN_FL'] = "UNFROZEN_FL"; /** * When the auto-borrow renewing is complete and the position returns to “EFFECTIVE” status, the system will push this event. */ TypeEnum[TypeEnum["FROZEN_RENEW"] = 'FROZEN_RENEW'] = "FROZEN_RENEW"; /** * When the account reaches a negative balance, the system will push this event. */ TypeEnum[TypeEnum["UNFROZEN_RENEW"] = 'UNFROZEN_RENEW'] = "UNFROZEN_RENEW"; /** * When the account reaches a negative balance, the system will push this event. */ TypeEnum[TypeEnum["LIABILITY"] = 'LIABILITY'] = "LIABILITY"; /** * When all the liabilities are repaid and the position returns to “EFFECTIVE” status, the system will push this event. */ TypeEnum[TypeEnum["UNLIABILITY"] = 'UNLIABILITY'] = "UNLIABILITY"; })(TypeEnum = CrossMarginPositionEvent.TypeEnum || (CrossMarginPositionEvent.TypeEnum = {})); })(CrossMarginPositionEvent || (exports.CrossMarginPositionEvent = CrossMarginPositionEvent = {})); class CrossMarginPositionEventCallbackWrapper { constructor(callback) { this.callback = callback; this.callback = callback; } onMessage(msg) { let event = CrossMarginPositionEvent.fromObject(msg.data); event.setCommonResponse(msg); this.callback(msg.topic, msg.subject, event); } } exports.CrossMarginPositionEventCallbackWrapper = CrossMarginPositionEventCallbackWrapper; //# sourceMappingURL=model_cross_margin_position_event.js.map