ccxt 4.5.44 → 4.5.45
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 +9 -12
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -12
- package/dist/cjs/src/abstract/kucoinfutures.js +1 -1
- package/dist/cjs/src/base/Exchange.js +36 -3
- package/dist/cjs/src/base/functions/encode.js +2 -2
- package/dist/cjs/src/base/functions/generic.js +8 -2
- package/dist/cjs/src/bitrue.js +1 -1
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/btcbox.js +1 -1
- package/dist/cjs/src/cex.js +1 -0
- package/dist/cjs/src/gate.js +227 -168
- package/dist/cjs/src/grvt.js +3 -2
- package/dist/cjs/src/hyperliquid.js +16 -5
- package/dist/cjs/src/kraken.js +2 -2
- package/dist/cjs/src/krakenfutures.js +1 -5
- package/dist/cjs/src/kucoin.js +4729 -970
- package/dist/cjs/src/kucoinfutures.js +14 -3434
- package/dist/cjs/src/lbank.js +1 -1
- package/dist/cjs/src/poloniex.js +1 -1
- package/dist/cjs/src/pro/gate.js +37 -1
- package/dist/cjs/src/pro/kucoin.js +819 -178
- package/dist/cjs/src/pro/kucoinfutures.js +95 -1261
- package/dist/cjs/src/pro/mexc.js +10 -5
- package/dist/cjs/src/pro/okx.js +84 -39
- package/js/ccxt.d.ts +2 -14
- package/js/ccxt.js +2 -10
- package/js/src/abstract/kucoin.d.ts +46 -3
- package/js/src/abstract/kucoinfutures.d.ts +27 -12
- package/js/src/base/Exchange.d.ts +12 -1
- package/js/src/base/Exchange.js +36 -3
- package/js/src/base/functions/encode.js +2 -2
- package/js/src/base/functions/generic.js +9 -3
- package/js/src/bitrue.js +1 -1
- package/js/src/bitteam.js +1 -1
- package/js/src/btcbox.js +1 -1
- package/js/src/cex.js +2 -1
- package/js/src/gate.d.ts +125 -119
- package/js/src/gate.js +227 -168
- package/js/src/grvt.js +3 -2
- package/js/src/hyperliquid.d.ts +3 -1
- package/js/src/hyperliquid.js +16 -5
- package/js/src/kraken.js +2 -2
- package/js/src/krakenfutures.js +1 -5
- package/js/src/kucoin.d.ts +696 -100
- package/js/src/kucoin.js +4730 -971
- package/js/src/kucoinfutures.d.ts +4 -522
- package/js/src/kucoinfutures.js +14 -3434
- package/js/src/lbank.js +1 -1
- package/js/src/poloniex.js +1 -1
- package/js/src/pro/gate.d.ts +30 -1
- package/js/src/pro/gate.js +37 -1
- package/js/src/pro/kucoin.d.ts +70 -30
- package/js/src/pro/kucoin.js +821 -180
- package/js/src/pro/kucoinfutures.d.ts +17 -195
- package/js/src/pro/kucoinfutures.js +96 -1262
- package/js/src/pro/mexc.js +10 -5
- package/js/src/pro/okx.d.ts +1 -0
- package/js/src/pro/okx.js +84 -39
- package/package.json +1 -1
- package/dist/cjs/src/abstract/alp.js +0 -11
- package/dist/cjs/src/abstract/defx.js +0 -11
- package/dist/cjs/src/abstract/timex.js +0 -11
- package/dist/cjs/src/alp.js +0 -1059
- package/dist/cjs/src/defx.js +0 -2142
- package/dist/cjs/src/pro/defx.js +0 -866
- package/dist/cjs/src/timex.js +0 -1793
- package/js/src/abstract/alp.d.ts +0 -21
- package/js/src/abstract/alp.js +0 -5
- package/js/src/abstract/defx.d.ts +0 -72
- package/js/src/abstract/defx.js +0 -5
- package/js/src/abstract/timex.d.ts +0 -65
- package/js/src/abstract/timex.js +0 -5
- package/js/src/alp.d.ts +0 -209
- package/js/src/alp.js +0 -1052
- package/js/src/defx.d.ts +0 -348
- package/js/src/defx.js +0 -2135
- package/js/src/pro/defx.d.ts +0 -236
- package/js/src/pro/defx.js +0 -859
- package/js/src/timex.d.ts +0 -247
- package/js/src/timex.js +0 -1786
package/dist/cjs/src/gate.js
CHANGED
|
@@ -25,7 +25,7 @@ class gate extends gate$1["default"] {
|
|
|
25
25
|
'pro': true,
|
|
26
26
|
'urls': {
|
|
27
27
|
'logo': 'https://github.com/user-attachments/assets/64f988c5-07b6-4652-b5c1-679a6bf67c85',
|
|
28
|
-
'doc': 'https://www.gate.com/docs/developers/apiv4/en
|
|
28
|
+
'doc': 'https://www.gate.com/docs/developers/apiv4/en',
|
|
29
29
|
'www': 'https://gate.com',
|
|
30
30
|
'api': {
|
|
31
31
|
'public': {
|
|
@@ -1174,7 +1174,7 @@ class gate extends gate$1["default"] {
|
|
|
1174
1174
|
* @name gate#loadUnifiedStatus
|
|
1175
1175
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1176
1176
|
* @description returns unifiedAccount so the user can check if the unified account is enabled
|
|
1177
|
-
* @see https://www.gate.com/docs/developers/apiv4/#
|
|
1177
|
+
* @see https://www.gate.com/docs/developers/apiv4/#retrieve-user-account-information
|
|
1178
1178
|
* @returns {boolean} true or false if the enabled unified account is enabled or not and sets the unifiedAccount option if it is undefined
|
|
1179
1179
|
*/
|
|
1180
1180
|
async loadUnifiedStatus(params = {}) {
|
|
@@ -1212,7 +1212,7 @@ class gate extends gate$1["default"] {
|
|
|
1212
1212
|
* @method
|
|
1213
1213
|
* @name gate#fetchTime
|
|
1214
1214
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
1215
|
-
* @see https://www.gate.com/docs/developers/apiv4
|
|
1215
|
+
* @see https://www.gate.com/docs/developers/apiv4/#get-server-current-time
|
|
1216
1216
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1217
1217
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
1218
1218
|
*/
|
|
@@ -1302,11 +1302,11 @@ class gate extends gate$1["default"] {
|
|
|
1302
1302
|
* @method
|
|
1303
1303
|
* @name gate#fetchMarkets
|
|
1304
1304
|
* @description retrieves data on all markets for gate
|
|
1305
|
-
* @see https://www.gate.com/docs/developers/apiv4
|
|
1305
|
+
* @see https://www.gate.com/docs/developers/apiv4/#query-all-supported-currency-pairs // spot
|
|
1306
1306
|
* @see https://www.gate.com/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading // margin
|
|
1307
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
1308
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
1309
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#list-all-
|
|
1307
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-all-futures-contracts // swap
|
|
1308
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-all-futures-contracts-2 // future
|
|
1309
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#list-all-contracts-for-specified-underlying-and-expiration-date // option
|
|
1310
1310
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1311
1311
|
* @returns {object[]} an array of objects representing market data
|
|
1312
1312
|
*/
|
|
@@ -1940,7 +1940,7 @@ class gate extends gate$1["default"] {
|
|
|
1940
1940
|
* @method
|
|
1941
1941
|
* @name gate#fetchCurrencies
|
|
1942
1942
|
* @description fetches all available currencies on an exchange
|
|
1943
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
1943
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-all-currency-information
|
|
1944
1944
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1945
1945
|
* @returns {object} an associative dictionary of currencies
|
|
1946
1946
|
*/
|
|
@@ -2044,7 +2044,7 @@ class gate extends gate$1["default"] {
|
|
|
2044
2044
|
* @method
|
|
2045
2045
|
* @name gate#fetchFundingRate
|
|
2046
2046
|
* @description fetch the current funding rate
|
|
2047
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
2047
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-single-contract-information
|
|
2048
2048
|
* @param {string} symbol unified market symbol
|
|
2049
2049
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2050
2050
|
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/?id=funding-rate-structure}
|
|
@@ -2107,7 +2107,7 @@ class gate extends gate$1["default"] {
|
|
|
2107
2107
|
* @method
|
|
2108
2108
|
* @name gate#fetchFundingRates
|
|
2109
2109
|
* @description fetch the funding rate for multiple markets
|
|
2110
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
2110
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-all-futures-contracts
|
|
2111
2111
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
2112
2112
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2113
2113
|
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/?id=funding-rates-structure}, indexed by market symbols
|
|
@@ -2294,6 +2294,7 @@ class gate extends gate$1["default"] {
|
|
|
2294
2294
|
* @method
|
|
2295
2295
|
* @name gate#fetchDepositAddressesByNetwork
|
|
2296
2296
|
* @description fetch a dictionary of addresses for a currency, indexed by network
|
|
2297
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#generate-currency-deposit-address
|
|
2297
2298
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
2298
2299
|
* @param {object} [params] extra parameters specific to the api endpoint
|
|
2299
2300
|
* @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/?id=address-structure} indexed by the network
|
|
@@ -2353,7 +2354,7 @@ class gate extends gate$1["default"] {
|
|
|
2353
2354
|
* @method
|
|
2354
2355
|
* @name gate#fetchTradingFee
|
|
2355
2356
|
* @description fetch the trading fees for a market
|
|
2356
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
2357
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-personal-trading-fees
|
|
2357
2358
|
* @param {string} symbol unified market symbol
|
|
2358
2359
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2359
2360
|
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/?id=fee-structure}
|
|
@@ -2385,7 +2386,7 @@ class gate extends gate$1["default"] {
|
|
|
2385
2386
|
* @method
|
|
2386
2387
|
* @name gate#fetchTradingFees
|
|
2387
2388
|
* @description fetch the trading fees for multiple markets
|
|
2388
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
2389
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-personal-trading-fees
|
|
2389
2390
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2390
2391
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/?id=fee-structure} indexed by market symbols
|
|
2391
2392
|
*/
|
|
@@ -2452,7 +2453,7 @@ class gate extends gate$1["default"] {
|
|
|
2452
2453
|
* @name gate#fetchTransactionFees
|
|
2453
2454
|
* @deprecated
|
|
2454
2455
|
* @description please use fetchDepositWithdrawFees instead
|
|
2455
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
2456
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-withdrawal-status
|
|
2456
2457
|
* @param {string[]|undefined} codes list of unified currency codes
|
|
2457
2458
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2458
2459
|
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/?id=fee-structure}
|
|
@@ -2511,7 +2512,7 @@ class gate extends gate$1["default"] {
|
|
|
2511
2512
|
* @method
|
|
2512
2513
|
* @name gate#fetchDepositWithdrawFees
|
|
2513
2514
|
* @description fetch deposit and withdraw fees
|
|
2514
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
2515
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-withdrawal-status
|
|
2515
2516
|
* @param {string[]|undefined} codes list of unified currency codes
|
|
2516
2517
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2517
2518
|
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/?id=fee-structure}
|
|
@@ -2594,8 +2595,8 @@ class gate extends gate$1["default"] {
|
|
|
2594
2595
|
* @method
|
|
2595
2596
|
* @name gate#fetchFundingHistory
|
|
2596
2597
|
* @description fetch the history of funding payments paid and received on this account
|
|
2597
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#query-account-
|
|
2598
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#query-account-
|
|
2598
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-futures-account-change-history
|
|
2599
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-futures-account-change-history-2
|
|
2599
2600
|
* @param {string} symbol unified market symbol
|
|
2600
2601
|
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
2601
2602
|
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
@@ -2681,10 +2682,10 @@ class gate extends gate$1["default"] {
|
|
|
2681
2682
|
* @method
|
|
2682
2683
|
* @name gate#fetchOrderBook
|
|
2683
2684
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
2684
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
2685
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#futures-
|
|
2686
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#futures-
|
|
2687
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#options-order-book
|
|
2685
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-market-depth-information
|
|
2686
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-futures-market-depth-information
|
|
2687
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-futures-market-depth-information-2
|
|
2688
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-options-contract-order-book
|
|
2688
2689
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
2689
2690
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
2690
2691
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -2807,10 +2808,10 @@ class gate extends gate$1["default"] {
|
|
|
2807
2808
|
* @method
|
|
2808
2809
|
* @name gate#fetchTicker
|
|
2809
2810
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
2810
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#get-
|
|
2811
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
2812
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
2813
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
2811
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-currency-pair-ticker-information
|
|
2812
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-all-futures-trading-statistics
|
|
2813
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-all-futures-trading-statistics-2
|
|
2814
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-options-market-ticker-information
|
|
2814
2815
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
2815
2816
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2816
2817
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure}
|
|
@@ -2971,10 +2972,10 @@ class gate extends gate$1["default"] {
|
|
|
2971
2972
|
* @method
|
|
2972
2973
|
* @name gate#fetchTickers
|
|
2973
2974
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
2974
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#get-
|
|
2975
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
2976
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
2977
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
2975
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-currency-pair-ticker-information
|
|
2976
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-all-futures-trading-statistics
|
|
2977
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-all-futures-trading-statistics-2
|
|
2978
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-options-market-ticker-information
|
|
2978
2979
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
2979
2980
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2980
2981
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/?id=ticker-structure}
|
|
@@ -3025,9 +3026,10 @@ class gate extends gate$1["default"] {
|
|
|
3025
3026
|
/**
|
|
3026
3027
|
* @method
|
|
3027
3028
|
* @name gate#fetchBalance
|
|
3028
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#margin-account-list
|
|
3029
3029
|
* @see https://www.gate.com/docs/developers/apiv4/en/#get-unified-account-information
|
|
3030
3030
|
* @see https://www.gate.com/docs/developers/apiv4/en/#list-spot-trading-accounts
|
|
3031
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#margin-account-list
|
|
3032
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#funding-account-list
|
|
3031
3033
|
* @see https://www.gate.com/docs/developers/apiv4/en/#get-futures-account
|
|
3032
3034
|
* @see https://www.gate.com/docs/developers/apiv4/en/#get-futures-account-2
|
|
3033
3035
|
* @see https://www.gate.com/docs/developers/apiv4/en/#query-account-information
|
|
@@ -3327,10 +3329,10 @@ class gate extends gate$1["default"] {
|
|
|
3327
3329
|
* @method
|
|
3328
3330
|
* @name gateio#fetchOHLCV
|
|
3329
3331
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
3330
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#market-
|
|
3331
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
3332
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#market-
|
|
3333
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
3332
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#market-k-line-chart // spot
|
|
3333
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#futures-market-k-line-chart // swap
|
|
3334
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#futures-market-k-line-chart-2 // future
|
|
3335
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#options-contract-market-candlestick-chart // option
|
|
3334
3336
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
3335
3337
|
* @param {string} timeframe the length of time each candle represents
|
|
3336
3338
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -3417,7 +3419,7 @@ class gate extends gate$1["default"] {
|
|
|
3417
3419
|
* @method
|
|
3418
3420
|
* @name gate#fetchFundingRateHistory
|
|
3419
3421
|
* @description fetches historical funding rate prices
|
|
3420
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
3422
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-all-futures-trading-statistics
|
|
3421
3423
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
3422
3424
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
3423
3425
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/?id=funding-rate-history-structure} to fetch
|
|
@@ -3526,10 +3528,10 @@ class gate extends gate$1["default"] {
|
|
|
3526
3528
|
* @method
|
|
3527
3529
|
* @name gate#fetchTrades
|
|
3528
3530
|
* @description get the list of most recent trades for a particular symbol
|
|
3529
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
3530
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#futures-
|
|
3531
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#futures-
|
|
3532
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
3531
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-market-transaction-records
|
|
3532
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#futures-market-transaction-records
|
|
3533
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#futures-market-transaction-records-2
|
|
3534
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#market-trade-records
|
|
3533
3535
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
3534
3536
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
3535
3537
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -3641,10 +3643,10 @@ class gate extends gate$1["default"] {
|
|
|
3641
3643
|
* @method
|
|
3642
3644
|
* @name gate#fetchOrderTrades
|
|
3643
3645
|
* @description fetch all the trades made from a single order
|
|
3644
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
3645
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
3646
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
3647
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
3646
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-personal-trading-records
|
|
3647
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-personal-trading-records-by-time-range
|
|
3648
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-personal-trading-records-3
|
|
3649
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-personal-trading-records-4
|
|
3648
3650
|
* @param {string} id order id
|
|
3649
3651
|
* @param {string} symbol unified market symbol
|
|
3650
3652
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -3683,10 +3685,10 @@ class gate extends gate$1["default"] {
|
|
|
3683
3685
|
* @method
|
|
3684
3686
|
* @name gate#fetchMyTrades
|
|
3685
3687
|
* @description Fetch personal trading history
|
|
3686
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
3687
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
3688
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
3689
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
3688
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-personal-trading-records
|
|
3689
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-personal-trading-records-by-time-range
|
|
3690
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-personal-trading-records-3
|
|
3691
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-personal-trading-records-4
|
|
3690
3692
|
* @param {string} symbol unified market symbol
|
|
3691
3693
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
3692
3694
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -3995,7 +3997,7 @@ class gate extends gate$1["default"] {
|
|
|
3995
3997
|
* @method
|
|
3996
3998
|
* @name gate#fetchDeposits
|
|
3997
3999
|
* @description fetch all deposits made to an account
|
|
3998
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
4000
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-deposit-records
|
|
3999
4001
|
* @param {string} code unified currency code
|
|
4000
4002
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
4001
4003
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -4033,7 +4035,7 @@ class gate extends gate$1["default"] {
|
|
|
4033
4035
|
* @method
|
|
4034
4036
|
* @name gate#fetchWithdrawals
|
|
4035
4037
|
* @description fetch all withdrawals made from an account
|
|
4036
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
4038
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-withdrawal-records
|
|
4037
4039
|
* @param {string} code unified currency code
|
|
4038
4040
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
4039
4041
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
@@ -4252,11 +4254,11 @@ class gate extends gate$1["default"] {
|
|
|
4252
4254
|
* @name gate#createOrder
|
|
4253
4255
|
* @description Create an order on the exchange
|
|
4254
4256
|
* @see https://www.gate.com/docs/developers/apiv4/en/#create-an-order
|
|
4255
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#create-
|
|
4256
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
4257
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#create-
|
|
4258
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
4259
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#create-
|
|
4257
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#create-price-triggered-order
|
|
4258
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#place-futures-order
|
|
4259
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#create-price-triggered-order-2
|
|
4260
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#place-futures-order-2
|
|
4261
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#create-price-triggered-order-3
|
|
4260
4262
|
* @see https://www.gate.com/docs/developers/apiv4/en/#create-an-options-order
|
|
4261
4263
|
* @param {string} symbol Unified CCXT market symbol
|
|
4262
4264
|
* @param {string} type 'limit' or 'market' *"market" is contract only*
|
|
@@ -4429,9 +4431,8 @@ class gate extends gate$1["default"] {
|
|
|
4429
4431
|
* @method
|
|
4430
4432
|
* @name gate#createOrders
|
|
4431
4433
|
* @description create a list of trade orders
|
|
4432
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
4433
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
4434
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#create-a-batch-of-futures-orders
|
|
4434
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#batch-place-orders
|
|
4435
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#place-batch-futures-orders
|
|
4435
4436
|
* @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
|
4436
4437
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4437
4438
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
|
|
@@ -4735,7 +4736,7 @@ class gate extends gate$1["default"] {
|
|
|
4735
4736
|
if (!market['spot']) {
|
|
4736
4737
|
throw new errors.NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
|
|
4737
4738
|
}
|
|
4738
|
-
params
|
|
4739
|
+
params = this.extend(params, { 'createMarketBuyOrderRequiresPrice': false });
|
|
4739
4740
|
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
4740
4741
|
}
|
|
4741
4742
|
editOrderRequest(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
@@ -4785,8 +4786,8 @@ class gate extends gate$1["default"] {
|
|
|
4785
4786
|
* @method
|
|
4786
4787
|
* @name gate#editOrder
|
|
4787
4788
|
* @description edit a trade order, gate currently only supports the modification of the price or amount fields
|
|
4788
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#amend-
|
|
4789
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#amend-
|
|
4789
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#amend-single-order
|
|
4790
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#amend-single-order-2
|
|
4790
4791
|
* @param {string} id order id
|
|
4791
4792
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
4792
4793
|
* @param {string} type 'market' or 'limit'
|
|
@@ -5204,10 +5205,13 @@ class gate extends gate$1["default"] {
|
|
|
5204
5205
|
* @method
|
|
5205
5206
|
* @name gate#fetchOrder
|
|
5206
5207
|
* @description Retrieves information on an order
|
|
5207
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
5208
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
5209
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
5210
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
5208
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-single-order-details
|
|
5209
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-single-auto-order-details
|
|
5210
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-single-order-details-2
|
|
5211
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-single-auto-order-details-2
|
|
5212
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-single-order-details-3
|
|
5213
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-single-auto-order-details-3
|
|
5214
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-single-order-details-4
|
|
5211
5215
|
* @param {string} id Order id
|
|
5212
5216
|
* @param {string} symbol Unified market symbol, *required for spot and margin*
|
|
5213
5217
|
* @param {object} [params] Parameters specified by the exchange api
|
|
@@ -5264,7 +5268,6 @@ class gate extends gate$1["default"] {
|
|
|
5264
5268
|
* @name gate#fetchOpenOrders
|
|
5265
5269
|
* @description fetch all unfilled currently open orders
|
|
5266
5270
|
* @see https://www.gate.com/docs/developers/apiv4/en/#list-all-open-orders
|
|
5267
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#retrieve-running-auto-order-list
|
|
5268
5271
|
* @param {string} symbol unified market symbol
|
|
5269
5272
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
5270
5273
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -5282,14 +5285,14 @@ class gate extends gate$1["default"] {
|
|
|
5282
5285
|
* @method
|
|
5283
5286
|
* @name gate#fetchClosedOrders
|
|
5284
5287
|
* @description fetches information on multiple closed orders made by the user
|
|
5285
|
-
* @see https://www.gate.com/docs/developers/apiv4
|
|
5286
|
-
* @see https://www.gate.com/docs/developers/apiv4
|
|
5287
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
5288
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
5289
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
5290
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
5288
|
+
* @see https://www.gate.com/en-eu/docs/developers/apiv4/#list-orders
|
|
5289
|
+
* @see https://www.gate.com/en-eu/docs/developers/apiv4/#retrieve-running-auto-order-list
|
|
5290
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-futures-order-list
|
|
5291
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-auto-order-list
|
|
5292
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-futures-order-list-2
|
|
5293
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-auto-order-list-2
|
|
5291
5294
|
* @see https://www.gate.com/docs/developers/apiv4/en/#list-options-orders
|
|
5292
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
5295
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-futures-order-list-by-time-range
|
|
5293
5296
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
5294
5297
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
5295
5298
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -5585,10 +5588,13 @@ class gate extends gate$1["default"] {
|
|
|
5585
5588
|
* @method
|
|
5586
5589
|
* @name gate#cancelOrder
|
|
5587
5590
|
* @description Cancels an open order
|
|
5588
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-
|
|
5589
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-
|
|
5590
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-
|
|
5591
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-
|
|
5591
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-single-order
|
|
5592
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-single-auto-order
|
|
5593
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-single-order-2
|
|
5594
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-single-auto-order-2
|
|
5595
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-single-order-3
|
|
5596
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-single-auto-order-3
|
|
5597
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-single-order-4
|
|
5592
5598
|
* @param {string} id Order id
|
|
5593
5599
|
* @param {string} symbol Unified market symbol
|
|
5594
5600
|
* @param {object} [params] Parameters specified by the exchange api
|
|
@@ -5723,8 +5729,8 @@ class gate extends gate$1["default"] {
|
|
|
5723
5729
|
* @method
|
|
5724
5730
|
* @name gate#cancelOrders
|
|
5725
5731
|
* @description cancel multiple orders
|
|
5726
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-
|
|
5727
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-
|
|
5732
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-batch-orders-by-specified-id-list
|
|
5733
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-batch-orders-by-specified-id-list-2
|
|
5728
5734
|
* @param {string[]} ids order ids
|
|
5729
5735
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
5730
5736
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -5772,7 +5778,7 @@ class gate extends gate$1["default"] {
|
|
|
5772
5778
|
* @method
|
|
5773
5779
|
* @name gate#cancelOrdersForSymbols
|
|
5774
5780
|
* @description cancel multiple orders for multiple symbols
|
|
5775
|
-
* @see https://www.gate.com/docs/developers/apiv4
|
|
5781
|
+
* @see https://www.gate.com/en-eu/docs/developers/apiv4/#cancel-a-batch-of-orders-with-an-id-list
|
|
5776
5782
|
* @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
5777
5783
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5778
5784
|
* @param {string[]} [params.clientOrderIds] client order ids
|
|
@@ -5813,9 +5819,12 @@ class gate extends gate$1["default"] {
|
|
|
5813
5819
|
* @name gate#cancelAllOrders
|
|
5814
5820
|
* @description cancel all open orders
|
|
5815
5821
|
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-all-open-orders-in-specified-currency-pair
|
|
5816
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-all-
|
|
5817
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-all-
|
|
5818
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-all-
|
|
5822
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-all-auto-orders
|
|
5823
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-all-orders-with-open-status
|
|
5824
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-all-auto-orders-2
|
|
5825
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-all-orders-with-open-status-2
|
|
5826
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-all-auto-orders-3
|
|
5827
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#cancel-all-orders-with-open-status-3
|
|
5819
5828
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
5820
5829
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5821
5830
|
* @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
|
|
@@ -6199,8 +6208,8 @@ class gate extends gate$1["default"] {
|
|
|
6199
6208
|
* @method
|
|
6200
6209
|
* @name gate#fetchPosition
|
|
6201
6210
|
* @description fetch data on an open contract position
|
|
6202
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#get-single-position
|
|
6203
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#get-single-position-2
|
|
6211
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-single-position-information
|
|
6212
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-single-position-information-2
|
|
6204
6213
|
* @see https://www.gate.com/docs/developers/apiv4/en/#get-specified-contract-position
|
|
6205
6214
|
* @param {string} symbol unified market symbol of the market the position is held in
|
|
6206
6215
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -6287,8 +6296,8 @@ class gate extends gate$1["default"] {
|
|
|
6287
6296
|
* @method
|
|
6288
6297
|
* @name gate#fetchPositions
|
|
6289
6298
|
* @description fetch all open positions
|
|
6290
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
6291
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
6299
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-user-position-list
|
|
6300
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-user-position-list-2
|
|
6292
6301
|
* @see https://www.gate.com/docs/developers/apiv4/en/#list-user-s-positions-of-specified-underlying
|
|
6293
6302
|
* @param {string[]|undefined} symbols Not used by gate, but parsed internally by CCXT
|
|
6294
6303
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -6398,8 +6407,8 @@ class gate extends gate$1["default"] {
|
|
|
6398
6407
|
* @method
|
|
6399
6408
|
* @name gate#fetchLeverageTiers
|
|
6400
6409
|
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
|
6401
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
6402
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
6410
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-all-futures-contracts
|
|
6411
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-all-futures-contracts-2
|
|
6403
6412
|
* @param {string[]} [symbols] list of unified market symbols
|
|
6404
6413
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6405
6414
|
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/?id=leverage-tiers-structure}, indexed by market symbols
|
|
@@ -6519,7 +6528,8 @@ class gate extends gate$1["default"] {
|
|
|
6519
6528
|
* @method
|
|
6520
6529
|
* @name gate#fetchMarketLeverageTiers
|
|
6521
6530
|
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
|
6522
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
6531
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-risk-limit-tiers
|
|
6532
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-risk-limit-tiers-2
|
|
6523
6533
|
* @param {string} symbol unified market symbol
|
|
6524
6534
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6525
6535
|
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/?id=leverage-tiers-structure}
|
|
@@ -6532,18 +6542,24 @@ class gate extends gate$1["default"] {
|
|
|
6532
6542
|
if (type !== 'future' && type !== 'swap') {
|
|
6533
6543
|
throw new errors.BadRequest(this.id + ' fetchMarketLeverageTiers only supports swap and future');
|
|
6534
6544
|
}
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6545
|
+
let response = undefined;
|
|
6546
|
+
if (type === 'swap') {
|
|
6547
|
+
//
|
|
6548
|
+
// [
|
|
6549
|
+
// {
|
|
6550
|
+
// "maintenance_rate": "0.004",
|
|
6551
|
+
// "tier": 1,
|
|
6552
|
+
// "initial_rate": "0.008",
|
|
6553
|
+
// "leverage_max": "125",
|
|
6554
|
+
// "risk_limit": "1000000"
|
|
6555
|
+
// }
|
|
6556
|
+
// ]
|
|
6557
|
+
//
|
|
6558
|
+
response = await this.publicFuturesGetSettleRiskLimitTiers(this.extend(request, requestParams));
|
|
6559
|
+
}
|
|
6560
|
+
else {
|
|
6561
|
+
response = await this.publicDeliveryGetSettleRiskLimitTiers(this.extend(request, requestParams));
|
|
6562
|
+
}
|
|
6547
6563
|
return this.parseMarketLeverageTiers(response, market);
|
|
6548
6564
|
}
|
|
6549
6565
|
parseEmulatedLeverageTiers(info, market = undefined) {
|
|
@@ -6611,9 +6627,9 @@ class gate extends gate$1["default"] {
|
|
|
6611
6627
|
}
|
|
6612
6628
|
/**
|
|
6613
6629
|
* @method
|
|
6614
|
-
* @name gate#
|
|
6630
|
+
* @name gate#repayIsolatedMargin
|
|
6615
6631
|
* @description repay borrowed margin and interest
|
|
6616
|
-
* @see https://www.gate.com/docs/apiv4/en/#repay-
|
|
6632
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#borrow-or-repay-2
|
|
6617
6633
|
* @param {string} symbol unified market symbol
|
|
6618
6634
|
* @param {string} code unified currency code of the currency to repay
|
|
6619
6635
|
* @param {float} amount the amount to repay
|
|
@@ -6642,7 +6658,6 @@ class gate extends gate$1["default"] {
|
|
|
6642
6658
|
* @method
|
|
6643
6659
|
* @name gate#repayCrossMargin
|
|
6644
6660
|
* @description repay cross margin borrowed margin and interest
|
|
6645
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#cross-margin-repayments
|
|
6646
6661
|
* @see https://www.gate.com/docs/developers/apiv4/en/#borrow-or-repay
|
|
6647
6662
|
* @param {string} code unified currency code of the currency to repay
|
|
6648
6663
|
* @param {float} amount the amount to repay
|
|
@@ -6668,6 +6683,7 @@ class gate extends gate$1["default"] {
|
|
|
6668
6683
|
response = await this.privateUnifiedPostLoans(this.extend(request, params));
|
|
6669
6684
|
}
|
|
6670
6685
|
else {
|
|
6686
|
+
// deprecated and not present in the exchange's docs but still works
|
|
6671
6687
|
response = await this.privateMarginPostCrossRepayments(this.extend(request, params));
|
|
6672
6688
|
response = this.safeDict(response, 0);
|
|
6673
6689
|
//
|
|
@@ -6693,7 +6709,7 @@ class gate extends gate$1["default"] {
|
|
|
6693
6709
|
* @method
|
|
6694
6710
|
* @name gate#borrowIsolatedMargin
|
|
6695
6711
|
* @description create a loan to borrow margin
|
|
6696
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
6712
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#borrow-or-repay-2
|
|
6697
6713
|
* @param {string} symbol unified market symbol, required for isolated margin
|
|
6698
6714
|
* @param {string} code unified currency code of the currency to borrow
|
|
6699
6715
|
* @param {float} amount the amount to borrow
|
|
@@ -6736,15 +6752,14 @@ class gate extends gate$1["default"] {
|
|
|
6736
6752
|
}
|
|
6737
6753
|
/**
|
|
6738
6754
|
* @method
|
|
6739
|
-
* @name gate#
|
|
6755
|
+
* @name gate#borrowCrossMargin
|
|
6740
6756
|
* @description create a loan to borrow margin
|
|
6741
|
-
* @see https://www.gate.com/docs/apiv4/en/#create-a-cross-margin-borrow-loan
|
|
6742
6757
|
* @see https://www.gate.com/docs/developers/apiv4/en/#borrow-or-repay
|
|
6743
6758
|
* @param {string} code unified currency code of the currency to borrow
|
|
6744
6759
|
* @param {float} amount the amount to borrow
|
|
6745
6760
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6746
6761
|
* @param {string} [params.rate] '0.0002' or '0.002' extra parameter required for isolated margin
|
|
6747
|
-
* @param {boolean} [params.unifiedAccount] set to
|
|
6762
|
+
* @param {boolean} [params.unifiedAccount] default true (set to false to use deprecated privateMarginPostCrossLoans method)
|
|
6748
6763
|
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/?id=margin-loan-structure}
|
|
6749
6764
|
*/
|
|
6750
6765
|
async borrowCrossMargin(code, amount, params = {}) {
|
|
@@ -6763,6 +6778,8 @@ class gate extends gate$1["default"] {
|
|
|
6763
6778
|
response = await this.privateUnifiedPostLoans(this.extend(request, params));
|
|
6764
6779
|
}
|
|
6765
6780
|
else {
|
|
6781
|
+
// deprecated and not present in the exchange's docs
|
|
6782
|
+
// returns {"label":"REQUEST_FORBIDDEN","message":"Request is forbidden"}
|
|
6766
6783
|
response = await this.privateMarginPostCrossLoans(this.extend(request, params));
|
|
6767
6784
|
//
|
|
6768
6785
|
// {
|
|
@@ -6839,9 +6856,8 @@ class gate extends gate$1["default"] {
|
|
|
6839
6856
|
* @method
|
|
6840
6857
|
* @name gate#fetchBorrowInterest
|
|
6841
6858
|
* @description fetch the interest owed by the user for borrowing currency for margin trading
|
|
6842
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
6843
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#interest-records-
|
|
6844
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#list-interest-records-2
|
|
6859
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-interest-deduction-records
|
|
6860
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-interest-deduction-records-2
|
|
6845
6861
|
* @param {string} [code] unified currency code
|
|
6846
6862
|
* @param {string} [symbol] unified market symbol when fetching interest in isolated markets
|
|
6847
6863
|
* @param {int} [since] the earliest time in ms to fetch borrow interest for
|
|
@@ -6885,6 +6901,7 @@ class gate extends gate$1["default"] {
|
|
|
6885
6901
|
response = await this.privateMarginGetUniInterestRecords(this.extend(request, params));
|
|
6886
6902
|
}
|
|
6887
6903
|
else if (marginMode === 'cross') {
|
|
6904
|
+
// deprecated and not present in the exchange's docs but still works
|
|
6888
6905
|
response = await this.privateMarginGetCrossInterestRecords(this.extend(request, params));
|
|
6889
6906
|
}
|
|
6890
6907
|
const interest = this.parseBorrowInterests(response, market);
|
|
@@ -7100,7 +7117,7 @@ class gate extends gate$1["default"] {
|
|
|
7100
7117
|
* @method
|
|
7101
7118
|
* @name gate#fetchOpenInterest
|
|
7102
7119
|
* @description Retrieves the open interest of a currency
|
|
7103
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#futures-
|
|
7120
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#futures-statistics
|
|
7104
7121
|
* @param {string} symbol Unified CCXT market symbol
|
|
7105
7122
|
* @param {string} timeframe "5m", "15m", "30m", "1h", "4h", "1d"
|
|
7106
7123
|
* @param {int} [since] the time(ms) of the earliest record to retrieve as a unix timestamp
|
|
@@ -7188,7 +7205,7 @@ class gate extends gate$1["default"] {
|
|
|
7188
7205
|
* @method
|
|
7189
7206
|
* @name gate#fetchSettlementHistory
|
|
7190
7207
|
* @description fetches historical settlement records
|
|
7191
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#list-settlement-history
|
|
7208
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#list-settlement-history
|
|
7192
7209
|
* @param {string} symbol unified market symbol of the settlement history, required on gate
|
|
7193
7210
|
* @param {int} [since] timestamp in ms
|
|
7194
7211
|
* @param {int} [limit] number of records
|
|
@@ -7238,7 +7255,8 @@ class gate extends gate$1["default"] {
|
|
|
7238
7255
|
* @method
|
|
7239
7256
|
* @name gate#fetchMySettlementHistory
|
|
7240
7257
|
* @description fetches historical settlement records of the user
|
|
7241
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
7258
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-personal-settlement-records
|
|
7259
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-settlement-records
|
|
7242
7260
|
* @param {string} symbol unified market symbol of the settlement history
|
|
7243
7261
|
* @param {int} [since] timestamp in ms
|
|
7244
7262
|
* @param {int} [limit] number of records
|
|
@@ -7246,49 +7264,79 @@ class gate extends gate$1["default"] {
|
|
|
7246
7264
|
* @returns {object[]} a list of [settlement history objects]
|
|
7247
7265
|
*/
|
|
7248
7266
|
async fetchMySettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7249
|
-
if (symbol === undefined) {
|
|
7250
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchMySettlementHistory() requires a symbol argument');
|
|
7251
|
-
}
|
|
7252
7267
|
await this.loadMarkets();
|
|
7253
|
-
|
|
7268
|
+
let market = undefined;
|
|
7269
|
+
if (symbol !== undefined) {
|
|
7270
|
+
market = this.market(symbol);
|
|
7271
|
+
symbol = market['symbol'];
|
|
7272
|
+
}
|
|
7254
7273
|
let type = undefined;
|
|
7255
7274
|
[type, params] = this.handleMarketTypeAndParams('fetchMySettlementHistory', market, params);
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
const optionParts = marketId.split('-');
|
|
7261
|
-
const request = {
|
|
7262
|
-
'underlying': this.safeString(optionParts, 0),
|
|
7263
|
-
'contract': marketId,
|
|
7264
|
-
};
|
|
7265
|
-
if (since !== undefined) {
|
|
7266
|
-
request['from'] = since;
|
|
7275
|
+
const isOption = type === 'option';
|
|
7276
|
+
const isFuture = type === 'future';
|
|
7277
|
+
if (!isOption && !isFuture) {
|
|
7278
|
+
throw new errors.NotSupported(this.id + ' fetchMySettlementHistory() supports option and future markets only');
|
|
7267
7279
|
}
|
|
7280
|
+
const [request, query] = this.prepareRequest(market, type, params);
|
|
7268
7281
|
if (limit !== undefined) {
|
|
7269
7282
|
request['limit'] = limit;
|
|
7270
7283
|
}
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7284
|
+
let response = undefined;
|
|
7285
|
+
if (isFuture) {
|
|
7286
|
+
//
|
|
7287
|
+
// [
|
|
7288
|
+
// {
|
|
7289
|
+
// "time": 1548654951,
|
|
7290
|
+
// "contract": "BTC_USDT",
|
|
7291
|
+
// "size": 600,
|
|
7292
|
+
// "leverage": "25",
|
|
7293
|
+
// "margin": "0.006705256878",
|
|
7294
|
+
// "entry_price": "3536.123",
|
|
7295
|
+
// "settle_price": "3421.54",
|
|
7296
|
+
// "profit": "-6.87498",
|
|
7297
|
+
// "fee": "0.03079386"
|
|
7298
|
+
// }
|
|
7299
|
+
// ]
|
|
7300
|
+
//
|
|
7301
|
+
response = await this.privateDeliveryGetSettleSettlements(this.extend(request, query));
|
|
7302
|
+
}
|
|
7303
|
+
else {
|
|
7304
|
+
if (since !== undefined) {
|
|
7305
|
+
request['from'] = since;
|
|
7306
|
+
}
|
|
7307
|
+
if (market === undefined) {
|
|
7308
|
+
const underlying = this.safeString(params, 'underlying');
|
|
7309
|
+
if (underlying === undefined) {
|
|
7310
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchMySettlementHistory() requires a symbol argument or an underlying parameter in params');
|
|
7311
|
+
}
|
|
7312
|
+
}
|
|
7313
|
+
else {
|
|
7314
|
+
const marketId = market['id'];
|
|
7315
|
+
const optionParts = marketId.split('-');
|
|
7316
|
+
request['underlying'] = this.safeString(optionParts, 0);
|
|
7317
|
+
}
|
|
7318
|
+
//
|
|
7319
|
+
// [
|
|
7320
|
+
// {
|
|
7321
|
+
// "size": -1,
|
|
7322
|
+
// "settle_profit": "0",
|
|
7323
|
+
// "contract": "BTC_USDT-20220624-26000-C",
|
|
7324
|
+
// "strike_price": "26000",
|
|
7325
|
+
// "time": 1656057600,
|
|
7326
|
+
// "settle_price": "20917.461281337048",
|
|
7327
|
+
// "underlying": "BTC_USDT",
|
|
7328
|
+
// "realised_pnl": "-0.00116042",
|
|
7329
|
+
// "fee": "0"
|
|
7330
|
+
// }
|
|
7331
|
+
// ]
|
|
7332
|
+
//
|
|
7333
|
+
response = await this.privateOptionsGetMySettlements(this.extend(request, params));
|
|
7334
|
+
}
|
|
7287
7335
|
const result = this.safeValue(response, 'result', {});
|
|
7288
7336
|
const data = this.safeValue(result, 'list', []);
|
|
7289
7337
|
const settlements = this.parseSettlements(data, market);
|
|
7290
7338
|
const sorted = this.sortBy(settlements, 'timestamp');
|
|
7291
|
-
return this.filterBySymbolSinceLimit(sorted,
|
|
7339
|
+
return this.filterBySymbolSinceLimit(sorted, symbol, since, limit);
|
|
7292
7340
|
}
|
|
7293
7341
|
parseSettlement(settlement, market) {
|
|
7294
7342
|
//
|
|
@@ -7303,7 +7351,7 @@ class gate extends gate$1["default"] {
|
|
|
7303
7351
|
// "strike_price": "25000"
|
|
7304
7352
|
// }
|
|
7305
7353
|
//
|
|
7306
|
-
// fetchMySettlementHistory
|
|
7354
|
+
// fetchMySettlementHistory option
|
|
7307
7355
|
//
|
|
7308
7356
|
// {
|
|
7309
7357
|
// "size": -1,
|
|
@@ -7317,6 +7365,19 @@ class gate extends gate$1["default"] {
|
|
|
7317
7365
|
// "fee": "0"
|
|
7318
7366
|
// }
|
|
7319
7367
|
//
|
|
7368
|
+
// fetchMySettlementHistory future
|
|
7369
|
+
// {
|
|
7370
|
+
// "time": 1548654951,
|
|
7371
|
+
// "contract": "BTC_USDT",
|
|
7372
|
+
// "size": 600,
|
|
7373
|
+
// "leverage": "25",
|
|
7374
|
+
// "margin": "0.006705256878",
|
|
7375
|
+
// "entry_price": "3536.123",
|
|
7376
|
+
// "settle_price": "3421.54",
|
|
7377
|
+
// "profit": "-6.87498",
|
|
7378
|
+
// "fee": "0.03079386"
|
|
7379
|
+
// }
|
|
7380
|
+
//
|
|
7320
7381
|
const timestamp = this.safeTimestamp(settlement, 'time');
|
|
7321
7382
|
const marketId = this.safeString(settlement, 'contract');
|
|
7322
7383
|
return {
|
|
@@ -7368,11 +7429,11 @@ class gate extends gate$1["default"] {
|
|
|
7368
7429
|
* @method
|
|
7369
7430
|
* @name gate#fetchLedger
|
|
7370
7431
|
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
7371
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#query-account-
|
|
7372
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
7373
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#query-account-
|
|
7374
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#query-account-
|
|
7375
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
7432
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-spot-account-transaction-history
|
|
7433
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-margin-account-balance-change-history
|
|
7434
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-futures-account-change-history
|
|
7435
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-futures-account-change-history-2
|
|
7436
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-account-change-history
|
|
7376
7437
|
* @param {string} [code] unified currency code
|
|
7377
7438
|
* @param {int} [since] timestamp in ms of the earliest ledger entry
|
|
7378
7439
|
* @param {int} [limit] max number of ledger entries to return
|
|
@@ -7614,7 +7675,7 @@ class gate extends gate$1["default"] {
|
|
|
7614
7675
|
* @method
|
|
7615
7676
|
* @name gate#setPositionMode
|
|
7616
7677
|
* @description set dual/hedged mode to true or false for a swap market, make sure all positions are closed and no orders are open before setting dual mode
|
|
7617
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
7678
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#set-position-mode
|
|
7618
7679
|
* @param {bool} hedged set to true to enable dual mode
|
|
7619
7680
|
* @param {string|undefined} symbol if passed, dual mode is set for all markets with the same settle currency
|
|
7620
7681
|
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
@@ -7631,7 +7692,7 @@ class gate extends gate$1["default"] {
|
|
|
7631
7692
|
* @method
|
|
7632
7693
|
* @name gate#fetchUnderlyingAssets
|
|
7633
7694
|
* @description fetches the market ids of underlying assets for a specific contract market type
|
|
7634
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#list-all-
|
|
7695
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#list-all-underlying-assets
|
|
7635
7696
|
* @param {object} [params] exchange specific params
|
|
7636
7697
|
* @param {string} [params.type] the contract market type, 'option', 'swap' or 'future', the default is 'option'
|
|
7637
7698
|
* @returns {object[]} a list of [underlying assets]{@link https://docs.ccxt.com/?id=underlying-assets-structure}
|
|
@@ -7670,7 +7731,7 @@ class gate extends gate$1["default"] {
|
|
|
7670
7731
|
* @method
|
|
7671
7732
|
* @name gate#fetchLiquidations
|
|
7672
7733
|
* @description retrieves the public liquidations of a trading pair
|
|
7673
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
7734
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-liquidation-order-history
|
|
7674
7735
|
* @param {string} symbol unified CCXT market symbol
|
|
7675
7736
|
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
7676
7737
|
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
@@ -7714,8 +7775,8 @@ class gate extends gate$1["default"] {
|
|
|
7714
7775
|
* @method
|
|
7715
7776
|
* @name gate#fetchMyLiquidations
|
|
7716
7777
|
* @description retrieves the users liquidated positions
|
|
7717
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
7718
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
7778
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-liquidation-history
|
|
7779
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-liquidation-history-2
|
|
7719
7780
|
* @see https://www.gate.com/docs/developers/apiv4/en/#list-user-s-liquidation-history-of-specified-underlying
|
|
7720
7781
|
* @param {string} symbol unified CCXT market symbol
|
|
7721
7782
|
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
@@ -7881,7 +7942,7 @@ class gate extends gate$1["default"] {
|
|
|
7881
7942
|
* @method
|
|
7882
7943
|
* @name gate#fetchGreeks
|
|
7883
7944
|
* @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
|
7884
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
7945
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-options-market-ticker-information
|
|
7885
7946
|
* @param {string} symbol unified symbol of the market to fetch greeks for
|
|
7886
7947
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7887
7948
|
* @returns {object} a [greeks structure]{@link https://docs.ccxt.com/?id=greeks-structure}
|
|
@@ -7974,8 +8035,8 @@ class gate extends gate$1["default"] {
|
|
|
7974
8035
|
* @method
|
|
7975
8036
|
* @name gate#closePosition
|
|
7976
8037
|
* @description closes open positions for a market
|
|
7977
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
7978
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#
|
|
8038
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#place-futures-order
|
|
8039
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#place-futures-order-2
|
|
7979
8040
|
* @see https://www.gate.com/docs/developers/apiv4/en/#create-an-options-order
|
|
7980
8041
|
* @param {string} symbol Unified CCXT market symbol
|
|
7981
8042
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -7997,8 +8058,7 @@ class gate extends gate$1["default"] {
|
|
|
7997
8058
|
* @name gate#fetchLeverage
|
|
7998
8059
|
* @description fetch the set leverage for a market
|
|
7999
8060
|
* @see https://www.gate.com/docs/developers/apiv4/en/#get-unified-account-information
|
|
8000
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#get-
|
|
8001
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#query-one-single-margin-currency-pair-deprecated
|
|
8061
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#get-lending-market-details
|
|
8002
8062
|
* @param {string} symbol unified market symbol
|
|
8003
8063
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8004
8064
|
* @param {boolean} [params.unified] default false, set to true for fetching the unified accounts leverage
|
|
@@ -8029,7 +8089,7 @@ class gate extends gate$1["default"] {
|
|
|
8029
8089
|
//
|
|
8030
8090
|
}
|
|
8031
8091
|
else {
|
|
8032
|
-
response = await this.publicMarginGetCurrencyPairsCurrencyPair(this.extend(request, params));
|
|
8092
|
+
response = await this.publicMarginGetCurrencyPairsCurrencyPair(this.extend(request, params)); // deprecated
|
|
8033
8093
|
//
|
|
8034
8094
|
// {
|
|
8035
8095
|
// "id": "BTC_USDT",
|
|
@@ -8107,7 +8167,6 @@ class gate extends gate$1["default"] {
|
|
|
8107
8167
|
* @name gate#fetchLeverages
|
|
8108
8168
|
* @description fetch the set leverage for all leverage markets, only spot margin is supported on gate
|
|
8109
8169
|
* @see https://www.gate.com/docs/developers/apiv4/en/#list-lending-markets
|
|
8110
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading-deprecated
|
|
8111
8170
|
* @param {string[]} symbols a list of unified market symbols
|
|
8112
8171
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8113
8172
|
* @param {boolean} [params.unified] default false, set to true for fetching unified account leverages
|
|
@@ -8135,7 +8194,7 @@ class gate extends gate$1["default"] {
|
|
|
8135
8194
|
//
|
|
8136
8195
|
}
|
|
8137
8196
|
else {
|
|
8138
|
-
response = await this.publicMarginGetCurrencyPairs(params);
|
|
8197
|
+
response = await this.publicMarginGetCurrencyPairs(params); // deprecated
|
|
8139
8198
|
//
|
|
8140
8199
|
// [
|
|
8141
8200
|
// {
|
|
@@ -8168,7 +8227,7 @@ class gate extends gate$1["default"] {
|
|
|
8168
8227
|
* @method
|
|
8169
8228
|
* @name gate#fetchOption
|
|
8170
8229
|
* @description fetches option data that is commonly found in an option chain
|
|
8171
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#query-specified-contract-
|
|
8230
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#query-specified-contract-details
|
|
8172
8231
|
* @param {string} symbol unified market symbol
|
|
8173
8232
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8174
8233
|
* @returns {object} an [option chain structure]{@link https://docs.ccxt.com/?id=option-chain-structure}
|
|
@@ -8226,7 +8285,7 @@ class gate extends gate$1["default"] {
|
|
|
8226
8285
|
* @method
|
|
8227
8286
|
* @name gate#fetchOptionChain
|
|
8228
8287
|
* @description fetches data for an underlying asset that is commonly found in an option chain
|
|
8229
|
-
* @see https://www.gate.com/docs/developers/apiv4/en/#list-all-
|
|
8288
|
+
* @see https://www.gate.com/docs/developers/apiv4/en/#list-all-contracts-for-specified-underlying-and-expiration-date
|
|
8230
8289
|
* @param {string} code base currency to fetch an option chain for
|
|
8231
8290
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8232
8291
|
* @param {string} [params.underlying] the underlying asset, can be obtained from fetchUnderlyingAssets ()
|
|
@@ -8352,8 +8411,8 @@ class gate extends gate$1["default"] {
|
|
|
8352
8411
|
* @method
|
|
8353
8412
|
* @name gate#fetchPositionsHistory
|
|
8354
8413
|
* @description fetches historical positions
|
|
8355
|
-
* @see https://www.gate.com/docs/developers/apiv4/#
|
|
8356
|
-
* @see https://www.gate.com/docs/developers/apiv4/#
|
|
8414
|
+
* @see https://www.gate.com/docs/developers/apiv4/#query-position-close-history
|
|
8415
|
+
* @see https://www.gate.com/docs/developers/apiv4/#query-position-close-history-2
|
|
8357
8416
|
* @param {string[]} symbols unified conract symbols, must all have the same settle currency and the same market type
|
|
8358
8417
|
* @param {int} [since] the earliest time in ms to fetch positions for
|
|
8359
8418
|
* @param {int} [limit] the maximum amount of records to fetch, default=1000
|