ccxt 4.4.3 → 4.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +2 -2
- package/dist/cjs/src/base/functions/misc.js +11 -0
- package/dist/cjs/src/base/functions.js +1 -0
- package/dist/cjs/src/base/ws/WsClient.js +2 -1
- package/dist/cjs/src/binance.js +42 -15
- package/dist/cjs/src/binanceus.js +1 -0
- package/dist/cjs/src/bingx.js +1 -0
- package/dist/cjs/src/bitfinex2.js +7 -6
- package/dist/cjs/src/bitget.js +57 -100
- package/dist/cjs/src/bitmex.js +11 -10
- package/dist/cjs/src/bitso.js +5 -4
- package/dist/cjs/src/bitstamp.js +9 -9
- package/dist/cjs/src/blofin.js +21 -23
- package/dist/cjs/src/bybit.js +100 -26
- package/dist/cjs/src/coinbase.js +28 -7
- package/dist/cjs/src/coinbaseexchange.js +11 -11
- package/dist/cjs/src/coinlist.js +6 -5
- package/dist/cjs/src/coinmetro.js +3 -3
- package/dist/cjs/src/cryptocom.js +7 -5
- package/dist/cjs/src/currencycom.js +6 -6
- package/dist/cjs/src/delta.js +5 -5
- package/dist/cjs/src/digifinex.js +8 -6
- package/dist/cjs/src/gate.js +6 -5
- package/dist/cjs/src/hashkey.js +9 -7
- package/dist/cjs/src/htx.js +13 -16
- package/dist/cjs/src/hyperliquid.js +67 -114
- package/dist/cjs/src/kraken.js +8 -6
- package/dist/cjs/src/kucoin.js +9 -8
- package/dist/cjs/src/luno.js +10 -9
- package/dist/cjs/src/lykke.js +2 -2
- package/dist/cjs/src/mexc.js +42 -3
- package/dist/cjs/src/ndax.js +6 -5
- package/dist/cjs/src/okcoin.js +18 -27
- package/dist/cjs/src/okx.js +18 -26
- package/dist/cjs/src/p2b.js +2 -2
- package/dist/cjs/src/paradex.js +1 -1
- package/dist/cjs/src/pro/binance.js +6 -2
- package/dist/cjs/src/pro/binanceus.js +2 -1
- package/dist/cjs/src/pro/bybit.js +56 -0
- package/dist/cjs/src/pro/hyperliquid.js +16 -1
- package/dist/cjs/src/pro/mexc.js +83 -0
- package/dist/cjs/src/pro/paradex.js +1 -0
- package/dist/cjs/src/woo.js +7 -6
- package/dist/cjs/src/woofipro.js +8 -6
- package/dist/cjs/src/xt.js +4 -3
- package/dist/cjs/src/zonda.js +6 -5
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/Exchange.d.ts +2 -2
- package/js/src/base/Exchange.js +2 -2
- package/js/src/base/functions/misc.d.ts +2 -1
- package/js/src/base/functions/misc.js +11 -1
- package/js/src/base/types.d.ts +1 -1
- package/js/src/base/ws/WsClient.js +2 -2
- package/js/src/binance.d.ts +4 -20
- package/js/src/binance.js +42 -15
- package/js/src/binanceus.js +1 -0
- package/js/src/bingx.js +1 -0
- package/js/src/bitfinex2.d.ts +3 -19
- package/js/src/bitfinex2.js +7 -6
- package/js/src/bitget.d.ts +3 -20
- package/js/src/bitget.js +57 -100
- package/js/src/bitmex.d.ts +3 -22
- package/js/src/bitmex.js +11 -10
- package/js/src/bitso.d.ts +3 -19
- package/js/src/bitso.js +5 -4
- package/js/src/bitstamp.d.ts +3 -35
- package/js/src/bitstamp.js +9 -9
- package/js/src/blofin.d.ts +3 -15
- package/js/src/blofin.js +21 -23
- package/js/src/bybit.d.ts +3 -19
- package/js/src/bybit.js +100 -26
- package/js/src/coinbase.d.ts +3 -19
- package/js/src/coinbase.js +28 -7
- package/js/src/coinbaseexchange.d.ts +3 -19
- package/js/src/coinbaseexchange.js +11 -11
- package/js/src/coinlist.d.ts +3 -19
- package/js/src/coinlist.js +6 -5
- package/js/src/coinmetro.d.ts +3 -19
- package/js/src/coinmetro.js +3 -3
- package/js/src/cryptocom.d.ts +3 -22
- package/js/src/cryptocom.js +7 -5
- package/js/src/currencycom.d.ts +3 -3
- package/js/src/currencycom.js +6 -6
- package/js/src/delta.d.ts +3 -19
- package/js/src/delta.js +5 -5
- package/js/src/digifinex.d.ts +3 -19
- package/js/src/digifinex.js +8 -6
- package/js/src/gate.d.ts +3 -19
- package/js/src/gate.js +6 -5
- package/js/src/hashkey.d.ts +3 -20
- package/js/src/hashkey.js +9 -7
- package/js/src/htx.d.ts +3 -19
- package/js/src/htx.js +13 -16
- package/js/src/hyperliquid.d.ts +3 -19
- package/js/src/hyperliquid.js +68 -115
- package/js/src/kraken.d.ts +5 -24
- package/js/src/kraken.js +8 -6
- package/js/src/kucoin.d.ts +3 -19
- package/js/src/kucoin.js +9 -8
- package/js/src/luno.d.ts +4 -20
- package/js/src/luno.js +10 -9
- package/js/src/lykke.js +2 -2
- package/js/src/mexc.js +42 -3
- package/js/src/ndax.d.ts +3 -19
- package/js/src/ndax.js +6 -5
- package/js/src/okcoin.d.ts +3 -19
- package/js/src/okcoin.js +18 -27
- package/js/src/okx.d.ts +3 -19
- package/js/src/okx.js +18 -26
- package/js/src/p2b.js +2 -2
- package/js/src/paradex.js +1 -1
- package/js/src/pro/binance.d.ts +140 -0
- package/js/src/pro/binance.js +6 -2
- package/js/src/pro/binanceus.js +2 -1
- package/js/src/pro/bybit.d.ts +2 -0
- package/js/src/pro/bybit.js +56 -0
- package/js/src/pro/hyperliquid.d.ts +1 -0
- package/js/src/pro/hyperliquid.js +16 -1
- package/js/src/pro/mexc.d.ts +4 -1
- package/js/src/pro/mexc.js +84 -1
- package/js/src/pro/paradex.js +1 -0
- package/js/src/woo.d.ts +3 -19
- package/js/src/woo.js +7 -6
- package/js/src/woofipro.d.ts +3 -19
- package/js/src/woofipro.js +8 -6
- package/js/src/xt.d.ts +3 -22
- package/js/src/xt.js +4 -3
- package/js/src/zonda.d.ts +3 -19
- package/js/src/zonda.js +6 -5
- package/package.json +1 -1
package/js/src/lykke.js
CHANGED
|
@@ -681,9 +681,9 @@ export default class lykke extends Exchange {
|
|
|
681
681
|
const currencyId = this.safeString(balance, 'assetId');
|
|
682
682
|
const code = this.safeCurrencyCode(currencyId);
|
|
683
683
|
const account = this.account();
|
|
684
|
-
const
|
|
684
|
+
const total = this.safeString(balance, 'available');
|
|
685
685
|
const used = this.safeString(balance, 'reserved');
|
|
686
|
-
account['
|
|
686
|
+
account['total'] = total;
|
|
687
687
|
account['used'] = used;
|
|
688
688
|
result[code] = account;
|
|
689
689
|
}
|
package/js/src/mexc.js
CHANGED
|
@@ -92,7 +92,7 @@ export default class mexc extends Exchange {
|
|
|
92
92
|
'fetchOrderBooks': undefined,
|
|
93
93
|
'fetchOrders': true,
|
|
94
94
|
'fetchOrderTrades': true,
|
|
95
|
-
'fetchPosition':
|
|
95
|
+
'fetchPosition': 'emulated',
|
|
96
96
|
'fetchPositionHistory': 'emulated',
|
|
97
97
|
'fetchPositionMode': true,
|
|
98
98
|
'fetchPositions': true,
|
|
@@ -1017,8 +1017,9 @@ export default class mexc extends Exchange {
|
|
|
1017
1017
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1018
1018
|
* @returns {object[]} an array of objects representing market data
|
|
1019
1019
|
*/
|
|
1020
|
-
const
|
|
1021
|
-
const
|
|
1020
|
+
const spotMarketPromise = this.fetchSpotMarkets(params);
|
|
1021
|
+
const swapMarketPromise = this.fetchSwapMarkets(params);
|
|
1022
|
+
const [spotMarket, swapMarket] = await Promise.all([spotMarketPromise, swapMarketPromise]);
|
|
1022
1023
|
return this.arrayConcat(spotMarket, swapMarket);
|
|
1023
1024
|
}
|
|
1024
1025
|
async fetchSpotMarkets(params = {}) {
|
|
@@ -1157,7 +1158,10 @@ export default class mexc extends Exchange {
|
|
|
1157
1158
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1158
1159
|
* @returns {object[]} an array of objects representing market data
|
|
1159
1160
|
*/
|
|
1161
|
+
const currentRl = this.rateLimit;
|
|
1162
|
+
this.setProperty(this, 'rateLimit', 10); // see comment: https://github.com/ccxt/ccxt/pull/23698
|
|
1160
1163
|
const response = await this.contractPublicGetDetail(params);
|
|
1164
|
+
this.setProperty(this, 'rateLimit', currentRl);
|
|
1161
1165
|
//
|
|
1162
1166
|
// {
|
|
1163
1167
|
// "success":true,
|
|
@@ -2913,6 +2917,9 @@ export default class mexc extends Exchange {
|
|
|
2913
2917
|
* @method
|
|
2914
2918
|
* @name mexc#cancelOrder
|
|
2915
2919
|
* @description cancels an open order
|
|
2920
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#cancel-order
|
|
2921
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
|
|
2922
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-stop-limit-trigger-order-under-maintenance
|
|
2916
2923
|
* @param {string} id order id
|
|
2917
2924
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2918
2925
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -3030,6 +3037,7 @@ export default class mexc extends Exchange {
|
|
|
3030
3037
|
* @method
|
|
3031
3038
|
* @name mexc#cancelOrders
|
|
3032
3039
|
* @description cancel multiple orders
|
|
3040
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
|
|
3033
3041
|
* @param {string[]} ids order ids
|
|
3034
3042
|
* @param {string} symbol unified market symbol, default is undefined
|
|
3035
3043
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -3065,6 +3073,9 @@ export default class mexc extends Exchange {
|
|
|
3065
3073
|
* @method
|
|
3066
3074
|
* @name mexc#cancelAllOrders
|
|
3067
3075
|
* @description cancel all open orders
|
|
3076
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#cancel-all-open-orders-on-a-symbol
|
|
3077
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-all-orders-under-a-contract-under-maintenance
|
|
3078
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-all-trigger-orders-under-maintenance
|
|
3068
3079
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
3069
3080
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3070
3081
|
* @param {string} [params.marginMode] only 'isolated' is supported for spot-margin trading
|
|
@@ -3468,6 +3479,8 @@ export default class mexc extends Exchange {
|
|
|
3468
3479
|
* @method
|
|
3469
3480
|
* @name mexc#fetchAccounts
|
|
3470
3481
|
* @description fetch all the accounts associated with a profile
|
|
3482
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
|
|
3483
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
|
|
3471
3484
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3472
3485
|
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
3473
3486
|
*/
|
|
@@ -3495,6 +3508,8 @@ export default class mexc extends Exchange {
|
|
|
3495
3508
|
* @method
|
|
3496
3509
|
* @name mexc#fetchTradingFees
|
|
3497
3510
|
* @description fetch the trading fees for multiple markets
|
|
3511
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
|
|
3512
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
|
|
3498
3513
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3499
3514
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
3500
3515
|
*/
|
|
@@ -3780,6 +3795,8 @@ export default class mexc extends Exchange {
|
|
|
3780
3795
|
* @method
|
|
3781
3796
|
* @name mexc#fetchMyTrades
|
|
3782
3797
|
* @description fetch all trades made by the user
|
|
3798
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-trade-list
|
|
3799
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-transaction-details-of-the-user-s-order
|
|
3783
3800
|
* @param {string} symbol unified market symbol
|
|
3784
3801
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
3785
3802
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -3870,6 +3887,8 @@ export default class mexc extends Exchange {
|
|
|
3870
3887
|
* @method
|
|
3871
3888
|
* @name mexc#fetchOrderTrades
|
|
3872
3889
|
* @description fetch all the trades made from a single order
|
|
3890
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-trade-list
|
|
3891
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-order-number
|
|
3873
3892
|
* @param {string} id order id
|
|
3874
3893
|
* @param {string} symbol unified market symbol
|
|
3875
3894
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -3968,6 +3987,7 @@ export default class mexc extends Exchange {
|
|
|
3968
3987
|
* @method
|
|
3969
3988
|
* @name mexc#reduceMargin
|
|
3970
3989
|
* @description remove margin from a position
|
|
3990
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#increase-or-decrease-margin
|
|
3971
3991
|
* @param {string} symbol unified market symbol
|
|
3972
3992
|
* @param {float} amount the amount of margin to remove
|
|
3973
3993
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -3980,6 +4000,7 @@ export default class mexc extends Exchange {
|
|
|
3980
4000
|
* @method
|
|
3981
4001
|
* @name mexc#addMargin
|
|
3982
4002
|
* @description add margin
|
|
4003
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#increase-or-decrease-margin
|
|
3983
4004
|
* @param {string} symbol unified market symbol
|
|
3984
4005
|
* @param {float} amount amount of margin to add
|
|
3985
4006
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -3992,6 +4013,7 @@ export default class mexc extends Exchange {
|
|
|
3992
4013
|
* @method
|
|
3993
4014
|
* @name mexc#setLeverage
|
|
3994
4015
|
* @description set the level of leverage for a market
|
|
4016
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#switch-leverage
|
|
3995
4017
|
* @param {float} leverage the rate of leverage
|
|
3996
4018
|
* @param {string} symbol unified market symbol
|
|
3997
4019
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -4025,6 +4047,7 @@ export default class mexc extends Exchange {
|
|
|
4025
4047
|
* @method
|
|
4026
4048
|
* @name mexc#fetchFundingHistory
|
|
4027
4049
|
* @description fetch the history of funding payments paid and received on this account
|
|
4050
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-details-of-user-s-funding-rate
|
|
4028
4051
|
* @param {string} symbol unified market symbol
|
|
4029
4052
|
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
4030
4053
|
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
@@ -4140,6 +4163,7 @@ export default class mexc extends Exchange {
|
|
|
4140
4163
|
* @method
|
|
4141
4164
|
* @name mexc#fetchFundingRate
|
|
4142
4165
|
* @description fetch the current funding rate
|
|
4166
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate
|
|
4143
4167
|
* @param {string} symbol unified market symbol
|
|
4144
4168
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4145
4169
|
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
@@ -4173,6 +4197,7 @@ export default class mexc extends Exchange {
|
|
|
4173
4197
|
* @method
|
|
4174
4198
|
* @name mexc#fetchFundingRateHistory
|
|
4175
4199
|
* @description fetches historical funding rate prices
|
|
4200
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate-history
|
|
4176
4201
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
4177
4202
|
* @param {int} [since] not used by mexc, but filtered internally by ccxt
|
|
4178
4203
|
* @param {int} [limit] mexc limit is page_size default 20, maximum is 100
|
|
@@ -4746,6 +4771,7 @@ export default class mexc extends Exchange {
|
|
|
4746
4771
|
* @method
|
|
4747
4772
|
* @name mexc#fetchPosition
|
|
4748
4773
|
* @description fetch data on a single open contract trade position
|
|
4774
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
|
4749
4775
|
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
4750
4776
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4751
4777
|
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
@@ -4763,6 +4789,7 @@ export default class mexc extends Exchange {
|
|
|
4763
4789
|
* @method
|
|
4764
4790
|
* @name mexc#fetchPositions
|
|
4765
4791
|
* @description fetch all open positions
|
|
4792
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
|
4766
4793
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
4767
4794
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4768
4795
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
@@ -4906,6 +4933,16 @@ export default class mexc extends Exchange {
|
|
|
4906
4933
|
});
|
|
4907
4934
|
}
|
|
4908
4935
|
async fetchTransfer(id, code = undefined, params = {}) {
|
|
4936
|
+
/**
|
|
4937
|
+
* @method
|
|
4938
|
+
* @name mexc#fetchTransfer
|
|
4939
|
+
* @description fetches a transfer
|
|
4940
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v2_en/#internal-assets-transfer-order-inquiry
|
|
4941
|
+
* @param {string} id transfer id
|
|
4942
|
+
* @param {string} [code] not used by mexc fetchTransfer
|
|
4943
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
4944
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
4945
|
+
*/
|
|
4909
4946
|
const [marketType, query] = this.handleMarketTypeAndParams('fetchTransfer', undefined, params);
|
|
4910
4947
|
await this.loadMarkets();
|
|
4911
4948
|
if (marketType === 'spot') {
|
|
@@ -4939,6 +4976,8 @@ export default class mexc extends Exchange {
|
|
|
4939
4976
|
* @method
|
|
4940
4977
|
* @name mexc#fetchTransfers
|
|
4941
4978
|
* @description fetch a history of internal transfers made on an account
|
|
4979
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v2_en/#get-internal-assets-transfer-records
|
|
4980
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records
|
|
4942
4981
|
* @param {string} code unified currency code of the currency transferred
|
|
4943
4982
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
4944
4983
|
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
package/js/src/ndax.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/ndax.js';
|
|
2
|
-
import type { IndexType, Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, Transaction, Num, Account, Currencies, Dict, int } from './base/types.js';
|
|
2
|
+
import type { IndexType, Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, Transaction, Num, Account, Currencies, Dict, int, LedgerEntry } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class ndax
|
|
5
5
|
* @augments Exchange
|
|
@@ -22,24 +22,8 @@ export default class ndax extends Exchange {
|
|
|
22
22
|
parseBalance(response: any): Balances;
|
|
23
23
|
fetchBalance(params?: {}): Promise<Balances>;
|
|
24
24
|
parseLedgerEntryType(type: any): string;
|
|
25
|
-
parseLedgerEntry(item: Dict, currency?: Currency):
|
|
26
|
-
|
|
27
|
-
id: string;
|
|
28
|
-
direction: any;
|
|
29
|
-
account: string;
|
|
30
|
-
referenceId: string;
|
|
31
|
-
referenceAccount: string;
|
|
32
|
-
type: string;
|
|
33
|
-
currency: string;
|
|
34
|
-
amount: number;
|
|
35
|
-
before: number;
|
|
36
|
-
after: number;
|
|
37
|
-
status: string;
|
|
38
|
-
timestamp: number;
|
|
39
|
-
datetime: string;
|
|
40
|
-
fee: any;
|
|
41
|
-
};
|
|
42
|
-
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
25
|
+
parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
|
|
26
|
+
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
43
27
|
parseOrderStatus(status: Str): string;
|
|
44
28
|
parseOrder(order: Dict, market?: Market): Order;
|
|
45
29
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
package/js/src/ndax.js
CHANGED
|
@@ -1141,6 +1141,7 @@ export default class ndax extends Exchange {
|
|
|
1141
1141
|
// }
|
|
1142
1142
|
//
|
|
1143
1143
|
const currencyId = this.safeString(item, 'ProductId');
|
|
1144
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
1144
1145
|
const credit = this.safeString(item, 'CR');
|
|
1145
1146
|
const debit = this.safeString(item, 'DR');
|
|
1146
1147
|
let amount = undefined;
|
|
@@ -1162,7 +1163,7 @@ export default class ndax extends Exchange {
|
|
|
1162
1163
|
before = Precise.stringMax('0', Precise.stringSub(after, amount));
|
|
1163
1164
|
}
|
|
1164
1165
|
const timestamp = this.safeInteger(item, 'TimeStamp');
|
|
1165
|
-
return {
|
|
1166
|
+
return this.safeLedgerEntry({
|
|
1166
1167
|
'info': item,
|
|
1167
1168
|
'id': this.safeString(item, 'TransactionId'),
|
|
1168
1169
|
'direction': direction,
|
|
@@ -1178,17 +1179,17 @@ export default class ndax extends Exchange {
|
|
|
1178
1179
|
'timestamp': timestamp,
|
|
1179
1180
|
'datetime': this.iso8601(timestamp),
|
|
1180
1181
|
'fee': undefined,
|
|
1181
|
-
};
|
|
1182
|
+
}, currency);
|
|
1182
1183
|
}
|
|
1183
1184
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1184
1185
|
/**
|
|
1185
1186
|
* @method
|
|
1186
1187
|
* @name ndax#fetchLedger
|
|
1187
|
-
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
1188
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
1188
1189
|
* @see https://apidoc.ndax.io/#getaccounttransactions
|
|
1189
|
-
* @param {string} code unified currency code, default is undefined
|
|
1190
|
+
* @param {string} [code] unified currency code, default is undefined
|
|
1190
1191
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
1191
|
-
* @param {int} [limit] max number of ledger
|
|
1192
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
1192
1193
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1193
1194
|
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
1194
1195
|
*/
|
package/js/src/okcoin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/okcoin.js';
|
|
2
|
-
import type { TransferEntry, Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, Num, Currencies, Dict, int } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, Num, Currencies, Dict, int, LedgerEntry } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class okcoin
|
|
5
5
|
* @augments Exchange
|
|
@@ -52,25 +52,9 @@ export default class okcoin extends Exchange {
|
|
|
52
52
|
parseTransaction(transaction: Dict, currency?: Currency): Transaction;
|
|
53
53
|
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
54
54
|
fetchOrderTrades(id: string, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
55
|
-
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<
|
|
55
|
+
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
56
56
|
parseLedgerEntryType(type: any): string;
|
|
57
|
-
parseLedgerEntry(item: Dict, currency?: Currency):
|
|
58
|
-
id: string;
|
|
59
|
-
info: Dict;
|
|
60
|
-
timestamp: number;
|
|
61
|
-
datetime: string;
|
|
62
|
-
account: any;
|
|
63
|
-
referenceId: string;
|
|
64
|
-
referenceAccount: any;
|
|
65
|
-
type: string;
|
|
66
|
-
currency: string;
|
|
67
|
-
symbol: string;
|
|
68
|
-
amount: number;
|
|
69
|
-
before: any;
|
|
70
|
-
after: number;
|
|
71
|
-
status: string;
|
|
72
|
-
fee: any;
|
|
73
|
-
};
|
|
57
|
+
parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
|
|
74
58
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
75
59
|
url: string;
|
|
76
60
|
method: string;
|
package/js/src/okcoin.js
CHANGED
|
@@ -2861,13 +2861,13 @@ export default class okcoin extends Exchange {
|
|
|
2861
2861
|
/**
|
|
2862
2862
|
* @method
|
|
2863
2863
|
* @name okcoin#fetchLedger
|
|
2864
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
2864
2865
|
* @see https://www.okcoin.com/docs-v5/en/#rest-api-funding-asset-bills-details
|
|
2865
2866
|
* @see https://www.okcoin.com/docs-v5/en/#rest-api-account-get-bills-details-last-7-days
|
|
2866
2867
|
* @see https://www.okcoin.com/docs-v5/en/#rest-api-account-get-bills-details-last-3-months
|
|
2867
|
-
* @
|
|
2868
|
-
* @param {string} code unified currency code, default is undefined
|
|
2868
|
+
* @param {string} [code] unified currency code, default is undefined
|
|
2869
2869
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
2870
|
-
* @param {int} [limit] max number of ledger
|
|
2870
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
2871
2871
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2872
2872
|
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
2873
2873
|
*/
|
|
@@ -3009,46 +3009,37 @@ export default class okcoin extends Exchange {
|
|
|
3009
3009
|
// "ts": "1597026383085"
|
|
3010
3010
|
// }
|
|
3011
3011
|
//
|
|
3012
|
-
const
|
|
3013
|
-
const
|
|
3014
|
-
|
|
3015
|
-
const referenceAccount = undefined;
|
|
3016
|
-
const type = this.parseLedgerEntryType(this.safeString(item, 'type'));
|
|
3017
|
-
const code = this.safeCurrencyCode(this.safeString(item, 'ccy'), currency);
|
|
3018
|
-
const amountString = this.safeString(item, 'balChg');
|
|
3019
|
-
const amount = this.parseNumber(amountString);
|
|
3012
|
+
const currencyId = this.safeString(item, 'ccy');
|
|
3013
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
3014
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
3020
3015
|
const timestamp = this.safeInteger(item, 'ts');
|
|
3021
3016
|
const feeCostString = this.safeString(item, 'fee');
|
|
3022
3017
|
let fee = undefined;
|
|
3023
3018
|
if (feeCostString !== undefined) {
|
|
3024
3019
|
fee = {
|
|
3025
|
-
'cost': this.
|
|
3020
|
+
'cost': this.parseToNumeric(Precise.stringNeg(feeCostString)),
|
|
3026
3021
|
'currency': code,
|
|
3027
3022
|
};
|
|
3028
3023
|
}
|
|
3029
|
-
const before = undefined;
|
|
3030
|
-
const afterString = this.safeString(item, 'bal');
|
|
3031
|
-
const after = this.parseNumber(afterString);
|
|
3032
|
-
const status = 'ok';
|
|
3033
3024
|
const marketId = this.safeString(item, 'instId');
|
|
3034
3025
|
const symbol = this.safeSymbol(marketId, undefined, '-');
|
|
3035
|
-
return {
|
|
3036
|
-
'id': id,
|
|
3026
|
+
return this.safeLedgerEntry({
|
|
3037
3027
|
'info': item,
|
|
3028
|
+
'id': this.safeString(item, 'billId'),
|
|
3038
3029
|
'timestamp': timestamp,
|
|
3039
3030
|
'datetime': this.iso8601(timestamp),
|
|
3040
|
-
'account':
|
|
3041
|
-
'referenceId':
|
|
3042
|
-
'referenceAccount':
|
|
3043
|
-
'type': type,
|
|
3031
|
+
'account': undefined,
|
|
3032
|
+
'referenceId': this.safeString(item, 'ordId'),
|
|
3033
|
+
'referenceAccount': undefined,
|
|
3034
|
+
'type': this.parseLedgerEntryType(this.safeString(item, 'type')),
|
|
3044
3035
|
'currency': code,
|
|
3045
3036
|
'symbol': symbol,
|
|
3046
|
-
'amount':
|
|
3047
|
-
'before':
|
|
3048
|
-
'after':
|
|
3049
|
-
'status':
|
|
3037
|
+
'amount': this.safeNumber(item, 'balChg'),
|
|
3038
|
+
'before': undefined,
|
|
3039
|
+
'after': this.safeNumber(item, 'bal'),
|
|
3040
|
+
'status': 'ok',
|
|
3050
3041
|
'fee': fee,
|
|
3051
|
-
};
|
|
3042
|
+
}, currency);
|
|
3052
3043
|
}
|
|
3053
3044
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
3054
3045
|
const isArray = Array.isArray(params);
|
package/js/src/okx.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/okx.js';
|
|
2
|
-
import type { TransferEntry, Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, FundingHistory, Str, Transaction, Ticker, OrderBook, Balances, Tickers, Market, Greeks, Strings, MarketInterface, Currency, Leverage, Num, Account, OptionChain, Option, MarginModification, TradingFeeInterface, Currencies, Conversion, CancellationRequest, Dict, Position, CrossBorrowRate, CrossBorrowRates, LeverageTier, int } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, FundingHistory, Str, Transaction, Ticker, OrderBook, Balances, Tickers, Market, Greeks, Strings, MarketInterface, Currency, Leverage, Num, Account, OptionChain, Option, MarginModification, TradingFeeInterface, Currencies, Conversion, CancellationRequest, Dict, Position, CrossBorrowRate, CrossBorrowRates, LeverageTier, int, LedgerEntry } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class okx
|
|
5
5
|
* @augments Exchange
|
|
@@ -52,25 +52,9 @@ export default class okx extends Exchange {
|
|
|
52
52
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
53
53
|
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
54
54
|
fetchOrderTrades(id: string, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
55
|
-
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<
|
|
55
|
+
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
56
56
|
parseLedgerEntryType(type: any): string;
|
|
57
|
-
parseLedgerEntry(item: Dict, currency?: Currency):
|
|
58
|
-
id: string;
|
|
59
|
-
info: Dict;
|
|
60
|
-
timestamp: number;
|
|
61
|
-
datetime: string;
|
|
62
|
-
account: any;
|
|
63
|
-
referenceId: string;
|
|
64
|
-
referenceAccount: any;
|
|
65
|
-
type: string;
|
|
66
|
-
currency: string;
|
|
67
|
-
symbol: string;
|
|
68
|
-
amount: number;
|
|
69
|
-
before: any;
|
|
70
|
-
after: number;
|
|
71
|
-
status: string;
|
|
72
|
-
fee: any;
|
|
73
|
-
};
|
|
57
|
+
parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
|
|
74
58
|
parseDepositAddress(depositAddress: any, currency?: Currency): {
|
|
75
59
|
currency: string;
|
|
76
60
|
address: string;
|
package/js/src/okx.js
CHANGED
|
@@ -793,6 +793,7 @@ export default class okx extends Exchange {
|
|
|
793
793
|
// SPOT/MARGIN error codes 54000-54999
|
|
794
794
|
'54000': ExchangeError,
|
|
795
795
|
'54001': ExchangeError,
|
|
796
|
+
'54011': InvalidOrder,
|
|
796
797
|
// Trading bot Error Code from 55100 to 55999
|
|
797
798
|
'55100': InvalidOrder,
|
|
798
799
|
'55101': InvalidOrder,
|
|
@@ -4474,13 +4475,13 @@ export default class okx extends Exchange {
|
|
|
4474
4475
|
* @see https://www.okx.com/docs-v5/en/#rest-api-account-get-bills-details-last-7-days
|
|
4475
4476
|
* @see https://www.okx.com/docs-v5/en/#rest-api-account-get-bills-details-last-3-months
|
|
4476
4477
|
* @see https://www.okx.com/docs-v5/en/#rest-api-funding-asset-bills-details
|
|
4477
|
-
* @param {string} code unified currency code, default is undefined
|
|
4478
|
+
* @param {string} [code] unified currency code, default is undefined
|
|
4478
4479
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
4479
|
-
* @param {int} [limit] max number of ledger
|
|
4480
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
4480
4481
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4481
4482
|
* @param {string} [params.marginMode] 'cross' or 'isolated'
|
|
4482
4483
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4483
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [
|
|
4484
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4484
4485
|
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
4485
4486
|
*/
|
|
4486
4487
|
await this.loadMarkets();
|
|
@@ -4643,14 +4644,9 @@ export default class okx extends Exchange {
|
|
|
4643
4644
|
// "ts": "1597026383085"
|
|
4644
4645
|
// }
|
|
4645
4646
|
//
|
|
4646
|
-
const
|
|
4647
|
-
const
|
|
4648
|
-
|
|
4649
|
-
const referenceAccount = undefined;
|
|
4650
|
-
const type = this.parseLedgerEntryType(this.safeString(item, 'type'));
|
|
4651
|
-
const code = this.safeCurrencyCode(this.safeString(item, 'ccy'), currency);
|
|
4652
|
-
const amountString = this.safeString(item, 'balChg');
|
|
4653
|
-
const amount = this.parseNumber(amountString);
|
|
4647
|
+
const currencyId = this.safeString(item, 'ccy');
|
|
4648
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
4649
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
4654
4650
|
const timestamp = this.safeInteger(item, 'ts');
|
|
4655
4651
|
const feeCostString = this.safeString(item, 'fee');
|
|
4656
4652
|
let fee = undefined;
|
|
@@ -4660,29 +4656,25 @@ export default class okx extends Exchange {
|
|
|
4660
4656
|
'currency': code,
|
|
4661
4657
|
};
|
|
4662
4658
|
}
|
|
4663
|
-
const before = undefined;
|
|
4664
|
-
const afterString = this.safeString(item, 'bal');
|
|
4665
|
-
const after = this.parseNumber(afterString);
|
|
4666
|
-
const status = 'ok';
|
|
4667
4659
|
const marketId = this.safeString(item, 'instId');
|
|
4668
4660
|
const symbol = this.safeSymbol(marketId, undefined, '-');
|
|
4669
|
-
return {
|
|
4670
|
-
'id': id,
|
|
4661
|
+
return this.safeLedgerEntry({
|
|
4671
4662
|
'info': item,
|
|
4663
|
+
'id': this.safeString(item, 'billId'),
|
|
4672
4664
|
'timestamp': timestamp,
|
|
4673
4665
|
'datetime': this.iso8601(timestamp),
|
|
4674
|
-
'account':
|
|
4675
|
-
'referenceId':
|
|
4676
|
-
'referenceAccount':
|
|
4677
|
-
'type': type,
|
|
4666
|
+
'account': undefined,
|
|
4667
|
+
'referenceId': this.safeString(item, 'ordId'),
|
|
4668
|
+
'referenceAccount': undefined,
|
|
4669
|
+
'type': this.parseLedgerEntryType(this.safeString(item, 'type')),
|
|
4678
4670
|
'currency': code,
|
|
4679
4671
|
'symbol': symbol,
|
|
4680
|
-
'amount':
|
|
4681
|
-
'before':
|
|
4682
|
-
'after':
|
|
4683
|
-
'status':
|
|
4672
|
+
'amount': this.safeNumber(item, 'balChg'),
|
|
4673
|
+
'before': undefined,
|
|
4674
|
+
'after': this.safeNumber(item, 'bal'),
|
|
4675
|
+
'status': 'ok',
|
|
4684
4676
|
'fee': fee,
|
|
4685
|
-
};
|
|
4677
|
+
}, currency);
|
|
4686
4678
|
}
|
|
4687
4679
|
parseDepositAddress(depositAddress, currency = undefined) {
|
|
4688
4680
|
//
|
package/js/src/p2b.js
CHANGED
|
@@ -477,7 +477,7 @@ export default class p2b extends Exchange {
|
|
|
477
477
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
478
478
|
/**
|
|
479
479
|
* @method
|
|
480
|
-
* @name
|
|
480
|
+
* @name p2b#fetchOrderBook
|
|
481
481
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
482
482
|
* @see https://github.com/P2B-team/p2b-api-docs/blob/master/api-doc.md#depth-result
|
|
483
483
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
@@ -646,7 +646,7 @@ export default class p2b extends Exchange {
|
|
|
646
646
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
647
647
|
/**
|
|
648
648
|
* @method
|
|
649
|
-
* @name
|
|
649
|
+
* @name p2b#fetchOHLCV
|
|
650
650
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
651
651
|
* @see https://github.com/P2B-team/p2b-api-docs/blob/master/api-doc.md#kline
|
|
652
652
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
package/js/src/paradex.js
CHANGED
|
@@ -659,7 +659,7 @@ export default class paradex extends Exchange {
|
|
|
659
659
|
'low': undefined,
|
|
660
660
|
'bid': this.safeString(ticker, 'bid'),
|
|
661
661
|
'bidVolume': undefined,
|
|
662
|
-
'ask': this.safeString(ticker, '
|
|
662
|
+
'ask': this.safeString(ticker, 'ask'),
|
|
663
663
|
'askVolume': undefined,
|
|
664
664
|
'vwap': undefined,
|
|
665
665
|
'open': undefined,
|