ccxt 4.4.85 → 4.4.87
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 +18 -7
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +16 -9
- package/dist/cjs/src/abstract/bittrade.js +9 -0
- package/dist/cjs/src/abstract/modetrade.js +9 -0
- package/dist/cjs/src/ascendex.js +189 -155
- package/dist/cjs/src/base/Exchange.js +10 -8
- package/dist/cjs/src/bequant.js +1 -1
- package/dist/cjs/src/binance.js +1 -1
- package/dist/cjs/src/bitget.js +5 -4
- package/dist/cjs/src/bitmart.js +1 -1
- package/dist/cjs/src/bitteam.js +31 -0
- package/dist/cjs/src/bittrade.js +2049 -0
- package/dist/cjs/src/coinbase.js +2 -6
- package/dist/cjs/src/coinmetro.js +5 -1
- package/dist/cjs/src/deribit.js +4 -5
- package/dist/cjs/src/derive.js +4 -5
- package/dist/cjs/src/ellipx.js +2 -3
- package/dist/cjs/src/gate.js +92 -76
- package/dist/cjs/src/hollaex.js +107 -49
- package/dist/cjs/src/htx.js +30 -52
- package/dist/cjs/src/hyperliquid.js +36 -20
- package/dist/cjs/src/kraken.js +5 -8
- package/dist/cjs/src/mexc.js +2 -2
- package/dist/cjs/src/modetrade.js +2839 -0
- package/dist/cjs/src/ndax.js +25 -24
- package/dist/cjs/src/okcoin.js +12 -31
- package/dist/cjs/src/okx.js +104 -2
- package/dist/cjs/src/okxus.js +53 -0
- package/dist/cjs/src/onetrading.js +9 -6
- package/dist/cjs/src/oxfun.js +42 -114
- package/dist/cjs/src/paradex.js +10 -1
- package/dist/cjs/src/phemex.js +4 -6
- package/dist/cjs/src/poloniex.js +181 -170
- package/dist/cjs/src/pro/binance.js +1 -0
- package/dist/cjs/src/pro/bittrade.js +605 -0
- package/dist/cjs/src/pro/luno.js +6 -5
- package/dist/cjs/src/pro/mexc.js +3 -0
- package/dist/cjs/src/pro/modetrade.js +1334 -0
- package/dist/cjs/src/pro/okxus.js +38 -0
- package/dist/cjs/src/probit.js +18 -51
- package/dist/cjs/src/timex.js +5 -10
- package/dist/cjs/src/vertex.js +3 -4
- package/dist/cjs/src/whitebit.js +41 -11
- package/dist/cjs/src/woo.js +101 -77
- package/dist/cjs/src/woofipro.js +24 -21
- package/dist/cjs/src/xt.js +36 -44
- package/js/ccxt.d.ts +20 -11
- package/js/ccxt.js +14 -8
- package/js/src/abstract/modetrade.d.ts +122 -0
- package/js/src/abstract/myokx.d.ts +2 -0
- package/js/src/abstract/okx.d.ts +2 -0
- package/js/src/abstract/okxus.d.ts +352 -0
- package/js/src/abstract/okxus.js +11 -0
- package/js/src/ascendex.d.ts +2 -0
- package/js/src/ascendex.js +189 -155
- package/js/src/base/Exchange.js +10 -8
- package/js/src/bequant.js +1 -1
- package/js/src/binance.js +1 -1
- package/js/src/bitget.js +5 -4
- package/js/src/bitmart.js +1 -1
- package/js/src/bitteam.js +31 -0
- package/js/src/{huobijp.d.ts → bittrade.d.ts} +29 -29
- package/js/src/{huobijp.js → bittrade.js} +35 -35
- package/js/src/coinbase.js +2 -6
- package/js/src/coinmetro.js +5 -1
- package/js/src/deribit.js +4 -5
- package/js/src/derive.js +4 -3
- package/js/src/ellipx.d.ts +1 -1
- package/js/src/ellipx.js +3 -5
- package/js/src/gate.js +92 -76
- package/js/src/hollaex.js +107 -49
- package/js/src/htx.js +30 -52
- package/js/src/hyperliquid.js +36 -20
- package/js/src/kraken.js +5 -8
- package/js/src/mexc.js +2 -2
- package/js/src/modetrade.d.ts +475 -0
- package/js/src/modetrade.js +2840 -0
- package/js/src/ndax.js +25 -24
- package/js/src/okcoin.js +12 -31
- package/js/src/okx.d.ts +24 -1
- package/js/src/okx.js +104 -2
- package/js/src/okxus.d.ts +4 -0
- package/js/src/okxus.js +54 -0
- package/js/src/onetrading.js +9 -6
- package/js/src/oxfun.js +42 -114
- package/js/src/paradex.js +10 -1
- package/js/src/phemex.js +4 -6
- package/js/src/poloniex.d.ts +2 -0
- package/js/src/poloniex.js +181 -170
- package/js/src/pro/binance.js +1 -0
- package/js/src/pro/{huobijp.d.ts → bittrade.d.ts} +6 -6
- package/js/src/pro/{huobijp.js → bittrade.js} +7 -7
- package/js/src/pro/luno.js +6 -5
- package/js/src/pro/mexc.js +3 -0
- package/js/src/pro/modetrade.d.ts +155 -0
- package/js/src/pro/modetrade.js +1335 -0
- package/js/src/pro/okxus.d.ts +4 -0
- package/js/src/pro/okxus.js +39 -0
- package/js/src/probit.js +18 -51
- package/js/src/timex.js +5 -10
- package/js/src/vertex.js +3 -4
- package/js/src/whitebit.js +42 -11
- package/js/src/woo.d.ts +2 -0
- package/js/src/woo.js +101 -77
- package/js/src/woofipro.d.ts +2 -1
- package/js/src/woofipro.js +24 -21
- package/js/src/xt.js +36 -44
- package/package.json +1 -1
- package/js/src/abstract/kuna.d.ts +0 -185
- package/js/src/kuna.d.ts +0 -335
- package/js/src/kuna.js +0 -2006
- /package/js/src/abstract/{huobijp.d.ts → bittrade.d.ts} +0 -0
- /package/js/src/abstract/{huobijp.js → bittrade.js} +0 -0
- /package/js/src/abstract/{kuna.js → modetrade.js} +0 -0
package/dist/cjs/src/ndax.js
CHANGED
|
@@ -452,45 +452,45 @@ class ndax extends ndax$1 {
|
|
|
452
452
|
};
|
|
453
453
|
const response = await this.publicGetGetProducts(this.extend(request, params));
|
|
454
454
|
//
|
|
455
|
-
//
|
|
456
|
-
//
|
|
457
|
-
//
|
|
458
|
-
//
|
|
459
|
-
//
|
|
460
|
-
//
|
|
461
|
-
//
|
|
462
|
-
//
|
|
463
|
-
//
|
|
464
|
-
//
|
|
465
|
-
//
|
|
466
|
-
//
|
|
467
|
-
//
|
|
468
|
-
//
|
|
455
|
+
// [
|
|
456
|
+
// {
|
|
457
|
+
// "OMSId": "1",
|
|
458
|
+
// "ProductId": "1",
|
|
459
|
+
// "Product": "BTC",
|
|
460
|
+
// "ProductFullName": "Bitcoin",
|
|
461
|
+
// "MasterDataUniqueProductSymbol": "",
|
|
462
|
+
// "ProductType": "CryptoCurrency",
|
|
463
|
+
// "DecimalPlaces": "8",
|
|
464
|
+
// "TickSize": "0.0000000100000000000000000000",
|
|
465
|
+
// "DepositEnabled": true,
|
|
466
|
+
// "WithdrawEnabled": true,
|
|
467
|
+
// "NoFees": false,
|
|
468
|
+
// "IsDisabled": false,
|
|
469
|
+
// "MarginEnabled": false
|
|
470
|
+
// },
|
|
471
|
+
// ...
|
|
469
472
|
//
|
|
470
473
|
const result = {};
|
|
471
474
|
for (let i = 0; i < response.length; i++) {
|
|
472
475
|
const currency = response[i];
|
|
473
476
|
const id = this.safeString(currency, 'ProductId');
|
|
474
|
-
const
|
|
477
|
+
const code = this.safeCurrencyCode(this.safeString(currency, 'Product'));
|
|
475
478
|
const ProductType = this.safeString(currency, 'ProductType');
|
|
476
479
|
let type = (ProductType === 'NationalCurrency') ? 'fiat' : 'crypto';
|
|
477
480
|
if (ProductType === 'Unknown') {
|
|
478
481
|
// such currency is just a blanket entry
|
|
479
482
|
type = 'other';
|
|
480
483
|
}
|
|
481
|
-
|
|
482
|
-
const isDisabled = this.safeValue(currency, 'IsDisabled');
|
|
483
|
-
const active = !isDisabled;
|
|
484
|
-
result[code] = {
|
|
484
|
+
result[code] = this.safeCurrencyStructure({
|
|
485
485
|
'id': id,
|
|
486
|
-
'name':
|
|
486
|
+
'name': this.safeString(currency, 'ProductFullName'),
|
|
487
487
|
'code': code,
|
|
488
488
|
'type': type,
|
|
489
489
|
'precision': this.safeNumber(currency, 'TickSize'),
|
|
490
490
|
'info': currency,
|
|
491
|
-
'active':
|
|
492
|
-
'deposit':
|
|
493
|
-
'withdraw':
|
|
491
|
+
'active': !this.safeBool(currency, 'IsDisabled'),
|
|
492
|
+
'deposit': this.safeBool(currency, 'DepositEnabled'),
|
|
493
|
+
'withdraw': this.safeBool(currency, 'WithdrawEnabled'),
|
|
494
494
|
'fee': undefined,
|
|
495
495
|
'limits': {
|
|
496
496
|
'amount': {
|
|
@@ -503,7 +503,8 @@ class ndax extends ndax$1 {
|
|
|
503
503
|
},
|
|
504
504
|
},
|
|
505
505
|
'networks': {},
|
|
506
|
-
|
|
506
|
+
'margin': this.safeBool(currency, 'MarginEnabled'),
|
|
507
|
+
});
|
|
507
508
|
}
|
|
508
509
|
return result;
|
|
509
510
|
}
|
package/dist/cjs/src/okcoin.js
CHANGED
|
@@ -826,49 +826,30 @@ class okcoin extends okcoin$1 {
|
|
|
826
826
|
}
|
|
827
827
|
else {
|
|
828
828
|
const response = await this.privateGetAssetCurrencies(params);
|
|
829
|
-
const data = this.
|
|
829
|
+
const data = this.safeList(response, 'data', []);
|
|
830
830
|
const result = {};
|
|
831
831
|
const dataByCurrencyId = this.groupBy(data, 'ccy');
|
|
832
832
|
const currencyIds = Object.keys(dataByCurrencyId);
|
|
833
833
|
for (let i = 0; i < currencyIds.length; i++) {
|
|
834
834
|
const currencyId = currencyIds[i];
|
|
835
|
-
const
|
|
836
|
-
const code = currency['code'];
|
|
835
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
837
836
|
const chains = dataByCurrencyId[currencyId];
|
|
838
837
|
const networks = {};
|
|
839
|
-
let currencyActive = false;
|
|
840
|
-
let depositEnabled = false;
|
|
841
|
-
let withdrawEnabled = false;
|
|
842
|
-
let maxPrecision = undefined;
|
|
843
838
|
for (let j = 0; j < chains.length; j++) {
|
|
844
839
|
const chain = chains[j];
|
|
845
|
-
const canDeposit = this.safeValue(chain, 'canDep');
|
|
846
|
-
depositEnabled = (canDeposit) ? canDeposit : depositEnabled;
|
|
847
|
-
const canWithdraw = this.safeValue(chain, 'canWd');
|
|
848
|
-
withdrawEnabled = (canWithdraw) ? canWithdraw : withdrawEnabled;
|
|
849
|
-
const canInternal = this.safeValue(chain, 'canInternal');
|
|
850
|
-
const active = (canDeposit && canWithdraw && canInternal) ? true : false;
|
|
851
|
-
currencyActive = (active) ? active : currencyActive;
|
|
852
840
|
const networkId = this.safeString(chain, 'chain');
|
|
853
841
|
if ((networkId !== undefined) && (networkId.indexOf('-') >= 0)) {
|
|
854
842
|
const parts = networkId.split('-');
|
|
855
843
|
const chainPart = this.safeString(parts, 1, networkId);
|
|
856
844
|
const networkCode = this.networkIdToCode(chainPart);
|
|
857
|
-
const precision = this.parsePrecision(this.safeString(chain, 'wdTickSz'));
|
|
858
|
-
if (maxPrecision === undefined) {
|
|
859
|
-
maxPrecision = precision;
|
|
860
|
-
}
|
|
861
|
-
else {
|
|
862
|
-
maxPrecision = Precise["default"].stringMin(maxPrecision, precision);
|
|
863
|
-
}
|
|
864
845
|
networks[networkCode] = {
|
|
865
846
|
'id': networkId,
|
|
866
847
|
'network': networkCode,
|
|
867
|
-
'active':
|
|
868
|
-
'deposit':
|
|
869
|
-
'withdraw':
|
|
848
|
+
'active': undefined,
|
|
849
|
+
'deposit': this.safeBool(chain, 'canDep'),
|
|
850
|
+
'withdraw': this.safeBool(chain, 'canWd'),
|
|
870
851
|
'fee': this.safeNumber(chain, 'minFee'),
|
|
871
|
-
'precision': this.parseNumber(
|
|
852
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'wdTickSz'))),
|
|
872
853
|
'limits': {
|
|
873
854
|
'withdraw': {
|
|
874
855
|
'min': this.safeNumber(chain, 'minWd'),
|
|
@@ -880,16 +861,16 @@ class okcoin extends okcoin$1 {
|
|
|
880
861
|
}
|
|
881
862
|
}
|
|
882
863
|
const firstChain = this.safeValue(chains, 0);
|
|
883
|
-
result[code] = {
|
|
864
|
+
result[code] = this.safeCurrencyStructure({
|
|
884
865
|
'info': chains,
|
|
885
866
|
'code': code,
|
|
886
867
|
'id': currencyId,
|
|
887
868
|
'name': this.safeString(firstChain, 'name'),
|
|
888
|
-
'active':
|
|
889
|
-
'deposit':
|
|
890
|
-
'withdraw':
|
|
869
|
+
'active': undefined,
|
|
870
|
+
'deposit': undefined,
|
|
871
|
+
'withdraw': undefined,
|
|
891
872
|
'fee': undefined,
|
|
892
|
-
'precision':
|
|
873
|
+
'precision': undefined,
|
|
893
874
|
'limits': {
|
|
894
875
|
'amount': {
|
|
895
876
|
'min': undefined,
|
|
@@ -897,7 +878,7 @@ class okcoin extends okcoin$1 {
|
|
|
897
878
|
},
|
|
898
879
|
},
|
|
899
880
|
'networks': networks,
|
|
900
|
-
};
|
|
881
|
+
});
|
|
901
882
|
}
|
|
902
883
|
return result;
|
|
903
884
|
}
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -83,7 +83,7 @@ class okx extends okx$1 {
|
|
|
83
83
|
'fetchFundingIntervals': false,
|
|
84
84
|
'fetchFundingRate': true,
|
|
85
85
|
'fetchFundingRateHistory': true,
|
|
86
|
-
'fetchFundingRates':
|
|
86
|
+
'fetchFundingRates': true,
|
|
87
87
|
'fetchGreeks': true,
|
|
88
88
|
'fetchIndexOHLCV': true,
|
|
89
89
|
'fetchIsolatedBorrowRate': false,
|
|
@@ -106,6 +106,7 @@ class okx extends okx$1 {
|
|
|
106
106
|
'fetchOHLCV': true,
|
|
107
107
|
'fetchOpenInterest': true,
|
|
108
108
|
'fetchOpenInterestHistory': true,
|
|
109
|
+
'fetchOpenInterests': true,
|
|
109
110
|
'fetchOpenOrder': undefined,
|
|
110
111
|
'fetchOpenOrders': true,
|
|
111
112
|
'fetchOption': true,
|
|
@@ -363,6 +364,7 @@ class okx extends okx$1 {
|
|
|
363
364
|
'account/spot-manual-borrow-repay': 10,
|
|
364
365
|
'account/set-auto-repay': 4,
|
|
365
366
|
'account/spot-borrow-repay-history': 4,
|
|
367
|
+
'account/move-positions-history': 10,
|
|
366
368
|
// subaccount
|
|
367
369
|
'users/subaccount/list': 10,
|
|
368
370
|
'account/subaccount/balances': 10 / 3,
|
|
@@ -500,6 +502,7 @@ class okx extends okx$1 {
|
|
|
500
502
|
'account/fixed-loan/manual-reborrow': 5,
|
|
501
503
|
'account/fixed-loan/repay-borrowing-order': 5,
|
|
502
504
|
'account/bills-history-archive': 72000,
|
|
505
|
+
'account/move-positions': 10,
|
|
503
506
|
// subaccount
|
|
504
507
|
'users/subaccount/modify-apikey': 10,
|
|
505
508
|
'asset/subaccount/transfer': 10,
|
|
@@ -966,6 +969,13 @@ class okx extends okx$1 {
|
|
|
966
969
|
'70010': errors.BadRequest,
|
|
967
970
|
'70013': errors.BadRequest,
|
|
968
971
|
'70016': errors.BadRequest,
|
|
972
|
+
'70060': errors.BadRequest,
|
|
973
|
+
'70061': errors.BadRequest,
|
|
974
|
+
'70062': errors.BadRequest,
|
|
975
|
+
'70064': errors.BadRequest,
|
|
976
|
+
'70065': errors.BadRequest,
|
|
977
|
+
'70066': errors.BadRequest,
|
|
978
|
+
'70067': errors.BadRequest,
|
|
969
979
|
'1009': errors.BadRequest,
|
|
970
980
|
'4001': errors.AuthenticationError,
|
|
971
981
|
'4002': errors.BadRequest,
|
|
@@ -6288,7 +6298,7 @@ class okx extends okx$1 {
|
|
|
6288
6298
|
const nextFundingRate = this.safeNumber(contract, 'nextFundingRate');
|
|
6289
6299
|
const fundingTime = this.safeInteger(contract, 'fundingTime');
|
|
6290
6300
|
const fundingTimeString = this.safeString(contract, 'fundingTime');
|
|
6291
|
-
const nextFundingTimeString = this.safeString(contract, '
|
|
6301
|
+
const nextFundingTimeString = this.safeString(contract, 'nextFundingTime');
|
|
6292
6302
|
const millisecondsInterval = Precise["default"].stringSub(nextFundingTimeString, fundingTimeString);
|
|
6293
6303
|
// https://www.okx.com/support/hc/en-us/articles/360053909272-Ⅸ-Introduction-to-perpetual-swap-funding-fee
|
|
6294
6304
|
// > The current interest is 0.
|
|
@@ -6374,6 +6384,39 @@ class okx extends okx$1 {
|
|
|
6374
6384
|
const entry = this.safeDict(data, 0, {});
|
|
6375
6385
|
return this.parseFundingRate(entry, market);
|
|
6376
6386
|
}
|
|
6387
|
+
/**
|
|
6388
|
+
* @method
|
|
6389
|
+
* @name okx#fetchFundingRates
|
|
6390
|
+
* @description fetches the current funding rates for multiple symbols
|
|
6391
|
+
* @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate
|
|
6392
|
+
* @param {string[]} symbols unified market symbols
|
|
6393
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6394
|
+
* @returns {object} a dictionary of [funding rates structure]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}
|
|
6395
|
+
*/
|
|
6396
|
+
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
6397
|
+
await this.loadMarkets();
|
|
6398
|
+
symbols = this.marketSymbols(symbols, 'swap', true);
|
|
6399
|
+
const request = { 'instId': 'ANY' };
|
|
6400
|
+
const response = await this.publicGetPublicFundingRate(this.extend(request, params));
|
|
6401
|
+
//
|
|
6402
|
+
// {
|
|
6403
|
+
// "code": "0",
|
|
6404
|
+
// "data": [
|
|
6405
|
+
// {
|
|
6406
|
+
// "fundingRate": "0.00027815",
|
|
6407
|
+
// "fundingTime": "1634256000000",
|
|
6408
|
+
// "instId": "BTC-USD-SWAP",
|
|
6409
|
+
// "instType": "SWAP",
|
|
6410
|
+
// "nextFundingRate": "0.00017",
|
|
6411
|
+
// "nextFundingTime": "1634284800000"
|
|
6412
|
+
// }
|
|
6413
|
+
// ],
|
|
6414
|
+
// "msg": ""
|
|
6415
|
+
// }
|
|
6416
|
+
//
|
|
6417
|
+
const data = this.safeList(response, 'data', []);
|
|
6418
|
+
return this.parseFundingRates(data, symbols);
|
|
6419
|
+
}
|
|
6377
6420
|
/**
|
|
6378
6421
|
* @method
|
|
6379
6422
|
* @name okx#fetchFundingHistory
|
|
@@ -7378,6 +7421,65 @@ class okx extends okx$1 {
|
|
|
7378
7421
|
const data = this.safeList(response, 'data', []);
|
|
7379
7422
|
return this.parseOpenInterest(data[0], market);
|
|
7380
7423
|
}
|
|
7424
|
+
/**
|
|
7425
|
+
* @method
|
|
7426
|
+
* @name okx#fetchOpenInterests
|
|
7427
|
+
* @description Retrieves the open interests of some currencies
|
|
7428
|
+
* @see https://www.okx.com/docs-v5/en/#rest-api-public-data-get-open-interest
|
|
7429
|
+
* @param {string[]} symbols Unified CCXT market symbols
|
|
7430
|
+
* @param {object} [params] exchange specific parameters
|
|
7431
|
+
* @param {string} params.instType Instrument type, options: 'SWAP', 'FUTURES', 'OPTION', default to 'SWAP'
|
|
7432
|
+
* @param {string} params.uly Underlying, Applicable to FUTURES/SWAP/OPTION, if instType is 'OPTION', either uly or instFamily is required
|
|
7433
|
+
* @param {string} params.instFamily Instrument family, Applicable to FUTURES/SWAP/OPTION, if instType is 'OPTION', either uly or instFamily is required
|
|
7434
|
+
* @returns {object} an dictionary of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
7435
|
+
*/
|
|
7436
|
+
async fetchOpenInterests(symbols = undefined, params = {}) {
|
|
7437
|
+
await this.loadMarkets();
|
|
7438
|
+
symbols = this.marketSymbols(symbols, undefined, true, true);
|
|
7439
|
+
let market = undefined;
|
|
7440
|
+
if (symbols !== undefined) {
|
|
7441
|
+
market = this.market(symbols[0]);
|
|
7442
|
+
}
|
|
7443
|
+
let marketType = undefined;
|
|
7444
|
+
[marketType, params] = this.handleSubTypeAndParams('fetchOpenInterests', market, params, 'swap');
|
|
7445
|
+
let instType = 'SWAP';
|
|
7446
|
+
if (marketType === 'future') {
|
|
7447
|
+
instType = 'FUTURES';
|
|
7448
|
+
}
|
|
7449
|
+
else if (instType === 'option') {
|
|
7450
|
+
instType = 'OPTION';
|
|
7451
|
+
}
|
|
7452
|
+
const request = { 'instType': instType };
|
|
7453
|
+
const uly = this.safeString(params, 'uly');
|
|
7454
|
+
if (uly !== undefined) {
|
|
7455
|
+
request['uly'] = uly;
|
|
7456
|
+
}
|
|
7457
|
+
const instFamily = this.safeString(params, 'instFamily');
|
|
7458
|
+
if (instFamily !== undefined) {
|
|
7459
|
+
request['instFamily'] = instFamily;
|
|
7460
|
+
}
|
|
7461
|
+
if (instType === 'OPTION' && uly === undefined && instFamily === undefined) {
|
|
7462
|
+
throw new errors.BadRequest(this.id + ' fetchOpenInterests() requires either uly or instFamily parameter for OPTION markets');
|
|
7463
|
+
}
|
|
7464
|
+
const response = await this.publicGetPublicOpenInterest(this.extend(request, params));
|
|
7465
|
+
//
|
|
7466
|
+
// {
|
|
7467
|
+
// "code": "0",
|
|
7468
|
+
// "data": [
|
|
7469
|
+
// {
|
|
7470
|
+
// "instId": "BTC-USDT-SWAP",
|
|
7471
|
+
// "instType": "SWAP",
|
|
7472
|
+
// "oi": "2125419",
|
|
7473
|
+
// "oiCcy": "21254.19",
|
|
7474
|
+
// "ts": "1664005108969"
|
|
7475
|
+
// }
|
|
7476
|
+
// ],
|
|
7477
|
+
// "msg": ""
|
|
7478
|
+
// }
|
|
7479
|
+
//
|
|
7480
|
+
const data = this.safeList(response, 'data', []);
|
|
7481
|
+
return this.parseOpenInterests(data, symbols);
|
|
7482
|
+
}
|
|
7381
7483
|
/**
|
|
7382
7484
|
* @method
|
|
7383
7485
|
* @name okx#fetchOpenInterestHistory
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var okx = require('./okx.js');
|
|
4
|
+
|
|
5
|
+
// ----------------------------------------------------------------------------
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
class okxus extends okx {
|
|
8
|
+
describe() {
|
|
9
|
+
return this.deepExtend(super.describe(), {
|
|
10
|
+
'id': 'okxus',
|
|
11
|
+
'name': 'OKX (US)',
|
|
12
|
+
'certified': false,
|
|
13
|
+
'pro': true,
|
|
14
|
+
'hostname': 'us.okx.com',
|
|
15
|
+
'urls': {
|
|
16
|
+
'logo': 'https://user-images.githubusercontent.com/1294454/152485636-38b19e4a-bece-4dec-979a-5982859ffc04.jpg',
|
|
17
|
+
'api': {
|
|
18
|
+
'rest': 'https://{hostname}',
|
|
19
|
+
},
|
|
20
|
+
'www': 'https://app.okx.com',
|
|
21
|
+
'doc': 'https://app.okx.com/docs-v5/en/#overview',
|
|
22
|
+
'fees': 'https://app.okx.com/pages/products/fees.html',
|
|
23
|
+
'referral': {
|
|
24
|
+
'url': 'https://www.app.okx.com/join/CCXT2023',
|
|
25
|
+
'discount': 0.2,
|
|
26
|
+
},
|
|
27
|
+
'test': {
|
|
28
|
+
'rest': 'https://{hostname}',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
'has': {
|
|
32
|
+
'CORS': undefined,
|
|
33
|
+
'spot': true,
|
|
34
|
+
'margin': undefined,
|
|
35
|
+
'swap': false,
|
|
36
|
+
'future': false,
|
|
37
|
+
'option': false,
|
|
38
|
+
},
|
|
39
|
+
'features': {
|
|
40
|
+
'swap': {
|
|
41
|
+
'linear': undefined,
|
|
42
|
+
'inverse': undefined,
|
|
43
|
+
},
|
|
44
|
+
'future': {
|
|
45
|
+
'linear': undefined,
|
|
46
|
+
'inverse': undefined,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
module.exports = okxus;
|
|
@@ -392,9 +392,12 @@ class onetrading extends onetrading$1 {
|
|
|
392
392
|
//
|
|
393
393
|
// [
|
|
394
394
|
// {
|
|
395
|
-
// "code":"
|
|
396
|
-
// "precision":
|
|
397
|
-
//
|
|
395
|
+
// "code": "USDT",
|
|
396
|
+
// "precision": 6,
|
|
397
|
+
// "unified_cryptoasset_id": 825,
|
|
398
|
+
// "name": "Tether USDt",
|
|
399
|
+
// "collateral_percentage": 0
|
|
400
|
+
// },
|
|
398
401
|
// ]
|
|
399
402
|
//
|
|
400
403
|
const result = {};
|
|
@@ -402,10 +405,10 @@ class onetrading extends onetrading$1 {
|
|
|
402
405
|
const currency = response[i];
|
|
403
406
|
const id = this.safeString(currency, 'code');
|
|
404
407
|
const code = this.safeCurrencyCode(id);
|
|
405
|
-
result[code] = {
|
|
408
|
+
result[code] = this.safeCurrencyStructure({
|
|
406
409
|
'id': id,
|
|
407
410
|
'code': code,
|
|
408
|
-
'name':
|
|
411
|
+
'name': this.safeString(currency, 'name'),
|
|
409
412
|
'info': currency,
|
|
410
413
|
'active': undefined,
|
|
411
414
|
'fee': undefined,
|
|
@@ -417,7 +420,7 @@ class onetrading extends onetrading$1 {
|
|
|
417
420
|
'withdraw': { 'min': undefined, 'max': undefined },
|
|
418
421
|
},
|
|
419
422
|
'networks': {},
|
|
420
|
-
};
|
|
423
|
+
});
|
|
421
424
|
}
|
|
422
425
|
return result;
|
|
423
426
|
}
|
package/dist/cjs/src/oxfun.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var oxfun$1 = require('./abstract/oxfun.js');
|
|
4
|
-
var Precise = require('./base/Precise.js');
|
|
5
4
|
var errors = require('./base/errors.js');
|
|
6
5
|
var number = require('./base/functions/number.js');
|
|
7
6
|
var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
|
|
@@ -599,66 +598,7 @@ class oxfun extends oxfun$1 {
|
|
|
599
598
|
// "minDeposit": "0.00010",
|
|
600
599
|
// "minWithdrawal": "0.00010"
|
|
601
600
|
// },
|
|
602
|
-
//
|
|
603
|
-
// "network": "Arbitrum",
|
|
604
|
-
// "tokenId": "0xba0Dda8762C24dA9487f5FA026a9B64b695A07Ea",
|
|
605
|
-
// "transactionPrecision": "18",
|
|
606
|
-
// "isWithdrawalFeeChargedToUser": true,
|
|
607
|
-
// "canDeposit": true,
|
|
608
|
-
// "canWithdraw": true,
|
|
609
|
-
// "minDeposit": "0.00010",
|
|
610
|
-
// "minWithdrawal": "0.00010"
|
|
611
|
-
// },
|
|
612
|
-
// {
|
|
613
|
-
// "network": "Ethereum",
|
|
614
|
-
// "tokenId": "0xba0Dda8762C24dA9487f5FA026a9B64b695A07Ea",
|
|
615
|
-
// "transactionPrecision": "18",
|
|
616
|
-
// "isWithdrawalFeeChargedToUser": true,
|
|
617
|
-
// "canDeposit": true,
|
|
618
|
-
// "canWithdraw": true,
|
|
619
|
-
// "minDeposit": "0.00010",
|
|
620
|
-
// "minWithdrawal": "0.00010"
|
|
621
|
-
// },
|
|
622
|
-
// {
|
|
623
|
-
// "network": "Arbitrum",
|
|
624
|
-
// "tokenId": "0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f",
|
|
625
|
-
// "transactionPrecision": "18",
|
|
626
|
-
// "isWithdrawalFeeChargedToUser": true,
|
|
627
|
-
// "canDeposit": true,
|
|
628
|
-
// "canWithdraw": false,
|
|
629
|
-
// "minDeposit": "0.00010",
|
|
630
|
-
// "minWithdrawal": "0.00010"
|
|
631
|
-
// },
|
|
632
|
-
// {
|
|
633
|
-
// "network": "Avalanche",
|
|
634
|
-
// "tokenId": "0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f",
|
|
635
|
-
// "transactionPrecision": "18",
|
|
636
|
-
// "isWithdrawalFeeChargedToUser": true,
|
|
637
|
-
// "canDeposit": true,
|
|
638
|
-
// "canWithdraw": false,
|
|
639
|
-
// "minDeposit": "0.00010",
|
|
640
|
-
// "minWithdrawal": "0.00010"
|
|
641
|
-
// },
|
|
642
|
-
// {
|
|
643
|
-
// "network": "Solana",
|
|
644
|
-
// "tokenId": "DV3845GEAVXfwpyVGGgWbqBVCtzHdCXNCGfcdboSEuZz",
|
|
645
|
-
// "transactionPrecision": "8",
|
|
646
|
-
// "isWithdrawalFeeChargedToUser": true,
|
|
647
|
-
// "canDeposit": true,
|
|
648
|
-
// "canWithdraw": true,
|
|
649
|
-
// "minDeposit": "0.00010",
|
|
650
|
-
// "minWithdrawal": "0.00010"
|
|
651
|
-
// },
|
|
652
|
-
// {
|
|
653
|
-
// "network": "Ethereum",
|
|
654
|
-
// "tokenId": "0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f",
|
|
655
|
-
// "transactionPrecision": "18",
|
|
656
|
-
// "isWithdrawalFeeChargedToUser": true,
|
|
657
|
-
// "canDeposit": true,
|
|
658
|
-
// "canWithdraw": false,
|
|
659
|
-
// "minDeposit": "0.00010",
|
|
660
|
-
// "minWithdrawal": "0.00010"
|
|
661
|
-
// }
|
|
601
|
+
// ...
|
|
662
602
|
// ]
|
|
663
603
|
// },
|
|
664
604
|
// {
|
|
@@ -708,79 +648,67 @@ class oxfun extends oxfun$1 {
|
|
|
708
648
|
const parts = fullId.split('.');
|
|
709
649
|
const id = parts[0];
|
|
710
650
|
const code = this.safeCurrencyCode(id);
|
|
711
|
-
|
|
651
|
+
if (!(code in result)) {
|
|
652
|
+
result[code] = {
|
|
653
|
+
'id': id,
|
|
654
|
+
'code': code,
|
|
655
|
+
'precision': undefined,
|
|
656
|
+
'type': undefined,
|
|
657
|
+
'name': undefined,
|
|
658
|
+
'active': undefined,
|
|
659
|
+
'deposit': undefined,
|
|
660
|
+
'withdraw': undefined,
|
|
661
|
+
'fee': undefined,
|
|
662
|
+
'limits': {
|
|
663
|
+
'withdraw': {
|
|
664
|
+
'min': undefined,
|
|
665
|
+
'max': undefined,
|
|
666
|
+
},
|
|
667
|
+
'deposit': {
|
|
668
|
+
'min': undefined,
|
|
669
|
+
'max': undefined,
|
|
670
|
+
},
|
|
671
|
+
},
|
|
672
|
+
'networks': {},
|
|
673
|
+
'info': [],
|
|
674
|
+
};
|
|
675
|
+
}
|
|
712
676
|
const chains = this.safeList(currency, 'networkList', []);
|
|
713
|
-
let currencyMaxPrecision = undefined;
|
|
714
|
-
let currencyDepositEnabled = undefined;
|
|
715
|
-
let currencyWithdrawEnabled = undefined;
|
|
716
677
|
for (let j = 0; j < chains.length; j++) {
|
|
717
678
|
const chain = chains[j];
|
|
718
679
|
const networkId = this.safeString(chain, 'network');
|
|
719
680
|
const networkCode = this.networkIdToCode(networkId);
|
|
720
|
-
|
|
721
|
-
const withdraw = this.safeBool(chain, 'canWithdraw');
|
|
722
|
-
const active = (deposit && withdraw);
|
|
723
|
-
const minDeposit = this.safeString(chain, 'minDeposit');
|
|
724
|
-
const minWithdrawal = this.safeString(chain, 'minWithdrawal');
|
|
725
|
-
const precision = this.parsePrecision(this.safeString(chain, 'transactionPrecision'));
|
|
726
|
-
networks[networkCode] = {
|
|
681
|
+
result[code]['networks'][networkCode] = {
|
|
727
682
|
'id': networkId,
|
|
728
683
|
'network': networkCode,
|
|
729
684
|
'margin': undefined,
|
|
730
|
-
'deposit':
|
|
731
|
-
'withdraw':
|
|
732
|
-
'active':
|
|
685
|
+
'deposit': this.safeBool(chain, 'canDeposit'),
|
|
686
|
+
'withdraw': this.safeBool(chain, 'canWithdraw'),
|
|
687
|
+
'active': undefined,
|
|
733
688
|
'fee': undefined,
|
|
734
|
-
'precision': this.parseNumber(
|
|
689
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'transactionPrecision'))),
|
|
735
690
|
'limits': {
|
|
736
691
|
'deposit': {
|
|
737
|
-
'min': minDeposit,
|
|
692
|
+
'min': this.safeNumber(chain, 'minDeposit'),
|
|
738
693
|
'max': undefined,
|
|
739
694
|
},
|
|
740
695
|
'withdraw': {
|
|
741
|
-
'min': minWithdrawal,
|
|
696
|
+
'min': this.safeNumber(chain, 'minWithdrawal'),
|
|
742
697
|
'max': undefined,
|
|
743
698
|
},
|
|
744
699
|
},
|
|
745
700
|
'info': chain,
|
|
746
701
|
};
|
|
747
|
-
if ((currencyDepositEnabled === undefined) || deposit) {
|
|
748
|
-
currencyDepositEnabled = deposit;
|
|
749
|
-
}
|
|
750
|
-
if ((currencyWithdrawEnabled === undefined) || withdraw) {
|
|
751
|
-
currencyWithdrawEnabled = withdraw;
|
|
752
|
-
}
|
|
753
|
-
if ((currencyMaxPrecision === undefined) || Precise["default"].stringGt(currencyMaxPrecision, precision)) {
|
|
754
|
-
currencyMaxPrecision = precision;
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
if (code in result) {
|
|
758
|
-
// checking for specific ids as USDC.ARB
|
|
759
|
-
networks = this.extend(result[code]['networks'], networks);
|
|
760
702
|
}
|
|
761
|
-
result[code]
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
'precision': this.parseNumber(currencyMaxPrecision),
|
|
771
|
-
'limits': {
|
|
772
|
-
'amount': {
|
|
773
|
-
'min': undefined,
|
|
774
|
-
'max': undefined,
|
|
775
|
-
},
|
|
776
|
-
'withdraw': {
|
|
777
|
-
'min': undefined,
|
|
778
|
-
'max': undefined,
|
|
779
|
-
},
|
|
780
|
-
},
|
|
781
|
-
'networks': networks,
|
|
782
|
-
'info': currency,
|
|
783
|
-
};
|
|
703
|
+
const infos = this.safeList(result[code], 'info', []);
|
|
704
|
+
infos.push(currency);
|
|
705
|
+
result[code]['info'] = infos;
|
|
706
|
+
}
|
|
707
|
+
// only after all entries are formed in currencies, restructure each entry
|
|
708
|
+
const allKeys = Object.keys(result);
|
|
709
|
+
for (let i = 0; i < allKeys.length; i++) {
|
|
710
|
+
const code = allKeys[i];
|
|
711
|
+
result[code] = this.safeCurrencyStructure(result[code]); // this is needed after adding network entry
|
|
784
712
|
}
|
|
785
713
|
return result;
|
|
786
714
|
}
|
package/dist/cjs/src/paradex.js
CHANGED
|
@@ -1257,7 +1257,16 @@ class paradex extends paradex$1 {
|
|
|
1257
1257
|
const price = this.safeString(order, 'price');
|
|
1258
1258
|
const amount = this.safeString(order, 'size');
|
|
1259
1259
|
const orderType = this.safeString(order, 'type');
|
|
1260
|
-
const
|
|
1260
|
+
const cancelReason = this.safeString(order, 'cancel_reason');
|
|
1261
|
+
let status = this.safeString(order, 'status');
|
|
1262
|
+
if (cancelReason !== undefined) {
|
|
1263
|
+
if (cancelReason === 'NOT_ENOUGH_MARGIN') {
|
|
1264
|
+
status = 'rejected';
|
|
1265
|
+
}
|
|
1266
|
+
else {
|
|
1267
|
+
status = 'canceled';
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1261
1270
|
const side = this.safeStringLower(order, 'side');
|
|
1262
1271
|
const average = this.omitZero(this.safeString(order, 'avg_fill_price'));
|
|
1263
1272
|
const remaining = this.omitZero(this.safeString(order, 'remaining_size'));
|