ccxt 4.5.22 → 4.5.23
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 +6 -5
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +6 -1
- package/dist/cjs/src/abstract/bullish.js +11 -0
- package/dist/cjs/src/base/Exchange.js +3 -2
- package/dist/cjs/src/base/ws/WsClient.js +15 -0
- package/dist/cjs/src/binance.js +159 -36
- package/dist/cjs/src/bingx.js +2 -1
- package/dist/cjs/src/bitmart.js +1 -0
- package/dist/cjs/src/bullish.js +2919 -0
- package/dist/cjs/src/bybit.js +34 -37
- package/dist/cjs/src/gate.js +2 -2
- package/dist/cjs/src/htx.js +4 -1
- package/dist/cjs/src/hyperliquid.js +115 -12
- package/dist/cjs/src/kucoin.js +22 -3
- package/dist/cjs/src/mexc.js +7 -0
- package/dist/cjs/src/okx.js +117 -63
- package/dist/cjs/src/paradex.js +78 -3
- package/dist/cjs/src/pro/binance.js +131 -29
- package/dist/cjs/src/pro/bullish.js +781 -0
- package/dist/cjs/src/pro/coinbase.js +2 -2
- package/dist/cjs/src/pro/hyperliquid.js +75 -15
- package/dist/cjs/src/pro/upbit.js +28 -82
- package/js/ccxt.d.ts +8 -2
- package/js/ccxt.js +6 -2
- package/js/src/abstract/binance.d.ts +1 -0
- package/js/src/abstract/binancecoinm.d.ts +1 -0
- package/js/src/abstract/binanceus.d.ts +1 -0
- package/js/src/abstract/binanceusdm.d.ts +1 -0
- package/js/src/abstract/bingx.d.ts +1 -0
- package/js/src/abstract/bullish.d.ts +65 -0
- package/js/src/abstract/bullish.js +5 -0
- package/js/src/abstract/kucoin.d.ts +15 -0
- package/js/src/abstract/kucoinfutures.d.ts +15 -0
- package/js/src/abstract/mexc.d.ts +7 -0
- package/js/src/abstract/myokx.d.ts +90 -39
- package/js/src/abstract/okx.d.ts +90 -39
- package/js/src/abstract/okxus.d.ts +90 -39
- package/js/src/base/Exchange.d.ts +1 -1
- package/js/src/base/Exchange.js +3 -2
- package/js/src/base/ws/Client.d.ts +1 -0
- package/js/src/base/ws/WsClient.js +15 -0
- package/js/src/binance.d.ts +14 -5
- package/js/src/binance.js +159 -36
- package/js/src/bingx.js +2 -1
- package/js/src/bitmart.js +1 -0
- package/js/src/bullish.d.ts +446 -0
- package/js/src/bullish.js +2912 -0
- package/js/src/bybit.js +34 -37
- package/js/src/gate.js +2 -2
- package/js/src/htx.js +4 -1
- package/js/src/hyperliquid.d.ts +24 -0
- package/js/src/hyperliquid.js +115 -12
- package/js/src/kucoin.js +22 -3
- package/js/src/mexc.js +7 -0
- package/js/src/okx.js +117 -63
- package/js/src/paradex.d.ts +15 -1
- package/js/src/paradex.js +78 -3
- package/js/src/pro/binance.d.ts +7 -0
- package/js/src/pro/binance.js +131 -29
- package/js/src/pro/bullish.d.ts +108 -0
- package/js/src/pro/bullish.js +774 -0
- package/js/src/pro/coinbase.js +2 -2
- package/js/src/pro/hyperliquid.d.ts +13 -1
- package/js/src/pro/hyperliquid.js +75 -15
- package/js/src/pro/upbit.d.ts +0 -1
- package/js/src/pro/upbit.js +28 -82
- package/package.json +2 -2
package/js/src/okx.js
CHANGED
|
@@ -189,74 +189,85 @@ export default class okx extends Exchange {
|
|
|
189
189
|
'api': {
|
|
190
190
|
'public': {
|
|
191
191
|
'get': {
|
|
192
|
-
|
|
192
|
+
// market
|
|
193
193
|
'market/tickers': 1,
|
|
194
194
|
'market/ticker': 1,
|
|
195
|
-
'market/index-tickers': 1,
|
|
196
195
|
'market/books': 1 / 2,
|
|
197
|
-
'market/books-
|
|
196
|
+
'market/books-full': 2,
|
|
198
197
|
'market/candles': 1 / 2,
|
|
199
198
|
'market/history-candles': 1,
|
|
200
|
-
'market/index-candles': 1,
|
|
201
|
-
'market/history-index-candles': 2,
|
|
202
|
-
'market/mark-price-candles': 1,
|
|
203
|
-
'market/history-mark-price-candles': 2,
|
|
204
199
|
'market/trades': 1 / 5,
|
|
205
200
|
'market/history-trades': 2,
|
|
206
201
|
'market/option/instrument-family-trades': 1,
|
|
207
202
|
'market/platform-24-volume': 10,
|
|
208
|
-
'market/
|
|
209
|
-
'market/
|
|
210
|
-
'market/index-components': 1,
|
|
211
|
-
'public/market-data-history': 4,
|
|
212
|
-
'public/economic-calendar': 50,
|
|
203
|
+
'market/call-auction-detail': 1,
|
|
204
|
+
'market/books-sbe': 10,
|
|
213
205
|
'market/block-tickers': 1,
|
|
214
206
|
'market/block-ticker': 1,
|
|
207
|
+
'market/sprd-ticker': 1,
|
|
208
|
+
'market/sprd-candles': 1 / 2,
|
|
209
|
+
'market/sprd-history-candles': 1,
|
|
210
|
+
'market/index-tickers': 1,
|
|
211
|
+
'market/index-candles': 1,
|
|
212
|
+
'market/history-index-candles': 2,
|
|
213
|
+
'market/mark-price-candles': 1,
|
|
214
|
+
'market/history-mark-price-candles': 1,
|
|
215
|
+
'market/exchange-rate': 20,
|
|
216
|
+
'market/index-components': 1,
|
|
217
|
+
'market/open-oracle': 50,
|
|
218
|
+
'market/books-lite': 5 / 3,
|
|
219
|
+
// public
|
|
220
|
+
'public/option-trades': 1,
|
|
215
221
|
'public/block-trades': 1,
|
|
216
222
|
'public/instruments': 1,
|
|
223
|
+
'public/estimated-price': 2,
|
|
217
224
|
'public/delivery-exercise-history': 1 / 2,
|
|
225
|
+
'public/estimated-settlement-info': 2,
|
|
226
|
+
'public/settlement-history': 1 / 2,
|
|
227
|
+
'public/funding-rate': 2,
|
|
228
|
+
'public/funding-rate-history': 2,
|
|
218
229
|
'public/open-interest': 1,
|
|
219
|
-
'public/funding-rate': 1,
|
|
220
|
-
'public/funding-rate-history': 1,
|
|
221
230
|
'public/price-limit': 1,
|
|
222
231
|
'public/opt-summary': 1,
|
|
223
|
-
'public/estimated-price': 2,
|
|
224
232
|
'public/discount-rate-interest-free-quota': 10,
|
|
225
233
|
'public/time': 2,
|
|
226
234
|
'public/mark-price': 2,
|
|
227
235
|
'public/position-tiers': 2,
|
|
228
236
|
'public/interest-rate-loan-quota': 10,
|
|
229
|
-
'public/vip-interest-rate-loan-quota': 10,
|
|
230
237
|
'public/underlying': 1,
|
|
231
238
|
'public/insurance-fund': 2,
|
|
232
239
|
'public/convert-contract-coin': 2,
|
|
233
|
-
'public/option-trades': 1,
|
|
234
240
|
'public/instrument-tick-bands': 4,
|
|
241
|
+
'public/premium-history': 1,
|
|
242
|
+
'public/economic-calendar': 50,
|
|
243
|
+
'public/market-data-history': 4,
|
|
244
|
+
'public/vip-interest-rate-loan-quota': 10,
|
|
245
|
+
// rubik
|
|
235
246
|
'rubik/stat/trading-data/support-coin': 4,
|
|
247
|
+
'rubik/stat/contracts/open-interest-history': 2,
|
|
236
248
|
'rubik/stat/taker-volume': 4,
|
|
249
|
+
'rubik/stat/taker-volume-contract': 4,
|
|
237
250
|
'rubik/stat/margin/loan-ratio': 4,
|
|
238
|
-
|
|
239
|
-
'rubik/stat/contracts/long-short-account-ratio': 4,
|
|
251
|
+
'rubik/stat/contracts/long-short-account-ratio-contract-top-trader': 4,
|
|
240
252
|
'rubik/stat/contracts/long-short-account-ratio-contract': 4,
|
|
253
|
+
'rubik/stat/contracts/long-short-account-ratio': 4,
|
|
241
254
|
'rubik/stat/contracts/open-interest-volume': 4,
|
|
242
255
|
'rubik/stat/option/open-interest-volume': 4,
|
|
243
|
-
// put/call
|
|
244
256
|
'rubik/stat/option/open-interest-volume-ratio': 4,
|
|
245
257
|
'rubik/stat/option/open-interest-volume-expiry': 4,
|
|
246
258
|
'rubik/stat/option/open-interest-volume-strike': 4,
|
|
247
259
|
'rubik/stat/option/taker-block-volume': 4,
|
|
260
|
+
// system
|
|
248
261
|
'system/status': 50,
|
|
249
|
-
//
|
|
262
|
+
// sprd
|
|
250
263
|
'sprd/spreads': 1,
|
|
251
|
-
'sprd/books': 1
|
|
264
|
+
'sprd/books': 1,
|
|
265
|
+
'sprd/public-trades': 1,
|
|
252
266
|
'sprd/ticker': 1,
|
|
253
|
-
'sprd/public-trades': 1 / 5,
|
|
254
|
-
'market/sprd-ticker': 2,
|
|
255
|
-
'market/sprd-candles': 2,
|
|
256
|
-
'market/sprd-history-candles': 2,
|
|
257
267
|
'tradingBot/grid/ai-param': 1,
|
|
258
268
|
'tradingBot/grid/min-investment': 1,
|
|
259
269
|
'tradingBot/public/rsi-back-testing': 1,
|
|
270
|
+
'tradingBot/grid/grid-quantity': 4,
|
|
260
271
|
'asset/exchange-list': 5 / 3,
|
|
261
272
|
'finance/staking-defi/eth/apy-history': 5 / 3,
|
|
262
273
|
'finance/staking-defi/sol/apy-history': 5 / 3,
|
|
@@ -268,14 +279,21 @@ export default class okx extends Exchange {
|
|
|
268
279
|
// public broker
|
|
269
280
|
'finance/sfp/dcd/products': 2 / 3,
|
|
270
281
|
// copytrading
|
|
282
|
+
'copytrading/public-config': 4,
|
|
271
283
|
'copytrading/public-lead-traders': 4,
|
|
272
284
|
'copytrading/public-weekly-pnl': 4,
|
|
285
|
+
'copytrading/public-pnl': 4,
|
|
273
286
|
'copytrading/public-stats': 4,
|
|
274
287
|
'copytrading/public-preference-currency': 4,
|
|
275
288
|
'copytrading/public-current-subpositions': 4,
|
|
276
289
|
'copytrading/public-subpositions-history': 4,
|
|
290
|
+
'copytrading/public-copy-traders': 4,
|
|
291
|
+
'support/announcements': 4,
|
|
277
292
|
'support/announcements-types': 20,
|
|
278
293
|
},
|
|
294
|
+
'post': {
|
|
295
|
+
'tradingBot/grid/min-investment': 1, // public
|
|
296
|
+
},
|
|
279
297
|
},
|
|
280
298
|
'private': {
|
|
281
299
|
'get': {
|
|
@@ -288,18 +306,18 @@ export default class okx extends Exchange {
|
|
|
288
306
|
'rfq/trades': 4,
|
|
289
307
|
'rfq/public-trades': 4,
|
|
290
308
|
// sprd
|
|
291
|
-
'sprd/order': 1
|
|
292
|
-
'sprd/orders-pending':
|
|
293
|
-
'sprd/orders-history': 1
|
|
294
|
-
'sprd/orders-history-archive': 1
|
|
295
|
-
'sprd/trades': 1
|
|
309
|
+
'sprd/order': 1,
|
|
310
|
+
'sprd/orders-pending': 2,
|
|
311
|
+
'sprd/orders-history': 1,
|
|
312
|
+
'sprd/orders-history-archive': 1,
|
|
313
|
+
'sprd/trades': 1,
|
|
296
314
|
// trade
|
|
297
315
|
'trade/order': 1 / 3,
|
|
298
316
|
'trade/orders-pending': 1 / 3,
|
|
299
317
|
'trade/orders-history': 1 / 2,
|
|
300
318
|
'trade/orders-history-archive': 1,
|
|
301
319
|
'trade/fills': 1 / 3,
|
|
302
|
-
'trade/fills-history': 2
|
|
320
|
+
'trade/fills-history': 2,
|
|
303
321
|
'trade/fills-archive': 2,
|
|
304
322
|
'trade/order-algo': 1,
|
|
305
323
|
'trade/orders-algo-pending': 1,
|
|
@@ -316,25 +334,26 @@ export default class okx extends Exchange {
|
|
|
316
334
|
'asset/balances': 5 / 3,
|
|
317
335
|
'asset/non-tradable-assets': 5 / 3,
|
|
318
336
|
'asset/asset-valuation': 10,
|
|
319
|
-
'asset/transfer-state':
|
|
337
|
+
'asset/transfer-state': 1,
|
|
320
338
|
'asset/bills': 5 / 3,
|
|
339
|
+
'asset/bills-history': 10,
|
|
321
340
|
'asset/deposit-lightning': 5,
|
|
322
341
|
'asset/deposit-address': 5 / 3,
|
|
323
342
|
'asset/deposit-history': 5 / 3,
|
|
324
343
|
'asset/withdrawal-history': 5 / 3,
|
|
325
344
|
'asset/deposit-withdraw-status': 20,
|
|
345
|
+
'asset/monthly-statement': 2,
|
|
326
346
|
'asset/convert/currencies': 5 / 3,
|
|
327
347
|
'asset/convert/currency-pair': 5 / 3,
|
|
328
348
|
'asset/convert/history': 5 / 3,
|
|
329
|
-
'asset/monthly-statement': 2,
|
|
330
349
|
// account
|
|
331
350
|
'account/instruments': 1,
|
|
332
351
|
'account/balance': 2,
|
|
333
352
|
'account/positions': 2,
|
|
334
|
-
'account/positions-history':
|
|
353
|
+
'account/positions-history': 2,
|
|
335
354
|
'account/account-position-risk': 2,
|
|
336
|
-
'account/bills':
|
|
337
|
-
'account/bills-archive':
|
|
355
|
+
'account/bills': 2,
|
|
356
|
+
'account/bills-archive': 4,
|
|
338
357
|
'account/bills-history-archive': 2,
|
|
339
358
|
'account/config': 4,
|
|
340
359
|
'account/max-size': 1,
|
|
@@ -347,23 +366,26 @@ export default class okx extends Exchange {
|
|
|
347
366
|
'account/interest-rate': 4,
|
|
348
367
|
'account/max-withdrawal': 1,
|
|
349
368
|
'account/risk-state': 2,
|
|
369
|
+
'account/interest-limits': 4,
|
|
370
|
+
'account/spot-borrow-repay-history': 4,
|
|
371
|
+
'account/greeks': 2,
|
|
372
|
+
'account/position-tiers': 2,
|
|
373
|
+
'account/set-account-switch-precheck': 4,
|
|
374
|
+
'account/collateral-assets': 4,
|
|
375
|
+
'account/mmp-config': 4,
|
|
376
|
+
'account/move-positions-history': 10,
|
|
377
|
+
'account/precheck-set-delta-neutral': 20,
|
|
350
378
|
'account/quick-margin-borrow-repay-history': 4,
|
|
351
379
|
'account/borrow-repay-history': 4,
|
|
352
380
|
'account/vip-interest-accrued': 4,
|
|
353
381
|
'account/vip-interest-deducted': 4,
|
|
354
382
|
'account/vip-loan-order-list': 4,
|
|
355
383
|
'account/vip-loan-order-detail': 4,
|
|
356
|
-
'account/interest-limits': 4,
|
|
357
|
-
'account/greeks': 2,
|
|
358
|
-
'account/position-tiers': 2,
|
|
359
|
-
'account/mmp-config': 4,
|
|
360
384
|
'account/fixed-loan/borrowing-limit': 4,
|
|
361
385
|
'account/fixed-loan/borrowing-quote': 5,
|
|
362
386
|
'account/fixed-loan/borrowing-orders-list': 5,
|
|
363
387
|
'account/spot-manual-borrow-repay': 30,
|
|
364
388
|
'account/set-auto-repay': 4,
|
|
365
|
-
'account/spot-borrow-repay-history': 4,
|
|
366
|
-
'account/move-positions-history': 10,
|
|
367
389
|
// subaccount
|
|
368
390
|
'users/subaccount/list': 10,
|
|
369
391
|
'account/subaccount/balances': 10 / 3,
|
|
@@ -383,9 +405,10 @@ export default class okx extends Exchange {
|
|
|
383
405
|
'tradingBot/grid/ai-param': 1,
|
|
384
406
|
'tradingBot/signal/signals': 1,
|
|
385
407
|
'tradingBot/signal/orders-algo-details': 1,
|
|
408
|
+
'tradingBot/signal/orders-algo-pending': 1,
|
|
386
409
|
'tradingBot/signal/orders-algo-history': 1,
|
|
387
410
|
'tradingBot/signal/positions': 1,
|
|
388
|
-
'tradingBot/signal/positions-history':
|
|
411
|
+
'tradingBot/signal/positions-history': 2,
|
|
389
412
|
'tradingBot/signal/sub-orders': 1,
|
|
390
413
|
'tradingBot/signal/event-history': 1,
|
|
391
414
|
'tradingBot/recurring/orders-algo-pending': 1,
|
|
@@ -399,11 +422,18 @@ export default class okx extends Exchange {
|
|
|
399
422
|
'finance/staking-defi/orders-active': 10 / 3,
|
|
400
423
|
'finance/staking-defi/orders-history': 10 / 3,
|
|
401
424
|
// eth staking
|
|
425
|
+
'finance/staking-defi/eth/product-info': 10 / 3,
|
|
402
426
|
'finance/staking-defi/eth/balance': 5 / 3,
|
|
403
427
|
'finance/staking-defi/eth/purchase-redeem-history': 5 / 3,
|
|
404
|
-
'finance/staking-defi/
|
|
428
|
+
'finance/staking-defi/sol/product-info': 10 / 3,
|
|
405
429
|
'finance/staking-defi/sol/balance': 5 / 3,
|
|
406
430
|
'finance/staking-defi/sol/purchase-redeem-history': 5 / 3,
|
|
431
|
+
'finance/flexible-loan/borrow-currencies': 4,
|
|
432
|
+
'finance/flexible-loan/collateral-assets': 4,
|
|
433
|
+
'finance/flexible-loan/max-collateral-redeem-amount': 4,
|
|
434
|
+
'finance/flexible-loan/loan-info': 4,
|
|
435
|
+
'finance/flexible-loan/loan-history': 4,
|
|
436
|
+
'finance/flexible-loan/interest-accrued': 4,
|
|
407
437
|
// copytrading
|
|
408
438
|
'copytrading/current-subpositions': 1,
|
|
409
439
|
'copytrading/subpositions-history': 1,
|
|
@@ -411,11 +441,19 @@ export default class okx extends Exchange {
|
|
|
411
441
|
'copytrading/profit-sharing-details': 4,
|
|
412
442
|
'copytrading/total-profit-sharing': 4,
|
|
413
443
|
'copytrading/unrealized-profit-sharing-details': 4,
|
|
444
|
+
'copytrading/total-unrealized-profit-sharing': 4,
|
|
445
|
+
'copytrading/config': 4,
|
|
414
446
|
'copytrading/copy-settings': 4,
|
|
415
|
-
'copytrading/batch-leverage-info': 4,
|
|
416
447
|
'copytrading/current-lead-traders': 4,
|
|
448
|
+
'copytrading/batch-leverage-info': 4,
|
|
417
449
|
'copytrading/lead-traders-history': 4,
|
|
418
450
|
// broker
|
|
451
|
+
'broker/dma/subaccount-info': 2,
|
|
452
|
+
'broker/dma/subaccount-trade-fee': 10,
|
|
453
|
+
'broker/dma/subaccount/apikey': 10,
|
|
454
|
+
'broker/dma/rebate-per-orders': 300,
|
|
455
|
+
'broker/fd/rebate-per-orders': 300,
|
|
456
|
+
'broker/fd/if-rebate': 5,
|
|
419
457
|
'broker/nd/info': 10,
|
|
420
458
|
'broker/nd/subaccount-info': 10,
|
|
421
459
|
'broker/nd/subaccount/apikey': 10,
|
|
@@ -426,8 +464,6 @@ export default class okx extends Exchange {
|
|
|
426
464
|
'broker/nd/rebate-per-orders': 300,
|
|
427
465
|
'finance/sfp/dcd/order': 2,
|
|
428
466
|
'finance/sfp/dcd/orders': 2,
|
|
429
|
-
'broker/fd/rebate-per-orders': 300,
|
|
430
|
-
'broker/fd/if-rebate': 5,
|
|
431
467
|
// affiliate
|
|
432
468
|
'affiliate/invitee/detail': 1,
|
|
433
469
|
'users/partner/if-rebate': 1,
|
|
@@ -447,6 +483,7 @@ export default class okx extends Exchange {
|
|
|
447
483
|
'rfq/cancel-quote': 0.4,
|
|
448
484
|
'rfq/cancel-batch-quotes': 10,
|
|
449
485
|
'rfq/cancel-all-quotes': 10,
|
|
486
|
+
'rfq/cancel-all-after': 10,
|
|
450
487
|
// sprd
|
|
451
488
|
'sprd/order': 1,
|
|
452
489
|
'sprd/cancel-order': 1,
|
|
@@ -462,57 +499,68 @@ export default class okx extends Exchange {
|
|
|
462
499
|
'trade/amend-batch-orders': 1 / 150,
|
|
463
500
|
'trade/close-position': 1,
|
|
464
501
|
'trade/fills-archive': 172800,
|
|
465
|
-
'trade/order-algo': 1,
|
|
466
|
-
'trade/cancel-algos': 1,
|
|
467
|
-
'trade/amend-algos': 1,
|
|
468
502
|
'trade/cancel-advance-algos': 1,
|
|
469
503
|
'trade/easy-convert': 20,
|
|
470
504
|
'trade/one-click-repay': 20,
|
|
471
505
|
'trade/one-click-repay-v2': 20,
|
|
472
506
|
'trade/mass-cancel': 4,
|
|
473
507
|
'trade/cancel-all-after': 10,
|
|
508
|
+
'trade/order-precheck': 4,
|
|
509
|
+
'trade/order-algo': 1,
|
|
510
|
+
'trade/cancel-algos': 1,
|
|
511
|
+
'trade/amend-algos': 1,
|
|
474
512
|
// asset
|
|
475
|
-
'asset/transfer':
|
|
513
|
+
'asset/transfer': 5,
|
|
476
514
|
'asset/withdrawal': 5 / 3,
|
|
477
515
|
'asset/withdrawal-lightning': 5,
|
|
478
516
|
'asset/cancel-withdrawal': 5 / 3,
|
|
479
517
|
'asset/convert-dust-assets': 10,
|
|
480
|
-
'asset/
|
|
518
|
+
'asset/monthly-statement': 1296000,
|
|
519
|
+
'asset/convert/estimate-quote': 50,
|
|
481
520
|
'asset/convert/trade': 1,
|
|
482
|
-
'asset/monthly-statement': 1,
|
|
483
521
|
// account
|
|
522
|
+
'account/bills-history-archive': 72000,
|
|
484
523
|
'account/set-position-mode': 4,
|
|
485
524
|
'account/set-leverage': 1,
|
|
486
525
|
'account/position/margin-balance': 1,
|
|
526
|
+
'account/set-fee-type': 4,
|
|
487
527
|
'account/set-greeks': 4,
|
|
488
528
|
'account/set-isolated-mode': 4,
|
|
529
|
+
'account/spot-manual-borrow-repay': 30,
|
|
530
|
+
'account/set-auto-repay': 4,
|
|
489
531
|
'account/quick-margin-borrow-repay': 4,
|
|
490
532
|
'account/borrow-repay': 5 / 3,
|
|
491
533
|
'account/simulated_margin': 10,
|
|
492
534
|
'account/position-builder': 10,
|
|
535
|
+
'account/position-builder-graph': 50,
|
|
493
536
|
'account/set-riskOffset-type': 2,
|
|
494
537
|
'account/activate-option': 4,
|
|
495
538
|
'account/set-auto-loan': 4,
|
|
539
|
+
'account/account-level-switch-preset': 4,
|
|
496
540
|
'account/set-account-level': 4,
|
|
541
|
+
'account/set-collateral-assets': 4,
|
|
497
542
|
'account/mmp-reset': 4,
|
|
498
|
-
'account/mmp-config':
|
|
543
|
+
'account/mmp-config': 50,
|
|
499
544
|
'account/fixed-loan/borrowing-order': 5,
|
|
500
545
|
'account/fixed-loan/amend-borrowing-order': 5,
|
|
501
546
|
'account/fixed-loan/manual-reborrow': 5,
|
|
502
547
|
'account/fixed-loan/repay-borrowing-order': 5,
|
|
503
|
-
'account/bills-history-archive': 72000,
|
|
504
548
|
'account/move-positions': 10,
|
|
549
|
+
'account/set-auto-earn': 10,
|
|
505
550
|
'account/set-settle-currency': 1,
|
|
551
|
+
'account/set-trading-config': 20,
|
|
506
552
|
// subaccount
|
|
507
|
-
'users/subaccount/modify-apikey': 10,
|
|
508
553
|
'asset/subaccount/transfer': 10,
|
|
509
|
-
'users/subaccount/set-transfer-out': 10,
|
|
510
554
|
'account/subaccount/set-loan-allocation': 4,
|
|
511
555
|
'users/subaccount/create-subaccount': 10,
|
|
556
|
+
'users/subaccount/apikey': 10,
|
|
557
|
+
'users/subaccount/modify-apikey': 10,
|
|
512
558
|
'users/subaccount/subaccount-apikey': 10,
|
|
513
559
|
'users/subaccount/delete-apikey': 10,
|
|
560
|
+
'users/subaccount/set-transfer-out': 10,
|
|
514
561
|
// grid trading
|
|
515
562
|
'tradingBot/grid/order-algo': 1,
|
|
563
|
+
'tradingBot/grid/amend-algo-basic-param': 1,
|
|
516
564
|
'tradingBot/grid/amend-order-algo': 1,
|
|
517
565
|
'tradingBot/grid/stop-order-algo': 1,
|
|
518
566
|
'tradingBot/grid/close-position': 1,
|
|
@@ -538,18 +586,23 @@ export default class okx extends Exchange {
|
|
|
538
586
|
// earn
|
|
539
587
|
'finance/savings/purchase-redempt': 5 / 3,
|
|
540
588
|
'finance/savings/set-lending-rate': 5 / 3,
|
|
541
|
-
'finance/staking-defi/purchase':
|
|
542
|
-
'finance/staking-defi/redeem':
|
|
543
|
-
'finance/staking-defi/cancel':
|
|
589
|
+
'finance/staking-defi/purchase': 5,
|
|
590
|
+
'finance/staking-defi/redeem': 5,
|
|
591
|
+
'finance/staking-defi/cancel': 5,
|
|
544
592
|
// eth staking
|
|
545
593
|
'finance/staking-defi/eth/purchase': 5,
|
|
546
594
|
'finance/staking-defi/eth/redeem': 5,
|
|
595
|
+
'finance/staking-defi/eth/cancel-redeem': 5,
|
|
547
596
|
'finance/staking-defi/sol/purchase': 5,
|
|
548
597
|
'finance/staking-defi/sol/redeem': 5,
|
|
598
|
+
'finance/staking-defi/sol/cancel-redeem': 5,
|
|
599
|
+
'finance/flexible-loan/max-loan': 4,
|
|
600
|
+
'finance/flexible-loan/adjust-collateral': 4,
|
|
549
601
|
// copytrading
|
|
550
602
|
'copytrading/algo-order': 1,
|
|
551
603
|
'copytrading/close-subposition': 1,
|
|
552
604
|
'copytrading/set-instruments': 4,
|
|
605
|
+
'copytrading/amend-profit-sharing-ratio': 4,
|
|
553
606
|
'copytrading/first-copy-settings': 4,
|
|
554
607
|
'copytrading/amend-copy-settings': 4,
|
|
555
608
|
'copytrading/stop-copy-trading': 4,
|
|
@@ -569,6 +622,8 @@ export default class okx extends Exchange {
|
|
|
569
622
|
'finance/sfp/dcd/quote': 10,
|
|
570
623
|
'finance/sfp/dcd/order': 10,
|
|
571
624
|
'broker/nd/report-subaccount-ip': 0.25,
|
|
625
|
+
'broker/dma/subaccount/apikey': 1 / 4,
|
|
626
|
+
'broker/dma/trades': 36000,
|
|
572
627
|
'broker/fd/rebate-per-orders': 36000,
|
|
573
628
|
},
|
|
574
629
|
},
|
|
@@ -1333,8 +1388,7 @@ export default class okx extends Exchange {
|
|
|
1333
1388
|
},
|
|
1334
1389
|
'commonCurrencies': {
|
|
1335
1390
|
// the exchange refers to ERC20 version of Aeternity (AEToken)
|
|
1336
|
-
'AE': 'AET',
|
|
1337
|
-
'WIN': 'WINTOKEN', // https://github.com/ccxt/ccxt/issues/5701
|
|
1391
|
+
'AE': 'AET', // https://github.com/ccxt/ccxt/issues/4981
|
|
1338
1392
|
},
|
|
1339
1393
|
});
|
|
1340
1394
|
}
|
package/js/src/paradex.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/paradex.js';
|
|
2
|
-
import type { Str, Num, Dict, Int, Market, OrderType, OrderSide, Order, OrderBook, Strings, Ticker, Tickers, Trade, Balances, Currency, Transaction, OHLCV, Position, int, MarginMode, Leverage, Greeks } from './base/types.js';
|
|
2
|
+
import type { Str, Num, Dict, Int, Market, OrderType, OrderSide, Order, OrderBook, Strings, Ticker, Tickers, Trade, Balances, Currency, Transaction, OHLCV, Position, int, MarginMode, Leverage, Greeks, FundingRateHistory } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class paradex
|
|
5
5
|
* @description Paradex is a decentralized exchange built on the StarkWare layer 2 scaling solution. To access private methods you can either use the ETH public key and private key by setting (exchange.privateKey and exchange.walletAddress)
|
|
@@ -53,6 +53,7 @@ export default class paradex extends Exchange {
|
|
|
53
53
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
54
54
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
55
55
|
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
56
|
+
* @param {string} [params.price] "last", "mark", "index", default is "last"
|
|
56
57
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
57
58
|
*/
|
|
58
59
|
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
@@ -379,6 +380,19 @@ export default class paradex extends Exchange {
|
|
|
379
380
|
*/
|
|
380
381
|
fetchAllGreeks(symbols?: Strings, params?: {}): Promise<Greeks[]>;
|
|
381
382
|
parseGreeks(greeks: Dict, market?: Market): Greeks;
|
|
383
|
+
/**
|
|
384
|
+
* @method
|
|
385
|
+
* @name paradex#fetchFundingRateHistory
|
|
386
|
+
* @description fetches historical funding rate prices
|
|
387
|
+
* @see https://docs.paradex.trade/api/prod/markets/get-funding-data
|
|
388
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
389
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
390
|
+
* @param {int} [limit] the maximum amount of funding rate structures
|
|
391
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
392
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate to fetch
|
|
393
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
394
|
+
*/
|
|
395
|
+
fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
|
|
382
396
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
383
397
|
url: string;
|
|
384
398
|
method: string;
|
package/js/src/paradex.js
CHANGED
|
@@ -66,9 +66,9 @@ export default class paradex extends Exchange {
|
|
|
66
66
|
'fetchDeposits': true,
|
|
67
67
|
'fetchDepositWithdrawFee': false,
|
|
68
68
|
'fetchDepositWithdrawFees': false,
|
|
69
|
-
'fetchFundingHistory':
|
|
69
|
+
'fetchFundingHistory': true,
|
|
70
70
|
'fetchFundingRate': false,
|
|
71
|
-
'fetchFundingRateHistory':
|
|
71
|
+
'fetchFundingRateHistory': true,
|
|
72
72
|
'fetchFundingRates': false,
|
|
73
73
|
'fetchGreeks': true,
|
|
74
74
|
'fetchIndexOHLCV': false,
|
|
@@ -626,6 +626,7 @@ export default class paradex extends Exchange {
|
|
|
626
626
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
627
627
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
628
628
|
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
629
|
+
* @param {string} [params.price] "last", "mark", "index", default is "last"
|
|
629
630
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
630
631
|
*/
|
|
631
632
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
@@ -638,7 +639,11 @@ export default class paradex extends Exchange {
|
|
|
638
639
|
const now = this.milliseconds();
|
|
639
640
|
const duration = this.parseTimeframe(timeframe);
|
|
640
641
|
const until = this.safeInteger2(params, 'until', 'till', now);
|
|
641
|
-
|
|
642
|
+
const price = this.safeString(params, 'price');
|
|
643
|
+
if (price !== undefined) {
|
|
644
|
+
request['price_kind'] = price;
|
|
645
|
+
}
|
|
646
|
+
params = this.omit(params, ['until', 'till', 'price']);
|
|
642
647
|
if (since !== undefined) {
|
|
643
648
|
request['start_at'] = since;
|
|
644
649
|
if (limit !== undefined) {
|
|
@@ -2522,6 +2527,76 @@ export default class paradex extends Exchange {
|
|
|
2522
2527
|
'info': greeks,
|
|
2523
2528
|
};
|
|
2524
2529
|
}
|
|
2530
|
+
/**
|
|
2531
|
+
* @method
|
|
2532
|
+
* @name paradex#fetchFundingRateHistory
|
|
2533
|
+
* @description fetches historical funding rate prices
|
|
2534
|
+
* @see https://docs.paradex.trade/api/prod/markets/get-funding-data
|
|
2535
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
2536
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
2537
|
+
* @param {int} [limit] the maximum amount of funding rate structures
|
|
2538
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2539
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate to fetch
|
|
2540
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
2541
|
+
*/
|
|
2542
|
+
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2543
|
+
if (symbol === undefined) {
|
|
2544
|
+
throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
2545
|
+
}
|
|
2546
|
+
await this.loadMarkets();
|
|
2547
|
+
const market = this.market(symbol);
|
|
2548
|
+
const request = {
|
|
2549
|
+
'market': market['id'],
|
|
2550
|
+
};
|
|
2551
|
+
if (limit !== undefined) {
|
|
2552
|
+
request['page_size'] = Math.min(limit, 5000); // api maximum 5000
|
|
2553
|
+
}
|
|
2554
|
+
else {
|
|
2555
|
+
request['page_size'] = 1000; // max is 5000
|
|
2556
|
+
}
|
|
2557
|
+
if (since !== undefined) {
|
|
2558
|
+
request['start_at'] = since;
|
|
2559
|
+
}
|
|
2560
|
+
const until = this.safeInteger(params, 'until');
|
|
2561
|
+
if (until !== undefined) {
|
|
2562
|
+
params = this.omit(params, 'until');
|
|
2563
|
+
request['end_at'] = until;
|
|
2564
|
+
}
|
|
2565
|
+
const response = await this.publicGetFundingData(this.extend(request, params));
|
|
2566
|
+
//
|
|
2567
|
+
// {
|
|
2568
|
+
// "next": "eyJmaWx0ZXIiMsIm1hcmtlciI6eyJtYXJrZXIiOiIxNjc1NjUwMDE3NDMxMTAxNjk5N=",
|
|
2569
|
+
// "prev": "eyJmaWx0ZXIiOnsiTGltaXQiOjkwfSwidGltZSI6MTY4MTY3OTgzNzk3MTMwOTk1MywibWFya2VyIjp7Im1zMjExMD==",
|
|
2570
|
+
// "results": [
|
|
2571
|
+
// {
|
|
2572
|
+
// "market":"BTC-USD-PERP",
|
|
2573
|
+
// "funding_index":"20511.93608234044552",
|
|
2574
|
+
// "funding_premium":"-6.04646651485986656",
|
|
2575
|
+
// "funding_rate":"-0.00006992598926",
|
|
2576
|
+
// "funding_rate_8h":"",
|
|
2577
|
+
// "funding_period_hours":0,
|
|
2578
|
+
// "created_at":1764160327843
|
|
2579
|
+
// }
|
|
2580
|
+
// ]
|
|
2581
|
+
// }
|
|
2582
|
+
//
|
|
2583
|
+
const results = this.safeList(response, 'results', []);
|
|
2584
|
+
const rates = [];
|
|
2585
|
+
for (let i = 0; i < results.length; i++) {
|
|
2586
|
+
const rate = results[i];
|
|
2587
|
+
const timestamp = this.safeInteger(rate, 'created_at');
|
|
2588
|
+
const datetime = this.iso8601(timestamp);
|
|
2589
|
+
rates.push({
|
|
2590
|
+
'info': rate,
|
|
2591
|
+
'symbol': market['symbol'],
|
|
2592
|
+
'fundingRate': this.safeNumber(rate, 'funding_rate'),
|
|
2593
|
+
'timestamp': timestamp,
|
|
2594
|
+
'datetime': datetime,
|
|
2595
|
+
});
|
|
2596
|
+
}
|
|
2597
|
+
const sorted = this.sortBy(rates, 'timestamp');
|
|
2598
|
+
return this.filterBySymbolSinceLimit(sorted, market['symbol'], since, limit);
|
|
2599
|
+
}
|
|
2525
2600
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
2526
2601
|
let url = this.implodeHostname(this.urls['api'][this.version]) + '/' + this.implodeParams(path, params);
|
|
2527
2602
|
const query = this.omit(params, this.extractParams(path));
|
package/js/src/pro/binance.d.ts
CHANGED
|
@@ -240,6 +240,7 @@ export default class binance extends binanceRest {
|
|
|
240
240
|
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#diff-depth-stream
|
|
241
241
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams
|
|
242
242
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams
|
|
243
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams-RPI
|
|
243
244
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams
|
|
244
245
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams
|
|
245
246
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
@@ -256,11 +257,13 @@ export default class binance extends binanceRest {
|
|
|
256
257
|
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#diff-depth-stream
|
|
257
258
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams
|
|
258
259
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams
|
|
260
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams-RPI
|
|
259
261
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams
|
|
260
262
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams
|
|
261
263
|
* @param {string[]} symbols unified array of symbols
|
|
262
264
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
263
265
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
266
|
+
* @param {boolean} [params.rpi] *future only* set to true to use the RPI endpoint
|
|
264
267
|
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
265
268
|
*/
|
|
266
269
|
watchOrderBookForSymbols(symbols: string[], limit?: Int, params?: {}): Promise<OrderBook>;
|
|
@@ -661,6 +664,7 @@ export default class binance extends binanceRest {
|
|
|
661
664
|
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-trade
|
|
662
665
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Order
|
|
663
666
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api
|
|
667
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order
|
|
664
668
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
665
669
|
* @param {string} type 'market' or 'limit'
|
|
666
670
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -699,10 +703,12 @@ export default class binance extends binanceRest {
|
|
|
699
703
|
* @see https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-order-trade
|
|
700
704
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order
|
|
701
705
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order
|
|
706
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order
|
|
702
707
|
* @param {string} id order id
|
|
703
708
|
* @param {string} [symbol] unified market symbol, default is undefined
|
|
704
709
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
705
710
|
* @param {string|undefined} [params.cancelRestrictions] Supported values: ONLY_NEW - Cancel will succeed if the order status is NEW. ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED.
|
|
711
|
+
* @param {boolean} [params.trigger] set to true if you would like to cancel a conditional order
|
|
706
712
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
707
713
|
*/
|
|
708
714
|
cancelOrderWs(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
@@ -776,6 +782,7 @@ export default class binance extends binanceRest {
|
|
|
776
782
|
* @see https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream#order-update
|
|
777
783
|
* @see https://developers.binance.com/docs/margin_trading/trade-data-stream/Event-Order-Update
|
|
778
784
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update
|
|
785
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Algo-Order-Update
|
|
779
786
|
* @param {string} symbol unified market symbol of the market the orders were made in
|
|
780
787
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
781
788
|
* @param {int} [limit] the maximum number of order structures to retrieve
|