UNPKG

@hydro-protocol/hydro-client-js

Version:
37 lines (36 loc) 1.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var bignumber_js_1 = require("bignumber.js"); /** * Data used to represent a trade on the exchange. The values in this class * may not be set to useful values depending on the source, for example if * you are looking at data of a trade made by someone else it will only contain * a minimal amount of data, and orders that come through from websocket events * will also be more stripped down. You can expect the class to contain full * data whenever querying for your own trades. */ var Trade = /** @class */ (function () { function Trade(json) { this.marketId = json.marketId; this.status = json.status; this.transactionId = json.transactionId; this.makerOrderId = json.makerOrderId; this.takerOrderId = json.takerOrderId; this.maker = json.maker; this.taker = json.taker; this.buyer = json.buyer; this.seller = json.seller; this.amount = json.amount ? new bignumber_js_1.BigNumber(json.amount) : new bignumber_js_1.BigNumber("0"); this.price = json.price ? new bignumber_js_1.BigNumber(json.price) : new bignumber_js_1.BigNumber("0"); this.takerPrice = json.takerPrice ? new bignumber_js_1.BigNumber(json.takerPrice) : new bignumber_js_1.BigNumber("0"); this.feeAmount = json.feeAmount ? new bignumber_js_1.BigNumber(json.feeAmount) : new bignumber_js_1.BigNumber("0"); this.createdAt = new Date(json.createdAt); this.executedAt = new Date(json.executedAt); } return Trade; }()); exports.Trade = Trade;