ccxt 4.4.26 → 4.4.27
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 +194 -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 +1 -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/lbank.js +100 -1
- package/dist/cjs/src/pro/binance.js +1 -1
- package/dist/cjs/src/pro/lbank.js +9 -4
- package/dist/cjs/src/wavesexchange.js +13 -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/ace.js +1 -1
- package/js/src/alpaca.d.ts +9 -1
- package/js/src/alpaca.js +194 -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 +1 -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/lbank.d.ts +4 -1
- package/js/src/lbank.js +100 -1
- package/js/src/pro/binance.js +1 -1
- package/js/src/pro/lbank.js +9 -4
- package/js/src/wavesexchange.js +13 -2
- package/package.json +1 -1
package/js/src/bit2c.js
CHANGED
|
@@ -80,7 +80,7 @@ export default class bit2c extends Exchange {
|
|
|
80
80
|
'ws': false,
|
|
81
81
|
},
|
|
82
82
|
'urls': {
|
|
83
|
-
'logo': 'https://
|
|
83
|
+
'logo': 'https://github.com/user-attachments/assets/db0bce50-6842-4c09-a1d5-0c87d22118aa',
|
|
84
84
|
'api': {
|
|
85
85
|
'rest': 'https://bit2c.co.il',
|
|
86
86
|
},
|
package/js/src/bitbank.js
CHANGED
|
@@ -95,7 +95,7 @@ export default class bitbank extends Exchange {
|
|
|
95
95
|
},
|
|
96
96
|
'hostname': 'bitbank.cc',
|
|
97
97
|
'urls': {
|
|
98
|
-
'logo': 'https://
|
|
98
|
+
'logo': 'https://github.com/user-attachments/assets/9d616de0-8a88-4468-8e38-d269acab0348',
|
|
99
99
|
'api': {
|
|
100
100
|
'public': 'https://public.{hostname}',
|
|
101
101
|
'private': 'https://api.{hostname}',
|
package/js/src/bitbns.js
CHANGED
|
@@ -70,7 +70,7 @@ export default class bitbns extends Exchange {
|
|
|
70
70
|
},
|
|
71
71
|
'hostname': 'bitbns.com',
|
|
72
72
|
'urls': {
|
|
73
|
-
'logo': 'https://
|
|
73
|
+
'logo': 'https://github.com/user-attachments/assets/a5b9a562-cdd8-4bea-9fa7-fd24c1dad3d9',
|
|
74
74
|
'api': {
|
|
75
75
|
'www': 'https://{hostname}',
|
|
76
76
|
'v1': 'https://api.{hostname}/api/trade/v1',
|
package/js/src/bitfinex.js
CHANGED
|
@@ -91,7 +91,7 @@ export default class bitfinex extends Exchange {
|
|
|
91
91
|
'1M': '1M',
|
|
92
92
|
},
|
|
93
93
|
'urls': {
|
|
94
|
-
'logo': 'https://
|
|
94
|
+
'logo': 'https://github.com/user-attachments/assets/9147c6c5-7197-481e-827b-7483672bb0e9',
|
|
95
95
|
'api': {
|
|
96
96
|
'v2': 'https://api-pub.bitfinex.com',
|
|
97
97
|
'public': 'https://api.bitfinex.com',
|
package/js/src/bitfinex2.js
CHANGED
|
@@ -131,7 +131,7 @@ export default class bitfinex2 extends Exchange {
|
|
|
131
131
|
// cheapest endpoint is 240 requests per minute => ~ 4 requests per second => ( 1000ms / 4 ) = 250ms between requests on average
|
|
132
132
|
'rateLimit': 250,
|
|
133
133
|
'urls': {
|
|
134
|
-
'logo': 'https://
|
|
134
|
+
'logo': 'https://github.com/user-attachments/assets/4a8e947f-ab46-481a-a8ae-8b20e9b03178',
|
|
135
135
|
'api': {
|
|
136
136
|
'v1': 'https://api.bitfinex.com',
|
|
137
137
|
'public': 'https://api-pub.bitfinex.com',
|
package/js/src/bitflyer.js
CHANGED
|
@@ -60,7 +60,7 @@ export default class bitflyer extends Exchange {
|
|
|
60
60
|
'withdraw': true,
|
|
61
61
|
},
|
|
62
62
|
'urls': {
|
|
63
|
-
'logo': 'https://
|
|
63
|
+
'logo': 'https://github.com/user-attachments/assets/d0217747-e54d-4533-8416-0d553dca74bb',
|
|
64
64
|
'api': {
|
|
65
65
|
'rest': 'https://api.{hostname}',
|
|
66
66
|
},
|
package/js/src/bitget.js
CHANGED
|
@@ -163,7 +163,7 @@ export default class bitget extends Exchange {
|
|
|
163
163
|
},
|
|
164
164
|
'hostname': 'bitget.com',
|
|
165
165
|
'urls': {
|
|
166
|
-
'logo': 'https://
|
|
166
|
+
'logo': 'https://github.com/user-attachments/assets/fbaa10cc-a277-441d-a5b7-997dd9a87658',
|
|
167
167
|
'api': {
|
|
168
168
|
'spot': 'https://api.{hostname}',
|
|
169
169
|
'mix': 'https://api.{hostname}',
|
package/js/src/bithumb.js
CHANGED
|
@@ -79,7 +79,7 @@ export default class bithumb extends Exchange {
|
|
|
79
79
|
},
|
|
80
80
|
'hostname': 'bithumb.com',
|
|
81
81
|
'urls': {
|
|
82
|
-
'logo': 'https://
|
|
82
|
+
'logo': 'https://github.com/user-attachments/assets/c9e0eefb-4777-46b9-8f09-9d7f7c4af82d',
|
|
83
83
|
'api': {
|
|
84
84
|
'public': 'https://api.{hostname}/public',
|
|
85
85
|
'private': 'https://api.{hostname}',
|
package/js/src/bitmart.js
CHANGED
|
@@ -111,7 +111,7 @@ export default class bitmart extends Exchange {
|
|
|
111
111
|
},
|
|
112
112
|
'hostname': 'bitmart.com',
|
|
113
113
|
'urls': {
|
|
114
|
-
'logo': 'https://
|
|
114
|
+
'logo': 'https://github.com/user-attachments/assets/0623e9c4-f50e-48c9-82bd-65c3908c3a14',
|
|
115
115
|
'api': {
|
|
116
116
|
'spot': 'https://api-cloud.{hostname}',
|
|
117
117
|
'swap': 'https://api-cloud-v2.{hostname}', // bitmart.info for Hong Kong users
|
package/js/src/bitmex.js
CHANGED
|
@@ -111,7 +111,7 @@ export default class bitmex extends Exchange {
|
|
|
111
111
|
'public': 'https://testnet.bitmex.com',
|
|
112
112
|
'private': 'https://testnet.bitmex.com',
|
|
113
113
|
},
|
|
114
|
-
'logo': 'https://github.com/
|
|
114
|
+
'logo': 'https://github.com/user-attachments/assets/c78425ab-78d5-49d6-bd14-db7734798f04',
|
|
115
115
|
'api': {
|
|
116
116
|
'public': 'https://www.bitmex.com',
|
|
117
117
|
'private': 'https://www.bitmex.com',
|
package/js/src/bitopro.js
CHANGED
|
@@ -107,7 +107,7 @@ export default class bitopro extends Exchange {
|
|
|
107
107
|
'1M': '1M',
|
|
108
108
|
},
|
|
109
109
|
'urls': {
|
|
110
|
-
'logo': 'https://
|
|
110
|
+
'logo': 'https://github.com/user-attachments/assets/affc6337-b95a-44bf-aacd-04f9722364f6',
|
|
111
111
|
'api': {
|
|
112
112
|
'rest': 'https://api.bitopro.com/v3',
|
|
113
113
|
},
|
package/js/src/bitrue.js
CHANGED
|
@@ -98,7 +98,7 @@ export default class bitrue extends Exchange {
|
|
|
98
98
|
'1w': '1W',
|
|
99
99
|
},
|
|
100
100
|
'urls': {
|
|
101
|
-
'logo': 'https://
|
|
101
|
+
'logo': 'https://github.com/user-attachments/assets/67abe346-1273-461a-bd7c-42fa32907c8e',
|
|
102
102
|
'api': {
|
|
103
103
|
'spot': 'https://www.bitrue.com/api',
|
|
104
104
|
'fapi': 'https://fapi.bitrue.com/fapi',
|
package/js/src/bitso.js
CHANGED
|
@@ -99,7 +99,7 @@ export default class bitso extends Exchange {
|
|
|
99
99
|
'withdraw': true,
|
|
100
100
|
},
|
|
101
101
|
'urls': {
|
|
102
|
-
'logo': 'https://
|
|
102
|
+
'logo': 'https://github.com/user-attachments/assets/178c8e56-9054-4107-b192-5e5053d4f975',
|
|
103
103
|
'api': {
|
|
104
104
|
'rest': 'https://bitso.com/api',
|
|
105
105
|
},
|
package/js/src/bitstamp.js
CHANGED
|
@@ -97,7 +97,7 @@ export default class bitstamp extends Exchange {
|
|
|
97
97
|
'withdraw': true,
|
|
98
98
|
},
|
|
99
99
|
'urls': {
|
|
100
|
-
'logo': 'https://
|
|
100
|
+
'logo': 'https://github.com/user-attachments/assets/d5480572-1fee-43cb-b900-d38c522d0024',
|
|
101
101
|
'api': {
|
|
102
102
|
'public': 'https://www.bitstamp.net/api',
|
|
103
103
|
'private': 'https://www.bitstamp.net/api',
|
package/js/src/bitteam.js
CHANGED
|
@@ -131,7 +131,7 @@ export default class bitteam extends Exchange {
|
|
|
131
131
|
'1d': '1D',
|
|
132
132
|
},
|
|
133
133
|
'urls': {
|
|
134
|
-
'logo': 'https://github.com/
|
|
134
|
+
'logo': 'https://github.com/user-attachments/assets/b41b5e0d-98e5-4bd3-8a6e-aeb230a4a135',
|
|
135
135
|
'api': {
|
|
136
136
|
'history': 'https://history.bit.team',
|
|
137
137
|
'public': 'https://bit.team',
|
package/js/src/bitvavo.js
CHANGED
|
@@ -112,7 +112,7 @@ export default class bitvavo extends Exchange {
|
|
|
112
112
|
'1d': '1d',
|
|
113
113
|
},
|
|
114
114
|
'urls': {
|
|
115
|
-
'logo': 'https://
|
|
115
|
+
'logo': 'https://github.com/user-attachments/assets/d213155c-8c71-4701-9bd5-45351febc2a8',
|
|
116
116
|
'api': {
|
|
117
117
|
'public': 'https://api.bitvavo.com',
|
|
118
118
|
'private': 'https://api.bitvavo.com',
|
package/js/src/bl3p.js
CHANGED
|
@@ -83,7 +83,7 @@ export default class bl3p extends Exchange {
|
|
|
83
83
|
'ws': false,
|
|
84
84
|
},
|
|
85
85
|
'urls': {
|
|
86
|
-
'logo': 'https://
|
|
86
|
+
'logo': 'https://github.com/user-attachments/assets/75aeb14e-cd48-43c8-8492-dff002dea0be',
|
|
87
87
|
'api': {
|
|
88
88
|
'rest': 'https://api.bl3p.eu',
|
|
89
89
|
},
|
package/js/src/blockchaincom.js
CHANGED
|
@@ -79,7 +79,7 @@ export default class blockchaincom extends Exchange {
|
|
|
79
79
|
},
|
|
80
80
|
'timeframes': undefined,
|
|
81
81
|
'urls': {
|
|
82
|
-
'logo': 'https://
|
|
82
|
+
'logo': 'https://github.com/user-attachments/assets/975e3054-3399-4363-bcee-ec3c6d63d4e8',
|
|
83
83
|
'test': {
|
|
84
84
|
'public': 'https://testnet-api.delta.exchange',
|
|
85
85
|
'private': 'https://testnet-api.delta.exchange',
|
package/js/src/blofin.js
CHANGED
|
@@ -156,7 +156,7 @@ export default class blofin extends Exchange {
|
|
|
156
156
|
},
|
|
157
157
|
'hostname': 'www.blofin.com',
|
|
158
158
|
'urls': {
|
|
159
|
-
'logo': 'https://github.com/
|
|
159
|
+
'logo': 'https://github.com/user-attachments/assets/518cdf80-f05d-4821-a3e3-d48ceb41d73b',
|
|
160
160
|
'api': {
|
|
161
161
|
'rest': 'https://openapi.blofin.com',
|
|
162
162
|
},
|
package/js/src/btcalpha.js
CHANGED
|
@@ -102,7 +102,7 @@ export default class btcalpha extends Exchange {
|
|
|
102
102
|
'1d': 'D',
|
|
103
103
|
},
|
|
104
104
|
'urls': {
|
|
105
|
-
'logo': 'https://
|
|
105
|
+
'logo': 'https://github.com/user-attachments/assets/dce49f3a-61e5-4ba0-a2fe-41d192fd0e5d',
|
|
106
106
|
'api': {
|
|
107
107
|
'rest': 'https://btc-alpha.com/api',
|
|
108
108
|
},
|
package/js/src/btcbox.js
CHANGED
|
@@ -82,7 +82,7 @@ export default class btcbox extends Exchange {
|
|
|
82
82
|
'ws': false,
|
|
83
83
|
},
|
|
84
84
|
'urls': {
|
|
85
|
-
'logo': 'https://
|
|
85
|
+
'logo': 'https://github.com/user-attachments/assets/1e2cb499-8d0f-4f8f-9464-3c015cfbc76b',
|
|
86
86
|
'api': {
|
|
87
87
|
'rest': 'https://www.btcbox.co.jp/api',
|
|
88
88
|
},
|
package/js/src/btcmarkets.js
CHANGED
|
@@ -87,7 +87,7 @@ export default class btcmarkets extends Exchange {
|
|
|
87
87
|
'withdraw': true,
|
|
88
88
|
},
|
|
89
89
|
'urls': {
|
|
90
|
-
'logo': 'https://
|
|
90
|
+
'logo': 'https://github.com/user-attachments/assets/8c8d6907-3873-4cc4-ad20-e22fba28247e',
|
|
91
91
|
'api': {
|
|
92
92
|
'public': 'https://api.btcmarkets.net',
|
|
93
93
|
'private': 'https://api.btcmarkets.net',
|
package/js/src/btcturk.js
CHANGED
|
@@ -90,7 +90,7 @@ export default class btcturk extends Exchange {
|
|
|
90
90
|
'1y': '1 y',
|
|
91
91
|
},
|
|
92
92
|
'urls': {
|
|
93
|
-
'logo': 'https://
|
|
93
|
+
'logo': 'https://github.com/user-attachments/assets/10e0a238-9f60-4b06-9dda-edfc7602f1d6',
|
|
94
94
|
'api': {
|
|
95
95
|
'public': 'https://api.btcturk.com/api/v2',
|
|
96
96
|
'private': 'https://api.btcturk.com/api/v1',
|
package/js/src/bybit.js
CHANGED
|
@@ -160,7 +160,7 @@ export default class bybit extends Exchange {
|
|
|
160
160
|
'public': 'https://api-testnet.{hostname}',
|
|
161
161
|
'private': 'https://api-testnet.{hostname}',
|
|
162
162
|
},
|
|
163
|
-
'logo': 'https://
|
|
163
|
+
'logo': 'https://github.com/user-attachments/assets/97a5d0b3-de10-423d-90e1-6620960025ed',
|
|
164
164
|
'api': {
|
|
165
165
|
'spot': 'https://api.{hostname}',
|
|
166
166
|
'futures': 'https://api.{hostname}',
|
|
@@ -2586,6 +2586,10 @@ export default class bybit extends Exchange {
|
|
|
2586
2586
|
//
|
|
2587
2587
|
const data = this.safeDict(response, 'result', {});
|
|
2588
2588
|
const tickerList = this.safeList(data, 'list', []);
|
|
2589
|
+
const timestamp = this.safeInteger(response, 'time');
|
|
2590
|
+
for (let i = 0; i < tickerList.length; i++) {
|
|
2591
|
+
tickerList[i]['timestamp'] = timestamp; // will be removed inside the parser
|
|
2592
|
+
}
|
|
2589
2593
|
const result = this.parseFundingRates(tickerList);
|
|
2590
2594
|
return this.filterByArray(result, 'symbol', symbols);
|
|
2591
2595
|
}
|
package/js/src/coinbase.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export default class coinbase extends Exchange {
|
|
|
28
28
|
fetchTransactionsWithMethod(method: any, code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
29
29
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
30
30
|
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
31
|
+
fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
31
32
|
parseTransactionStatus(status: Str): string;
|
|
32
33
|
parseTransaction(transaction: Dict, currency?: Currency): Transaction;
|
|
33
34
|
parseTrade(trade: Dict, market?: Market): Trade;
|
package/js/src/coinbase.js
CHANGED
|
@@ -82,6 +82,7 @@ export default class coinbase extends Exchange {
|
|
|
82
82
|
'fetchDepositAddresses': false,
|
|
83
83
|
'fetchDepositAddressesByNetwork': true,
|
|
84
84
|
'fetchDeposits': true,
|
|
85
|
+
'fetchDepositsWithdrawals': true,
|
|
85
86
|
'fetchFundingHistory': false,
|
|
86
87
|
'fetchFundingRate': false,
|
|
87
88
|
'fetchFundingRateHistory': false,
|
|
@@ -776,8 +777,15 @@ export default class coinbase extends Exchange {
|
|
|
776
777
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
777
778
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
778
779
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
780
|
+
* @param {string} [params.currencyType] "fiat" or "crypto"
|
|
779
781
|
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
780
782
|
*/
|
|
783
|
+
let currencyType = undefined;
|
|
784
|
+
[currencyType, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'currencyType');
|
|
785
|
+
if (currencyType === 'crypto') {
|
|
786
|
+
const results = await this.fetchTransactionsWithMethod('v2PrivateGetAccountsAccountIdTransactions', code, since, limit, params);
|
|
787
|
+
return this.filterByArray(results, 'type', 'withdrawal', false);
|
|
788
|
+
}
|
|
781
789
|
return await this.fetchTransactionsWithMethod('v2PrivateGetAccountsAccountIdWithdrawals', code, since, limit, params);
|
|
782
790
|
}
|
|
783
791
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -790,10 +798,33 @@ export default class coinbase extends Exchange {
|
|
|
790
798
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
791
799
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
792
800
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
801
|
+
* @param {string} [params.currencyType] "fiat" or "crypto"
|
|
793
802
|
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
794
803
|
*/
|
|
804
|
+
let currencyType = undefined;
|
|
805
|
+
[currencyType, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'currencyType');
|
|
806
|
+
if (currencyType === 'crypto') {
|
|
807
|
+
const results = await this.fetchTransactionsWithMethod('v2PrivateGetAccountsAccountIdTransactions', code, since, limit, params);
|
|
808
|
+
return this.filterByArray(results, 'type', 'deposit', false);
|
|
809
|
+
}
|
|
795
810
|
return await this.fetchTransactionsWithMethod('v2PrivateGetAccountsAccountIdDeposits', code, since, limit, params);
|
|
796
811
|
}
|
|
812
|
+
async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
813
|
+
/**
|
|
814
|
+
* @method
|
|
815
|
+
* @name coinbase#fetchDepositsWithdrawals
|
|
816
|
+
* @description fetch history of deposits and withdrawals
|
|
817
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/docs/api-transactions
|
|
818
|
+
* @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
|
|
819
|
+
* @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
|
|
820
|
+
* @param {int} [limit] max number of deposit/withdrawals to return, default = 50, Min: 1, Max: 100
|
|
821
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
822
|
+
* @returns {object} a list of [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
823
|
+
*/
|
|
824
|
+
await this.loadMarkets();
|
|
825
|
+
const results = await this.fetchTransactionsWithMethod('v2PrivateGetAccountsAccountIdTransactions', code, since, limit, params);
|
|
826
|
+
return this.filterByArray(results, 'type', ['deposit', 'withdrawal'], false);
|
|
827
|
+
}
|
|
797
828
|
parseTransactionStatus(status) {
|
|
798
829
|
const statuses = {
|
|
799
830
|
'created': 'pending',
|
|
@@ -917,18 +948,62 @@ export default class coinbase extends Exchange {
|
|
|
917
948
|
// "hide_native_amount": false
|
|
918
949
|
// }
|
|
919
950
|
//
|
|
951
|
+
//
|
|
952
|
+
// crypto deposit & withdrawal (using `/transactions` endpoint)
|
|
953
|
+
// {
|
|
954
|
+
// "amount": {
|
|
955
|
+
// "amount": "0.00014200", (negative for withdrawal)
|
|
956
|
+
// "currency": "BTC"
|
|
957
|
+
// },
|
|
958
|
+
// "created_at": "2024-03-29T15:48:30Z",
|
|
959
|
+
// "id": "0031a605-241d-514d-a97b-d4b99f3225d3",
|
|
960
|
+
// "idem": "092a979b-017e-4403-940a-2ca57811f442", // field present only in case of withdrawal
|
|
961
|
+
// "native_amount": {
|
|
962
|
+
// "amount": "9.85", (negative for withdrawal)
|
|
963
|
+
// "currency": "USD"
|
|
964
|
+
// },
|
|
965
|
+
// "network": {
|
|
966
|
+
// "status": "pending", // if status is `off_blockchain` then no more other fields are present in this object
|
|
967
|
+
// "hash": "5jYuvrNsvX2DZoMnzGYzVpYxJLfYu4GSK3xetG1H5LHrSovsuFCFYdFMwNRoiht3s6fBk92MM8QLLnz65xuEFTrE",
|
|
968
|
+
// "network_name": "solana",
|
|
969
|
+
// "transaction_fee": {
|
|
970
|
+
// "amount": "0.000100000",
|
|
971
|
+
// "currency": "SOL"
|
|
972
|
+
// }
|
|
973
|
+
// },
|
|
974
|
+
// "resource": "transaction",
|
|
975
|
+
// "resource_path": "/v2/accounts/dc504b1c-248e-5b68-a3b0-b991f7fa84e6/transactions/0031a605-241d-514d-a97b-d4b99f3225d3",
|
|
976
|
+
// "status": "completed",
|
|
977
|
+
// "type": "send",
|
|
978
|
+
// "from": { // in some cases, field might be present for deposit
|
|
979
|
+
// "id": "7fd10cd7-b091-5cee-ba41-c29e49a7cccf",
|
|
980
|
+
// "name": "Coinbase",
|
|
981
|
+
// "resource": "user"
|
|
982
|
+
// },
|
|
983
|
+
// "to": { // field only present for withdrawal
|
|
984
|
+
// "address": "5HA12BNthAvBwNYARYf9y5MqqCpB4qhCNFCs1Qw48ACE",
|
|
985
|
+
// "resource": "address"
|
|
986
|
+
// },
|
|
987
|
+
// "description": "C3 - One Time BTC Credit . Reference Case # 123.", // in some cases, field might be present for deposit
|
|
988
|
+
// }
|
|
989
|
+
//
|
|
920
990
|
const transactionType = this.safeString(transaction, 'type');
|
|
921
991
|
let amountAndCurrencyObject = undefined;
|
|
922
992
|
let feeObject = undefined;
|
|
993
|
+
const network = this.safeDict(transaction, 'network', {});
|
|
923
994
|
if (transactionType === 'send') {
|
|
924
|
-
|
|
925
|
-
amountAndCurrencyObject = this.safeDict(network, 'transaction_amount', {});
|
|
995
|
+
amountAndCurrencyObject = this.safeDict(network, 'transaction_amount');
|
|
926
996
|
feeObject = this.safeDict(network, 'transaction_fee', {});
|
|
927
997
|
}
|
|
928
998
|
else {
|
|
929
|
-
amountAndCurrencyObject = this.safeDict(transaction, 'subtotal'
|
|
999
|
+
amountAndCurrencyObject = this.safeDict(transaction, 'subtotal');
|
|
930
1000
|
feeObject = this.safeDict(transaction, 'fee', {});
|
|
931
1001
|
}
|
|
1002
|
+
if (amountAndCurrencyObject === undefined) {
|
|
1003
|
+
amountAndCurrencyObject = this.safeDict(transaction, 'amount');
|
|
1004
|
+
}
|
|
1005
|
+
const amountString = this.safeString(amountAndCurrencyObject, 'amount');
|
|
1006
|
+
const amountStringAbs = Precise.stringAbs(amountString);
|
|
932
1007
|
let status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
|
|
933
1008
|
if (status === undefined) {
|
|
934
1009
|
const committed = this.safeBool(transaction, 'committed');
|
|
@@ -938,23 +1013,34 @@ export default class coinbase extends Exchange {
|
|
|
938
1013
|
const currencyId = this.safeString(amountAndCurrencyObject, 'currency');
|
|
939
1014
|
const feeCurrencyId = this.safeString(feeObject, 'currency');
|
|
940
1015
|
const datetime = this.safeString(transaction, 'created_at');
|
|
941
|
-
const
|
|
942
|
-
|
|
1016
|
+
const resource = this.safeString(transaction, 'resource');
|
|
1017
|
+
let type = resource;
|
|
1018
|
+
if (!this.inArray(type, ['deposit', 'withdrawal'])) {
|
|
1019
|
+
if (Precise.stringGt(amountString, '0')) {
|
|
1020
|
+
type = 'deposit';
|
|
1021
|
+
}
|
|
1022
|
+
else if (Precise.stringLt(amountString, '0')) {
|
|
1023
|
+
type = 'withdrawal';
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
const toObject = this.safeDict(transaction, 'to');
|
|
1027
|
+
const addressTo = this.safeString(toObject, 'address');
|
|
1028
|
+
const networkId = this.safeString(network, 'network_name');
|
|
943
1029
|
return {
|
|
944
1030
|
'info': transaction,
|
|
945
1031
|
'id': id,
|
|
946
|
-
'txid': id,
|
|
1032
|
+
'txid': this.safeString(network, 'hash', id),
|
|
947
1033
|
'timestamp': this.parse8601(datetime),
|
|
948
1034
|
'datetime': datetime,
|
|
949
|
-
'network':
|
|
950
|
-
'address':
|
|
951
|
-
'addressTo':
|
|
1035
|
+
'network': this.networkIdToCode(networkId),
|
|
1036
|
+
'address': addressTo,
|
|
1037
|
+
'addressTo': addressTo,
|
|
952
1038
|
'addressFrom': undefined,
|
|
953
1039
|
'tag': undefined,
|
|
954
1040
|
'tagTo': undefined,
|
|
955
1041
|
'tagFrom': undefined,
|
|
956
|
-
'type':
|
|
957
|
-
'amount': this.
|
|
1042
|
+
'type': type,
|
|
1043
|
+
'amount': this.parseNumber(amountStringAbs),
|
|
958
1044
|
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
959
1045
|
'status': status,
|
|
960
1046
|
'updated': this.parse8601(this.safeString(transaction, 'updated_at')),
|
package/js/src/coinex.js
CHANGED
|
@@ -4961,7 +4961,7 @@ export default class coinex extends Exchange {
|
|
|
4961
4961
|
await this.loadMarkets();
|
|
4962
4962
|
const currency = this.currency(code);
|
|
4963
4963
|
const amountToPrecision = this.currencyToPrecision(code, amount);
|
|
4964
|
-
const accountsByType = this.safeDict(this.options, '
|
|
4964
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
4965
4965
|
const fromId = this.safeString(accountsByType, fromAccount, fromAccount);
|
|
4966
4966
|
const toId = this.safeString(accountsByType, toAccount, toAccount);
|
|
4967
4967
|
const request = {
|
package/js/src/gate.js
CHANGED
|
@@ -909,22 +909,28 @@ export default class gate extends Exchange {
|
|
|
909
909
|
*/
|
|
910
910
|
const unifiedAccount = this.safeBool(this.options, 'unifiedAccount');
|
|
911
911
|
if (unifiedAccount === undefined) {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
912
|
+
try {
|
|
913
|
+
//
|
|
914
|
+
// {
|
|
915
|
+
// "user_id": 10406147,
|
|
916
|
+
// "ip_whitelist": [],
|
|
917
|
+
// "currency_pairs": [],
|
|
918
|
+
// "key": {
|
|
919
|
+
// "mode": 1
|
|
920
|
+
// },
|
|
921
|
+
// "tier": 0,
|
|
922
|
+
// "tier_expire_time": "0001-01-01T00:00:00Z",
|
|
923
|
+
// "copy_trading_role": 0
|
|
924
|
+
// }
|
|
925
|
+
//
|
|
926
|
+
const response = await this.privateAccountGetDetail(params);
|
|
927
|
+
const result = this.safeDict(response, 'key', {});
|
|
928
|
+
this.options['unifiedAccount'] = this.safeInteger(result, 'mode') === 2;
|
|
929
|
+
}
|
|
930
|
+
catch (e) {
|
|
931
|
+
// if the request fails, the unifiedAccount is disabled
|
|
932
|
+
this.options['unifiedAccount'] = false;
|
|
933
|
+
}
|
|
928
934
|
}
|
|
929
935
|
}
|
|
930
936
|
async upgradeUnifiedTradeAccount(params = {}) {
|
package/js/src/hyperliquid.d.ts
CHANGED
|
@@ -104,5 +104,6 @@ export default class hyperliquid extends Exchange {
|
|
|
104
104
|
body: any;
|
|
105
105
|
headers: any;
|
|
106
106
|
};
|
|
107
|
+
calculateRateLimiterCost(api: any, method: any, path: any, params: any, config?: {}): any;
|
|
107
108
|
parseCreateOrderArgs(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): {}[];
|
|
108
109
|
}
|
package/js/src/hyperliquid.js
CHANGED
|
@@ -153,7 +153,17 @@ export default class hyperliquid extends Exchange {
|
|
|
153
153
|
'api': {
|
|
154
154
|
'public': {
|
|
155
155
|
'post': {
|
|
156
|
-
'info':
|
|
156
|
+
'info': {
|
|
157
|
+
'cost': 20,
|
|
158
|
+
'byType': {
|
|
159
|
+
'l2Book': 2,
|
|
160
|
+
'allMids': 2,
|
|
161
|
+
'clearinghouseState': 2,
|
|
162
|
+
'orderStatus': 2,
|
|
163
|
+
'spotClearinghouseState': 2,
|
|
164
|
+
'exchangeStatus': 2,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
157
167
|
},
|
|
158
168
|
},
|
|
159
169
|
'private': {
|
|
@@ -3031,6 +3041,16 @@ export default class hyperliquid extends Exchange {
|
|
|
3031
3041
|
}
|
|
3032
3042
|
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
3033
3043
|
}
|
|
3044
|
+
calculateRateLimiterCost(api, method, path, params, config = {}) {
|
|
3045
|
+
if (('byType' in config) && ('type' in params)) {
|
|
3046
|
+
const type = params['type'];
|
|
3047
|
+
const byType = config['byType'];
|
|
3048
|
+
if (type in byType) {
|
|
3049
|
+
return byType[type];
|
|
3050
|
+
}
|
|
3051
|
+
}
|
|
3052
|
+
return this.safeValue(config, 'cost', 1);
|
|
3053
|
+
}
|
|
3034
3054
|
parseCreateOrderArgs(symbol, type, side, amount, price = undefined, params = {}) {
|
|
3035
3055
|
const market = this.market(symbol);
|
|
3036
3056
|
const vaultAddress = this.safeString(params, 'vaultAddress');
|
package/js/src/lbank.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/lbank.js';
|
|
2
|
-
import type { Balances, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, int, DepositAddress } from './base/types.js';
|
|
2
|
+
import type { Balances, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, int, DepositAddress, FundingRates, FundingRate } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class lbank
|
|
5
5
|
* @augments Exchange
|
|
@@ -19,6 +19,9 @@ export default class lbank extends Exchange {
|
|
|
19
19
|
parseOHLCV(ohlcv: any, market?: Market): OHLCV;
|
|
20
20
|
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
21
21
|
parseBalance(response: any): Balances;
|
|
22
|
+
parseFundingRate(ticker: any, market?: Market): FundingRate;
|
|
23
|
+
fetchFundingRate(symbol: string, params?: {}): Promise<FundingRate>;
|
|
24
|
+
fetchFundingRates(symbols?: Strings, params?: {}): Promise<FundingRates>;
|
|
22
25
|
fetchBalance(params?: {}): Promise<Balances>;
|
|
23
26
|
parseTradingFee(fee: Dict, market?: Market): TradingFeeInterface;
|
|
24
27
|
fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
|