ccxt 4.4.26 → 4.4.28
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 +133 -132
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +1 -1
- package/dist/cjs/src/alpaca.js +198 -5
- package/dist/cjs/src/ascendex.js +1 -1
- package/dist/cjs/src/base/Exchange.js +18 -0
- package/dist/cjs/src/bequant.js +1 -1
- package/dist/cjs/src/bigone.js +1 -1
- package/dist/cjs/src/binance.js +8 -1
- package/dist/cjs/src/binancecoinm.js +1 -1
- package/dist/cjs/src/binanceus.js +1 -1
- package/dist/cjs/src/binanceusdm.js +1 -1
- package/dist/cjs/src/bingx.js +25 -36
- package/dist/cjs/src/bit2c.js +1 -1
- package/dist/cjs/src/bitbank.js +1 -1
- package/dist/cjs/src/bitbns.js +1 -1
- package/dist/cjs/src/bitfinex.js +1 -1
- package/dist/cjs/src/bitfinex2.js +1 -1
- package/dist/cjs/src/bitflyer.js +1 -1
- package/dist/cjs/src/bitget.js +1 -1
- package/dist/cjs/src/bithumb.js +1 -1
- package/dist/cjs/src/bitmart.js +1 -1
- package/dist/cjs/src/bitmex.js +1 -1
- package/dist/cjs/src/bitopro.js +1 -1
- package/dist/cjs/src/bitrue.js +1 -1
- package/dist/cjs/src/bitso.js +1 -1
- package/dist/cjs/src/bitstamp.js +1 -1
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/bitvavo.js +1 -1
- package/dist/cjs/src/bl3p.js +1 -1
- package/dist/cjs/src/blockchaincom.js +1 -1
- package/dist/cjs/src/blofin.js +1 -1
- package/dist/cjs/src/btcalpha.js +1 -1
- package/dist/cjs/src/btcbox.js +1 -1
- package/dist/cjs/src/btcmarkets.js +1 -1
- package/dist/cjs/src/btcturk.js +1 -1
- package/dist/cjs/src/bybit.js +5 -1
- package/dist/cjs/src/coinbase.js +97 -11
- package/dist/cjs/src/coinex.js +1 -1
- package/dist/cjs/src/gate.js +22 -16
- package/dist/cjs/src/hyperliquid.js +21 -1
- package/dist/cjs/src/kraken.js +48 -35
- package/dist/cjs/src/lbank.js +100 -1
- package/dist/cjs/src/pro/binance.js +5 -7
- package/dist/cjs/src/pro/lbank.js +9 -4
- package/dist/cjs/src/wavesexchange.js +14 -2
- package/examples/js/cli.js +23 -3
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/alpaca.d.ts +2 -0
- package/js/src/abstract/binance.d.ts +7 -0
- package/js/src/abstract/binancecoinm.d.ts +7 -0
- package/js/src/abstract/binanceus.d.ts +7 -0
- package/js/src/abstract/binanceusdm.d.ts +7 -0
- package/js/src/ace.js +1 -1
- package/js/src/alpaca.d.ts +9 -1
- package/js/src/alpaca.js +198 -5
- package/js/src/ascendex.js +1 -1
- package/js/src/base/Exchange.d.ts +6 -0
- package/js/src/base/Exchange.js +18 -0
- package/js/src/bequant.js +1 -1
- package/js/src/bigone.js +1 -1
- package/js/src/binance.js +8 -1
- package/js/src/binancecoinm.js +1 -1
- package/js/src/binanceus.js +1 -1
- package/js/src/binanceusdm.js +1 -1
- package/js/src/bingx.js +25 -36
- package/js/src/bit2c.js +1 -1
- package/js/src/bitbank.js +1 -1
- package/js/src/bitbns.js +1 -1
- package/js/src/bitfinex.js +1 -1
- package/js/src/bitfinex2.js +1 -1
- package/js/src/bitflyer.js +1 -1
- package/js/src/bitget.js +1 -1
- package/js/src/bithumb.js +1 -1
- package/js/src/bitmart.js +1 -1
- package/js/src/bitmex.js +1 -1
- package/js/src/bitopro.js +1 -1
- package/js/src/bitrue.js +1 -1
- package/js/src/bitso.js +1 -1
- package/js/src/bitstamp.js +1 -1
- package/js/src/bitteam.js +1 -1
- package/js/src/bitvavo.js +1 -1
- package/js/src/bl3p.js +1 -1
- package/js/src/blockchaincom.js +1 -1
- package/js/src/blofin.js +1 -1
- package/js/src/btcalpha.js +1 -1
- package/js/src/btcbox.js +1 -1
- package/js/src/btcmarkets.js +1 -1
- package/js/src/btcturk.js +1 -1
- package/js/src/bybit.js +5 -1
- package/js/src/coinbase.d.ts +1 -0
- package/js/src/coinbase.js +97 -11
- package/js/src/coinex.js +1 -1
- package/js/src/gate.js +22 -16
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +21 -1
- package/js/src/kraken.js +48 -35
- package/js/src/lbank.d.ts +4 -1
- package/js/src/lbank.js +100 -1
- package/js/src/pro/binance.js +5 -7
- package/js/src/pro/lbank.js +9 -4
- package/js/src/wavesexchange.js +14 -2
- package/package.json +1 -1
package/dist/cjs/src/bitopro.js
CHANGED
|
@@ -104,7 +104,7 @@ class bitopro extends bitopro$1 {
|
|
|
104
104
|
'1M': '1M',
|
|
105
105
|
},
|
|
106
106
|
'urls': {
|
|
107
|
-
'logo': 'https://
|
|
107
|
+
'logo': 'https://github.com/user-attachments/assets/affc6337-b95a-44bf-aacd-04f9722364f6',
|
|
108
108
|
'api': {
|
|
109
109
|
'rest': 'https://api.bitopro.com/v3',
|
|
110
110
|
},
|
package/dist/cjs/src/bitrue.js
CHANGED
|
@@ -95,7 +95,7 @@ class bitrue extends bitrue$1 {
|
|
|
95
95
|
'1w': '1W',
|
|
96
96
|
},
|
|
97
97
|
'urls': {
|
|
98
|
-
'logo': 'https://
|
|
98
|
+
'logo': 'https://github.com/user-attachments/assets/67abe346-1273-461a-bd7c-42fa32907c8e',
|
|
99
99
|
'api': {
|
|
100
100
|
'spot': 'https://www.bitrue.com/api',
|
|
101
101
|
'fapi': 'https://fapi.bitrue.com/fapi',
|
package/dist/cjs/src/bitso.js
CHANGED
|
@@ -96,7 +96,7 @@ class bitso extends bitso$1 {
|
|
|
96
96
|
'withdraw': true,
|
|
97
97
|
},
|
|
98
98
|
'urls': {
|
|
99
|
-
'logo': 'https://
|
|
99
|
+
'logo': 'https://github.com/user-attachments/assets/178c8e56-9054-4107-b192-5e5053d4f975',
|
|
100
100
|
'api': {
|
|
101
101
|
'rest': 'https://bitso.com/api',
|
|
102
102
|
},
|
package/dist/cjs/src/bitstamp.js
CHANGED
|
@@ -94,7 +94,7 @@ class bitstamp extends bitstamp$1 {
|
|
|
94
94
|
'withdraw': true,
|
|
95
95
|
},
|
|
96
96
|
'urls': {
|
|
97
|
-
'logo': 'https://
|
|
97
|
+
'logo': 'https://github.com/user-attachments/assets/d5480572-1fee-43cb-b900-d38c522d0024',
|
|
98
98
|
'api': {
|
|
99
99
|
'public': 'https://www.bitstamp.net/api',
|
|
100
100
|
'private': 'https://www.bitstamp.net/api',
|
package/dist/cjs/src/bitteam.js
CHANGED
|
@@ -128,7 +128,7 @@ class bitteam extends bitteam$1 {
|
|
|
128
128
|
'1d': '1D',
|
|
129
129
|
},
|
|
130
130
|
'urls': {
|
|
131
|
-
'logo': 'https://github.com/
|
|
131
|
+
'logo': 'https://github.com/user-attachments/assets/b41b5e0d-98e5-4bd3-8a6e-aeb230a4a135',
|
|
132
132
|
'api': {
|
|
133
133
|
'history': 'https://history.bit.team',
|
|
134
134
|
'public': 'https://bit.team',
|
package/dist/cjs/src/bitvavo.js
CHANGED
|
@@ -109,7 +109,7 @@ class bitvavo extends bitvavo$1 {
|
|
|
109
109
|
'1d': '1d',
|
|
110
110
|
},
|
|
111
111
|
'urls': {
|
|
112
|
-
'logo': 'https://
|
|
112
|
+
'logo': 'https://github.com/user-attachments/assets/d213155c-8c71-4701-9bd5-45351febc2a8',
|
|
113
113
|
'api': {
|
|
114
114
|
'public': 'https://api.bitvavo.com',
|
|
115
115
|
'private': 'https://api.bitvavo.com',
|
package/dist/cjs/src/bl3p.js
CHANGED
|
@@ -80,7 +80,7 @@ class bl3p extends bl3p$1 {
|
|
|
80
80
|
'ws': false,
|
|
81
81
|
},
|
|
82
82
|
'urls': {
|
|
83
|
-
'logo': 'https://
|
|
83
|
+
'logo': 'https://github.com/user-attachments/assets/75aeb14e-cd48-43c8-8492-dff002dea0be',
|
|
84
84
|
'api': {
|
|
85
85
|
'rest': 'https://api.bl3p.eu',
|
|
86
86
|
},
|
|
@@ -76,7 +76,7 @@ class blockchaincom extends blockchaincom$1 {
|
|
|
76
76
|
},
|
|
77
77
|
'timeframes': undefined,
|
|
78
78
|
'urls': {
|
|
79
|
-
'logo': 'https://
|
|
79
|
+
'logo': 'https://github.com/user-attachments/assets/975e3054-3399-4363-bcee-ec3c6d63d4e8',
|
|
80
80
|
'test': {
|
|
81
81
|
'public': 'https://testnet-api.delta.exchange',
|
|
82
82
|
'private': 'https://testnet-api.delta.exchange',
|
package/dist/cjs/src/blofin.js
CHANGED
|
@@ -153,7 +153,7 @@ class blofin extends blofin$1 {
|
|
|
153
153
|
},
|
|
154
154
|
'hostname': 'www.blofin.com',
|
|
155
155
|
'urls': {
|
|
156
|
-
'logo': 'https://github.com/
|
|
156
|
+
'logo': 'https://github.com/user-attachments/assets/518cdf80-f05d-4821-a3e3-d48ceb41d73b',
|
|
157
157
|
'api': {
|
|
158
158
|
'rest': 'https://openapi.blofin.com',
|
|
159
159
|
},
|
package/dist/cjs/src/btcalpha.js
CHANGED
|
@@ -99,7 +99,7 @@ class btcalpha extends btcalpha$1 {
|
|
|
99
99
|
'1d': 'D',
|
|
100
100
|
},
|
|
101
101
|
'urls': {
|
|
102
|
-
'logo': 'https://
|
|
102
|
+
'logo': 'https://github.com/user-attachments/assets/dce49f3a-61e5-4ba0-a2fe-41d192fd0e5d',
|
|
103
103
|
'api': {
|
|
104
104
|
'rest': 'https://btc-alpha.com/api',
|
|
105
105
|
},
|
package/dist/cjs/src/btcbox.js
CHANGED
|
@@ -79,7 +79,7 @@ class btcbox extends btcbox$1 {
|
|
|
79
79
|
'ws': false,
|
|
80
80
|
},
|
|
81
81
|
'urls': {
|
|
82
|
-
'logo': 'https://
|
|
82
|
+
'logo': 'https://github.com/user-attachments/assets/1e2cb499-8d0f-4f8f-9464-3c015cfbc76b',
|
|
83
83
|
'api': {
|
|
84
84
|
'rest': 'https://www.btcbox.co.jp/api',
|
|
85
85
|
},
|
|
@@ -84,7 +84,7 @@ class btcmarkets extends btcmarkets$1 {
|
|
|
84
84
|
'withdraw': true,
|
|
85
85
|
},
|
|
86
86
|
'urls': {
|
|
87
|
-
'logo': 'https://
|
|
87
|
+
'logo': 'https://github.com/user-attachments/assets/8c8d6907-3873-4cc4-ad20-e22fba28247e',
|
|
88
88
|
'api': {
|
|
89
89
|
'public': 'https://api.btcmarkets.net',
|
|
90
90
|
'private': 'https://api.btcmarkets.net',
|
package/dist/cjs/src/btcturk.js
CHANGED
|
@@ -87,7 +87,7 @@ class btcturk extends btcturk$1 {
|
|
|
87
87
|
'1y': '1 y',
|
|
88
88
|
},
|
|
89
89
|
'urls': {
|
|
90
|
-
'logo': 'https://
|
|
90
|
+
'logo': 'https://github.com/user-attachments/assets/10e0a238-9f60-4b06-9dda-edfc7602f1d6',
|
|
91
91
|
'api': {
|
|
92
92
|
'public': 'https://api.btcturk.com/api/v2',
|
|
93
93
|
'private': 'https://api.btcturk.com/api/v1',
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -157,7 +157,7 @@ class bybit extends bybit$1 {
|
|
|
157
157
|
'public': 'https://api-testnet.{hostname}',
|
|
158
158
|
'private': 'https://api-testnet.{hostname}',
|
|
159
159
|
},
|
|
160
|
-
'logo': 'https://
|
|
160
|
+
'logo': 'https://github.com/user-attachments/assets/97a5d0b3-de10-423d-90e1-6620960025ed',
|
|
161
161
|
'api': {
|
|
162
162
|
'spot': 'https://api.{hostname}',
|
|
163
163
|
'futures': 'https://api.{hostname}',
|
|
@@ -2583,6 +2583,10 @@ class bybit extends bybit$1 {
|
|
|
2583
2583
|
//
|
|
2584
2584
|
const data = this.safeDict(response, 'result', {});
|
|
2585
2585
|
const tickerList = this.safeList(data, 'list', []);
|
|
2586
|
+
const timestamp = this.safeInteger(response, 'time');
|
|
2587
|
+
for (let i = 0; i < tickerList.length; i++) {
|
|
2588
|
+
tickerList[i]['timestamp'] = timestamp; // will be removed inside the parser
|
|
2589
|
+
}
|
|
2586
2590
|
const result = this.parseFundingRates(tickerList);
|
|
2587
2591
|
return this.filterByArray(result, 'symbol', symbols);
|
|
2588
2592
|
}
|
package/dist/cjs/src/coinbase.js
CHANGED
|
@@ -79,6 +79,7 @@ class coinbase extends coinbase$1 {
|
|
|
79
79
|
'fetchDepositAddresses': false,
|
|
80
80
|
'fetchDepositAddressesByNetwork': true,
|
|
81
81
|
'fetchDeposits': true,
|
|
82
|
+
'fetchDepositsWithdrawals': true,
|
|
82
83
|
'fetchFundingHistory': false,
|
|
83
84
|
'fetchFundingRate': false,
|
|
84
85
|
'fetchFundingRateHistory': false,
|
|
@@ -773,8 +774,15 @@ class coinbase extends coinbase$1 {
|
|
|
773
774
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
774
775
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
775
776
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
777
|
+
* @param {string} [params.currencyType] "fiat" or "crypto"
|
|
776
778
|
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
777
779
|
*/
|
|
780
|
+
let currencyType = undefined;
|
|
781
|
+
[currencyType, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'currencyType');
|
|
782
|
+
if (currencyType === 'crypto') {
|
|
783
|
+
const results = await this.fetchTransactionsWithMethod('v2PrivateGetAccountsAccountIdTransactions', code, since, limit, params);
|
|
784
|
+
return this.filterByArray(results, 'type', 'withdrawal', false);
|
|
785
|
+
}
|
|
778
786
|
return await this.fetchTransactionsWithMethod('v2PrivateGetAccountsAccountIdWithdrawals', code, since, limit, params);
|
|
779
787
|
}
|
|
780
788
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -787,10 +795,33 @@ class coinbase extends coinbase$1 {
|
|
|
787
795
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
788
796
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
789
797
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
798
|
+
* @param {string} [params.currencyType] "fiat" or "crypto"
|
|
790
799
|
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
791
800
|
*/
|
|
801
|
+
let currencyType = undefined;
|
|
802
|
+
[currencyType, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'currencyType');
|
|
803
|
+
if (currencyType === 'crypto') {
|
|
804
|
+
const results = await this.fetchTransactionsWithMethod('v2PrivateGetAccountsAccountIdTransactions', code, since, limit, params);
|
|
805
|
+
return this.filterByArray(results, 'type', 'deposit', false);
|
|
806
|
+
}
|
|
792
807
|
return await this.fetchTransactionsWithMethod('v2PrivateGetAccountsAccountIdDeposits', code, since, limit, params);
|
|
793
808
|
}
|
|
809
|
+
async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
810
|
+
/**
|
|
811
|
+
* @method
|
|
812
|
+
* @name coinbase#fetchDepositsWithdrawals
|
|
813
|
+
* @description fetch history of deposits and withdrawals
|
|
814
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/docs/api-transactions
|
|
815
|
+
* @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
|
|
816
|
+
* @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
|
|
817
|
+
* @param {int} [limit] max number of deposit/withdrawals to return, default = 50, Min: 1, Max: 100
|
|
818
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
819
|
+
* @returns {object} a list of [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
820
|
+
*/
|
|
821
|
+
await this.loadMarkets();
|
|
822
|
+
const results = await this.fetchTransactionsWithMethod('v2PrivateGetAccountsAccountIdTransactions', code, since, limit, params);
|
|
823
|
+
return this.filterByArray(results, 'type', ['deposit', 'withdrawal'], false);
|
|
824
|
+
}
|
|
794
825
|
parseTransactionStatus(status) {
|
|
795
826
|
const statuses = {
|
|
796
827
|
'created': 'pending',
|
|
@@ -914,18 +945,62 @@ class coinbase extends coinbase$1 {
|
|
|
914
945
|
// "hide_native_amount": false
|
|
915
946
|
// }
|
|
916
947
|
//
|
|
948
|
+
//
|
|
949
|
+
// crypto deposit & withdrawal (using `/transactions` endpoint)
|
|
950
|
+
// {
|
|
951
|
+
// "amount": {
|
|
952
|
+
// "amount": "0.00014200", (negative for withdrawal)
|
|
953
|
+
// "currency": "BTC"
|
|
954
|
+
// },
|
|
955
|
+
// "created_at": "2024-03-29T15:48:30Z",
|
|
956
|
+
// "id": "0031a605-241d-514d-a97b-d4b99f3225d3",
|
|
957
|
+
// "idem": "092a979b-017e-4403-940a-2ca57811f442", // field present only in case of withdrawal
|
|
958
|
+
// "native_amount": {
|
|
959
|
+
// "amount": "9.85", (negative for withdrawal)
|
|
960
|
+
// "currency": "USD"
|
|
961
|
+
// },
|
|
962
|
+
// "network": {
|
|
963
|
+
// "status": "pending", // if status is `off_blockchain` then no more other fields are present in this object
|
|
964
|
+
// "hash": "5jYuvrNsvX2DZoMnzGYzVpYxJLfYu4GSK3xetG1H5LHrSovsuFCFYdFMwNRoiht3s6fBk92MM8QLLnz65xuEFTrE",
|
|
965
|
+
// "network_name": "solana",
|
|
966
|
+
// "transaction_fee": {
|
|
967
|
+
// "amount": "0.000100000",
|
|
968
|
+
// "currency": "SOL"
|
|
969
|
+
// }
|
|
970
|
+
// },
|
|
971
|
+
// "resource": "transaction",
|
|
972
|
+
// "resource_path": "/v2/accounts/dc504b1c-248e-5b68-a3b0-b991f7fa84e6/transactions/0031a605-241d-514d-a97b-d4b99f3225d3",
|
|
973
|
+
// "status": "completed",
|
|
974
|
+
// "type": "send",
|
|
975
|
+
// "from": { // in some cases, field might be present for deposit
|
|
976
|
+
// "id": "7fd10cd7-b091-5cee-ba41-c29e49a7cccf",
|
|
977
|
+
// "name": "Coinbase",
|
|
978
|
+
// "resource": "user"
|
|
979
|
+
// },
|
|
980
|
+
// "to": { // field only present for withdrawal
|
|
981
|
+
// "address": "5HA12BNthAvBwNYARYf9y5MqqCpB4qhCNFCs1Qw48ACE",
|
|
982
|
+
// "resource": "address"
|
|
983
|
+
// },
|
|
984
|
+
// "description": "C3 - One Time BTC Credit . Reference Case # 123.", // in some cases, field might be present for deposit
|
|
985
|
+
// }
|
|
986
|
+
//
|
|
917
987
|
const transactionType = this.safeString(transaction, 'type');
|
|
918
988
|
let amountAndCurrencyObject = undefined;
|
|
919
989
|
let feeObject = undefined;
|
|
990
|
+
const network = this.safeDict(transaction, 'network', {});
|
|
920
991
|
if (transactionType === 'send') {
|
|
921
|
-
|
|
922
|
-
amountAndCurrencyObject = this.safeDict(network, 'transaction_amount', {});
|
|
992
|
+
amountAndCurrencyObject = this.safeDict(network, 'transaction_amount');
|
|
923
993
|
feeObject = this.safeDict(network, 'transaction_fee', {});
|
|
924
994
|
}
|
|
925
995
|
else {
|
|
926
|
-
amountAndCurrencyObject = this.safeDict(transaction, 'subtotal'
|
|
996
|
+
amountAndCurrencyObject = this.safeDict(transaction, 'subtotal');
|
|
927
997
|
feeObject = this.safeDict(transaction, 'fee', {});
|
|
928
998
|
}
|
|
999
|
+
if (amountAndCurrencyObject === undefined) {
|
|
1000
|
+
amountAndCurrencyObject = this.safeDict(transaction, 'amount');
|
|
1001
|
+
}
|
|
1002
|
+
const amountString = this.safeString(amountAndCurrencyObject, 'amount');
|
|
1003
|
+
const amountStringAbs = Precise["default"].stringAbs(amountString);
|
|
929
1004
|
let status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
|
|
930
1005
|
if (status === undefined) {
|
|
931
1006
|
const committed = this.safeBool(transaction, 'committed');
|
|
@@ -935,23 +1010,34 @@ class coinbase extends coinbase$1 {
|
|
|
935
1010
|
const currencyId = this.safeString(amountAndCurrencyObject, 'currency');
|
|
936
1011
|
const feeCurrencyId = this.safeString(feeObject, 'currency');
|
|
937
1012
|
const datetime = this.safeString(transaction, 'created_at');
|
|
938
|
-
const
|
|
939
|
-
|
|
1013
|
+
const resource = this.safeString(transaction, 'resource');
|
|
1014
|
+
let type = resource;
|
|
1015
|
+
if (!this.inArray(type, ['deposit', 'withdrawal'])) {
|
|
1016
|
+
if (Precise["default"].stringGt(amountString, '0')) {
|
|
1017
|
+
type = 'deposit';
|
|
1018
|
+
}
|
|
1019
|
+
else if (Precise["default"].stringLt(amountString, '0')) {
|
|
1020
|
+
type = 'withdrawal';
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
const toObject = this.safeDict(transaction, 'to');
|
|
1024
|
+
const addressTo = this.safeString(toObject, 'address');
|
|
1025
|
+
const networkId = this.safeString(network, 'network_name');
|
|
940
1026
|
return {
|
|
941
1027
|
'info': transaction,
|
|
942
1028
|
'id': id,
|
|
943
|
-
'txid': id,
|
|
1029
|
+
'txid': this.safeString(network, 'hash', id),
|
|
944
1030
|
'timestamp': this.parse8601(datetime),
|
|
945
1031
|
'datetime': datetime,
|
|
946
|
-
'network':
|
|
947
|
-
'address':
|
|
948
|
-
'addressTo':
|
|
1032
|
+
'network': this.networkIdToCode(networkId),
|
|
1033
|
+
'address': addressTo,
|
|
1034
|
+
'addressTo': addressTo,
|
|
949
1035
|
'addressFrom': undefined,
|
|
950
1036
|
'tag': undefined,
|
|
951
1037
|
'tagTo': undefined,
|
|
952
1038
|
'tagFrom': undefined,
|
|
953
|
-
'type':
|
|
954
|
-
'amount': this.
|
|
1039
|
+
'type': type,
|
|
1040
|
+
'amount': this.parseNumber(amountStringAbs),
|
|
955
1041
|
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
956
1042
|
'status': status,
|
|
957
1043
|
'updated': this.parse8601(this.safeString(transaction, 'updated_at')),
|
package/dist/cjs/src/coinex.js
CHANGED
|
@@ -4958,7 +4958,7 @@ class coinex extends coinex$1 {
|
|
|
4958
4958
|
await this.loadMarkets();
|
|
4959
4959
|
const currency = this.currency(code);
|
|
4960
4960
|
const amountToPrecision = this.currencyToPrecision(code, amount);
|
|
4961
|
-
const accountsByType = this.safeDict(this.options, '
|
|
4961
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
4962
4962
|
const fromId = this.safeString(accountsByType, fromAccount, fromAccount);
|
|
4963
4963
|
const toId = this.safeString(accountsByType, toAccount, toAccount);
|
|
4964
4964
|
const request = {
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -906,22 +906,28 @@ class gate extends gate$1 {
|
|
|
906
906
|
*/
|
|
907
907
|
const unifiedAccount = this.safeBool(this.options, 'unifiedAccount');
|
|
908
908
|
if (unifiedAccount === undefined) {
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
909
|
+
try {
|
|
910
|
+
//
|
|
911
|
+
// {
|
|
912
|
+
// "user_id": 10406147,
|
|
913
|
+
// "ip_whitelist": [],
|
|
914
|
+
// "currency_pairs": [],
|
|
915
|
+
// "key": {
|
|
916
|
+
// "mode": 1
|
|
917
|
+
// },
|
|
918
|
+
// "tier": 0,
|
|
919
|
+
// "tier_expire_time": "0001-01-01T00:00:00Z",
|
|
920
|
+
// "copy_trading_role": 0
|
|
921
|
+
// }
|
|
922
|
+
//
|
|
923
|
+
const response = await this.privateAccountGetDetail(params);
|
|
924
|
+
const result = this.safeDict(response, 'key', {});
|
|
925
|
+
this.options['unifiedAccount'] = this.safeInteger(result, 'mode') === 2;
|
|
926
|
+
}
|
|
927
|
+
catch (e) {
|
|
928
|
+
// if the request fails, the unifiedAccount is disabled
|
|
929
|
+
this.options['unifiedAccount'] = false;
|
|
930
|
+
}
|
|
925
931
|
}
|
|
926
932
|
}
|
|
927
933
|
async upgradeUnifiedTradeAccount(params = {}) {
|
|
@@ -150,7 +150,17 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
150
150
|
'api': {
|
|
151
151
|
'public': {
|
|
152
152
|
'post': {
|
|
153
|
-
'info':
|
|
153
|
+
'info': {
|
|
154
|
+
'cost': 20,
|
|
155
|
+
'byType': {
|
|
156
|
+
'l2Book': 2,
|
|
157
|
+
'allMids': 2,
|
|
158
|
+
'clearinghouseState': 2,
|
|
159
|
+
'orderStatus': 2,
|
|
160
|
+
'spotClearinghouseState': 2,
|
|
161
|
+
'exchangeStatus': 2,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
154
164
|
},
|
|
155
165
|
},
|
|
156
166
|
'private': {
|
|
@@ -3028,6 +3038,16 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
3028
3038
|
}
|
|
3029
3039
|
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
3030
3040
|
}
|
|
3041
|
+
calculateRateLimiterCost(api, method, path, params, config = {}) {
|
|
3042
|
+
if (('byType' in config) && ('type' in params)) {
|
|
3043
|
+
const type = params['type'];
|
|
3044
|
+
const byType = config['byType'];
|
|
3045
|
+
if (type in byType) {
|
|
3046
|
+
return byType[type];
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3049
|
+
return this.safeValue(config, 'cost', 1);
|
|
3050
|
+
}
|
|
3031
3051
|
parseCreateOrderArgs(symbol, type, side, amount, price = undefined, params = {}) {
|
|
3032
3052
|
const market = this.market(symbol);
|
|
3033
3053
|
const vaultAddress = this.safeString(params, 'vaultAddress');
|
package/dist/cjs/src/kraken.js
CHANGED
|
@@ -1489,7 +1489,7 @@ class kraken extends kraken$1 {
|
|
|
1489
1489
|
// {
|
|
1490
1490
|
// "error": [],
|
|
1491
1491
|
// "result": {
|
|
1492
|
-
// "descr": { order: 'buy 0.02100000 ETHUSDT @ limit 330.00' },
|
|
1492
|
+
// "descr": { order: 'buy 0.02100000 ETHUSDT @ limit 330.00' }, // see more examples in "parseOrder"
|
|
1493
1493
|
// "txid": [ 'OEKVV2-IH52O-TPL6GZ' ]
|
|
1494
1494
|
// }
|
|
1495
1495
|
// }
|
|
@@ -1555,9 +1555,10 @@ class kraken extends kraken$1 {
|
|
|
1555
1555
|
}
|
|
1556
1556
|
parseOrderType(status) {
|
|
1557
1557
|
const statuses = {
|
|
1558
|
+
// we dont add "space" delimited orders here (eg. stop loss) because they need separate parsing
|
|
1558
1559
|
'take-profit': 'market',
|
|
1559
|
-
'stop-loss-limit': 'limit',
|
|
1560
1560
|
'stop-loss': 'market',
|
|
1561
|
+
'stop-loss-limit': 'limit',
|
|
1561
1562
|
'take-profit-limit': 'limit',
|
|
1562
1563
|
'trailing-stop-limit': 'limit',
|
|
1563
1564
|
};
|
|
@@ -1565,30 +1566,19 @@ class kraken extends kraken$1 {
|
|
|
1565
1566
|
}
|
|
1566
1567
|
parseOrder(order, market = undefined) {
|
|
1567
1568
|
//
|
|
1568
|
-
// createOrder
|
|
1569
|
+
// createOrder
|
|
1569
1570
|
//
|
|
1570
1571
|
// {
|
|
1571
|
-
// "descr": {
|
|
1572
|
+
// "descr": {
|
|
1573
|
+
// "order": "buy 0.02100000 ETHUSDT @ limit 330.00" // limit orders
|
|
1574
|
+
// "buy 0.12345678 ETHUSDT @ market" // market order
|
|
1575
|
+
// "sell 0.28002676 ETHUSDT @ stop loss 0.0123 -> limit 0.0.1222" // stop order
|
|
1576
|
+
// "sell 0.00100000 ETHUSDT @ stop loss 2677.00 -> limit 2577.00 with 5:1 leverage"
|
|
1577
|
+
// "buy 0.10000000 LTCUSDT @ take profit 75.00000 -> limit 74.00000"
|
|
1578
|
+
// "sell 10.00000000 XRPEUR @ trailing stop +50.0000%" // trailing stop
|
|
1579
|
+
// },
|
|
1572
1580
|
// "txid": [ 'OEKVV2-IH52O-TPL6GZ' ]
|
|
1573
1581
|
// }
|
|
1574
|
-
// {
|
|
1575
|
-
// "txid": [ "TX_ID_HERE" ],
|
|
1576
|
-
// "descr": { "order":"buy 0.12345678 ETHEUR @ market" },
|
|
1577
|
-
// }
|
|
1578
|
-
//
|
|
1579
|
-
//
|
|
1580
|
-
// createOrder for stop orders
|
|
1581
|
-
//
|
|
1582
|
-
// {
|
|
1583
|
-
// "txid":["OSILNC-VQI5Q-775ZDQ"],
|
|
1584
|
-
// "descr":{"order":"sell 167.28002676 ADAXBT @ stop loss 0.00003280 -> limit 0.00003212"}
|
|
1585
|
-
// }
|
|
1586
|
-
//
|
|
1587
|
-
//
|
|
1588
|
-
// {
|
|
1589
|
-
// "txid":["OVHMJV-BZW2V-6NZFWF"],
|
|
1590
|
-
// "descr":{"order":"sell 0.00100000 ETHUSD @ stop loss 2677.00 -> limit 2577.00 with 5:1 leverage"}
|
|
1591
|
-
// }
|
|
1592
1582
|
//
|
|
1593
1583
|
// editOrder
|
|
1594
1584
|
//
|
|
@@ -1668,27 +1658,34 @@ class kraken extends kraken$1 {
|
|
|
1668
1658
|
orderDescription = this.safeString(order, 'descr');
|
|
1669
1659
|
}
|
|
1670
1660
|
let side = undefined;
|
|
1671
|
-
let
|
|
1661
|
+
let rawType = undefined;
|
|
1672
1662
|
let marketId = undefined;
|
|
1673
1663
|
let price = undefined;
|
|
1674
1664
|
let amount = undefined;
|
|
1675
|
-
let
|
|
1665
|
+
let triggerPrice = undefined;
|
|
1676
1666
|
if (orderDescription !== undefined) {
|
|
1677
1667
|
const parts = orderDescription.split(' ');
|
|
1678
1668
|
side = this.safeString(parts, 0);
|
|
1679
1669
|
amount = this.safeString(parts, 1);
|
|
1680
1670
|
marketId = this.safeString(parts, 2);
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1671
|
+
const part4 = this.safeString(parts, 4);
|
|
1672
|
+
const part5 = this.safeString(parts, 5);
|
|
1673
|
+
if (part4 === 'limit' || part4 === 'market') {
|
|
1674
|
+
rawType = part4; // eg, limit, market
|
|
1675
|
+
}
|
|
1676
|
+
else {
|
|
1677
|
+
rawType = part4 + ' ' + part5; // eg. stop loss, take profit, trailing stop
|
|
1678
|
+
}
|
|
1679
|
+
if (rawType === 'stop loss' || rawType === 'take profit') {
|
|
1680
|
+
triggerPrice = this.safeString(parts, 6);
|
|
1684
1681
|
price = this.safeString(parts, 9);
|
|
1685
1682
|
}
|
|
1686
|
-
else if (
|
|
1683
|
+
else if (rawType === 'limit') {
|
|
1687
1684
|
price = this.safeString(parts, 5);
|
|
1688
1685
|
}
|
|
1689
1686
|
}
|
|
1690
1687
|
side = this.safeString(description, 'type', side);
|
|
1691
|
-
|
|
1688
|
+
rawType = this.safeString(description, 'ordertype', rawType); // orderType has dash, e.g. trailing-stop
|
|
1692
1689
|
marketId = this.safeString(description, 'pair', marketId);
|
|
1693
1690
|
const foundMarket = this.findMarketByAltnameOrId(marketId);
|
|
1694
1691
|
let symbol = undefined;
|
|
@@ -1753,17 +1750,33 @@ class kraken extends kraken$1 {
|
|
|
1753
1750
|
trades.push(rawTrade);
|
|
1754
1751
|
}
|
|
1755
1752
|
}
|
|
1756
|
-
|
|
1753
|
+
// as mentioned in #24192 PR, this field is not something consistent/actual
|
|
1754
|
+
// triggerPrice = this.omitZero (this.safeString (order, 'stopprice', triggerPrice));
|
|
1757
1755
|
let stopLossPrice = undefined;
|
|
1758
1756
|
let takeProfitPrice = undefined;
|
|
1759
|
-
|
|
1757
|
+
// the dashed strings are not provided from fields (eg. fetch order)
|
|
1758
|
+
// while spaced strings from "order" sentence (when other fields not available)
|
|
1759
|
+
if (rawType.startsWith('take-profit')) {
|
|
1760
1760
|
takeProfitPrice = this.safeString(description, 'price');
|
|
1761
1761
|
price = this.omitZero(this.safeString(description, 'price2'));
|
|
1762
1762
|
}
|
|
1763
|
-
else if (
|
|
1763
|
+
else if (rawType.startsWith('stop-loss')) {
|
|
1764
1764
|
stopLossPrice = this.safeString(description, 'price');
|
|
1765
1765
|
price = this.omitZero(this.safeString(description, 'price2'));
|
|
1766
1766
|
}
|
|
1767
|
+
else if (rawType === 'take profit') {
|
|
1768
|
+
takeProfitPrice = triggerPrice;
|
|
1769
|
+
}
|
|
1770
|
+
else if (rawType === 'stop loss') {
|
|
1771
|
+
stopLossPrice = triggerPrice;
|
|
1772
|
+
}
|
|
1773
|
+
let finalType = this.parseOrderType(rawType);
|
|
1774
|
+
// unlike from endpoints which provide eg: "take-profit-limit"
|
|
1775
|
+
// for "space-delimited" orders we dont have market/limit suffixes, their format is
|
|
1776
|
+
// eg: `stop loss > limit 123`, so we need to parse them manually
|
|
1777
|
+
if (this.inArray(finalType, ['stop loss', 'take profit'])) {
|
|
1778
|
+
finalType = (price === undefined) ? 'market' : 'limit';
|
|
1779
|
+
}
|
|
1767
1780
|
return this.safeOrder({
|
|
1768
1781
|
'id': id,
|
|
1769
1782
|
'clientOrderId': clientOrderId,
|
|
@@ -1773,13 +1786,13 @@ class kraken extends kraken$1 {
|
|
|
1773
1786
|
'lastTradeTimestamp': undefined,
|
|
1774
1787
|
'status': status,
|
|
1775
1788
|
'symbol': symbol,
|
|
1776
|
-
'type':
|
|
1789
|
+
'type': finalType,
|
|
1777
1790
|
'timeInForce': undefined,
|
|
1778
1791
|
'postOnly': isPostOnly,
|
|
1779
1792
|
'side': side,
|
|
1780
1793
|
'price': price,
|
|
1781
|
-
'stopPrice':
|
|
1782
|
-
'triggerPrice':
|
|
1794
|
+
'stopPrice': triggerPrice,
|
|
1795
|
+
'triggerPrice': triggerPrice,
|
|
1783
1796
|
'takeProfitPrice': takeProfitPrice,
|
|
1784
1797
|
'stopLossPrice': stopLossPrice,
|
|
1785
1798
|
'cost': undefined,
|