ccxt 4.2.12 → 4.2.14
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 +3 -3
- package/dist/ccxt.browser.js +1338 -366
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/js/ccxt.js +1 -1
- package/dist/cjs/js/src/base/Exchange.js +148 -1
- package/dist/cjs/js/src/bigone.js +125 -54
- package/dist/cjs/js/src/binance.js +142 -27
- package/dist/cjs/js/src/binanceus.js +8 -0
- package/dist/cjs/js/src/bingx.js +110 -36
- package/dist/cjs/js/src/bitget.js +17 -6
- package/dist/cjs/js/src/bitmart.js +3 -3
- package/dist/cjs/js/src/bybit.js +5 -1
- package/dist/cjs/js/src/coinbase.js +176 -26
- package/dist/cjs/js/src/coinex.js +3 -0
- package/dist/cjs/js/src/coinlist.js +1 -1
- package/dist/cjs/js/src/coinone.js +1 -1
- package/dist/cjs/js/src/delta.js +7 -1
- package/dist/cjs/js/src/deribit.js +1 -1
- package/dist/cjs/js/src/gate.js +79 -56
- package/dist/cjs/js/src/gemini.js +1 -1
- package/dist/cjs/js/src/htx.js +151 -1
- package/dist/cjs/js/src/independentreserve.js +7 -5
- package/dist/cjs/js/src/kraken.js +22 -14
- package/dist/cjs/js/src/kucoin.js +5 -0
- package/dist/cjs/js/src/kucoinfutures.js +131 -77
- package/dist/cjs/js/src/lbank.js +59 -33
- package/dist/cjs/js/src/oceanex.js +1 -1
- package/dist/cjs/js/src/okx.js +11 -9
- package/dist/cjs/js/src/phemex.js +9 -2
- package/dist/cjs/js/src/pro/kraken.js +1 -1
- package/dist/cjs/js/src/pro/okx.js +52 -2
- package/dist/cjs/js/src/probit.js +4 -2
- package/dist/cjs/js/src/wavesexchange.js +1 -1
- package/dist/cjs/js/src/woo.js +56 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bigone.d.ts +1 -0
- package/js/src/abstract/bingx.d.ts +2 -0
- package/js/src/abstract/kucoin.d.ts +4 -0
- package/js/src/abstract/kucoinfutures.d.ts +4 -0
- package/js/src/abstract/okx.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +8 -0
- package/js/src/base/Exchange.js +148 -1
- package/js/src/bigone.d.ts +2 -0
- package/js/src/bigone.js +125 -54
- package/js/src/binance.d.ts +9 -0
- package/js/src/binance.js +142 -27
- package/js/src/binanceus.js +8 -0
- package/js/src/bingx.js +110 -36
- package/js/src/bitget.js +17 -6
- package/js/src/bitmart.js +3 -3
- package/js/src/bybit.js +5 -1
- package/js/src/coinbase.d.ts +26 -3
- package/js/src/coinbase.js +176 -26
- package/js/src/coinex.js +3 -0
- package/js/src/coinlist.js +1 -1
- package/js/src/coinone.js +1 -1
- package/js/src/delta.js +7 -1
- package/js/src/deribit.js +1 -1
- package/js/src/gate.js +79 -56
- package/js/src/gemini.js +1 -1
- package/js/src/htx.d.ts +10 -0
- package/js/src/htx.js +151 -1
- package/js/src/independentreserve.js +7 -5
- package/js/src/kraken.js +22 -14
- package/js/src/kucoin.js +5 -0
- package/js/src/kucoinfutures.d.ts +4 -2
- package/js/src/kucoinfutures.js +131 -77
- package/js/src/lbank.js +59 -33
- package/js/src/oceanex.js +1 -1
- package/js/src/okx.js +11 -9
- package/js/src/phemex.js +9 -2
- package/js/src/pro/kraken.js +1 -1
- package/js/src/pro/okx.d.ts +1 -0
- package/js/src/pro/okx.js +52 -2
- package/js/src/probit.js +4 -2
- package/js/src/wavesexchange.js +1 -1
- package/js/src/woo.d.ts +2 -0
- package/js/src/woo.js +56 -2
- package/package.json +1 -1
|
@@ -102,7 +102,7 @@ class coinbase extends coinbase$1 {
|
|
|
102
102
|
'setLeverage': false,
|
|
103
103
|
'setMarginMode': false,
|
|
104
104
|
'setPositionMode': false,
|
|
105
|
-
'withdraw':
|
|
105
|
+
'withdraw': true,
|
|
106
106
|
},
|
|
107
107
|
'urls': {
|
|
108
108
|
'logo': 'https://user-images.githubusercontent.com/1294454/40811661-b6eceae2-653a-11e8-829e-10bfadb078cf.jpg',
|
|
@@ -773,46 +773,102 @@ class coinbase extends coinbase$1 {
|
|
|
773
773
|
// "next_step": null
|
|
774
774
|
// }
|
|
775
775
|
//
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
776
|
+
// withdraw
|
|
777
|
+
//
|
|
778
|
+
// {
|
|
779
|
+
// "id": "a1794ecf-5693-55fa-70cf-ef731748ed82",
|
|
780
|
+
// "type": "send",
|
|
781
|
+
// "status": "pending",
|
|
782
|
+
// "amount": {
|
|
783
|
+
// "amount": "-14.008308",
|
|
784
|
+
// "currency": "USDC"
|
|
785
|
+
// },
|
|
786
|
+
// "native_amount": {
|
|
787
|
+
// "amount": "-18.74",
|
|
788
|
+
// "currency": "CAD"
|
|
789
|
+
// },
|
|
790
|
+
// "description": null,
|
|
791
|
+
// "created_at": "2024-01-12T01:27:31Z",
|
|
792
|
+
// "updated_at": "2024-01-12T01:27:31Z",
|
|
793
|
+
// "resource": "transaction",
|
|
794
|
+
// "resource_path": "/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82",
|
|
795
|
+
// "instant_exchange": false,
|
|
796
|
+
// "network": {
|
|
797
|
+
// "status": "pending",
|
|
798
|
+
// "status_description": "Pending (est. less than 10 minutes)",
|
|
799
|
+
// "transaction_fee": {
|
|
800
|
+
// "amount": "4.008308",
|
|
801
|
+
// "currency": "USDC"
|
|
802
|
+
// },
|
|
803
|
+
// "transaction_amount": {
|
|
804
|
+
// "amount": "10.000000",
|
|
805
|
+
// "currency": "USDC"
|
|
806
|
+
// },
|
|
807
|
+
// "confirmations": 0
|
|
808
|
+
// },
|
|
809
|
+
// "to": {
|
|
810
|
+
// "resource": "ethereum_address",
|
|
811
|
+
// "address": "0x9...",
|
|
812
|
+
// "currency": "USDC",
|
|
813
|
+
// "address_info": {
|
|
814
|
+
// "address": "0x9..."
|
|
815
|
+
// }
|
|
816
|
+
// },
|
|
817
|
+
// "idem": "748d8591-dg9a-7831-a45b-crd61dg78762",
|
|
818
|
+
// "details": {
|
|
819
|
+
// "title": "Sent USDC",
|
|
820
|
+
// "subtitle": "To USDC address on Ethereum network",
|
|
821
|
+
// "header": "Sent 14.008308 USDC ($18.74)",
|
|
822
|
+
// "health": "warning"
|
|
823
|
+
// },
|
|
824
|
+
// "hide_native_amount": false
|
|
825
|
+
// }
|
|
826
|
+
//
|
|
827
|
+
const transactionType = this.safeString(transaction, 'type');
|
|
828
|
+
let amountAndCurrencyObject = undefined;
|
|
829
|
+
let feeObject = undefined;
|
|
830
|
+
if (transactionType === 'send') {
|
|
831
|
+
const network = this.safeValue(transaction, 'network', {});
|
|
832
|
+
amountAndCurrencyObject = this.safeValue(network, 'transaction_amount', {});
|
|
833
|
+
feeObject = this.safeValue(network, 'transaction_fee', {});
|
|
834
|
+
}
|
|
835
|
+
else {
|
|
836
|
+
amountAndCurrencyObject = this.safeValue(transaction, 'subtotal', {});
|
|
837
|
+
feeObject = this.safeValue(transaction, 'fee', {});
|
|
838
|
+
}
|
|
792
839
|
let status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
|
|
793
840
|
if (status === undefined) {
|
|
794
841
|
const committed = this.safeValue(transaction, 'committed');
|
|
795
842
|
status = committed ? 'ok' : 'pending';
|
|
796
843
|
}
|
|
844
|
+
const id = this.safeString(transaction, 'id');
|
|
845
|
+
const currencyId = this.safeString(amountAndCurrencyObject, 'currency');
|
|
846
|
+
const feeCurrencyId = this.safeString(feeObject, 'currency');
|
|
847
|
+
const datetime = this.safeValue(transaction, 'created_at');
|
|
848
|
+
const toObject = this.safeValue(transaction, 'to', {});
|
|
849
|
+
const toAddress = this.safeString(toObject, 'address');
|
|
797
850
|
return {
|
|
798
851
|
'info': transaction,
|
|
799
852
|
'id': id,
|
|
800
853
|
'txid': id,
|
|
801
|
-
'timestamp':
|
|
802
|
-
'datetime':
|
|
854
|
+
'timestamp': this.parse8601(datetime),
|
|
855
|
+
'datetime': datetime,
|
|
803
856
|
'network': undefined,
|
|
804
|
-
'address':
|
|
805
|
-
'addressTo':
|
|
857
|
+
'address': toAddress,
|
|
858
|
+
'addressTo': toAddress,
|
|
806
859
|
'addressFrom': undefined,
|
|
807
860
|
'tag': undefined,
|
|
808
861
|
'tagTo': undefined,
|
|
809
862
|
'tagFrom': undefined,
|
|
810
|
-
'type':
|
|
811
|
-
'amount': amount,
|
|
812
|
-
'currency':
|
|
863
|
+
'type': this.safeString(transaction, 'resource'),
|
|
864
|
+
'amount': this.safeNumber(amountAndCurrencyObject, 'amount'),
|
|
865
|
+
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
813
866
|
'status': status,
|
|
814
|
-
'updated':
|
|
815
|
-
'fee':
|
|
867
|
+
'updated': this.parse8601(this.safeValue(transaction, 'updated_at')),
|
|
868
|
+
'fee': {
|
|
869
|
+
'cost': this.safeNumber(feeObject, 'amount'),
|
|
870
|
+
'currency': this.safeCurrencyCode(feeCurrencyId),
|
|
871
|
+
},
|
|
816
872
|
};
|
|
817
873
|
}
|
|
818
874
|
parseTrade(trade, market = undefined) {
|
|
@@ -3166,6 +3222,100 @@ class coinbase extends coinbase$1 {
|
|
|
3166
3222
|
const tickers = this.safeValue(response, 'pricebooks', []);
|
|
3167
3223
|
return this.parseTickers(tickers, symbols);
|
|
3168
3224
|
}
|
|
3225
|
+
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
3226
|
+
/**
|
|
3227
|
+
* @method
|
|
3228
|
+
* @name coinbase#withdraw
|
|
3229
|
+
* @description make a withdrawal
|
|
3230
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-transactions#send-money
|
|
3231
|
+
* @param {string} code unified currency code
|
|
3232
|
+
* @param {float} amount the amount to withdraw
|
|
3233
|
+
* @param {string} address the address to withdraw to
|
|
3234
|
+
* @param {string} [tag] an optional tag for the withdrawal
|
|
3235
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3236
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3237
|
+
*/
|
|
3238
|
+
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
3239
|
+
this.checkAddress(address);
|
|
3240
|
+
await this.loadMarkets();
|
|
3241
|
+
const currency = this.currency(code);
|
|
3242
|
+
let accountId = this.safeString2(params, 'account_id', 'accountId');
|
|
3243
|
+
params = this.omit(params, ['account_id', 'accountId']);
|
|
3244
|
+
if (accountId === undefined) {
|
|
3245
|
+
if (code === undefined) {
|
|
3246
|
+
throw new errors.ArgumentsRequired(this.id + ' withdraw() requires an account_id (or accountId) parameter OR a currency code argument');
|
|
3247
|
+
}
|
|
3248
|
+
accountId = await this.findAccountId(code);
|
|
3249
|
+
if (accountId === undefined) {
|
|
3250
|
+
throw new errors.ExchangeError(this.id + ' withdraw() could not find account id for ' + code);
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
const request = {
|
|
3254
|
+
'account_id': accountId,
|
|
3255
|
+
'type': 'send',
|
|
3256
|
+
'to': address,
|
|
3257
|
+
'amount': amount,
|
|
3258
|
+
'currency': currency['id'],
|
|
3259
|
+
};
|
|
3260
|
+
if (tag !== undefined) {
|
|
3261
|
+
request['destination_tag'] = tag;
|
|
3262
|
+
}
|
|
3263
|
+
const response = await this.v2PrivatePostAccountsAccountIdTransactions(this.extend(request, params));
|
|
3264
|
+
//
|
|
3265
|
+
// {
|
|
3266
|
+
// "data": {
|
|
3267
|
+
// "id": "a1794ecf-5693-55fa-70cf-ef731748ed82",
|
|
3268
|
+
// "type": "send",
|
|
3269
|
+
// "status": "pending",
|
|
3270
|
+
// "amount": {
|
|
3271
|
+
// "amount": "-14.008308",
|
|
3272
|
+
// "currency": "USDC"
|
|
3273
|
+
// },
|
|
3274
|
+
// "native_amount": {
|
|
3275
|
+
// "amount": "-18.74",
|
|
3276
|
+
// "currency": "CAD"
|
|
3277
|
+
// },
|
|
3278
|
+
// "description": null,
|
|
3279
|
+
// "created_at": "2024-01-12T01:27:31Z",
|
|
3280
|
+
// "updated_at": "2024-01-12T01:27:31Z",
|
|
3281
|
+
// "resource": "transaction",
|
|
3282
|
+
// "resource_path": "/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82",
|
|
3283
|
+
// "instant_exchange": false,
|
|
3284
|
+
// "network": {
|
|
3285
|
+
// "status": "pending",
|
|
3286
|
+
// "status_description": "Pending (est. less than 10 minutes)",
|
|
3287
|
+
// "transaction_fee": {
|
|
3288
|
+
// "amount": "4.008308",
|
|
3289
|
+
// "currency": "USDC"
|
|
3290
|
+
// },
|
|
3291
|
+
// "transaction_amount": {
|
|
3292
|
+
// "amount": "10.000000",
|
|
3293
|
+
// "currency": "USDC"
|
|
3294
|
+
// },
|
|
3295
|
+
// "confirmations": 0
|
|
3296
|
+
// },
|
|
3297
|
+
// "to": {
|
|
3298
|
+
// "resource": "ethereum_address",
|
|
3299
|
+
// "address": "0x9...",
|
|
3300
|
+
// "currency": "USDC",
|
|
3301
|
+
// "address_info": {
|
|
3302
|
+
// "address": "0x9..."
|
|
3303
|
+
// }
|
|
3304
|
+
// },
|
|
3305
|
+
// "idem": "748d8591-dg9a-7831-a45b-crd61dg78762",
|
|
3306
|
+
// "details": {
|
|
3307
|
+
// "title": "Sent USDC",
|
|
3308
|
+
// "subtitle": "To USDC address on Ethereum network",
|
|
3309
|
+
// "header": "Sent 14.008308 USDC ($18.74)",
|
|
3310
|
+
// "health": "warning"
|
|
3311
|
+
// },
|
|
3312
|
+
// "hide_native_amount": false
|
|
3313
|
+
// }
|
|
3314
|
+
// }
|
|
3315
|
+
//
|
|
3316
|
+
const data = this.safeValue(response, 'data', {});
|
|
3317
|
+
return this.parseTransaction(data, currency);
|
|
3318
|
+
}
|
|
3169
3319
|
sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
3170
3320
|
const version = api[0];
|
|
3171
3321
|
const signed = api[1] === 'private';
|
|
@@ -48,6 +48,9 @@ class coinex extends coinex$1 {
|
|
|
48
48
|
'createMarketBuyOrderWithCost': true,
|
|
49
49
|
'createMarketOrderWithCost': false,
|
|
50
50
|
'createMarketSellOrderWithCost': false,
|
|
51
|
+
'createTriggerOrder': true,
|
|
52
|
+
'createTakeProfitOrder': true,
|
|
53
|
+
'createStopLossOrder': true,
|
|
51
54
|
'createOrder': true,
|
|
52
55
|
'createOrders': true,
|
|
53
56
|
'createReduceOnlyOrder': true,
|
|
@@ -750,7 +750,7 @@ class coinlist extends coinlist$1 {
|
|
|
750
750
|
request['start_time'] = this.iso8601(since);
|
|
751
751
|
}
|
|
752
752
|
if (limit !== undefined) {
|
|
753
|
-
request['count'] = limit;
|
|
753
|
+
request['count'] = Math.min(limit, 500);
|
|
754
754
|
}
|
|
755
755
|
const until = this.safeInteger2(params, 'till', 'until');
|
|
756
756
|
if (until !== undefined) {
|
|
@@ -709,7 +709,7 @@ class coinone extends coinone$1 {
|
|
|
709
709
|
'target_currency': market['base'],
|
|
710
710
|
};
|
|
711
711
|
if (limit !== undefined) {
|
|
712
|
-
request['size'] = limit
|
|
712
|
+
request['size'] = Math.min(limit, 200);
|
|
713
713
|
}
|
|
714
714
|
const response = await this.v2PublicGetTradesQuoteCurrencyTargetCurrency(this.extend(request, params));
|
|
715
715
|
//
|
package/dist/cjs/js/src/delta.js
CHANGED
|
@@ -2071,7 +2071,13 @@ class delta extends delta$1 {
|
|
|
2071
2071
|
if (limit !== undefined) {
|
|
2072
2072
|
request['page_size'] = limit;
|
|
2073
2073
|
}
|
|
2074
|
-
|
|
2074
|
+
let response = undefined;
|
|
2075
|
+
if (method === 'privateGetOrders') {
|
|
2076
|
+
response = await this.privateGetOrders(this.extend(request, params));
|
|
2077
|
+
}
|
|
2078
|
+
else if (method === 'privateGetOrdersHistory') {
|
|
2079
|
+
response = await this.privateGetOrdersHistory(this.extend(request, params));
|
|
2080
|
+
}
|
|
2075
2081
|
//
|
|
2076
2082
|
// {
|
|
2077
2083
|
// "success": true,
|
|
@@ -36,11 +36,11 @@ class deribit extends deribit$1 {
|
|
|
36
36
|
'cancelOrder': true,
|
|
37
37
|
'cancelOrders': false,
|
|
38
38
|
'createDepositAddress': true,
|
|
39
|
-
'createTrailingAmountOrder': true,
|
|
40
39
|
'createOrder': true,
|
|
41
40
|
'createStopLimitOrder': true,
|
|
42
41
|
'createStopMarketOrder': true,
|
|
43
42
|
'createStopOrder': true,
|
|
43
|
+
'createTrailingAmountOrder': true,
|
|
44
44
|
'editOrder': true,
|
|
45
45
|
'fetchAccounts': true,
|
|
46
46
|
'fetchBalance': true,
|
package/dist/cjs/js/src/gate.js
CHANGED
|
@@ -90,6 +90,9 @@ class gate extends gate$1 {
|
|
|
90
90
|
'createReduceOnlyOrder': true,
|
|
91
91
|
'createStopLimitOrder': true,
|
|
92
92
|
'createStopMarketOrder': false,
|
|
93
|
+
'createTriggerOrder': true,
|
|
94
|
+
'createTakeProfitOrder': true,
|
|
95
|
+
'createStopLossOrder': true,
|
|
93
96
|
'createStopOrder': true,
|
|
94
97
|
'editOrder': true,
|
|
95
98
|
'fetchBalance': true,
|
|
@@ -3120,7 +3123,7 @@ class gate extends gate$1 {
|
|
|
3120
3123
|
request['to'] = this.parseToInt(until / 1000);
|
|
3121
3124
|
}
|
|
3122
3125
|
if (limit !== undefined) {
|
|
3123
|
-
request['limit'] = limit; // default 100, max 1000
|
|
3126
|
+
request['limit'] = Math.min(limit, 1000); // default 100, max 1000
|
|
3124
3127
|
}
|
|
3125
3128
|
if (since !== undefined && (market['contract'])) {
|
|
3126
3129
|
request['from'] = this.parseToInt(since / 1000);
|
|
@@ -3766,6 +3769,8 @@ class gate extends gate$1 {
|
|
|
3766
3769
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3767
3770
|
* @param {float} [params.stopPrice] The price at which a trigger order is triggered at
|
|
3768
3771
|
* @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
|
|
3772
|
+
* @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
|
|
3773
|
+
* @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
|
|
3769
3774
|
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
|
|
3770
3775
|
* @param {int} [params.iceberg] Amount to display for the iceberg order, Null or 0 for normal orders, Set to -1 to hide the order completely
|
|
3771
3776
|
* @param {string} [params.text] User defined information
|
|
@@ -5260,29 +5265,35 @@ class gate extends gate$1 {
|
|
|
5260
5265
|
// swap and future
|
|
5261
5266
|
//
|
|
5262
5267
|
// {
|
|
5263
|
-
// "value": "
|
|
5268
|
+
// "value": "4.60516",
|
|
5264
5269
|
// "leverage": "0",
|
|
5265
5270
|
// "mode": "single",
|
|
5266
5271
|
// "realised_point": "0",
|
|
5267
5272
|
// "contract": "BTC_USDT",
|
|
5268
|
-
// "entry_price": "
|
|
5269
|
-
// "mark_price": "
|
|
5273
|
+
// "entry_price": "46030.3",
|
|
5274
|
+
// "mark_price": "46051.6",
|
|
5270
5275
|
// "history_point": "0",
|
|
5271
|
-
// "realised_pnl": "-0.
|
|
5272
|
-
// "close_order":
|
|
5273
|
-
// "size":
|
|
5274
|
-
// "cross_leverage_limit": "
|
|
5275
|
-
// "pending_orders":
|
|
5276
|
-
// "adl_ranking":
|
|
5277
|
-
// "maintenance_rate": "0.
|
|
5278
|
-
// "unrealised_pnl": "
|
|
5279
|
-
// "user":
|
|
5280
|
-
// "leverage_max": "
|
|
5281
|
-
// "history_pnl": "
|
|
5276
|
+
// "realised_pnl": "-0.002301515",
|
|
5277
|
+
// "close_order": null,
|
|
5278
|
+
// "size": 1,
|
|
5279
|
+
// "cross_leverage_limit": "0",
|
|
5280
|
+
// "pending_orders": 0,
|
|
5281
|
+
// "adl_ranking": 5,
|
|
5282
|
+
// "maintenance_rate": "0.004",
|
|
5283
|
+
// "unrealised_pnl": "0.00213",
|
|
5284
|
+
// "user": 5691076,
|
|
5285
|
+
// "leverage_max": "125",
|
|
5286
|
+
// "history_pnl": "0",
|
|
5282
5287
|
// "risk_limit": "1000000",
|
|
5283
|
-
// "margin": "
|
|
5284
|
-
// "last_close_pnl": "
|
|
5285
|
-
// "liq_price": "
|
|
5288
|
+
// "margin": "8.997698485",
|
|
5289
|
+
// "last_close_pnl": "0",
|
|
5290
|
+
// "liq_price": "0",
|
|
5291
|
+
// "update_time": 1705034246,
|
|
5292
|
+
// "update_id": 1,
|
|
5293
|
+
// "initial_margin": "0",
|
|
5294
|
+
// "maintenance_margin": "0",
|
|
5295
|
+
// "open_time": 1705034246,
|
|
5296
|
+
// "trade_max_size": "0"
|
|
5286
5297
|
// }
|
|
5287
5298
|
//
|
|
5288
5299
|
// option
|
|
@@ -5333,14 +5344,14 @@ class gate extends gate$1 {
|
|
|
5333
5344
|
const takerFee = '0.00075';
|
|
5334
5345
|
const feePaid = Precise["default"].stringMul(takerFee, notional);
|
|
5335
5346
|
const initialMarginString = Precise["default"].stringAdd(Precise["default"].stringDiv(notional, leverage), feePaid);
|
|
5336
|
-
const timestamp = this.
|
|
5347
|
+
const timestamp = this.safeTimestamp(position, 'open_time');
|
|
5337
5348
|
return this.safePosition({
|
|
5338
5349
|
'info': position,
|
|
5339
5350
|
'id': undefined,
|
|
5340
5351
|
'symbol': this.safeString(market, 'symbol'),
|
|
5341
|
-
'timestamp':
|
|
5342
|
-
'datetime':
|
|
5343
|
-
'lastUpdateTimestamp':
|
|
5352
|
+
'timestamp': timestamp,
|
|
5353
|
+
'datetime': this.iso8601(timestamp),
|
|
5354
|
+
'lastUpdateTimestamp': this.safeTimestamp(position, 'update_time'),
|
|
5344
5355
|
'initialMargin': this.parseNumber(initialMarginString),
|
|
5345
5356
|
'initialMarginPercentage': this.parseNumber(Precise["default"].stringDiv(initialMarginString, notional)),
|
|
5346
5357
|
'maintenanceMargin': this.parseNumber(Precise["default"].stringMul(maintenanceRate, notional)),
|
|
@@ -5399,29 +5410,35 @@ class gate extends gate$1 {
|
|
|
5399
5410
|
// swap and future
|
|
5400
5411
|
//
|
|
5401
5412
|
// {
|
|
5402
|
-
// "value": "
|
|
5413
|
+
// "value": "4.60516",
|
|
5403
5414
|
// "leverage": "0",
|
|
5404
5415
|
// "mode": "single",
|
|
5405
5416
|
// "realised_point": "0",
|
|
5406
5417
|
// "contract": "BTC_USDT",
|
|
5407
|
-
// "entry_price": "
|
|
5408
|
-
// "mark_price": "
|
|
5418
|
+
// "entry_price": "46030.3",
|
|
5419
|
+
// "mark_price": "46051.6",
|
|
5409
5420
|
// "history_point": "0",
|
|
5410
|
-
// "realised_pnl": "-0.
|
|
5411
|
-
// "close_order":
|
|
5412
|
-
// "size":
|
|
5413
|
-
// "cross_leverage_limit": "
|
|
5414
|
-
// "pending_orders":
|
|
5415
|
-
// "adl_ranking":
|
|
5416
|
-
// "maintenance_rate": "0.
|
|
5417
|
-
// "unrealised_pnl": "
|
|
5418
|
-
// "user":
|
|
5419
|
-
// "leverage_max": "
|
|
5420
|
-
// "history_pnl": "
|
|
5421
|
+
// "realised_pnl": "-0.002301515",
|
|
5422
|
+
// "close_order": null,
|
|
5423
|
+
// "size": 1,
|
|
5424
|
+
// "cross_leverage_limit": "0",
|
|
5425
|
+
// "pending_orders": 0,
|
|
5426
|
+
// "adl_ranking": 5,
|
|
5427
|
+
// "maintenance_rate": "0.004",
|
|
5428
|
+
// "unrealised_pnl": "0.00213",
|
|
5429
|
+
// "user": 5691076,
|
|
5430
|
+
// "leverage_max": "125",
|
|
5431
|
+
// "history_pnl": "0",
|
|
5421
5432
|
// "risk_limit": "1000000",
|
|
5422
|
-
// "margin": "
|
|
5423
|
-
// "last_close_pnl": "
|
|
5424
|
-
// "liq_price": "
|
|
5433
|
+
// "margin": "8.997698485",
|
|
5434
|
+
// "last_close_pnl": "0",
|
|
5435
|
+
// "liq_price": "0",
|
|
5436
|
+
// "update_time": 1705034246,
|
|
5437
|
+
// "update_id": 1,
|
|
5438
|
+
// "initial_margin": "0",
|
|
5439
|
+
// "maintenance_margin": "0",
|
|
5440
|
+
// "open_time": 1705034246,
|
|
5441
|
+
// "trade_max_size": "0"
|
|
5425
5442
|
// }
|
|
5426
5443
|
//
|
|
5427
5444
|
// option
|
|
@@ -5501,29 +5518,35 @@ class gate extends gate$1 {
|
|
|
5501
5518
|
//
|
|
5502
5519
|
// [
|
|
5503
5520
|
// {
|
|
5504
|
-
// "value": "
|
|
5521
|
+
// "value": "4.602828",
|
|
5505
5522
|
// "leverage": "0",
|
|
5506
5523
|
// "mode": "single",
|
|
5507
5524
|
// "realised_point": "0",
|
|
5508
5525
|
// "contract": "BTC_USDT",
|
|
5509
|
-
// "entry_price": "
|
|
5510
|
-
// "mark_price": "
|
|
5526
|
+
// "entry_price": "46030.3",
|
|
5527
|
+
// "mark_price": "46028.28",
|
|
5511
5528
|
// "history_point": "0",
|
|
5512
|
-
// "realised_pnl": "-0.
|
|
5513
|
-
// "close_order":
|
|
5514
|
-
// "size":
|
|
5515
|
-
// "cross_leverage_limit": "
|
|
5516
|
-
// "pending_orders":
|
|
5517
|
-
// "adl_ranking":
|
|
5518
|
-
// "maintenance_rate": "0.
|
|
5519
|
-
// "unrealised_pnl": "-0.
|
|
5520
|
-
// "user":
|
|
5521
|
-
// "leverage_max": "
|
|
5522
|
-
// "history_pnl": "
|
|
5529
|
+
// "realised_pnl": "-0.002301515",
|
|
5530
|
+
// "close_order": null,
|
|
5531
|
+
// "size": 1,
|
|
5532
|
+
// "cross_leverage_limit": "0",
|
|
5533
|
+
// "pending_orders": 0,
|
|
5534
|
+
// "adl_ranking": 5,
|
|
5535
|
+
// "maintenance_rate": "0.004",
|
|
5536
|
+
// "unrealised_pnl": "-0.000202",
|
|
5537
|
+
// "user": 5691076,
|
|
5538
|
+
// "leverage_max": "125",
|
|
5539
|
+
// "history_pnl": "0",
|
|
5523
5540
|
// "risk_limit": "1000000",
|
|
5524
|
-
// "margin": "
|
|
5525
|
-
// "last_close_pnl": "
|
|
5526
|
-
// "liq_price": "
|
|
5541
|
+
// "margin": "8.997698485",
|
|
5542
|
+
// "last_close_pnl": "0",
|
|
5543
|
+
// "liq_price": "0",
|
|
5544
|
+
// "update_time": 1705034246,
|
|
5545
|
+
// "update_id": 1,
|
|
5546
|
+
// "initial_margin": "0",
|
|
5547
|
+
// "maintenance_margin": "0",
|
|
5548
|
+
// "open_time": 1705034246,
|
|
5549
|
+
// "trade_max_size": "0"
|
|
5527
5550
|
// }
|
|
5528
5551
|
// ]
|
|
5529
5552
|
//
|
|
@@ -951,7 +951,7 @@ class gemini extends gemini$1 {
|
|
|
951
951
|
'symbol': market['id'],
|
|
952
952
|
};
|
|
953
953
|
if (limit !== undefined) {
|
|
954
|
-
request['limit_trades'] = limit;
|
|
954
|
+
request['limit_trades'] = Math.min(limit, 500);
|
|
955
955
|
}
|
|
956
956
|
if (since !== undefined) {
|
|
957
957
|
request['timestamp'] = since;
|