MCPcopy Create free account
hub / github.com/ccxt/ccxt / parseTransaction

Method parseTransaction

ts/src/cryptocom.ts:2516–2602  ·  view source on GitHub ↗
(transaction: Dict, currency: Currency = undefined)

Source from the content-addressed store, hash-verified

2514 }
2515
2516 parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {
2517 //
2518 // fetchDeposits
2519 //
2520 // {
2521 // "currency": "BTC",
2522 // "fee": 0,
2523 // "create_time": 1688023659000,
2524 // "id": "6201135",
2525 // "update_time": 1688178509000,
2526 // "amount": 0.00114571,
2527 // "address": "1234fggxTSmJ3H4jaMQuWyEiLBzZdAbK6d",
2528 // "status": "1",
2529 // "txid": "f0ae4202b76eb999c301eccdde44dc639bee42d1fdd5974105286ca3393f6065/2"
2530 // }
2531 //
2532 // fetchWithdrawals
2533 //
2534 // {
2535 // "currency": "BTC",
2536 // "client_wid": "",
2537 // "fee": 0.0005,
2538 // "create_time": 1688613850000,
2539 // "id": "5775977",
2540 // "update_time": 1688613850000,
2541 // "amount": 0.0005,
2542 // "address": "1234NMEWbiF8ZkwUMxmfzMxi2A1MQ44bMn",
2543 // "status": "1",
2544 // "txid": "",
2545 // "network_id": "BTC"
2546 // }
2547 //
2548 // withdraw
2549 //
2550 // {
2551 // "id": 2220,
2552 // "amount": 1,
2553 // "fee": 0.0004,
2554 // "symbol": "BTC",
2555 // "address": "2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBf",
2556 // "client_wid": "my_withdrawal_002",
2557 // "create_time":1607063412000
2558 // }
2559 //
2560 let type: Str = undefined;
2561 const rawStatus = this.safeString (transaction, 'status');
2562 let status: Str = undefined;
2563 if ('client_wid' in transaction) {
2564 type = 'withdrawal';
2565 status = this.parseWithdrawalStatus (rawStatus);
2566 } else {
2567 type = 'deposit';
2568 status = this.parseDepositStatus (rawStatus);
2569 }
2570 const addressString = this.safeString (transaction, 'address');
2571 const [ address, tag ] = this.parseAddress (addressString);
2572 const currencyId = this.safeString (transaction, 'currency');
2573 const code = this.safeCurrencyCode (currencyId, currency);

Callers 1

withdrawMethod · 0.95

Calls 8

parseWithdrawalStatusMethod · 0.95
parseDepositStatusMethod · 0.95
parseAddressMethod · 0.95
safeStringMethod · 0.45
safeCurrencyCodeMethod · 0.45
safeIntegerMethod · 0.45
safeNumberMethod · 0.45
iso8601Method · 0.45

Tested by

no test coverage detected