Skip to content

Commit

Permalink
Merge pull request #16128 from samgermain/ascendex-parse-transaction
Browse files Browse the repository at this point in the history
ascendex parseTransaction unification
  • Loading branch information
kroitor committed Dec 20, 2022
2 parents 1e04000 + 3893bea commit ef6bf0b
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions js/ascendex.js
Expand Up @@ -2422,39 +2422,35 @@ module.exports = class ascendex extends Exchange {
// }
// }
//
const id = this.safeString (transaction, 'requestId');
const amount = this.safeNumber (transaction, 'amount');
const destAddress = this.safeValue (transaction, 'destAddress', {});
const address = this.safeString (destAddress, 'address');
const tag = this.safeString (destAddress, 'destTag');
const txid = this.safeString (transaction, 'networkTransactionId');
const type = this.safeString (transaction, 'transactionType');
const timestamp = this.safeInteger (transaction, 'time');
const currencyId = this.safeString (transaction, 'asset');
const code = this.safeCurrencyCode (currencyId, currency);
const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));
const feeCost = this.safeNumber (transaction, 'commission');
return {
'info': transaction,
'id': id,
'id': this.safeString (transaction, 'requestId'),
'txid': this.safeString (transaction, 'networkTransactionId'),
'type': this.safeString (transaction, 'transactionType'),
'currency': code,
'amount': amount,
'network': undefined,
'amount': this.safeNumber (transaction, 'amount'),
'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),
'timestamp': timestamp,
'datetime': this.iso8601 (timestamp),
'address': address,
'addressTo': address,
'addressFrom': undefined,
'addressTo': address,
'tag': tag,
'tagTo': tag,
'tagFrom': undefined,
'status': status,
'type': type,
'tagTo': tag,
'updated': undefined,
'txid': txid,
'timestamp': timestamp,
'datetime': this.iso8601 (timestamp),
'comment': undefined,
'fee': {
'currency': code,
'cost': feeCost,
'cost': this.safeNumber (transaction, 'commission'),
'rate': undefined,
},
};
}
Expand Down

0 comments on commit ef6bf0b

Please sign in to comment.