@method @name cex#fetchLedger @description fetch the history of changes, actions done by the user or operations that altered the balance of the user @see https://trade.cex.io/docs/#rest-private-api-calls-transaction-history @param {string} [code] unified currency code @param {int} [since] timestamp
(Object... optionalArgs)
| 1630 | * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/?id=ledger-entry-structure} |
| 1631 | */ |
| 1632 | public java.util.concurrent.CompletableFuture<Object> fetchLedger(Object... optionalArgs) |
| 1633 | { |
| 1634 | |
| 1635 | return java.util.concurrent.CompletableFuture.supplyAsync(() -> { |
| 1636 | |
| 1637 | Object code = Helpers.getArg(optionalArgs, 0, null); |
| 1638 | Object since = Helpers.getArg(optionalArgs, 1, null); |
| 1639 | Object limit = Helpers.getArg(optionalArgs, 2, null); |
| 1640 | Object parameters = Helpers.getArg(optionalArgs, 3, new java.util.HashMap<String, Object>() {{}}); |
| 1641 | (this.loadMarkets()).join(); |
| 1642 | Object currency = null; |
| 1643 | Object request = new java.util.HashMap<String, Object>() {{}}; |
| 1644 | if (Helpers.isTrue(!Helpers.isEqual(code, null))) |
| 1645 | { |
| 1646 | currency = this.currency(code); |
| 1647 | Helpers.addElementToObject(request, "currency", Helpers.GetValue(currency, "id")); |
| 1648 | } |
| 1649 | if (Helpers.isTrue(!Helpers.isEqual(since, null))) |
| 1650 | { |
| 1651 | Helpers.addElementToObject(request, "dateFrom", since); |
| 1652 | } |
| 1653 | if (Helpers.isTrue(!Helpers.isEqual(limit, null))) |
| 1654 | { |
| 1655 | Helpers.addElementToObject(request, "pageSize", limit); |
| 1656 | } |
| 1657 | Object until = null; |
| 1658 | var untilparametersVariable = this.handleParamInteger2(parameters, "until", "till"); |
| 1659 | until = ((java.util.List<Object>) untilparametersVariable).get(0); |
| 1660 | parameters = ((java.util.List<Object>) untilparametersVariable).get(1); |
| 1661 | if (Helpers.isTrue(!Helpers.isEqual(until, null))) |
| 1662 | { |
| 1663 | Helpers.addElementToObject(request, "dateTo", until); |
| 1664 | } |
| 1665 | Object response = (this.privatePostGetMyTransactionHistory(this.extend(request, parameters))).join(); |
| 1666 | // |
| 1667 | // { |
| 1668 | // "ok": "ok", |
| 1669 | // "data": [ |
| 1670 | // { |
| 1671 | // "transactionId": "30367722", |
| 1672 | // "timestamp": "2024-10-14T14:08:49.987Z", |
| 1673 | // "accountId": "", |
| 1674 | // "type": "withdraw", |
| 1675 | // "amount": "-12.39060600", |
| 1676 | // "details": "Withdraw fundingId=1235039 clientId=up421412345 walletTxId=76337154166", |
| 1677 | // "currency": "USDT" |
| 1678 | // }, |
| 1679 | // ... |
| 1680 | // |
| 1681 | Object data = this.safeList(response, "data", new java.util.ArrayList<Object>(java.util.Arrays.asList())); |
| 1682 | return this.parseLedger(data, currency, since, limit); |
| 1683 | }); |
| 1684 | |
| 1685 | } |
| 1686 | |
| 1687 | public Object parseLedgerEntry(Object item, Object... optionalArgs) |
| 1688 | { |
nothing calls this directly
no test coverage detected