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

Method parse_transaction

python/ccxt/async_support/htx.py:6280–6370  ·  view source on GitHub ↗
(self, transaction: dict, currency: Currency = None)

Source from the content-addressed store, hash-verified

6278 return self.parse_transactions(response['data'], currency, since, limit)
6279
6280 def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
6281 #
6282 # fetchDeposits
6283 #
6284 # {
6285 # "id": "75115912",
6286 # "type": "deposit",
6287 # "sub-type": "NORMAL",
6288 # "request-id": "trc20usdt-a2e229a44ef2a948c874366230bb56aa73631cc0a03d177bd8b4c9d38262d7ff-200",
6289 # "currency": "usdt",
6290 # "chain": "trc20usdt",
6291 # "tx-hash": "a2e229a44ef2a948c874366230bb56aa73631cc0a03d177bd8b4c9d38262d7ff",
6292 # "amount": "2849.000000000000000000",
6293 # "from-addr-tag": "",
6294 # "address-id": "0",
6295 # "address": "TRFTd1FxepQE6CnpwzUEMEbFaLm5bJK67s",
6296 # "address-tag": "",
6297 # "fee": "0",
6298 # "state": "safe",
6299 # "wallet-confirm": "2",
6300 # "created-at": "1621843808662",
6301 # "updated-at": "1621843857137"
6302 # },
6303 #
6304 # fetchWithdrawals
6305 #
6306 # {
6307 # "id": "61335312",
6308 # "type": "withdraw",
6309 # "sub-type": "NORMAL",
6310 # "currency": "usdt",
6311 # "chain": "trc20usdt",
6312 # "tx-hash": "30a3111f2fead74fae45c6218ca3150fc33cab2aa59cfe41526b96aae79ce4ec",
6313 # "amount": "12.000000000000000000",
6314 # "from-addr-tag": "",
6315 # "address-id": "27321591",
6316 # "address": "TRf5JacJQRsF4Nm2zu11W6maDGeiEWQu9e",
6317 # "address-tag": "",
6318 # "fee": "1.000000000000000000",
6319 # "state": "confirmed",
6320 # "created-at": "1621852316553",
6321 # "updated-at": "1621852467041"
6322 # }
6323 #
6324 # withdraw
6325 #
6326 # {
6327 # "status": "ok",
6328 # "data": "99562054"
6329 # }
6330 #
6331 timestamp = self.safe_integer(transaction, 'created-at')
6332 code = self.safe_currency_code(self.safe_string(transaction, 'currency'))
6333 type = self.safe_string(transaction, 'type')
6334 if type == 'withdraw':
6335 type = 'withdrawal'
6336 feeCost = self.safe_string(transaction, 'fee')
6337 if feeCost is not None:

Callers 1

withdrawMethod · 0.95

Calls 11

network_id_to_codeMethod · 0.95
safe_integerMethod · 0.80
safe_stringMethod · 0.80
string_absMethod · 0.80
findMethod · 0.80
safe_string_2Method · 0.80
safe_numberMethod · 0.80
parse_numberMethod · 0.80
safe_currency_codeMethod · 0.45
iso8601Method · 0.45

Tested by

no test coverage detected