ccxt 4.3.23 → 4.3.24
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 +5 -5
- package/dist/cjs/ccxt.js +9 -6
- package/dist/cjs/src/base/Exchange.js +4 -3
- package/dist/cjs/src/bitrue.js +6 -1
- package/dist/cjs/src/coinbaseadvanced.js +17 -0
- package/dist/cjs/src/{coinbasepro.js → coinbaseexchange.js} +40 -40
- package/dist/cjs/src/coinex.js +41 -76
- package/dist/cjs/src/kucoin.js +1 -0
- package/dist/cjs/src/pro/bitget.js +12 -3
- package/dist/cjs/src/pro/{coinbasepro.js → coinbaseexchange.js} +13 -13
- package/js/ccxt.d.ts +11 -8
- package/js/ccxt.js +8 -6
- package/js/src/abstract/coinbaseadvanced.d.ts +97 -0
- package/js/src/abstract/coinbaseadvanced.js +11 -0
- package/js/src/base/Exchange.js +4 -3
- package/js/src/bitrue.js +6 -1
- package/js/src/coinbaseadvanced.d.ts +4 -0
- package/js/src/coinbaseadvanced.js +18 -0
- package/js/src/{coinbasepro.d.ts → coinbaseexchange.d.ts} +3 -3
- package/js/src/{coinbasepro.js → coinbaseexchange.js} +39 -39
- package/js/src/coinex.d.ts +1 -1
- package/js/src/coinex.js +41 -76
- package/js/src/kucoin.js +1 -0
- package/js/src/pro/bitget.js +12 -3
- package/js/src/pro/{coinbasepro.d.ts → coinbaseexchange.d.ts} +2 -2
- package/js/src/pro/{coinbasepro.js → coinbaseexchange.js} +12 -12
- package/package.json +1 -1
- /package/dist/cjs/src/abstract/{coinbasepro.js → coinbaseexchange.js} +0 -0
- /package/js/src/abstract/{coinbasepro.d.ts → coinbaseexchange.d.ts} +0 -0
- /package/js/src/abstract/{coinbasepro.js → coinbaseexchange.js} +0 -0
|
@@ -5,21 +5,21 @@
|
|
|
5
5
|
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
6
|
|
|
7
7
|
// ----------------------------------------------------------------------------
|
|
8
|
-
import Exchange from './abstract/
|
|
8
|
+
import Exchange from './abstract/coinbaseexchange.js';
|
|
9
9
|
import { InsufficientFunds, ArgumentsRequired, ExchangeError, InvalidOrder, InvalidAddress, AuthenticationError, OrderNotFound, OnMaintenance, PermissionDenied, RateLimitExceeded } from './base/errors.js';
|
|
10
10
|
import { Precise } from './base/Precise.js';
|
|
11
11
|
import { TICK_SIZE } from './base/functions/number.js';
|
|
12
12
|
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
|
|
13
13
|
// ----------------------------------------------------------------------------
|
|
14
14
|
/**
|
|
15
|
-
* @class
|
|
15
|
+
* @class coinbaseexchange
|
|
16
16
|
* @augments Exchange
|
|
17
17
|
*/
|
|
18
|
-
export default class
|
|
18
|
+
export default class coinbaseexchange extends Exchange {
|
|
19
19
|
describe() {
|
|
20
20
|
return this.deepExtend(super.describe(), {
|
|
21
|
-
'id': '
|
|
22
|
-
'name': 'Coinbase
|
|
21
|
+
'id': 'coinbaseexchange',
|
|
22
|
+
'name': 'Coinbase Exchange',
|
|
23
23
|
'countries': ['US'],
|
|
24
24
|
'rateLimit': 100,
|
|
25
25
|
'userAgent': this.userAgents['chrome'],
|
|
@@ -81,19 +81,19 @@ export default class coinbasepro extends Exchange {
|
|
|
81
81
|
'6h': 21600,
|
|
82
82
|
'1d': 86400,
|
|
83
83
|
},
|
|
84
|
-
'hostname': '
|
|
84
|
+
'hostname': 'exchange.coinbase.com',
|
|
85
85
|
'urls': {
|
|
86
86
|
'test': {
|
|
87
|
-
'public': 'https://api-public.sandbox.
|
|
88
|
-
'private': 'https://api-public.sandbox.
|
|
87
|
+
'public': 'https://api-public.sandbox.exchange.coinbase.com',
|
|
88
|
+
'private': 'https://api-public.sandbox.exchange.coinbase.com',
|
|
89
89
|
},
|
|
90
|
-
'logo': 'https://
|
|
90
|
+
'logo': 'https://github.com/ccxt/ccxt/assets/43336371/34a65553-88aa-4a38-a714-064bd228b97e',
|
|
91
91
|
'api': {
|
|
92
92
|
'public': 'https://api.{hostname}',
|
|
93
93
|
'private': 'https://api.{hostname}',
|
|
94
94
|
},
|
|
95
|
-
'www': 'https://
|
|
96
|
-
'doc': 'https://docs.
|
|
95
|
+
'www': 'https://coinbase.com/',
|
|
96
|
+
'doc': 'https://docs.cloud.coinbase.com/exchange/docs/',
|
|
97
97
|
'fees': [
|
|
98
98
|
'https://docs.pro.coinbase.com/#fees',
|
|
99
99
|
'https://support.pro.coinbase.com/customer/en/portal/articles/2945310-fees',
|
|
@@ -240,7 +240,7 @@ export default class coinbasepro extends Exchange {
|
|
|
240
240
|
async fetchCurrencies(params = {}) {
|
|
241
241
|
/**
|
|
242
242
|
* @method
|
|
243
|
-
* @name
|
|
243
|
+
* @name coinbaseexchange#fetchCurrencies
|
|
244
244
|
* @description fetches all available currencies on an exchange
|
|
245
245
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getcurrencies
|
|
246
246
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -311,8 +311,8 @@ export default class coinbasepro extends Exchange {
|
|
|
311
311
|
async fetchMarkets(params = {}) {
|
|
312
312
|
/**
|
|
313
313
|
* @method
|
|
314
|
-
* @name
|
|
315
|
-
* @description retrieves data on all markets for
|
|
314
|
+
* @name coinbaseexchange#fetchMarkets
|
|
315
|
+
* @description retrieves data on all markets for coinbaseexchange
|
|
316
316
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproducts
|
|
317
317
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
318
318
|
* @returns {object[]} an array of objects representing market data
|
|
@@ -432,7 +432,7 @@ export default class coinbasepro extends Exchange {
|
|
|
432
432
|
async fetchAccounts(params = {}) {
|
|
433
433
|
/**
|
|
434
434
|
* @method
|
|
435
|
-
* @name
|
|
435
|
+
* @name coinbaseexchange#fetchAccounts
|
|
436
436
|
* @description fetch all the accounts associated with a profile
|
|
437
437
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounts
|
|
438
438
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -498,7 +498,7 @@ export default class coinbasepro extends Exchange {
|
|
|
498
498
|
async fetchBalance(params = {}) {
|
|
499
499
|
/**
|
|
500
500
|
* @method
|
|
501
|
-
* @name
|
|
501
|
+
* @name coinbaseexchange#fetchBalance
|
|
502
502
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
503
503
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounts
|
|
504
504
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -511,7 +511,7 @@ export default class coinbasepro extends Exchange {
|
|
|
511
511
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
512
512
|
/**
|
|
513
513
|
* @method
|
|
514
|
-
* @name
|
|
514
|
+
* @name coinbaseexchange#fetchOrderBook
|
|
515
515
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductbook
|
|
516
516
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
517
517
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
@@ -631,7 +631,7 @@ export default class coinbasepro extends Exchange {
|
|
|
631
631
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
632
632
|
/**
|
|
633
633
|
* @method
|
|
634
|
-
* @name
|
|
634
|
+
* @name coinbaseexchange#fetchTickers
|
|
635
635
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
636
636
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproduct
|
|
637
637
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
@@ -678,7 +678,7 @@ export default class coinbasepro extends Exchange {
|
|
|
678
678
|
async fetchTicker(symbol, params = {}) {
|
|
679
679
|
/**
|
|
680
680
|
* @method
|
|
681
|
-
* @name
|
|
681
|
+
* @name coinbaseexchange#fetchTicker
|
|
682
682
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductticker
|
|
683
683
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
684
684
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
@@ -792,7 +792,7 @@ export default class coinbasepro extends Exchange {
|
|
|
792
792
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
793
793
|
/**
|
|
794
794
|
* @method
|
|
795
|
-
* @name
|
|
795
|
+
* @name coinbaseexchange#fetchMyTrades
|
|
796
796
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getfills
|
|
797
797
|
* @description fetch all trades made by the user
|
|
798
798
|
* @param {string} symbol unified market symbol
|
|
@@ -833,7 +833,7 @@ export default class coinbasepro extends Exchange {
|
|
|
833
833
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
834
834
|
/**
|
|
835
835
|
* @method
|
|
836
|
-
* @name
|
|
836
|
+
* @name coinbaseexchange#fetchTrades
|
|
837
837
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproducttrades
|
|
838
838
|
* @description get the list of most recent trades for a particular symbol
|
|
839
839
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
@@ -867,7 +867,7 @@ export default class coinbasepro extends Exchange {
|
|
|
867
867
|
async fetchTradingFees(params = {}) {
|
|
868
868
|
/**
|
|
869
869
|
* @method
|
|
870
|
-
* @name
|
|
870
|
+
* @name coinbaseexchange#fetchTradingFees
|
|
871
871
|
* @description fetch the trading fees for multiple markets
|
|
872
872
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getfees
|
|
873
873
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -921,7 +921,7 @@ export default class coinbasepro extends Exchange {
|
|
|
921
921
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
922
922
|
/**
|
|
923
923
|
* @method
|
|
924
|
-
* @name
|
|
924
|
+
* @name coinbaseexchange#fetchOHLCV
|
|
925
925
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductcandles
|
|
926
926
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
927
927
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
@@ -987,7 +987,7 @@ export default class coinbasepro extends Exchange {
|
|
|
987
987
|
async fetchTime(params = {}) {
|
|
988
988
|
/**
|
|
989
989
|
* @method
|
|
990
|
-
* @name
|
|
990
|
+
* @name coinbaseexchange#fetchTime
|
|
991
991
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
992
992
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
993
993
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
@@ -1090,10 +1090,10 @@ export default class coinbasepro extends Exchange {
|
|
|
1090
1090
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
1091
1091
|
/**
|
|
1092
1092
|
* @method
|
|
1093
|
-
* @name
|
|
1093
|
+
* @name coinbaseexchange#fetchOrder
|
|
1094
1094
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorder
|
|
1095
1095
|
* @description fetches information on an order made by the user
|
|
1096
|
-
* @param {string} symbol not used by
|
|
1096
|
+
* @param {string} symbol not used by coinbaseexchange fetchOrder
|
|
1097
1097
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1098
1098
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1099
1099
|
*/
|
|
@@ -1116,7 +1116,7 @@ export default class coinbasepro extends Exchange {
|
|
|
1116
1116
|
async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1117
1117
|
/**
|
|
1118
1118
|
* @method
|
|
1119
|
-
* @name
|
|
1119
|
+
* @name coinbaseexchange#fetchOrderTrades
|
|
1120
1120
|
* @description fetch all the trades made from a single order
|
|
1121
1121
|
* @param {string} id order id
|
|
1122
1122
|
* @param {string} symbol unified market symbol
|
|
@@ -1139,7 +1139,7 @@ export default class coinbasepro extends Exchange {
|
|
|
1139
1139
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1140
1140
|
/**
|
|
1141
1141
|
* @method
|
|
1142
|
-
* @name
|
|
1142
|
+
* @name coinbaseexchange#fetchOrders
|
|
1143
1143
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
|
|
1144
1144
|
* @description fetches information on multiple orders made by the user
|
|
1145
1145
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
@@ -1157,7 +1157,7 @@ export default class coinbasepro extends Exchange {
|
|
|
1157
1157
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1158
1158
|
/**
|
|
1159
1159
|
* @method
|
|
1160
|
-
* @name
|
|
1160
|
+
* @name coinbaseexchange#fetchOpenOrders
|
|
1161
1161
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
|
|
1162
1162
|
* @description fetch all unfilled currently open orders
|
|
1163
1163
|
* @param {string} symbol unified market symbol
|
|
@@ -1197,7 +1197,7 @@ export default class coinbasepro extends Exchange {
|
|
|
1197
1197
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1198
1198
|
/**
|
|
1199
1199
|
* @method
|
|
1200
|
-
* @name
|
|
1200
|
+
* @name coinbaseexchange#fetchClosedOrders
|
|
1201
1201
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
|
|
1202
1202
|
* @description fetches information on multiple closed orders made by the user
|
|
1203
1203
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
@@ -1215,7 +1215,7 @@ export default class coinbasepro extends Exchange {
|
|
|
1215
1215
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
1216
1216
|
/**
|
|
1217
1217
|
* @method
|
|
1218
|
-
* @name
|
|
1218
|
+
* @name coinbaseexchange#createOrder
|
|
1219
1219
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postorders
|
|
1220
1220
|
* @description create a trade order
|
|
1221
1221
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
@@ -1311,7 +1311,7 @@ export default class coinbasepro extends Exchange {
|
|
|
1311
1311
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
1312
1312
|
/**
|
|
1313
1313
|
* @method
|
|
1314
|
-
* @name
|
|
1314
|
+
* @name coinbaseexchange#cancelOrder
|
|
1315
1315
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_deleteorder
|
|
1316
1316
|
* @description cancels an open order
|
|
1317
1317
|
* @param {string} id order id
|
|
@@ -1344,7 +1344,7 @@ export default class coinbasepro extends Exchange {
|
|
|
1344
1344
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
1345
1345
|
/**
|
|
1346
1346
|
* @method
|
|
1347
|
-
* @name
|
|
1347
|
+
* @name coinbaseexchange#cancelAllOrders
|
|
1348
1348
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_deleteorders
|
|
1349
1349
|
* @description cancel all open orders
|
|
1350
1350
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
@@ -1366,7 +1366,7 @@ export default class coinbasepro extends Exchange {
|
|
|
1366
1366
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
1367
1367
|
/**
|
|
1368
1368
|
* @method
|
|
1369
|
-
* @name
|
|
1369
|
+
* @name coinbaseexchange#withdraw
|
|
1370
1370
|
* @description make a withdrawal
|
|
1371
1371
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postwithdrawpaymentmethod
|
|
1372
1372
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postwithdrawcoinbaseaccount
|
|
@@ -1492,7 +1492,7 @@ export default class coinbasepro extends Exchange {
|
|
|
1492
1492
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1493
1493
|
/**
|
|
1494
1494
|
* @method
|
|
1495
|
-
* @name
|
|
1495
|
+
* @name coinbaseexchange#fetchLedger
|
|
1496
1496
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountledger
|
|
1497
1497
|
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
1498
1498
|
* @param {string} code unified currency code, default is undefined
|
|
@@ -1543,7 +1543,7 @@ export default class coinbasepro extends Exchange {
|
|
|
1543
1543
|
async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1544
1544
|
/**
|
|
1545
1545
|
* @method
|
|
1546
|
-
* @name
|
|
1546
|
+
* @name coinbaseexchange#fetchDepositsWithdrawals
|
|
1547
1547
|
* @description fetch history of deposits and withdrawals
|
|
1548
1548
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_gettransfers
|
|
1549
1549
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounttransfers
|
|
@@ -1651,7 +1651,7 @@ export default class coinbasepro extends Exchange {
|
|
|
1651
1651
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1652
1652
|
/**
|
|
1653
1653
|
* @method
|
|
1654
|
-
* @name
|
|
1654
|
+
* @name coinbaseexchange#fetchDeposits
|
|
1655
1655
|
* @description fetch all deposits made to an account
|
|
1656
1656
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_gettransfers
|
|
1657
1657
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounttransfers
|
|
@@ -1666,7 +1666,7 @@ export default class coinbasepro extends Exchange {
|
|
|
1666
1666
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1667
1667
|
/**
|
|
1668
1668
|
* @method
|
|
1669
|
-
* @name
|
|
1669
|
+
* @name coinbaseexchange#fetchWithdrawals
|
|
1670
1670
|
* @description fetch all withdrawals made from an account
|
|
1671
1671
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_gettransfers
|
|
1672
1672
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounttransfers
|
|
@@ -1778,7 +1778,7 @@ export default class coinbasepro extends Exchange {
|
|
|
1778
1778
|
async createDepositAddress(code, params = {}) {
|
|
1779
1779
|
/**
|
|
1780
1780
|
* @method
|
|
1781
|
-
* @name
|
|
1781
|
+
* @name coinbaseexchange#createDepositAddress
|
|
1782
1782
|
* @description create a currency deposit address
|
|
1783
1783
|
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postcoinbaseaccountaddresses
|
|
1784
1784
|
* @param {string} code unified currency code of the currency for the deposit address
|
package/js/src/coinex.d.ts
CHANGED
|
@@ -121,7 +121,7 @@ export default class coinex extends Exchange {
|
|
|
121
121
|
fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
|
|
122
122
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
123
123
|
transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
|
|
124
|
-
parseTransferStatus(status:
|
|
124
|
+
parseTransferStatus(status: any): string;
|
|
125
125
|
parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
|
|
126
126
|
fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<TransferEntries>;
|
|
127
127
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
package/js/src/coinex.js
CHANGED
|
@@ -448,7 +448,9 @@ export default class coinex extends Exchange {
|
|
|
448
448
|
'fillResponseFromRequest': true,
|
|
449
449
|
},
|
|
450
450
|
'accountsById': {
|
|
451
|
-
'spot': '
|
|
451
|
+
'spot': 'SPOT',
|
|
452
|
+
'margin': 'MARGIN',
|
|
453
|
+
'swap': 'FUTURES',
|
|
452
454
|
},
|
|
453
455
|
'networks': {
|
|
454
456
|
'BEP20': 'BSC',
|
|
@@ -3654,7 +3656,11 @@ export default class coinex extends Exchange {
|
|
|
3654
3656
|
* @param {string} [params.marginMode] 'cross' or 'isolated' for fetching spot margin orders
|
|
3655
3657
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3656
3658
|
*/
|
|
3657
|
-
|
|
3659
|
+
const openOrders = await this.fetchOrdersByStatus('pending', symbol, since, limit, params);
|
|
3660
|
+
for (let i = 0; i < openOrders.length; i++) {
|
|
3661
|
+
openOrders[i]['status'] = 'open';
|
|
3662
|
+
}
|
|
3663
|
+
return openOrders;
|
|
3658
3664
|
}
|
|
3659
3665
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3660
3666
|
/**
|
|
@@ -4886,43 +4892,45 @@ export default class coinex extends Exchange {
|
|
|
4886
4892
|
* @method
|
|
4887
4893
|
* @name coinex#transfer
|
|
4888
4894
|
* @description transfer currency internally between wallets on the same account
|
|
4889
|
-
* @see https://
|
|
4890
|
-
* @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account013_margin_transfer
|
|
4895
|
+
* @see https://docs.coinex.com/api/v2/assets/transfer/http/transfer
|
|
4891
4896
|
* @param {string} code unified currency code
|
|
4892
4897
|
* @param {float} amount amount to transfer
|
|
4893
4898
|
* @param {string} fromAccount account to transfer from
|
|
4894
4899
|
* @param {string} toAccount account to transfer to
|
|
4895
4900
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4901
|
+
* @param {string} [params.symbol] unified ccxt symbol, required when either the fromAccount or toAccount is margin
|
|
4896
4902
|
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
4897
4903
|
*/
|
|
4898
4904
|
await this.loadMarkets();
|
|
4899
4905
|
const currency = this.currency(code);
|
|
4900
4906
|
const amountToPrecision = this.currencyToPrecision(code, amount);
|
|
4907
|
+
const accountsById = this.safeDict(this.options, 'accountsById', {});
|
|
4908
|
+
const fromId = this.safeString(accountsById, fromAccount, fromAccount);
|
|
4909
|
+
const toId = this.safeString(accountsById, toAccount, toAccount);
|
|
4901
4910
|
const request = {
|
|
4911
|
+
'ccy': currency['id'],
|
|
4902
4912
|
'amount': amountToPrecision,
|
|
4903
|
-
'
|
|
4913
|
+
'from_account_type': fromId,
|
|
4914
|
+
'to_account_type': toId,
|
|
4904
4915
|
};
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
request['
|
|
4912
|
-
response = await this.v1PrivatePostContractBalanceTransfer(this.extend(request, params));
|
|
4916
|
+
if ((fromAccount === 'margin') || (toAccount === 'margin')) {
|
|
4917
|
+
const symbol = this.safeString(params, 'symbol');
|
|
4918
|
+
if (symbol === undefined) {
|
|
4919
|
+
throw new ArgumentsRequired(this.id + ' transfer() the symbol parameter must be defined for a margin account');
|
|
4920
|
+
}
|
|
4921
|
+
params = this.omit(params, 'symbol');
|
|
4922
|
+
request['market'] = this.marketId(symbol);
|
|
4913
4923
|
}
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
const fromId = this.safeString(accountsById, fromAccount, fromAccount);
|
|
4917
|
-
const toId = this.safeString(accountsById, toAccount, toAccount);
|
|
4918
|
-
// fromAccount and toAccount must be integers for margin transfers
|
|
4919
|
-
// spot is 0, use fetchBalance() to find the margin account id
|
|
4920
|
-
request['from_account'] = parseInt(fromId);
|
|
4921
|
-
request['to_account'] = parseInt(toId);
|
|
4922
|
-
response = await this.v1PrivatePostMarginTransfer(this.extend(request, params));
|
|
4924
|
+
if ((fromAccount !== 'spot') && (toAccount !== 'spot')) {
|
|
4925
|
+
throw new BadRequest(this.id + ' transfer() can only be between spot and swap, or spot and margin, either the fromAccount or toAccount must be spot');
|
|
4923
4926
|
}
|
|
4927
|
+
const response = await this.v2PrivatePostAssetsTransfer(this.extend(request, params));
|
|
4924
4928
|
//
|
|
4925
|
-
// {
|
|
4929
|
+
// {
|
|
4930
|
+
// "code": 0,
|
|
4931
|
+
// "data": {},
|
|
4932
|
+
// "message": "OK"
|
|
4933
|
+
// }
|
|
4926
4934
|
//
|
|
4927
4935
|
return this.extend(this.parseTransfer(response, currency), {
|
|
4928
4936
|
'amount': this.parseNumber(amountToPrecision),
|
|
@@ -4934,67 +4942,24 @@ export default class coinex extends Exchange {
|
|
|
4934
4942
|
const statuses = {
|
|
4935
4943
|
'0': 'ok',
|
|
4936
4944
|
'SUCCESS': 'ok',
|
|
4945
|
+
'OK': 'ok',
|
|
4937
4946
|
};
|
|
4938
4947
|
return this.safeString(statuses, status, status);
|
|
4939
4948
|
}
|
|
4940
4949
|
parseTransfer(transfer, currency = undefined) {
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
// "asset": "USDT",
|
|
4947
|
-
// "transfer_type": "transfer_out", // from swap to spot
|
|
4948
|
-
// "created_at": 1651633422
|
|
4949
|
-
// },
|
|
4950
|
-
//
|
|
4951
|
-
// fetchTransfers Margin
|
|
4952
|
-
//
|
|
4953
|
-
// {
|
|
4954
|
-
// "id": 7580062,
|
|
4955
|
-
// "updated_at": 1653684379,
|
|
4956
|
-
// "user_id": 3620173,
|
|
4957
|
-
// "from_account_id": 0,
|
|
4958
|
-
// "to_account_id": 1,
|
|
4959
|
-
// "asset": "BTC",
|
|
4960
|
-
// "amount": "0.00160829",
|
|
4961
|
-
// "balance": "0.00160829",
|
|
4962
|
-
// "transfer_type": "IN",
|
|
4963
|
-
// "status": "SUCCESS",
|
|
4964
|
-
// "created_at": 1653684379
|
|
4965
|
-
// },
|
|
4966
|
-
//
|
|
4967
|
-
const timestamp = this.safeTimestamp(transfer, 'created_at');
|
|
4968
|
-
const transferType = this.safeString(transfer, 'transfer_type');
|
|
4969
|
-
let fromAccount = undefined;
|
|
4970
|
-
let toAccount = undefined;
|
|
4971
|
-
if (transferType === 'transfer_out') {
|
|
4972
|
-
fromAccount = 'swap';
|
|
4973
|
-
toAccount = 'spot';
|
|
4974
|
-
}
|
|
4975
|
-
else if (transferType === 'transfer_in') {
|
|
4976
|
-
fromAccount = 'spot';
|
|
4977
|
-
toAccount = 'swap';
|
|
4978
|
-
}
|
|
4979
|
-
else if (transferType === 'IN') {
|
|
4980
|
-
fromAccount = 'spot';
|
|
4981
|
-
toAccount = 'margin';
|
|
4982
|
-
}
|
|
4983
|
-
else if (transferType === 'OUT') {
|
|
4984
|
-
fromAccount = 'margin';
|
|
4985
|
-
toAccount = 'spot';
|
|
4986
|
-
}
|
|
4987
|
-
const currencyId = this.safeString(transfer, 'asset');
|
|
4988
|
-
const currencyCode = this.safeCurrencyCode(currencyId, currency);
|
|
4950
|
+
const timestamp = this.safeInteger(transfer, 'created_at');
|
|
4951
|
+
const currencyId = this.safeString(transfer, 'ccy');
|
|
4952
|
+
const fromId = this.safeString(transfer, 'from_account_type');
|
|
4953
|
+
const toId = this.safeString(transfer, 'to_account_type');
|
|
4954
|
+
const accountsById = this.safeValue(this.options, 'accountsById', {});
|
|
4989
4955
|
return {
|
|
4990
|
-
'
|
|
4991
|
-
'id': this.safeString(transfer, 'id'),
|
|
4956
|
+
'id': undefined,
|
|
4992
4957
|
'timestamp': timestamp,
|
|
4993
4958
|
'datetime': this.iso8601(timestamp),
|
|
4994
|
-
'currency':
|
|
4959
|
+
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
4995
4960
|
'amount': this.safeNumber(transfer, 'amount'),
|
|
4996
|
-
'fromAccount':
|
|
4997
|
-
'toAccount':
|
|
4961
|
+
'fromAccount': this.safeString(accountsById, fromId, fromId),
|
|
4962
|
+
'toAccount': this.safeString(accountsById, toId, toId),
|
|
4998
4963
|
'status': this.parseTransferStatus(this.safeString2(transfer, 'code', 'status')),
|
|
4999
4964
|
};
|
|
5000
4965
|
}
|
package/js/src/kucoin.js
CHANGED
|
@@ -4786,6 +4786,7 @@ export default class kucoin extends Exchange {
|
|
|
4786
4786
|
const partnerSignature = this.hmac(this.encode(partnerPayload), this.encode(partnerSecret), sha256, 'base64');
|
|
4787
4787
|
headers['KC-API-PARTNER-SIGN'] = partnerSignature;
|
|
4788
4788
|
headers['KC-API-PARTNER'] = partnerId;
|
|
4789
|
+
headers['KC-API-PARTNER-VERIFY'] = 'true';
|
|
4789
4790
|
}
|
|
4790
4791
|
if (isBroker) {
|
|
4791
4792
|
const brokerName = this.safeString(partner, 'name');
|
package/js/src/pro/bitget.js
CHANGED
|
@@ -1126,7 +1126,7 @@ export default class bitget extends bitgetRest {
|
|
|
1126
1126
|
// "executePrice": "35123", // this is limit price
|
|
1127
1127
|
// "triggerType": "fill_price",
|
|
1128
1128
|
// "planType": "amount",
|
|
1129
|
-
// #### in case order had fill: ####
|
|
1129
|
+
// #### in case order had a partial fill: ####
|
|
1130
1130
|
// fillPrice: '35123',
|
|
1131
1131
|
// tradeId: '1171775539946528779',
|
|
1132
1132
|
// baseVolume: '7', // field present in market order
|
|
@@ -1246,6 +1246,8 @@ export default class bitget extends bitgetRest {
|
|
|
1246
1246
|
let totalAmount = undefined;
|
|
1247
1247
|
let filledAmount = undefined;
|
|
1248
1248
|
let cost = undefined;
|
|
1249
|
+
let remaining = undefined;
|
|
1250
|
+
const totalFilled = this.safeString(order, 'accBaseVolume');
|
|
1249
1251
|
if (isSpot) {
|
|
1250
1252
|
if (isMargin) {
|
|
1251
1253
|
filledAmount = this.omitZero(this.safeString(order, 'fillTotalAmount'));
|
|
@@ -1253,7 +1255,13 @@ export default class bitget extends bitgetRest {
|
|
|
1253
1255
|
cost = this.safeString(order, 'quoteSize');
|
|
1254
1256
|
}
|
|
1255
1257
|
else {
|
|
1256
|
-
|
|
1258
|
+
const partialFillAmount = this.safeString(order, 'baseVolume');
|
|
1259
|
+
if (partialFillAmount !== undefined) {
|
|
1260
|
+
filledAmount = partialFillAmount;
|
|
1261
|
+
}
|
|
1262
|
+
else {
|
|
1263
|
+
filledAmount = totalFilled;
|
|
1264
|
+
}
|
|
1257
1265
|
if (isMarketOrder) {
|
|
1258
1266
|
if (isBuy) {
|
|
1259
1267
|
totalAmount = accBaseVolume;
|
|
@@ -1276,6 +1284,7 @@ export default class bitget extends bitgetRest {
|
|
|
1276
1284
|
totalAmount = this.safeString(order, 'size');
|
|
1277
1285
|
cost = this.safeString(order, 'fillNotionalUsd');
|
|
1278
1286
|
}
|
|
1287
|
+
remaining = this.omitZero(Precise.stringSub(totalAmount, totalFilled));
|
|
1279
1288
|
return this.safeOrder({
|
|
1280
1289
|
'info': order,
|
|
1281
1290
|
'symbol': symbol,
|
|
@@ -1294,7 +1303,7 @@ export default class bitget extends bitgetRest {
|
|
|
1294
1303
|
'cost': cost,
|
|
1295
1304
|
'average': avgPrice,
|
|
1296
1305
|
'filled': filledAmount,
|
|
1297
|
-
'remaining':
|
|
1306
|
+
'remaining': remaining,
|
|
1298
1307
|
'status': this.parseWsOrderStatus(rawStatus),
|
|
1299
1308
|
'fee': feeObject,
|
|
1300
1309
|
'trades': undefined,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import coinbaseexchangeRest from '../coinbaseexchange.js';
|
|
2
2
|
import type { Tickers, Int, Ticker, Str, Strings, OrderBook, Trade, Order } from '../base/types.js';
|
|
3
3
|
import Client from '../base/ws/Client.js';
|
|
4
|
-
export default class
|
|
4
|
+
export default class coinbaseexchange extends coinbaseexchangeRest {
|
|
5
5
|
describe(): any;
|
|
6
6
|
authenticate(): {
|
|
7
7
|
timestamp: number;
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
6
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
|
-
import
|
|
8
|
+
import coinbaseexchangeRest from '../coinbaseexchange.js';
|
|
9
9
|
import { AuthenticationError, ExchangeError, BadSymbol, BadRequest, ArgumentsRequired } from '../base/errors.js';
|
|
10
10
|
import { ArrayCache, ArrayCacheBySymbolById } from '../base/ws/Cache.js';
|
|
11
11
|
import { sha256 } from '../static_dependencies/noble-hashes/sha256.js';
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
13
|
-
export default class
|
|
13
|
+
export default class coinbaseexchange extends coinbaseexchangeRest {
|
|
14
14
|
describe() {
|
|
15
15
|
return this.deepExtend(super.describe(), {
|
|
16
16
|
'has': {
|
|
@@ -31,7 +31,7 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
31
31
|
},
|
|
32
32
|
'urls': {
|
|
33
33
|
'api': {
|
|
34
|
-
'ws': 'wss://ws-feed.
|
|
34
|
+
'ws': 'wss://ws-feed.exchange.coinbase.com',
|
|
35
35
|
},
|
|
36
36
|
'test': {
|
|
37
37
|
'ws': 'wss://ws-feed-public.sandbox.exchange.coinbase.com',
|
|
@@ -112,7 +112,7 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
112
112
|
async watchTicker(symbol, params = {}) {
|
|
113
113
|
/**
|
|
114
114
|
* @method
|
|
115
|
-
* @name
|
|
115
|
+
* @name coinbaseexchange#watchTicker
|
|
116
116
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
117
117
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
118
118
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -124,7 +124,7 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
124
124
|
async watchTickers(symbols = undefined, params = {}) {
|
|
125
125
|
/**
|
|
126
126
|
* @method
|
|
127
|
-
* @name
|
|
127
|
+
* @name coinbaseexchange#watchTickers
|
|
128
128
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
129
129
|
* @param {string[]} [symbols] unified symbol of the market to fetch the ticker for
|
|
130
130
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -149,7 +149,7 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
149
149
|
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
150
150
|
/**
|
|
151
151
|
* @method
|
|
152
|
-
* @name
|
|
152
|
+
* @name coinbaseexchange#watchTrades
|
|
153
153
|
* @description get the list of most recent trades for a particular symbol
|
|
154
154
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
155
155
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
@@ -195,7 +195,7 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
195
195
|
async watchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
196
196
|
/**
|
|
197
197
|
* @method
|
|
198
|
-
* @name
|
|
198
|
+
* @name coinbaseexchange#watchMyTrades
|
|
199
199
|
* @description watches information on multiple trades made by the user
|
|
200
200
|
* @param {string} symbol unified market symbol of the market trades were made in
|
|
201
201
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -220,7 +220,7 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
220
220
|
async watchMyTradesForSymbols(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
221
221
|
/**
|
|
222
222
|
* @method
|
|
223
|
-
* @name
|
|
223
|
+
* @name coinbaseexchange#watchMyTradesForSymbols
|
|
224
224
|
* @description watches information on multiple trades made by the user
|
|
225
225
|
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
226
226
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -244,7 +244,7 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
244
244
|
async watchOrdersForSymbols(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
245
245
|
/**
|
|
246
246
|
* @method
|
|
247
|
-
* @name
|
|
247
|
+
* @name coinbaseexchange#watchOrdersForSymbols
|
|
248
248
|
* @description watches information on multiple orders made by the user
|
|
249
249
|
* @param {string[]} symbols unified symbol of the market to fetch orders for
|
|
250
250
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
@@ -268,7 +268,7 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
268
268
|
async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
269
269
|
/**
|
|
270
270
|
* @method
|
|
271
|
-
* @name
|
|
271
|
+
* @name coinbaseexchange#watchOrders
|
|
272
272
|
* @description watches information on multiple orders made by the user
|
|
273
273
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
274
274
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
@@ -293,7 +293,7 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
293
293
|
async watchOrderBookForSymbols(symbols, limit = undefined, params = {}) {
|
|
294
294
|
/**
|
|
295
295
|
* @method
|
|
296
|
-
* @name
|
|
296
|
+
* @name coinbaseexchange#watchOrderBookForSymbols
|
|
297
297
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
298
298
|
* @param {string[]} symbols unified array of symbols
|
|
299
299
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
@@ -335,7 +335,7 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
335
335
|
async watchOrderBook(symbol, limit = undefined, params = {}) {
|
|
336
336
|
/**
|
|
337
337
|
* @method
|
|
338
|
-
* @name
|
|
338
|
+
* @name coinbaseexchange#watchOrderBook
|
|
339
339
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
340
340
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
341
341
|
* @param {int} [limit] the maximum amount of order book entries to return
|
package/package.json
CHANGED