ccxt 4.3.84 → 4.3.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +2 -1
- package/dist/cjs/src/base/errors.js +8 -1
- package/dist/cjs/src/bitmex.js +4 -0
- package/dist/cjs/src/bybit.js +15 -14
- package/dist/cjs/src/cryptocom.js +117 -2
- package/dist/cjs/src/kraken.js +29 -1
- package/dist/cjs/src/kucoinfutures.js +5 -0
- package/dist/cjs/src/mexc.js +2 -2
- package/dist/cjs/src/pro/binance.js +1 -1
- package/dist/cjs/src/pro/bitget.js +113 -4
- package/dist/cjs/src/pro/okx.js +25 -4
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +3 -3
- package/js/src/abstract/cryptocom.d.ts +2 -0
- package/js/src/abstract/kucoinfutures.d.ts +2 -0
- package/js/src/base/errorHierarchy.d.ts +1 -0
- package/js/src/base/errorHierarchy.js +1 -0
- package/js/src/base/errors.d.ts +5 -1
- package/js/src/base/errors.js +8 -2
- package/js/src/bitmex.js +4 -0
- package/js/src/bybit.js +16 -15
- package/js/src/cryptocom.d.ts +5 -1
- package/js/src/cryptocom.js +117 -2
- package/js/src/kraken.js +29 -1
- package/js/src/kucoinfutures.js +5 -0
- package/js/src/mexc.js +2 -2
- package/js/src/pro/binance.js +1 -1
- package/js/src/pro/bitget.d.ts +4 -0
- package/js/src/pro/bitget.js +113 -4
- package/js/src/pro/okx.js +25 -4
- package/package.json +1 -1
package/js/ccxt.js
CHANGED
|
@@ -35,10 +35,10 @@ import { Exchange } from './src/base/Exchange.js';
|
|
|
35
35
|
import { Precise } from './src/base/Precise.js';
|
|
36
36
|
import * as functions from './src/base/functions.js';
|
|
37
37
|
import * as errors from './src/base/errors.js';
|
|
38
|
-
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending } from './src/base/errors.js';
|
|
38
|
+
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.3.
|
|
41
|
+
const version = '4.3.85';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -416,6 +416,6 @@ pro.exchanges = Object.keys(pro);
|
|
|
416
416
|
pro['Exchange'] = Exchange; // now the same for rest and ts
|
|
417
417
|
//-----------------------------------------------------------------------------
|
|
418
418
|
const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
|
|
419
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
|
|
419
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
|
|
420
420
|
export default ccxt;
|
|
421
421
|
//-----------------------------------------------------------------------------
|
|
@@ -37,6 +37,8 @@ interface Exchange {
|
|
|
37
37
|
v1PrivatePostPrivateGetAccounts(params?: {}): Promise<implicitReturnType>;
|
|
38
38
|
v1PrivatePostPrivateGetWithdrawalHistory(params?: {}): Promise<implicitReturnType>;
|
|
39
39
|
v1PrivatePostPrivateGetDepositHistory(params?: {}): Promise<implicitReturnType>;
|
|
40
|
+
v1PrivatePostPrivateGetFeeRate(params?: {}): Promise<implicitReturnType>;
|
|
41
|
+
v1PrivatePostPrivateGetInstrumentFeeRate(params?: {}): Promise<implicitReturnType>;
|
|
40
42
|
v1PrivatePostPrivateStakingStake(params?: {}): Promise<implicitReturnType>;
|
|
41
43
|
v1PrivatePostPrivateStakingUnstake(params?: {}): Promise<implicitReturnType>;
|
|
42
44
|
v1PrivatePostPrivateStakingGetStakingPosition(params?: {}): Promise<implicitReturnType>;
|
|
@@ -161,6 +161,7 @@ interface kucoin {
|
|
|
161
161
|
futuresPublicGetStatus(params?: {}): Promise<implicitReturnType>;
|
|
162
162
|
futuresPublicGetLevel2MessageQuery(params?: {}): Promise<implicitReturnType>;
|
|
163
163
|
futuresPublicGetContractsRiskLimitSymbol(params?: {}): Promise<implicitReturnType>;
|
|
164
|
+
futuresPublicGetAllTickers(params?: {}): Promise<implicitReturnType>;
|
|
164
165
|
futuresPublicGetLevel2DepthLimit(params?: {}): Promise<implicitReturnType>;
|
|
165
166
|
futuresPublicGetLevel3MessageQuery(params?: {}): Promise<implicitReturnType>;
|
|
166
167
|
futuresPublicGetLevel3Snapshot(params?: {}): Promise<implicitReturnType>;
|
|
@@ -190,6 +191,7 @@ interface kucoin {
|
|
|
190
191
|
futuresPrivateGetTradeStatistics(params?: {}): Promise<implicitReturnType>;
|
|
191
192
|
futuresPrivateGetTradeFees(params?: {}): Promise<implicitReturnType>;
|
|
192
193
|
futuresPrivateGetHistoryPositions(params?: {}): Promise<implicitReturnType>;
|
|
194
|
+
futuresPrivateGetGetMaxOpenSize(params?: {}): Promise<implicitReturnType>;
|
|
193
195
|
futuresPrivatePostTransferOut(params?: {}): Promise<implicitReturnType>;
|
|
194
196
|
futuresPrivatePostTransferIn(params?: {}): Promise<implicitReturnType>;
|
|
195
197
|
futuresPrivatePostOrders(params?: {}): Promise<implicitReturnType>;
|
package/js/src/base/errors.d.ts
CHANGED
|
@@ -37,6 +37,9 @@ declare class MarginModeAlreadySet extends NoChange {
|
|
|
37
37
|
declare class MarketClosed extends OperationRejected {
|
|
38
38
|
constructor(message: string);
|
|
39
39
|
}
|
|
40
|
+
declare class ManualInteractionNeeded extends OperationRejected {
|
|
41
|
+
constructor(message: string);
|
|
42
|
+
}
|
|
40
43
|
declare class InsufficientFunds extends ExchangeError {
|
|
41
44
|
constructor(message: string);
|
|
42
45
|
}
|
|
@@ -112,7 +115,7 @@ declare class NullResponse extends BadResponse {
|
|
|
112
115
|
declare class CancelPending extends OperationFailed {
|
|
113
116
|
constructor(message: string);
|
|
114
117
|
}
|
|
115
|
-
export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending };
|
|
118
|
+
export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending };
|
|
116
119
|
declare const _default: {
|
|
117
120
|
BaseError: typeof BaseError;
|
|
118
121
|
ExchangeError: typeof ExchangeError;
|
|
@@ -127,6 +130,7 @@ declare const _default: {
|
|
|
127
130
|
NoChange: typeof NoChange;
|
|
128
131
|
MarginModeAlreadySet: typeof MarginModeAlreadySet;
|
|
129
132
|
MarketClosed: typeof MarketClosed;
|
|
133
|
+
ManualInteractionNeeded: typeof ManualInteractionNeeded;
|
|
130
134
|
InsufficientFunds: typeof InsufficientFunds;
|
|
131
135
|
InvalidAddress: typeof InvalidAddress;
|
|
132
136
|
AddressPending: typeof AddressPending;
|
package/js/src/base/errors.js
CHANGED
|
@@ -83,6 +83,12 @@ class MarketClosed extends OperationRejected {
|
|
|
83
83
|
this.name = 'MarketClosed';
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
+
class ManualInteractionNeeded extends OperationRejected {
|
|
87
|
+
constructor(message) {
|
|
88
|
+
super(message);
|
|
89
|
+
this.name = 'ManualInteractionNeeded';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
86
92
|
class InsufficientFunds extends ExchangeError {
|
|
87
93
|
constructor(message) {
|
|
88
94
|
super(message);
|
|
@@ -233,5 +239,5 @@ class CancelPending extends OperationFailed {
|
|
|
233
239
|
this.name = 'CancelPending';
|
|
234
240
|
}
|
|
235
241
|
}
|
|
236
|
-
export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending };
|
|
237
|
-
export default { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending };
|
|
242
|
+
export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending };
|
|
243
|
+
export default { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending };
|
package/js/src/bitmex.js
CHANGED
|
@@ -10,6 +10,7 @@ import { TICK_SIZE } from './base/functions/number.js';
|
|
|
10
10
|
import { AuthenticationError, BadRequest, DDoSProtection, ExchangeError, ExchangeNotAvailable, InsufficientFunds, InvalidOrder, OrderNotFound, PermissionDenied, ArgumentsRequired, BadSymbol } from './base/errors.js';
|
|
11
11
|
import { Precise } from './base/Precise.js';
|
|
12
12
|
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
|
|
13
|
+
import { totp } from './base/functions/totp.js';
|
|
13
14
|
// ---------------------------------------------------------------------------
|
|
14
15
|
/**
|
|
15
16
|
* @class bitmex
|
|
@@ -2458,6 +2459,9 @@ export default class bitmex extends Exchange {
|
|
|
2458
2459
|
// 'otpToken': '123456', // requires if two-factor auth (OTP) is enabled
|
|
2459
2460
|
// 'fee': 0.001, // bitcoin network fee
|
|
2460
2461
|
};
|
|
2462
|
+
if (this.twofa !== undefined) {
|
|
2463
|
+
request['otpToken'] = totp(this.twofa);
|
|
2464
|
+
}
|
|
2461
2465
|
const response = await this.privatePostUserRequestWithdrawal(this.extend(request, params));
|
|
2462
2466
|
//
|
|
2463
2467
|
// {
|
package/js/src/bybit.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import Exchange from './abstract/bybit.js';
|
|
9
9
|
import { TICK_SIZE } from './base/functions/number.js';
|
|
10
|
-
import { AuthenticationError, ExchangeError, ArgumentsRequired, PermissionDenied, InvalidOrder, OrderNotFound, InsufficientFunds, BadRequest, RateLimitExceeded, InvalidNonce, NotSupported, RequestTimeout, MarginModeAlreadySet, NoChange } from './base/errors.js';
|
|
10
|
+
import { AuthenticationError, ExchangeError, ArgumentsRequired, PermissionDenied, InvalidOrder, OrderNotFound, InsufficientFunds, BadRequest, RateLimitExceeded, InvalidNonce, NotSupported, RequestTimeout, MarginModeAlreadySet, NoChange, ManualInteractionNeeded } from './base/errors.js';
|
|
11
11
|
import { Precise } from './base/Precise.js';
|
|
12
12
|
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
|
|
13
13
|
import { rsa } from './base/functions/rsa.js';
|
|
@@ -756,8 +756,11 @@ export default class bybit extends Exchange {
|
|
|
756
756
|
'140069': PermissionDenied,
|
|
757
757
|
'140070': InvalidOrder,
|
|
758
758
|
'170001': ExchangeError,
|
|
759
|
-
'170007': RequestTimeout,
|
|
760
759
|
'170005': InvalidOrder,
|
|
760
|
+
'170007': RequestTimeout,
|
|
761
|
+
'170010': InvalidOrder,
|
|
762
|
+
'170011': InvalidOrder,
|
|
763
|
+
'170019': InvalidOrder,
|
|
761
764
|
'170031': ExchangeError,
|
|
762
765
|
'170032': ExchangeError,
|
|
763
766
|
'170033': InsufficientFunds,
|
|
@@ -770,6 +773,7 @@ export default class bybit extends Exchange {
|
|
|
770
773
|
'170116': InvalidOrder,
|
|
771
774
|
'170117': InvalidOrder,
|
|
772
775
|
'170121': InvalidOrder,
|
|
776
|
+
'170124': InvalidOrder,
|
|
773
777
|
'170130': BadRequest,
|
|
774
778
|
'170131': InsufficientFunds,
|
|
775
779
|
'170132': InvalidOrder,
|
|
@@ -780,7 +784,6 @@ export default class bybit extends Exchange {
|
|
|
780
784
|
'170137': InvalidOrder,
|
|
781
785
|
'170139': InvalidOrder,
|
|
782
786
|
'170140': InvalidOrder,
|
|
783
|
-
'170124': InvalidOrder,
|
|
784
787
|
'170141': InvalidOrder,
|
|
785
788
|
'170142': InvalidOrder,
|
|
786
789
|
'170143': InvalidOrder,
|
|
@@ -805,6 +808,15 @@ export default class bybit extends Exchange {
|
|
|
805
808
|
'170198': InvalidOrder,
|
|
806
809
|
'170199': InvalidOrder,
|
|
807
810
|
'170200': InvalidOrder,
|
|
811
|
+
'170201': PermissionDenied,
|
|
812
|
+
'170202': InvalidOrder,
|
|
813
|
+
'170203': InvalidOrder,
|
|
814
|
+
'170204': InvalidOrder,
|
|
815
|
+
'170206': InvalidOrder,
|
|
816
|
+
'170210': InvalidOrder,
|
|
817
|
+
'170213': OrderNotFound,
|
|
818
|
+
'170217': InvalidOrder,
|
|
819
|
+
'170218': InvalidOrder,
|
|
808
820
|
'170221': BadRequest,
|
|
809
821
|
'170222': RateLimitExceeded,
|
|
810
822
|
'170223': InsufficientFunds,
|
|
@@ -814,18 +826,7 @@ export default class bybit extends Exchange {
|
|
|
814
826
|
'170228': InvalidOrder,
|
|
815
827
|
'170229': InvalidOrder,
|
|
816
828
|
'170234': ExchangeError,
|
|
817
|
-
'
|
|
818
|
-
'170213': OrderNotFound,
|
|
819
|
-
'170217': InvalidOrder,
|
|
820
|
-
'170218': InvalidOrder,
|
|
821
|
-
'170010': InvalidOrder,
|
|
822
|
-
'170011': InvalidOrder,
|
|
823
|
-
'170019': InvalidOrder,
|
|
824
|
-
'170201': PermissionDenied,
|
|
825
|
-
'170202': InvalidOrder,
|
|
826
|
-
'170203': InvalidOrder,
|
|
827
|
-
'170204': InvalidOrder,
|
|
828
|
-
'170206': InvalidOrder,
|
|
829
|
+
'170241': ManualInteractionNeeded,
|
|
829
830
|
'175000': InvalidOrder,
|
|
830
831
|
'175001': InvalidOrder,
|
|
831
832
|
'175002': InvalidOrder,
|
package/js/src/cryptocom.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/cryptocom.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, Str, Ticker, OrderRequest, Balances, Transaction, OrderBook, Tickers, Strings, Currency, Market, Num, Account, CancellationRequest, Dict, int } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, Str, Ticker, OrderRequest, Balances, Transaction, OrderBook, Tickers, Strings, Currency, Market, Num, Account, CancellationRequest, Dict, int, TradingFeeInterface, TradingFees } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class cryptocom
|
|
5
5
|
* @augments Exchange
|
|
@@ -90,6 +90,10 @@ export default class cryptocom extends Exchange {
|
|
|
90
90
|
nonce(): number;
|
|
91
91
|
paramsToString(object: any, level: any): any;
|
|
92
92
|
closePosition(symbol: string, side?: OrderSide, params?: {}): Promise<Order>;
|
|
93
|
+
fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
|
|
94
|
+
fetchTradingFees(params?: {}): Promise<TradingFees>;
|
|
95
|
+
parseTradingFees(response: any): Dict;
|
|
96
|
+
parseTradingFee(fee: Dict, market?: Market): TradingFeeInterface;
|
|
93
97
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
94
98
|
url: string;
|
|
95
99
|
method: string;
|
package/js/src/cryptocom.js
CHANGED
|
@@ -94,8 +94,8 @@ export default class cryptocom extends Exchange {
|
|
|
94
94
|
'fetchTickers': true,
|
|
95
95
|
'fetchTime': false,
|
|
96
96
|
'fetchTrades': true,
|
|
97
|
-
'fetchTradingFee':
|
|
98
|
-
'fetchTradingFees':
|
|
97
|
+
'fetchTradingFee': true,
|
|
98
|
+
'fetchTradingFees': true,
|
|
99
99
|
'fetchTransactionFees': false,
|
|
100
100
|
'fetchTransactions': false,
|
|
101
101
|
'fetchTransfers': false,
|
|
@@ -196,6 +196,8 @@ export default class cryptocom extends Exchange {
|
|
|
196
196
|
'private/get-accounts': 10 / 3,
|
|
197
197
|
'private/get-withdrawal-history': 10 / 3,
|
|
198
198
|
'private/get-deposit-history': 10 / 3,
|
|
199
|
+
'private/get-fee-rate': 2,
|
|
200
|
+
'private/get-instrument-fee-rate': 2,
|
|
199
201
|
'private/staking/stake': 2,
|
|
200
202
|
'private/staking/unstake': 2,
|
|
201
203
|
'private/staking/get-staking-position': 2,
|
|
@@ -3022,6 +3024,119 @@ export default class cryptocom extends Exchange {
|
|
|
3022
3024
|
const result = this.safeDict(response, 'result');
|
|
3023
3025
|
return this.parseOrder(result, market);
|
|
3024
3026
|
}
|
|
3027
|
+
async fetchTradingFee(symbol, params = {}) {
|
|
3028
|
+
/**
|
|
3029
|
+
* @method
|
|
3030
|
+
* @name cryptocom#fetchTradingFee
|
|
3031
|
+
* @description fetch the trading fees for a market
|
|
3032
|
+
* @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-instrument-fee-rate
|
|
3033
|
+
* @param {string} symbol unified market symbol
|
|
3034
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3035
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
3036
|
+
*/
|
|
3037
|
+
await this.loadMarkets();
|
|
3038
|
+
const market = this.market(symbol);
|
|
3039
|
+
const request = {
|
|
3040
|
+
'instrument_name': market['id'],
|
|
3041
|
+
};
|
|
3042
|
+
const response = await this.v1PrivatePostPrivateGetInstrumentFeeRate(this.extend(request, params));
|
|
3043
|
+
//
|
|
3044
|
+
// {
|
|
3045
|
+
// "id": 1,
|
|
3046
|
+
// "code": 0,
|
|
3047
|
+
// "method": "private/staking/unstake",
|
|
3048
|
+
// "result": {
|
|
3049
|
+
// "staking_id": "1",
|
|
3050
|
+
// "instrument_name": "SOL.staked",
|
|
3051
|
+
// "status": "NEW",
|
|
3052
|
+
// "quantity": "1",
|
|
3053
|
+
// "underlying_inst_name": "SOL",
|
|
3054
|
+
// "reason": "NO_ERROR"
|
|
3055
|
+
// }
|
|
3056
|
+
// }
|
|
3057
|
+
//
|
|
3058
|
+
const data = this.safeDict(response, 'result', {});
|
|
3059
|
+
return this.parseTradingFee(data, market);
|
|
3060
|
+
}
|
|
3061
|
+
async fetchTradingFees(params = {}) {
|
|
3062
|
+
/**
|
|
3063
|
+
* @method
|
|
3064
|
+
* @name cryptocom#fetchTradingFees
|
|
3065
|
+
* @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-fee-rate
|
|
3066
|
+
* @description fetch the trading fees for multiple markets
|
|
3067
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3068
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
3069
|
+
*/
|
|
3070
|
+
await this.loadMarkets();
|
|
3071
|
+
const response = await this.v1PrivatePostPrivateGetFeeRate(params);
|
|
3072
|
+
//
|
|
3073
|
+
// {
|
|
3074
|
+
// "id": 1,
|
|
3075
|
+
// "method": "/private/get-fee-rate",
|
|
3076
|
+
// "code": 0,
|
|
3077
|
+
// "result": {
|
|
3078
|
+
// "spot_tier": "3",
|
|
3079
|
+
// "deriv_tier": "3",
|
|
3080
|
+
// "effective_spot_maker_rate_bps": "6.5",
|
|
3081
|
+
// "effective_spot_taker_rate_bps": "6.9",
|
|
3082
|
+
// "effective_deriv_maker_rate_bps": "1.1",
|
|
3083
|
+
// "effective_deriv_taker_rate_bps": "3"
|
|
3084
|
+
// }
|
|
3085
|
+
// }
|
|
3086
|
+
//
|
|
3087
|
+
const result = this.safeDict(response, 'result', {});
|
|
3088
|
+
return this.parseTradingFees(result);
|
|
3089
|
+
}
|
|
3090
|
+
parseTradingFees(response) {
|
|
3091
|
+
//
|
|
3092
|
+
// {
|
|
3093
|
+
// "spot_tier": "3",
|
|
3094
|
+
// "deriv_tier": "3",
|
|
3095
|
+
// "effective_spot_maker_rate_bps": "6.5",
|
|
3096
|
+
// "effective_spot_taker_rate_bps": "6.9",
|
|
3097
|
+
// "effective_deriv_maker_rate_bps": "1.1",
|
|
3098
|
+
// "effective_deriv_taker_rate_bps": "3"
|
|
3099
|
+
// }
|
|
3100
|
+
//
|
|
3101
|
+
const result = {};
|
|
3102
|
+
result['info'] = response;
|
|
3103
|
+
for (let i = 0; i < this.symbols.length; i++) {
|
|
3104
|
+
const symbol = this.symbols[i];
|
|
3105
|
+
const market = this.market(symbol);
|
|
3106
|
+
const isSwap = market['swap'];
|
|
3107
|
+
const takerFeeKey = isSwap ? 'effective_deriv_taker_rate_bps' : 'effective_spot_taker_rate_bps';
|
|
3108
|
+
const makerFeeKey = isSwap ? 'effective_deriv_maker_rate_bps' : 'effective_spot_maker_rate_bps';
|
|
3109
|
+
const tradingFee = {
|
|
3110
|
+
'info': response,
|
|
3111
|
+
'symbol': symbol,
|
|
3112
|
+
'maker': this.parseNumber(Precise.stringDiv(this.safeString(response, makerFeeKey), '10000')),
|
|
3113
|
+
'taker': this.parseNumber(Precise.stringDiv(this.safeString(response, takerFeeKey), '10000')),
|
|
3114
|
+
'percentage': undefined,
|
|
3115
|
+
'tierBased': undefined,
|
|
3116
|
+
};
|
|
3117
|
+
result[symbol] = tradingFee;
|
|
3118
|
+
}
|
|
3119
|
+
return result;
|
|
3120
|
+
}
|
|
3121
|
+
parseTradingFee(fee, market = undefined) {
|
|
3122
|
+
//
|
|
3123
|
+
// {
|
|
3124
|
+
// "instrument_name": "BTC_USD",
|
|
3125
|
+
// "effective_maker_rate_bps": "6.5",
|
|
3126
|
+
// "effective_taker_rate_bps": "6.9"
|
|
3127
|
+
// }
|
|
3128
|
+
//
|
|
3129
|
+
const marketId = this.safeString(fee, 'instrument_name');
|
|
3130
|
+
const symbol = this.safeSymbol(marketId, market);
|
|
3131
|
+
return {
|
|
3132
|
+
'info': fee,
|
|
3133
|
+
'symbol': symbol,
|
|
3134
|
+
'maker': this.parseNumber(Precise.stringDiv(this.safeString(fee, 'effective_maker_rate_bps'), '10000')),
|
|
3135
|
+
'taker': this.parseNumber(Precise.stringDiv(this.safeString(fee, 'effective_taker_rate_bps'), '10000')),
|
|
3136
|
+
'percentage': undefined,
|
|
3137
|
+
'tierBased': undefined,
|
|
3138
|
+
};
|
|
3139
|
+
}
|
|
3025
3140
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
3026
3141
|
const type = this.safeString(api, 0);
|
|
3027
3142
|
const access = this.safeString(api, 1);
|
package/js/src/kraken.js
CHANGED
|
@@ -1211,6 +1211,26 @@ export default class kraken extends Exchange {
|
|
|
1211
1211
|
// "misc": ''
|
|
1212
1212
|
// }
|
|
1213
1213
|
//
|
|
1214
|
+
// fetchMyTrades
|
|
1215
|
+
//
|
|
1216
|
+
// {
|
|
1217
|
+
// "ordertxid": "OSJVN7-A2AE-63WZV",
|
|
1218
|
+
// "postxid": "TBP7O6-PNXI-CONU",
|
|
1219
|
+
// "pair": "XXBTZUSD",
|
|
1220
|
+
// "time": 1710429248.3052235,
|
|
1221
|
+
// "type": "sell",
|
|
1222
|
+
// "ordertype": "liquidation market",
|
|
1223
|
+
// "price": "72026.50000",
|
|
1224
|
+
// "cost": "7.20265",
|
|
1225
|
+
// "fee": "0.01873",
|
|
1226
|
+
// "vol": "0.00010000",
|
|
1227
|
+
// "margin": "1.44053",
|
|
1228
|
+
// "leverage": "5",
|
|
1229
|
+
// "misc": "closing",
|
|
1230
|
+
// "trade_id": 68230622,
|
|
1231
|
+
// "maker": false
|
|
1232
|
+
// }
|
|
1233
|
+
//
|
|
1214
1234
|
let timestamp = undefined;
|
|
1215
1235
|
let side = undefined;
|
|
1216
1236
|
let type = undefined;
|
|
@@ -1266,6 +1286,11 @@ export default class kraken extends Exchange {
|
|
|
1266
1286
|
symbol = market['symbol'];
|
|
1267
1287
|
}
|
|
1268
1288
|
const cost = this.safeString(trade, 'cost');
|
|
1289
|
+
const maker = this.safeBool(trade, 'maker');
|
|
1290
|
+
let takerOrMaker = undefined;
|
|
1291
|
+
if (maker !== undefined) {
|
|
1292
|
+
takerOrMaker = maker ? 'maker' : 'taker';
|
|
1293
|
+
}
|
|
1269
1294
|
return this.safeTrade({
|
|
1270
1295
|
'id': id,
|
|
1271
1296
|
'order': orderId,
|
|
@@ -1275,7 +1300,7 @@ export default class kraken extends Exchange {
|
|
|
1275
1300
|
'symbol': symbol,
|
|
1276
1301
|
'type': type,
|
|
1277
1302
|
'side': side,
|
|
1278
|
-
'takerOrMaker':
|
|
1303
|
+
'takerOrMaker': takerOrMaker,
|
|
1279
1304
|
'price': price,
|
|
1280
1305
|
'amount': amount,
|
|
1281
1306
|
'cost': cost,
|
|
@@ -2131,7 +2156,10 @@ export default class kraken extends Exchange {
|
|
|
2131
2156
|
// "fee": "0.000026",
|
|
2132
2157
|
// "vol": "16.00000000",
|
|
2133
2158
|
// "margin": "0.000000",
|
|
2159
|
+
// "leverage": "5",
|
|
2134
2160
|
// "misc": ""
|
|
2161
|
+
// "trade_id": 68230622,
|
|
2162
|
+
// "maker": false
|
|
2135
2163
|
// },
|
|
2136
2164
|
// ...
|
|
2137
2165
|
// },
|
package/js/src/kucoinfutures.js
CHANGED
|
@@ -127,6 +127,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
127
127
|
'contracts/{symbol}': 1,
|
|
128
128
|
'contracts/risk-limit/{symbol}': 1,
|
|
129
129
|
'ticker': 1,
|
|
130
|
+
'allTickers': 1,
|
|
130
131
|
'level2/snapshot': 1.33,
|
|
131
132
|
'level2/depth{limit}': 1,
|
|
132
133
|
'level2/message/query': 1,
|
|
@@ -170,6 +171,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
170
171
|
'trade-statistics': 1,
|
|
171
172
|
'trade-fees': 1,
|
|
172
173
|
'history-positions': 1,
|
|
174
|
+
'getMaxOpenSize': 1,
|
|
173
175
|
},
|
|
174
176
|
'post': {
|
|
175
177
|
'withdrawals': 1,
|
|
@@ -315,6 +317,9 @@ export default class kucoinfutures extends kucoin {
|
|
|
315
317
|
// endpoint versions
|
|
316
318
|
'versions': {
|
|
317
319
|
'futuresPrivate': {
|
|
320
|
+
'GET': {
|
|
321
|
+
'getMaxOpenSize': 'v2',
|
|
322
|
+
},
|
|
318
323
|
'POST': {
|
|
319
324
|
'transfer-out': 'v2',
|
|
320
325
|
},
|
package/js/src/mexc.js
CHANGED
|
@@ -1168,7 +1168,7 @@ export default class mexc extends Exchange {
|
|
|
1168
1168
|
// "symbols": [
|
|
1169
1169
|
// {
|
|
1170
1170
|
// "symbol": "OGNUSDT",
|
|
1171
|
-
// "status": "
|
|
1171
|
+
// "status": "1",
|
|
1172
1172
|
// "baseAsset": "OGN",
|
|
1173
1173
|
// "baseAssetPrecision": "2",
|
|
1174
1174
|
// "quoteAsset": "USDT",
|
|
@@ -1213,7 +1213,7 @@ export default class mexc extends Exchange {
|
|
|
1213
1213
|
const status = this.safeString(market, 'status');
|
|
1214
1214
|
const isSpotTradingAllowed = this.safeValue(market, 'isSpotTradingAllowed');
|
|
1215
1215
|
let active = false;
|
|
1216
|
-
if ((status === '
|
|
1216
|
+
if ((status === '1') && (isSpotTradingAllowed)) {
|
|
1217
1217
|
active = true;
|
|
1218
1218
|
}
|
|
1219
1219
|
const isMarginTradingAllowed = this.safeValue(market, 'isMarginTradingAllowed');
|
package/js/src/pro/binance.js
CHANGED
|
@@ -233,7 +233,7 @@ export default class binance extends binanceRest {
|
|
|
233
233
|
else {
|
|
234
234
|
for (let i = 0; i < symbols.length; i++) {
|
|
235
235
|
const market = this.market(symbols[i]);
|
|
236
|
-
subscriptionHashes.push(market['
|
|
236
|
+
subscriptionHashes.push(market['lowercaseId'] + '@forceOrder');
|
|
237
237
|
messageHashes.push('liquidations::' + symbols[i]);
|
|
238
238
|
}
|
|
239
239
|
streamHash += '::' + symbols.join(',');
|
package/js/src/pro/bitget.d.ts
CHANGED
|
@@ -17,8 +17,10 @@ export default class bitget extends bitgetRest {
|
|
|
17
17
|
handleOHLCV(client: Client, message: any): void;
|
|
18
18
|
parseWsOHLCV(ohlcv: any, market?: any): OHLCV;
|
|
19
19
|
watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
20
|
+
unWatchOrderBook(symbol: string, params?: {}): Promise<any>;
|
|
20
21
|
watchOrderBookForSymbols(symbols: string[], limit?: Int, params?: {}): Promise<OrderBook>;
|
|
21
22
|
handleOrderBook(client: Client, message: any): void;
|
|
23
|
+
handleCheckSumError(client: Client, symbol: string, messageHash: string): Promise<void>;
|
|
22
24
|
handleDelta(bookside: any, delta: any): void;
|
|
23
25
|
handleDeltas(bookside: any, deltas: any): void;
|
|
24
26
|
watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
@@ -37,6 +39,7 @@ export default class bitget extends bitgetRest {
|
|
|
37
39
|
watchBalance(params?: {}): Promise<Balances>;
|
|
38
40
|
handleBalance(client: Client, message: any): void;
|
|
39
41
|
watchPublic(messageHash: any, args: any, params?: {}): Promise<any>;
|
|
42
|
+
unWatchPublic(messageHash: any, args: any, params?: {}): Promise<any>;
|
|
40
43
|
watchPublicMultiple(messageHashes: any, argsArray: any, params?: {}): Promise<any>;
|
|
41
44
|
authenticate(params?: {}): Promise<any>;
|
|
42
45
|
watchPrivate(messageHash: any, subscriptionHash: any, args: any, params?: {}): Promise<any>;
|
|
@@ -46,4 +49,5 @@ export default class bitget extends bitgetRest {
|
|
|
46
49
|
ping(client: Client): string;
|
|
47
50
|
handlePong(client: Client, message: any): any;
|
|
48
51
|
handleSubscriptionStatus(client: Client, message: any): any;
|
|
52
|
+
handleUnSubscriptionStatus(client: Client, message: any): any;
|
|
49
53
|
}
|