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

Method fetch_ledger_entry

python/ccxt/binance.py:11270–11305  ·  view source on GitHub ↗

fetch the history of changes, actions done by the user or operations that altered the balance of the user https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow :param str id: the identification number of the ledger entry :param str cod

(self, id: str, code: Str = None, params={})

Source from the content-addressed store, hash-verified

11268 return result
11269
11270 def fetch_ledger_entry(self, id: str, code: Str = None, params={}) -> LedgerEntry:
11271 """
11272 fetch the history of changes, actions done by the user or operations that altered the balance of the user
11273
11274 https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
11275
11276 :param str id: the identification number of the ledger entry
11277 :param str code: unified currency code
11278 :param dict [params]: extra parameters specific to the exchange API endpoint
11279 :returns dict: a `ledger structure <https://docs.ccxt.com/?id=ledger-entry-structure>`
11280 """
11281 self.load_markets()
11282 type = None
11283 type, params = self.handle_market_type_and_params('fetchLedgerEntry', None, params)
11284 if type != 'option':
11285 raise BadRequest(self.id + ' fetchLedgerEntry() can only be used for type option')
11286 self.check_required_argument('fetchLedgerEntry', code, 'code')
11287 currency = self.currency(code)
11288 request = {
11289 'recordId': id,
11290 'currency': currency['id'],
11291 }
11292 response = self.eapiPrivateGetBill(self.extend(request, params))
11293 #
11294 # [
11295 # {
11296 # "id": "1125899906845701870",
11297 # "asset": "USDT",
11298 # "amount": "-0.16518203",
11299 # "type": "FEE",
11300 # "createDate": 1676621042489
11301 # }
11302 # ]
11303 #
11304 first = self.safe_dict(response, 0, response)
11305 return self.parse_ledger_entry(first, currency)
11306
11307 def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
11308 """

Callers

nothing calls this directly

Calls 9

eapiPrivateGetBillMethod · 0.95
parse_ledger_entryMethod · 0.95
BadRequestClass · 0.90
safe_dictMethod · 0.80
load_marketsMethod · 0.45
currencyMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected