Skip to content

Commit

Permalink
gateio parseTransaction fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Feb 11, 2022
1 parent fbe6d9c commit 8e6b9d2
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions js/gateio.js
Expand Up @@ -2130,16 +2130,13 @@ module.exports = class gateio extends Exchange {
// }
//
// withdrawals
const amount = this.safeNumber (transaction, 'amount');
const id = this.safeString (transaction, 'id');
let type = undefined;
let amount = this.safeString (transaction, 'amount');
if (id[0] === 'b') {
// GateCode redemption
if (amount > 0) {
type = 'deposit'
} else {
type = 'withdrawal'
}
// GateCode handling
type = Precise.stringGt (amount, '0') ? 'deposit' : 'withdrawal';
amount = Precise.stringAbs (amount);
} else if (id !== undefined) {
type = this.parseTransactionType (id[0]);
}
Expand All @@ -2160,7 +2157,7 @@ module.exports = class gateio extends Exchange {
'id': id,
'txid': txid,
'currency': code,
'amount': amount,
'amount': this.parseNumber (amount),
'network': undefined,
'address': address,
'addressTo': undefined,
Expand Down

0 comments on commit 8e6b9d2

Please sign in to comment.