Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
fix(Trade): do not serialize amount, currency, and time data
Browse files Browse the repository at this point in the history
  • Loading branch information
Thore3 committed Sep 15, 2016
1 parent a0065a7 commit 76137a1
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/coinify/trade.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,25 +456,9 @@ CoinifyTrade.prototype.toJSON = function () {
state: this._state,
tx_hash: this._txHash,
confirmed: this.confirmed,
is_buy: this.isBuy,
createTime: this._createdAt,
inCurrency: this._inCurrency,
outCurrency: this._outCurrency,
transferIn: {}
is_buy: this.isBuy
};

if (this._inCurrency === 'BTC') {
serialized.inAmount = Helpers.fromSatoshi(this._inAmount);
serialized.transferIn.sendAmount = Helpers.fromSatoshi(this._sendAmount);
serialized.outAmount = Helpers.fromCents(this._outAmount);
serialized.outAmountExpected = Helpers.fromCents(this._outAmountExpected);
} else {
serialized.inAmount = Helpers.fromCents(this._inAmount);
serialized.transferIn.sendAmount = Helpers.fromCents(this._sendAmount);
serialized.outAmount = Helpers.fromSatoshi(this._outAmount);
serialized.outAmountExpected = Helpers.fromSatoshi(this._outAmountExpected);
}

this._coinify.delegate.serializeExtraFields(serialized, this);

return serialized;
Expand Down

0 comments on commit 76137a1

Please sign in to comment.