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

Method fetch_ledger

python/ccxt/ndax.py:1271–1317  ·  view source on GitHub ↗

fetch the history of changes, actions done by the user or operations that altered the balance of the user https://apidoc.ndax.io/#getaccounttransactions :param str [code]: unified currency code, default is None :param int [since]: timestamp in ms of the earliest le

(self, code: Str = None, since: Int = None, limit: Int = None, params={})

Source from the content-addressed store, hash-verified

1269 }, currency)
1270
1271 def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
1272 """
1273 fetch the history of changes, actions done by the user or operations that altered the balance of the user
1274
1275 https://apidoc.ndax.io/#getaccounttransactions
1276
1277 :param str [code]: unified currency code, default is None
1278 :param int [since]: timestamp in ms of the earliest ledger entry, default is None
1279 :param int [limit]: max number of ledger entries to return, default is None
1280 :param dict [params]: extra parameters specific to the exchange API endpoint
1281 :returns dict: a `ledger structure <https://docs.ccxt.com/?id=ledger-entry-structure>`
1282 """
1283 omsId = self.safe_integer(self.options, 'omsId', 1)
1284 self.load_markets()
1285 self.load_accounts()
1286 defaultAccountId = self.safe_integer_2(self.options, 'accountId', 'AccountId', int(self.accounts[0]['id']))
1287 accountId = self.safe_integer_2(params, 'accountId', 'AccountId', defaultAccountId)
1288 params = self.omit(params, ['accountId', 'AccountId'])
1289 request = {
1290 'omsId': omsId,
1291 'AccountId': accountId,
1292 }
1293 if limit is not None:
1294 request['Depth'] = limit
1295 response = self.privateGetGetAccountTransactions(self.extend(request, params))
1296 #
1297 # [
1298 # {
1299 # "TransactionId":2663709493,
1300 # "ReferenceId":68,
1301 # "OMSId":1,
1302 # "AccountId":449,
1303 # "CR":10.000000000000000000000000000,
1304 # "DR":0.0000000000000000000000000000,
1305 # "Counterparty":3,
1306 # "TransactionType":"Other",
1307 # "ReferenceType":"Deposit",
1308 # "ProductId":1,
1309 # "Balance":10.000000000000000000000000000,
1310 # "TimeStamp":1607532331591
1311 # },
1312 # ]
1313 #
1314 currency = None
1315 if code is not None:
1316 currency = self.currency(code)
1317 return self.parse_ledger(response, currency, since, limit)
1318
1319 def parse_order_status(self, status: Str):
1320 statuses = {

Callers

nothing calls this directly

Calls 9

safe_integerMethod · 0.80
safe_integer_2Method · 0.80
parse_ledgerMethod · 0.80
load_marketsMethod · 0.45
load_accountsMethod · 0.45
omitMethod · 0.45
extendMethod · 0.45
currencyMethod · 0.45

Tested by

no test coverage detected