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

Method parse_transfer

python/ccxt/async_support/paymium.py:535–584  ·  view source on GitHub ↗
(self, transfer: dict, currency: Currency = None)

Source from the content-addressed store, hash-verified

533 return self.parse_transfer(response, currency)
534
535 def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
536 #
537 # {
538 # "uuid": "968f4580-e26c-4ad8-8bcd-874d23d55296",
539 # "type": "Transfer",
540 # "currency": "BTC",
541 # "currency_amount": "string",
542 # "created_at": "2013-10-24T10:34:37.000Z",
543 # "updated_at": "2013-10-24T10:34:37.000Z",
544 # "amount": "1.0",
545 # "state": "executed",
546 # "currency_fee": "0.0",
547 # "btc_fee": "0.0",
548 # "comment": "string",
549 # "traded_btc": "string",
550 # "traded_currency": "string",
551 # "direction": "buy",
552 # "price": "string",
553 # "account_operations": [
554 # {
555 # "uuid": "968f4580-e26c-4ad8-8bcd-874d23d55296",
556 # "amount": "1.0",
557 # "currency": "BTC",
558 # "created_at": "2013-10-24T10:34:37.000Z",
559 # "created_at_int": 1389094259,
560 # "name": "account_operation",
561 # "address": "1FPDBXNqSkZMsw1kSkkajcj8berxDQkUoc",
562 # "tx_hash": "string",
563 # "is_trading_account": True
564 # }
565 # ]
566 # }
567 #
568 currencyId = self.safe_string(transfer, 'currency')
569 updatedAt = self.safe_string(transfer, 'updated_at')
570 timetstamp = self.parse_date(updatedAt)
571 accountOperations = self.safe_value(transfer, 'account_operations')
572 firstOperation = self.safe_value(accountOperations, 0, {})
573 status = self.safe_string(transfer, 'state')
574 return {
575 'info': transfer,
576 'id': self.safe_string(transfer, 'uuid'),
577 'timestamp': timetstamp,
578 'datetime': self.iso8601(timetstamp),
579 'currency': self.safe_currency_code(currencyId, currency),
580 'amount': self.safe_number(transfer, 'amount'),
581 'fromAccount': None,
582 'toAccount': self.safe_string(firstOperation, 'address'),
583 'status': self.parse_transfer_status(status),
584 }
585
586 def parse_transfer_status(self, status: Str) -> Str:
587 statuses = {

Callers 1

transferMethod · 0.95

Calls 7

parse_transfer_statusMethod · 0.95
safe_stringMethod · 0.80
parse_dateMethod · 0.80
safe_valueMethod · 0.80
safe_numberMethod · 0.80
iso8601Method · 0.45
safe_currency_codeMethod · 0.45

Tested by

no test coverage detected