ccxt 4.2.31 → 4.2.34
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/.gitattributes +1 -0
- package/CONTRIBUTING.md +20 -1
- package/README.md +8 -7
- package/build.sh +9 -2
- package/cleanup.sh +3 -0
- package/dist/ccxt.browser.js +639 -483
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +3 -2
- package/dist/cjs/src/ascendex.js +1 -1
- package/dist/cjs/src/base/Exchange.js +54 -20
- package/dist/cjs/src/bigone.js +21 -1
- package/dist/cjs/src/binance.js +5 -4
- package/dist/cjs/src/bingx.js +4 -3
- package/dist/cjs/src/bit2c.js +12 -0
- package/dist/cjs/src/bitget.js +3 -3
- package/dist/cjs/src/bitmart.js +1 -1
- package/dist/cjs/src/bitrue.js +3 -3
- package/dist/cjs/src/blockchaincom.js +1 -1
- package/dist/cjs/src/bybit.js +1 -1
- package/dist/cjs/src/coinbase.js +2 -2
- package/dist/cjs/src/coinex.js +1 -1
- package/dist/cjs/src/cryptocom.js +10 -10
- package/dist/cjs/src/gate.js +34 -29
- package/dist/cjs/src/kraken.js +39 -0
- package/dist/cjs/src/kucoin.js +1 -1
- package/dist/cjs/src/mexc.js +2 -1
- package/dist/cjs/src/okx.js +4 -3
- package/dist/cjs/src/phemex.js +8 -8
- package/dist/cjs/src/pro/alpaca.js +8 -4
- package/dist/cjs/src/pro/ascendex.js +1 -2
- package/dist/cjs/src/pro/binance.js +14 -10
- package/dist/cjs/src/pro/bingx.js +1 -1
- package/dist/cjs/src/pro/bitfinex.js +21 -24
- package/dist/cjs/src/pro/bitfinex2.js +13 -17
- package/dist/cjs/src/pro/bitget.js +3 -1
- package/dist/cjs/src/pro/bitmart.js +3 -8
- package/dist/cjs/src/pro/bitmex.js +4 -7
- package/dist/cjs/src/pro/bitopro.js +2 -5
- package/dist/cjs/src/pro/bitrue.js +1 -1
- package/dist/cjs/src/pro/bitstamp.js +2 -3
- package/dist/cjs/src/pro/bitvavo.js +12 -5
- package/dist/cjs/src/pro/blockchaincom.js +22 -23
- package/dist/cjs/src/pro/bybit.js +5 -5
- package/dist/cjs/src/pro/cex.js +7 -7
- package/dist/cjs/src/pro/coinbase.js +3 -2
- package/dist/cjs/src/pro/coinbasepro.js +1 -1
- package/dist/cjs/src/pro/coinex.js +15 -13
- package/dist/cjs/src/pro/currencycom.js +5 -7
- package/dist/cjs/src/pro/deribit.js +4 -4
- package/dist/cjs/src/pro/exmo.js +15 -13
- package/dist/cjs/src/pro/gate.js +1 -1
- package/dist/cjs/src/pro/gemini.js +4 -2
- package/dist/cjs/src/pro/hitbtc.js +9 -8
- package/dist/cjs/src/pro/hollaex.js +2 -2
- package/dist/cjs/src/pro/htx.js +6 -7
- package/dist/cjs/src/pro/huobijp.js +3 -5
- package/dist/cjs/src/pro/idex.js +1 -1
- package/dist/cjs/src/pro/independentreserve.js +14 -13
- package/dist/cjs/src/pro/kraken.js +10 -16
- package/dist/cjs/src/pro/krakenfutures.js +10 -6
- package/dist/cjs/src/pro/kucoin.js +10 -11
- package/dist/cjs/src/pro/kucoinfutures.js +12 -11
- package/dist/cjs/src/pro/lbank.js +10 -10
- package/dist/cjs/src/pro/luno.js +12 -14
- package/dist/cjs/src/pro/mexc.js +3 -2
- package/dist/cjs/src/pro/ndax.js +7 -13
- package/dist/cjs/src/pro/okcoin.js +7 -12
- package/dist/cjs/src/pro/okx.js +6 -11
- package/dist/cjs/src/pro/onetrading.js +16 -15
- package/dist/cjs/src/pro/p2b.js +5 -3
- package/dist/cjs/src/pro/phemex.js +16 -11
- package/dist/cjs/src/pro/poloniex.js +6 -4
- package/dist/cjs/src/pro/poloniexfutures.js +14 -9
- package/dist/cjs/src/pro/probit.js +15 -11
- package/dist/cjs/src/pro/upbit.js +8 -8
- package/dist/cjs/src/pro/wazirx.js +6 -3
- package/dist/cjs/src/pro/woo.js +8 -6
- package/dist/cjs/src/probit.js +3 -3
- package/dist/cjs/src/tokocrypto.js +2 -2
- package/dist/cjs/src/wavesexchange.js +2 -1
- package/dist/cjs/src/woo.js +1 -1
- package/dist/cjs/src/yobit.js +39 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/ace.d.ts +1 -1
- package/js/src/ace.js +3 -2
- package/js/src/alpaca.d.ts +1 -1
- package/js/src/ascendex.d.ts +5 -15
- package/js/src/ascendex.js +1 -1
- package/js/src/base/Exchange.d.ts +87 -78
- package/js/src/base/Exchange.js +54 -20
- package/js/src/base/types.d.ts +90 -6
- package/js/src/bigone.d.ts +5 -15
- package/js/src/bigone.js +21 -1
- package/js/src/binance.d.ts +13 -23
- package/js/src/binance.js +5 -4
- package/js/src/bingx.d.ts +6 -16
- package/js/src/bingx.js +4 -3
- package/js/src/bit2c.d.ts +1 -1
- package/js/src/bit2c.js +12 -0
- package/js/src/bitbank.d.ts +2 -2
- package/js/src/bitbns.d.ts +1 -1
- package/js/src/bitfinex.d.ts +5 -5
- package/js/src/bitfinex2.d.ts +7 -17
- package/js/src/bitflyer.d.ts +5 -5
- package/js/src/bitforex.d.ts +1 -1
- package/js/src/bitget.d.ts +8 -38
- package/js/src/bitget.js +3 -3
- package/js/src/bithumb.d.ts +2 -2
- package/js/src/bitmart.d.ts +10 -21
- package/js/src/bitmart.js +1 -1
- package/js/src/bitmex.d.ts +3 -3
- package/js/src/bitopro.d.ts +2 -2
- package/js/src/bitrue.d.ts +5 -15
- package/js/src/bitrue.js +3 -3
- package/js/src/bitso.d.ts +4 -4
- package/js/src/bitstamp.d.ts +2 -2
- package/js/src/bitteam.d.ts +1 -1
- package/js/src/bitvavo.d.ts +3 -3
- package/js/src/bl3p.d.ts +1 -1
- package/js/src/blockchaincom.d.ts +2 -2
- package/js/src/blockchaincom.js +1 -1
- package/js/src/btcalpha.d.ts +1 -1
- package/js/src/btcbox.d.ts +1 -1
- package/js/src/btcmarkets.d.ts +3 -3
- package/js/src/btcturk.d.ts +1 -1
- package/js/src/bybit.d.ts +8 -8
- package/js/src/bybit.js +1 -1
- package/js/src/cex.d.ts +1 -1
- package/js/src/coinbase.d.ts +6 -50
- package/js/src/coinbase.js +2 -2
- package/js/src/coinbasepro.d.ts +2 -2
- package/js/src/coincheck.d.ts +1 -1
- package/js/src/coinex.d.ts +8 -8
- package/js/src/coinex.js +1 -1
- package/js/src/coinlist.d.ts +4 -14
- package/js/src/coinmate.d.ts +2 -2
- package/js/src/coinmetro.d.ts +2 -2
- package/js/src/coinone.d.ts +1 -1
- package/js/src/coinsph.d.ts +2 -2
- package/js/src/coinspot.d.ts +1 -1
- package/js/src/cryptocom.d.ts +4 -4
- package/js/src/cryptocom.js +10 -10
- package/js/src/currencycom.d.ts +2 -2
- package/js/src/delta.d.ts +2 -2
- package/js/src/deribit.d.ts +4 -14
- package/js/src/digifinex.d.ts +10 -38
- package/js/src/exmo.d.ts +2 -2
- package/js/src/gate.d.ts +8 -18
- package/js/src/gate.js +34 -29
- package/js/src/gemini.d.ts +2 -2
- package/js/src/hitbtc.d.ts +6 -16
- package/js/src/hollaex.d.ts +2 -2
- package/js/src/htx.d.ts +11 -21
- package/js/src/huobijp.d.ts +4 -4
- package/js/src/idex.d.ts +3 -3
- package/js/src/independentreserve.d.ts +2 -2
- package/js/src/indodax.d.ts +2 -2
- package/js/src/kraken.d.ts +5 -5
- package/js/src/kraken.js +39 -0
- package/js/src/krakenfutures.d.ts +7 -7
- package/js/src/kucoin.d.ts +8 -29
- package/js/src/kucoin.js +1 -1
- package/js/src/kucoinfutures.d.ts +4 -4
- package/js/src/kuna.d.ts +2 -2
- package/js/src/latoken.d.ts +4 -14
- package/js/src/lbank.d.ts +2 -5
- package/js/src/luno.d.ts +1 -1
- package/js/src/lykke.d.ts +2 -2
- package/js/src/mercado.d.ts +2 -2
- package/js/src/mexc.d.ts +6 -6
- package/js/src/mexc.js +2 -1
- package/js/src/ndax.d.ts +2 -2
- package/js/src/novadax.d.ts +4 -15
- package/js/src/oceanex.d.ts +1 -1
- package/js/src/okcoin.d.ts +5 -15
- package/js/src/okx.d.ts +8 -18
- package/js/src/okx.js +4 -3
- package/js/src/onetrading.d.ts +2 -2
- package/js/src/p2b.d.ts +1 -1
- package/js/src/paymium.d.ts +3 -13
- package/js/src/phemex.d.ts +5 -5
- package/js/src/phemex.js +8 -8
- package/js/src/poloniex.d.ts +4 -14
- package/js/src/poloniexfutures.d.ts +1 -1
- package/js/src/pro/alpaca.d.ts +2 -2
- package/js/src/pro/alpaca.js +8 -4
- package/js/src/pro/ascendex.d.ts +2 -2
- package/js/src/pro/ascendex.js +1 -2
- package/js/src/pro/binance.d.ts +3 -3
- package/js/src/pro/binance.js +14 -10
- package/js/src/pro/bingx.d.ts +1 -1
- package/js/src/pro/bingx.js +1 -1
- package/js/src/pro/bitfinex.d.ts +2 -2
- package/js/src/pro/bitfinex.js +21 -24
- package/js/src/pro/bitfinex2.d.ts +2 -2
- package/js/src/pro/bitfinex2.js +13 -17
- package/js/src/pro/bitget.js +3 -1
- package/js/src/pro/bitmart.d.ts +3 -3
- package/js/src/pro/bitmart.js +3 -8
- package/js/src/pro/bitmex.d.ts +1 -1
- package/js/src/pro/bitmex.js +4 -7
- package/js/src/pro/bitopro.d.ts +1 -1
- package/js/src/pro/bitopro.js +2 -5
- package/js/src/pro/bitrue.js +1 -1
- package/js/src/pro/bitstamp.d.ts +1 -1
- package/js/src/pro/bitstamp.js +2 -3
- package/js/src/pro/bitvavo.d.ts +3 -3
- package/js/src/pro/bitvavo.js +12 -5
- package/js/src/pro/blockchaincom.d.ts +8 -8
- package/js/src/pro/blockchaincom.js +22 -23
- package/js/src/pro/bybit.d.ts +2 -2
- package/js/src/pro/bybit.js +5 -5
- package/js/src/pro/cex.d.ts +1 -1
- package/js/src/pro/cex.js +7 -7
- package/js/src/pro/coinbase.d.ts +1 -1
- package/js/src/pro/coinbase.js +3 -2
- package/js/src/pro/coinbasepro.d.ts +1 -1
- package/js/src/pro/coinbasepro.js +1 -1
- package/js/src/pro/coinex.d.ts +2 -2
- package/js/src/pro/coinex.js +15 -13
- package/js/src/pro/currencycom.d.ts +1 -1
- package/js/src/pro/currencycom.js +5 -7
- package/js/src/pro/deribit.d.ts +2 -2
- package/js/src/pro/deribit.js +4 -4
- package/js/src/pro/exmo.d.ts +2 -2
- package/js/src/pro/exmo.js +15 -13
- package/js/src/pro/gate.js +1 -1
- package/js/src/pro/gemini.d.ts +1 -1
- package/js/src/pro/gemini.js +4 -2
- package/js/src/pro/hitbtc.d.ts +2 -2
- package/js/src/pro/hitbtc.js +9 -8
- package/js/src/pro/hollaex.d.ts +2 -2
- package/js/src/pro/hollaex.js +2 -2
- package/js/src/pro/htx.d.ts +2 -2
- package/js/src/pro/htx.js +6 -7
- package/js/src/pro/huobijp.d.ts +1 -1
- package/js/src/pro/huobijp.js +3 -5
- package/js/src/pro/idex.js +1 -1
- package/js/src/pro/independentreserve.d.ts +1 -1
- package/js/src/pro/independentreserve.js +14 -13
- package/js/src/pro/kraken.d.ts +2 -2
- package/js/src/pro/kraken.js +10 -16
- package/js/src/pro/krakenfutures.d.ts +1 -1
- package/js/src/pro/krakenfutures.js +10 -6
- package/js/src/pro/kucoin.d.ts +3 -3
- package/js/src/pro/kucoin.js +10 -11
- package/js/src/pro/kucoinfutures.d.ts +3 -3
- package/js/src/pro/kucoinfutures.js +12 -11
- package/js/src/pro/lbank.d.ts +1 -1
- package/js/src/pro/lbank.js +10 -10
- package/js/src/pro/luno.d.ts +2 -2
- package/js/src/pro/luno.js +12 -14
- package/js/src/pro/mexc.d.ts +2 -2
- package/js/src/pro/mexc.js +3 -2
- package/js/src/pro/ndax.d.ts +3 -3
- package/js/src/pro/ndax.js +7 -13
- package/js/src/pro/okcoin.d.ts +1 -1
- package/js/src/pro/okcoin.js +7 -12
- package/js/src/pro/okx.d.ts +1 -1
- package/js/src/pro/okx.js +6 -11
- package/js/src/pro/onetrading.d.ts +1 -1
- package/js/src/pro/onetrading.js +16 -15
- package/js/src/pro/p2b.d.ts +1 -1
- package/js/src/pro/p2b.js +5 -3
- package/js/src/pro/phemex.d.ts +3 -3
- package/js/src/pro/phemex.js +16 -11
- package/js/src/pro/poloniex.d.ts +1 -1
- package/js/src/pro/poloniex.js +6 -4
- package/js/src/pro/poloniexfutures.d.ts +4 -4
- package/js/src/pro/poloniexfutures.js +13 -10
- package/js/src/pro/probit.d.ts +1 -1
- package/js/src/pro/probit.js +14 -12
- package/js/src/pro/upbit.js +8 -8
- package/js/src/pro/wazirx.d.ts +1 -1
- package/js/src/pro/wazirx.js +6 -3
- package/js/src/pro/woo.d.ts +3 -3
- package/js/src/pro/woo.js +8 -6
- package/js/src/probit.d.ts +3 -3
- package/js/src/probit.js +3 -3
- package/js/src/timex.d.ts +1 -1
- package/js/src/tokocrypto.d.ts +3 -3
- package/js/src/tokocrypto.js +2 -2
- package/js/src/upbit.d.ts +2 -2
- package/js/src/wavesexchange.d.ts +3 -4
- package/js/src/wavesexchange.js +2 -1
- package/js/src/wazirx.d.ts +1 -1
- package/js/src/whitebit.d.ts +5 -15
- package/js/src/woo.d.ts +5 -15
- package/js/src/woo.js +1 -1
- package/js/src/yobit.d.ts +21 -6
- package/js/src/yobit.js +39 -0
- package/js/src/zaif.d.ts +2 -2
- package/js/src/zonda.d.ts +4 -14
- package/package.json +22 -8
- package/skip-tests.json +9 -1
- package/tests-manager.sh +1 -2
package/js/src/binance.js
CHANGED
|
@@ -3139,7 +3139,7 @@ export default class binance extends Exchange {
|
|
|
3139
3139
|
account['debt'] = Precise.stringAdd(debt, interest);
|
|
3140
3140
|
return account;
|
|
3141
3141
|
}
|
|
3142
|
-
|
|
3142
|
+
parseBalanceCustom(response, type = undefined, marginMode = undefined) {
|
|
3143
3143
|
const result = {
|
|
3144
3144
|
'info': response,
|
|
3145
3145
|
};
|
|
@@ -3482,7 +3482,7 @@ export default class binance extends Exchange {
|
|
|
3482
3482
|
// }
|
|
3483
3483
|
// ]
|
|
3484
3484
|
//
|
|
3485
|
-
return this.
|
|
3485
|
+
return this.parseBalanceCustom(response, type, marginMode);
|
|
3486
3486
|
}
|
|
3487
3487
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
3488
3488
|
/**
|
|
@@ -5254,7 +5254,7 @@ export default class binance extends Exchange {
|
|
|
5254
5254
|
const stopLossPrice = this.safeValue(params, 'stopLossPrice', triggerPrice); // fallback to stopLoss
|
|
5255
5255
|
const takeProfitPrice = this.safeValue(params, 'takeProfitPrice');
|
|
5256
5256
|
const trailingDelta = this.safeValue(params, 'trailingDelta');
|
|
5257
|
-
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', price);
|
|
5257
|
+
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', this.numberToString(price));
|
|
5258
5258
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
|
|
5259
5259
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
5260
5260
|
const isStopLoss = stopLossPrice !== undefined || trailingDelta !== undefined;
|
|
@@ -9587,7 +9587,7 @@ export default class binance extends Exchange {
|
|
|
9587
9587
|
}
|
|
9588
9588
|
return this.safeValue(config, 'cost', 1);
|
|
9589
9589
|
}
|
|
9590
|
-
async request(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}
|
|
9590
|
+
async request(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}) {
|
|
9591
9591
|
const response = await this.fetch2(path, api, method, params, headers, body, config);
|
|
9592
9592
|
// a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
|
|
9593
9593
|
if (api === 'private') {
|
|
@@ -10220,6 +10220,7 @@ export default class binance extends Exchange {
|
|
|
10220
10220
|
else {
|
|
10221
10221
|
return this.parseOpenInterest(response, market);
|
|
10222
10222
|
}
|
|
10223
|
+
return undefined;
|
|
10223
10224
|
}
|
|
10224
10225
|
parseOpenInterest(interest, market = undefined) {
|
|
10225
10226
|
const timestamp = this.safeInteger2(interest, 'timestamp', 'time');
|
package/js/src/bingx.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bingx.js';
|
|
2
|
-
import type { Int, OrderSide, OHLCV, FundingRateHistory, Order, OrderType, OrderRequest, Str, Trade, Balances, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Int, OrderSide, OHLCV, FundingRateHistory, Order, OrderType, OrderRequest, Str, Trade, Balances, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bingx
|
|
5
5
|
* @augments Exchange
|
|
@@ -69,8 +69,8 @@ export default class bingx extends Exchange {
|
|
|
69
69
|
createMarketOrderWithCost(symbol: string, side: OrderSide, cost: any, params?: {}): Promise<Order>;
|
|
70
70
|
createMarketBuyOrderWithCost(symbol: string, cost: any, params?: {}): Promise<Order>;
|
|
71
71
|
createMarketSellOrderWithCost(symbol: string, cost: any, params?: {}): Promise<Order>;
|
|
72
|
-
createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
73
|
-
createOrder(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
72
|
+
createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): any;
|
|
73
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
74
74
|
createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
|
|
75
75
|
parseOrderSide(side: any): string;
|
|
76
76
|
parseOrder(order: any, market?: Market): Order;
|
|
@@ -81,17 +81,7 @@ export default class bingx extends Exchange {
|
|
|
81
81
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
82
82
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
83
83
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
84
|
-
transfer(code: string, amount:
|
|
85
|
-
info: any;
|
|
86
|
-
id: string;
|
|
87
|
-
timestamp: any;
|
|
88
|
-
datetime: any;
|
|
89
|
-
currency: string;
|
|
90
|
-
amount: any;
|
|
91
|
-
fromAccount: any;
|
|
92
|
-
toAccount: any;
|
|
93
|
-
status: any;
|
|
94
|
-
}>;
|
|
84
|
+
transfer(code: string, amount: number, fromAccount: any, toAccount: any, params?: {}): Promise<TransferEntry>;
|
|
95
85
|
fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
96
86
|
parseTransfer(transfer: any, currency?: Currency): {
|
|
97
87
|
info: any;
|
|
@@ -119,7 +109,7 @@ export default class bingx extends Exchange {
|
|
|
119
109
|
setMarginMode(marginMode: string, symbol?: Str, params?: {}): Promise<any>;
|
|
120
110
|
setMargin(symbol: string, amount: any, params?: {}): Promise<any>;
|
|
121
111
|
fetchLeverage(symbol: string, params?: {}): Promise<any>;
|
|
122
|
-
setLeverage(leverage:
|
|
112
|
+
setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
|
|
123
113
|
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
124
114
|
parseDepositWithdrawFee(fee: any, currency?: Currency): {
|
|
125
115
|
info: any;
|
|
@@ -134,7 +124,7 @@ export default class bingx extends Exchange {
|
|
|
134
124
|
networks: {};
|
|
135
125
|
};
|
|
136
126
|
fetchDepositWithdrawFees(codes?: Strings, params?: {}): Promise<any>;
|
|
137
|
-
withdraw(code: string, amount:
|
|
127
|
+
withdraw(code: string, amount: number, address: any, tag?: any, params?: {}): Promise<Transaction>;
|
|
138
128
|
parseParams(params: any): {};
|
|
139
129
|
fetchMyLiquidations(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Liquidation[]>;
|
|
140
130
|
parseLiquidation(liquidation: any, market?: Market): import("./base/types.js").Liquidation;
|
package/js/src/bingx.js
CHANGED
|
@@ -1888,6 +1888,7 @@ export default class bingx extends Exchange {
|
|
|
1888
1888
|
}
|
|
1889
1889
|
}
|
|
1890
1890
|
if (isStopLoss || isTakeProfit) {
|
|
1891
|
+
const stringifiedAmount = this.numberToString(amount);
|
|
1891
1892
|
if (isStopLoss) {
|
|
1892
1893
|
const slTriggerPrice = this.safeString2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss);
|
|
1893
1894
|
const slWorkingType = this.safeString(stopLoss, 'workingType', 'MARK_PRICE');
|
|
@@ -1901,7 +1902,7 @@ export default class bingx extends Exchange {
|
|
|
1901
1902
|
if (slPrice !== undefined) {
|
|
1902
1903
|
slRequest['price'] = this.parseToNumeric(this.priceToPrecision(symbol, slPrice));
|
|
1903
1904
|
}
|
|
1904
|
-
const slQuantity = this.safeString(stopLoss, 'quantity',
|
|
1905
|
+
const slQuantity = this.safeString(stopLoss, 'quantity', stringifiedAmount);
|
|
1905
1906
|
slRequest['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, slQuantity));
|
|
1906
1907
|
request['stopLoss'] = this.json(slRequest);
|
|
1907
1908
|
}
|
|
@@ -1918,7 +1919,7 @@ export default class bingx extends Exchange {
|
|
|
1918
1919
|
if (slPrice !== undefined) {
|
|
1919
1920
|
tpRequest['price'] = this.parseToNumeric(this.priceToPrecision(symbol, slPrice));
|
|
1920
1921
|
}
|
|
1921
|
-
const tkQuantity = this.safeString(takeProfit, 'quantity',
|
|
1922
|
+
const tkQuantity = this.safeString(takeProfit, 'quantity', stringifiedAmount);
|
|
1922
1923
|
tpRequest['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, tkQuantity));
|
|
1923
1924
|
request['takeProfit'] = this.json(tpRequest);
|
|
1924
1925
|
}
|
|
@@ -3604,7 +3605,7 @@ export default class bingx extends Exchange {
|
|
|
3604
3605
|
// "id":"1197073063359000577"
|
|
3605
3606
|
// }
|
|
3606
3607
|
// }
|
|
3607
|
-
this.parseTransaction(data);
|
|
3608
|
+
return this.parseTransaction(data);
|
|
3608
3609
|
}
|
|
3609
3610
|
parseParams(params) {
|
|
3610
3611
|
const sortedParams = this.keysort(params);
|
package/js/src/bit2c.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export default class bit2c extends Exchange {
|
|
|
13
13
|
fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
14
14
|
fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
15
15
|
fetchTradingFees(params?: {}): Promise<{}>;
|
|
16
|
-
createOrder(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
16
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
17
17
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
|
|
18
18
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
19
19
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
package/js/src/bit2c.js
CHANGED
|
@@ -211,6 +211,7 @@ export default class bit2c extends Exchange {
|
|
|
211
211
|
* @method
|
|
212
212
|
* @name bit2c#fetchBalance
|
|
213
213
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
214
|
+
* @see https://bit2c.co.il/home/api#balance
|
|
214
215
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
215
216
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
216
217
|
*/
|
|
@@ -265,6 +266,7 @@ export default class bit2c extends Exchange {
|
|
|
265
266
|
* @method
|
|
266
267
|
* @name bit2c#fetchOrderBook
|
|
267
268
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
269
|
+
* @see https://bit2c.co.il/home/api#orderb
|
|
268
270
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
269
271
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
270
272
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -311,6 +313,7 @@ export default class bit2c extends Exchange {
|
|
|
311
313
|
* @method
|
|
312
314
|
* @name bit2c#fetchTicker
|
|
313
315
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
316
|
+
* @see https://bit2c.co.il/home/api#ticker
|
|
314
317
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
315
318
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
316
319
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -328,6 +331,8 @@ export default class bit2c extends Exchange {
|
|
|
328
331
|
* @method
|
|
329
332
|
* @name bit2c#fetchTrades
|
|
330
333
|
* @description get the list of most recent trades for a particular symbol
|
|
334
|
+
* @see https://bit2c.co.il/home/api#transactions
|
|
335
|
+
* @see https://bit2c.co.il/home/api#trades
|
|
331
336
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
332
337
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
333
338
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -370,6 +375,7 @@ export default class bit2c extends Exchange {
|
|
|
370
375
|
* @method
|
|
371
376
|
* @name bit2c#fetchTradingFees
|
|
372
377
|
* @description fetch the trading fees for multiple markets
|
|
378
|
+
* @see https://bit2c.co.il/home/api#balance
|
|
373
379
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
374
380
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
375
381
|
*/
|
|
@@ -418,6 +424,7 @@ export default class bit2c extends Exchange {
|
|
|
418
424
|
* @method
|
|
419
425
|
* @name bit2c#createOrder
|
|
420
426
|
* @description create a trade order
|
|
427
|
+
* @see https://bit2c.co.il/home/api#addo
|
|
421
428
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
422
429
|
* @param {string} type 'market' or 'limit'
|
|
423
430
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -451,6 +458,7 @@ export default class bit2c extends Exchange {
|
|
|
451
458
|
* @method
|
|
452
459
|
* @name bit2c#cancelOrder
|
|
453
460
|
* @description cancels an open order
|
|
461
|
+
* @see https://bit2c.co.il/home/api#cancelo
|
|
454
462
|
* @param {string} id order id
|
|
455
463
|
* @param {string} symbol Not used by bit2c cancelOrder ()
|
|
456
464
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -466,6 +474,7 @@ export default class bit2c extends Exchange {
|
|
|
466
474
|
* @method
|
|
467
475
|
* @name bit2c#fetchOpenOrders
|
|
468
476
|
* @description fetch all unfilled currently open orders
|
|
477
|
+
* @see https://bit2c.co.il/home/api#geto
|
|
469
478
|
* @param {string} symbol unified market symbol
|
|
470
479
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
471
480
|
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
@@ -491,6 +500,7 @@ export default class bit2c extends Exchange {
|
|
|
491
500
|
* @method
|
|
492
501
|
* @name bit2c#fetchOrder
|
|
493
502
|
* @description fetches information on an order made by the user
|
|
503
|
+
* @see https://bit2c.co.il/home/api#getoid
|
|
494
504
|
* @param {string} symbol unified market symbol
|
|
495
505
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
496
506
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -643,6 +653,7 @@ export default class bit2c extends Exchange {
|
|
|
643
653
|
* @method
|
|
644
654
|
* @name bit2c#fetchMyTrades
|
|
645
655
|
* @description fetch all trades made by the user
|
|
656
|
+
* @see https://bit2c.co.il/home/api#orderh
|
|
646
657
|
* @param {string} symbol unified market symbol
|
|
647
658
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
648
659
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -823,6 +834,7 @@ export default class bit2c extends Exchange {
|
|
|
823
834
|
* @method
|
|
824
835
|
* @name bit2c#fetchDepositAddress
|
|
825
836
|
* @description fetch the deposit address for a currency associated with this account
|
|
837
|
+
* @see https://bit2c.co.il/home/api#addc
|
|
826
838
|
* @param {string} code unified currency code
|
|
827
839
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
828
840
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
package/js/src/bitbank.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export default class bitbank extends Exchange {
|
|
|
20
20
|
fetchBalance(params?: {}): Promise<Balances>;
|
|
21
21
|
parseOrderStatus(status: any): string;
|
|
22
22
|
parseOrder(order: any, market?: Market): Order;
|
|
23
|
-
createOrder(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
23
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
24
24
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
|
|
25
25
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
26
26
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
@@ -32,7 +32,7 @@ export default class bitbank extends Exchange {
|
|
|
32
32
|
network: any;
|
|
33
33
|
info: any;
|
|
34
34
|
}>;
|
|
35
|
-
withdraw(code: string, amount:
|
|
35
|
+
withdraw(code: string, amount: number, address: any, tag?: any, params?: {}): Promise<Transaction>;
|
|
36
36
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
37
37
|
nonce(): number;
|
|
38
38
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
package/js/src/bitbns.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export default class bitbns extends Exchange {
|
|
|
21
21
|
fetchBalance(params?: {}): Promise<Balances>;
|
|
22
22
|
parseStatus(status: any): string;
|
|
23
23
|
parseOrder(order: any, market?: Market): Order;
|
|
24
|
-
createOrder(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
24
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
25
25
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
26
26
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
27
27
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
package/js/src/bitfinex.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bitfinex.js';
|
|
2
|
-
import type { Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bitfinex
|
|
5
5
|
* @augments Exchange
|
|
@@ -25,7 +25,7 @@ export default class bitfinex extends Exchange {
|
|
|
25
25
|
amountToPrecision(symbol: any, amount: any): any;
|
|
26
26
|
priceToPrecision(symbol: any, price: any): any;
|
|
27
27
|
fetchBalance(params?: {}): Promise<Balances>;
|
|
28
|
-
transfer(code: string, amount:
|
|
28
|
+
transfer(code: string, amount: number, fromAccount: any, toAccount: any, params?: {}): Promise<TransferEntry>;
|
|
29
29
|
parseTransfer(transfer: any, currency?: Currency): {
|
|
30
30
|
info: any;
|
|
31
31
|
id: any;
|
|
@@ -44,9 +44,9 @@ export default class bitfinex extends Exchange {
|
|
|
44
44
|
fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
45
45
|
parseTicker(ticker: any, market?: Market): Ticker;
|
|
46
46
|
parseTrade(trade: any, market?: Market): Trade;
|
|
47
|
-
fetchTrades(symbol: string, since?: Int, limit?:
|
|
47
|
+
fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
48
48
|
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
49
|
-
createOrder(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
49
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
50
50
|
editOrder(id: string, symbol: any, type: any, side: any, amount?: any, price?: any, params?: {}): Promise<Order>;
|
|
51
51
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
|
|
52
52
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
@@ -74,7 +74,7 @@ export default class bitfinex extends Exchange {
|
|
|
74
74
|
fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
75
75
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
76
76
|
parseTransactionStatus(status: any): string;
|
|
77
|
-
withdraw(code: string, amount:
|
|
77
|
+
withdraw(code: string, amount: number, address: any, tag?: any, params?: {}): Promise<Transaction>;
|
|
78
78
|
fetchPositions(symbols?: Strings, params?: {}): Promise<any>;
|
|
79
79
|
nonce(): number;
|
|
80
80
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
package/js/src/bitfinex2.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bitfinex2.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderBook, Str, Transaction, Ticker, Balances, Tickers, Strings, Currency, Market, OpenInterest, Liquidation, OrderRequest } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderBook, Str, Transaction, Ticker, Balances, Tickers, Strings, Currency, Market, OpenInterest, Liquidation, OrderRequest } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bitfinex2
|
|
5
5
|
* @augments Exchange
|
|
@@ -22,17 +22,7 @@ export default class bitfinex2 extends Exchange {
|
|
|
22
22
|
fetchCurrencies(params?: {}): Promise<{}>;
|
|
23
23
|
safeNetwork(networkId: any): string;
|
|
24
24
|
fetchBalance(params?: {}): Promise<Balances>;
|
|
25
|
-
transfer(code: string, amount:
|
|
26
|
-
id: any;
|
|
27
|
-
timestamp: number;
|
|
28
|
-
datetime: string;
|
|
29
|
-
status: string;
|
|
30
|
-
amount: number;
|
|
31
|
-
currency: string;
|
|
32
|
-
fromAccount: string;
|
|
33
|
-
toAccount: string;
|
|
34
|
-
info: any;
|
|
35
|
-
}>;
|
|
25
|
+
transfer(code: string, amount: number, fromAccount: any, toAccount: any, params?: {}): Promise<TransferEntry>;
|
|
36
26
|
parseTransfer(transfer: any, currency?: Currency): {
|
|
37
27
|
id: any;
|
|
38
28
|
timestamp: number;
|
|
@@ -52,14 +42,14 @@ export default class bitfinex2 extends Exchange {
|
|
|
52
42
|
fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
53
43
|
parseTrade(trade: any, market?: Market): Trade;
|
|
54
44
|
fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
55
|
-
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?:
|
|
45
|
+
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
56
46
|
parseOHLCV(ohlcv: any, market?: Market): OHLCV;
|
|
57
47
|
parseOrderStatus(status: any): any;
|
|
58
48
|
parseOrderFlags(flags: any): any;
|
|
59
49
|
parseTimeInForce(orderType: any): string;
|
|
60
50
|
parseOrder(order: any, market?: Market): Order;
|
|
61
|
-
createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
62
|
-
createOrder(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
51
|
+
createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): any;
|
|
52
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
63
53
|
createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
|
|
64
54
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
|
|
65
55
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
@@ -88,7 +78,7 @@ export default class bitfinex2 extends Exchange {
|
|
|
88
78
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
89
79
|
fetchTradingFees(params?: {}): Promise<{}>;
|
|
90
80
|
fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
91
|
-
withdraw(code: string, amount:
|
|
81
|
+
withdraw(code: string, amount: number, address: any, tag?: any, params?: {}): Promise<any>;
|
|
92
82
|
fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
|
|
93
83
|
parsePosition(position: any, market?: Market): import("./base/types.js").Position;
|
|
94
84
|
nonce(): number;
|
|
@@ -118,7 +108,7 @@ export default class bitfinex2 extends Exchange {
|
|
|
118
108
|
info: any;
|
|
119
109
|
};
|
|
120
110
|
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
121
|
-
fetchFundingRate(symbol: string, params?: {}): Promise<
|
|
111
|
+
fetchFundingRate(symbol: string, params?: {}): Promise<any>;
|
|
122
112
|
fetchFundingRates(symbols?: Strings, params?: {}): Promise<{}>;
|
|
123
113
|
fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
|
|
124
114
|
parseFundingRate(contract: any, market?: Market): {
|
package/js/src/bitflyer.d.ts
CHANGED
|
@@ -22,17 +22,17 @@ export default class bitflyer extends Exchange {
|
|
|
22
22
|
maker: number;
|
|
23
23
|
taker: number;
|
|
24
24
|
}>;
|
|
25
|
-
createOrder(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
25
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
26
26
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
|
|
27
27
|
parseOrderStatus(status: any): string;
|
|
28
28
|
parseOrder(order: any, market?: Market): Order;
|
|
29
|
-
fetchOrders(symbol?: Str, since?: Int, limit?:
|
|
30
|
-
fetchOpenOrders(symbol?: Str, since?: Int, limit?:
|
|
31
|
-
fetchClosedOrders(symbol?: Str, since?: Int, limit?:
|
|
29
|
+
fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
30
|
+
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
31
|
+
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
32
32
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
33
33
|
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
34
34
|
fetchPositions(symbols?: Strings, params?: {}): Promise<any>;
|
|
35
|
-
withdraw(code: string, amount:
|
|
35
|
+
withdraw(code: string, amount: number, address: any, tag?: any, params?: {}): Promise<Transaction>;
|
|
36
36
|
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
37
37
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
38
38
|
parseDepositStatus(status: any): string;
|
package/js/src/bitforex.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export default class bitforex extends Exchange {
|
|
|
24
24
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
25
25
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
26
26
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
27
|
-
createOrder(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
27
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
28
28
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<{
|
|
29
29
|
info: any;
|
|
30
30
|
success: any;
|
package/js/src/bitget.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bitget.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, FundingHistory, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position, Liquidation } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, FundingHistory, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position, Liquidation, TransferEntry } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bitget
|
|
5
5
|
* @augments Exchange
|
|
@@ -17,27 +17,7 @@ export default class bitget extends Exchange {
|
|
|
17
17
|
fetchMarketLeverageTiers(symbol: string, params?: {}): Promise<any[]>;
|
|
18
18
|
parseMarketLeverageTiers(info: any, market?: Market): any[];
|
|
19
19
|
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
20
|
-
withdraw(code: string, amount:
|
|
21
|
-
id: string;
|
|
22
|
-
info: any;
|
|
23
|
-
txid: any;
|
|
24
|
-
timestamp: any;
|
|
25
|
-
datetime: any;
|
|
26
|
-
network: any;
|
|
27
|
-
addressFrom: any;
|
|
28
|
-
address: any;
|
|
29
|
-
addressTo: any;
|
|
30
|
-
amount: any;
|
|
31
|
-
type: string;
|
|
32
|
-
currency: any;
|
|
33
|
-
status: any;
|
|
34
|
-
updated: any;
|
|
35
|
-
tagFrom: any;
|
|
36
|
-
tag: any;
|
|
37
|
-
tagTo: any;
|
|
38
|
-
comment: any;
|
|
39
|
-
fee: any;
|
|
40
|
-
}>;
|
|
20
|
+
withdraw(code: string, amount: number, address: any, tag?: any, params?: {}): Promise<Transaction>;
|
|
41
21
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
42
22
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
43
23
|
parseTransactionStatus(status: any): string;
|
|
@@ -81,8 +61,8 @@ export default class bitget extends Exchange {
|
|
|
81
61
|
parseOrderStatus(status: any): string;
|
|
82
62
|
parseOrder(order: any, market?: Market): Order;
|
|
83
63
|
createMarketBuyOrderWithCost(symbol: string, cost: any, params?: {}): Promise<Order>;
|
|
84
|
-
createOrder(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
85
|
-
createOrderRequest(symbol: any, type: any, side: any, amount:
|
|
64
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
65
|
+
createOrderRequest(symbol: any, type: any, side: any, amount: number, price?: number, params?: {}): any;
|
|
86
66
|
createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
|
|
87
67
|
editOrder(id: string, symbol: any, type: any, side: any, amount?: any, price?: any, params?: {}): Promise<Order>;
|
|
88
68
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
@@ -178,23 +158,13 @@ export default class bitget extends Exchange {
|
|
|
178
158
|
reduceMargin(symbol: string, amount: any, params?: {}): Promise<any>;
|
|
179
159
|
addMargin(symbol: string, amount: any, params?: {}): Promise<any>;
|
|
180
160
|
fetchLeverage(symbol: string, params?: {}): Promise<any>;
|
|
181
|
-
setLeverage(leverage:
|
|
161
|
+
setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
|
|
182
162
|
setMarginMode(marginMode: any, symbol?: Str, params?: {}): Promise<any>;
|
|
183
163
|
setPositionMode(hedged: any, symbol?: Str, params?: {}): Promise<any>;
|
|
184
164
|
fetchOpenInterest(symbol: string, params?: {}): Promise<import("./base/types.js").OpenInterest>;
|
|
185
165
|
parseOpenInterest(interest: any, market?: Market): import("./base/types.js").OpenInterest;
|
|
186
166
|
fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
187
|
-
transfer(code: string, amount:
|
|
188
|
-
info: any;
|
|
189
|
-
id: string;
|
|
190
|
-
timestamp: number;
|
|
191
|
-
datetime: string;
|
|
192
|
-
currency: string;
|
|
193
|
-
amount: number;
|
|
194
|
-
fromAccount: string;
|
|
195
|
-
toAccount: string;
|
|
196
|
-
status: string;
|
|
197
|
-
}>;
|
|
167
|
+
transfer(code: string, amount: number, fromAccount: any, toAccount: any, params?: {}): Promise<TransferEntry>;
|
|
198
168
|
parseTransfer(transfer: any, currency?: Currency): {
|
|
199
169
|
info: any;
|
|
200
170
|
id: string;
|
|
@@ -220,7 +190,7 @@ export default class bitget extends Exchange {
|
|
|
220
190
|
networks: {};
|
|
221
191
|
};
|
|
222
192
|
fetchDepositWithdrawFees(codes?: Strings, params?: {}): Promise<any>;
|
|
223
|
-
borrowCrossMargin(code: string, amount:
|
|
193
|
+
borrowCrossMargin(code: string, amount: number, params?: {}): Promise<{
|
|
224
194
|
id: string;
|
|
225
195
|
currency: string;
|
|
226
196
|
amount: number;
|
|
@@ -229,7 +199,7 @@ export default class bitget extends Exchange {
|
|
|
229
199
|
datetime: any;
|
|
230
200
|
info: any;
|
|
231
201
|
}>;
|
|
232
|
-
borrowIsolatedMargin(symbol: string, code: string, amount:
|
|
202
|
+
borrowIsolatedMargin(symbol: string, code: string, amount: number, params?: {}): Promise<{
|
|
233
203
|
id: string;
|
|
234
204
|
currency: string;
|
|
235
205
|
amount: number;
|
package/js/src/bitget.js
CHANGED
|
@@ -4138,7 +4138,7 @@ export default class bitget extends Exchange {
|
|
|
4138
4138
|
const isTakeProfit = takeProfit !== undefined;
|
|
4139
4139
|
const isStopLossOrTakeProfitTrigger = isStopLossTriggerOrder || isTakeProfitTriggerOrder;
|
|
4140
4140
|
const isStopLossOrTakeProfit = isStopLoss || isTakeProfit;
|
|
4141
|
-
const trailingTriggerPrice = this.safeString(params, 'trailingTriggerPrice', price);
|
|
4141
|
+
const trailingTriggerPrice = this.safeString(params, 'trailingTriggerPrice', this.numberToString(price));
|
|
4142
4142
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRatio');
|
|
4143
4143
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
4144
4144
|
if (this.sum(isTriggerOrder, isStopLossTriggerOrder, isTakeProfitTriggerOrder, isTrailingPercentOrder) > 1) {
|
|
@@ -6961,7 +6961,7 @@ export default class bitget extends Exchange {
|
|
|
6961
6961
|
* @name bitget#setLeverage
|
|
6962
6962
|
* @description set the level of leverage for a market
|
|
6963
6963
|
* @see https://www.bitget.com/api-doc/contract/account/Change-Leverage
|
|
6964
|
-
* @param {
|
|
6964
|
+
* @param {int} leverage the rate of leverage
|
|
6965
6965
|
* @param {string} symbol unified market symbol
|
|
6966
6966
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6967
6967
|
* @param {string} [params.holdSide] *isolated only* position direction, 'long' or 'short'
|
|
@@ -6985,7 +6985,7 @@ export default class bitget extends Exchange {
|
|
|
6985
6985
|
const request = {
|
|
6986
6986
|
'symbol': market['id'],
|
|
6987
6987
|
'marginCoin': market['settleId'],
|
|
6988
|
-
'leverage': leverage,
|
|
6988
|
+
'leverage': this.numberToString(leverage),
|
|
6989
6989
|
'productType': productType,
|
|
6990
6990
|
// 'holdSide': 'long',
|
|
6991
6991
|
};
|
package/js/src/bithumb.d.ts
CHANGED
|
@@ -19,14 +19,14 @@ export default class bithumb extends Exchange {
|
|
|
19
19
|
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
20
20
|
parseTrade(trade: any, market?: Market): Trade;
|
|
21
21
|
fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
22
|
-
createOrder(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
22
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
23
23
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
24
24
|
parseOrderStatus(status: any): string;
|
|
25
25
|
parseOrder(order: any, market?: Market): Order;
|
|
26
26
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
27
27
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
|
|
28
28
|
cancelUnifiedOrder(order: any, params?: {}): Promise<any>;
|
|
29
|
-
withdraw(code: string, amount:
|
|
29
|
+
withdraw(code: string, amount: number, address: any, tag?: any, params?: {}): Promise<Transaction>;
|
|
30
30
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
31
31
|
fixCommaNumber(numberStr: any): any;
|
|
32
32
|
nonce(): number;
|
package/js/src/bitmart.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bitmart.js';
|
|
2
|
-
import type { Int, OrderSide, Balances, OrderType, OHLCV, Order, Str, Trade, Transaction, Ticker, OrderBook, Tickers, Strings, Currency, Market } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, Balances, OrderType, OHLCV, Order, Str, Trade, Transaction, Ticker, OrderBook, Tickers, Strings, Currency, Market, TransferEntry } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bitmart
|
|
5
5
|
* @augments Exchange
|
|
@@ -35,18 +35,7 @@ export default class bitmart extends Exchange {
|
|
|
35
35
|
};
|
|
36
36
|
networks: {};
|
|
37
37
|
};
|
|
38
|
-
fetchDepositWithdrawFee(code: string, params?: {}): Promise<
|
|
39
|
-
info: any;
|
|
40
|
-
withdraw: {
|
|
41
|
-
fee: number;
|
|
42
|
-
percentage: any;
|
|
43
|
-
};
|
|
44
|
-
deposit: {
|
|
45
|
-
fee: any;
|
|
46
|
-
percentage: any;
|
|
47
|
-
};
|
|
48
|
-
networks: {};
|
|
49
|
-
}>;
|
|
38
|
+
fetchDepositWithdrawFee(code: string, params?: {}): Promise<any>;
|
|
50
39
|
parseTicker(ticker: any, market?: Market): Ticker;
|
|
51
40
|
fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
52
41
|
fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
@@ -76,9 +65,9 @@ export default class bitmart extends Exchange {
|
|
|
76
65
|
parseOrderSide(side: any): string;
|
|
77
66
|
parseOrderStatusByType(type: any, status: any): string;
|
|
78
67
|
createMarketBuyOrderWithCost(symbol: string, cost: any, params?: {}): Promise<Order>;
|
|
79
|
-
createOrder(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
80
|
-
createSwapOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
81
|
-
createSpotOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
68
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
69
|
+
createSwapOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): any;
|
|
70
|
+
createSpotOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): any;
|
|
82
71
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
|
|
83
72
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
84
73
|
fetchOrdersByStatus(status: any, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
@@ -94,8 +83,8 @@ export default class bitmart extends Exchange {
|
|
|
94
83
|
info: any;
|
|
95
84
|
}>;
|
|
96
85
|
safeNetwork(networkId: any): any;
|
|
97
|
-
withdraw(code: string, amount:
|
|
98
|
-
fetchTransactionsByType(type: any, code?: Str, since?: Int, limit?: Int, params?: {}): Promise<
|
|
86
|
+
withdraw(code: string, amount: number, address: any, tag?: any, params?: {}): Promise<any>;
|
|
87
|
+
fetchTransactionsByType(type: any, code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
99
88
|
fetchDeposit(id: string, code?: Str, params?: {}): Promise<Transaction>;
|
|
100
89
|
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
101
90
|
fetchWithdrawal(id: string, code?: Str, params?: {}): Promise<Transaction>;
|
|
@@ -103,7 +92,7 @@ export default class bitmart extends Exchange {
|
|
|
103
92
|
parseTransactionStatus(status: any): string;
|
|
104
93
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
105
94
|
repayIsolatedMargin(symbol: string, code: string, amount: any, params?: {}): Promise<any>;
|
|
106
|
-
borrowIsolatedMargin(symbol: string, code: string, amount:
|
|
95
|
+
borrowIsolatedMargin(symbol: string, code: string, amount: number, params?: {}): Promise<any>;
|
|
107
96
|
parseMarginLoan(info: any, currency?: Currency): {
|
|
108
97
|
id: string;
|
|
109
98
|
currency: string;
|
|
@@ -136,7 +125,7 @@ export default class bitmart extends Exchange {
|
|
|
136
125
|
info: any;
|
|
137
126
|
};
|
|
138
127
|
fetchIsolatedBorrowRates(params?: {}): Promise<any[]>;
|
|
139
|
-
transfer(code: string, amount:
|
|
128
|
+
transfer(code: string, amount: number, fromAccount: any, toAccount: any, params?: {}): Promise<TransferEntry>;
|
|
140
129
|
parseTransferStatus(status: any): string;
|
|
141
130
|
parseTransferToAccount(type: any): string;
|
|
142
131
|
parseTransferFromAccount(type: any): string;
|
|
@@ -165,7 +154,7 @@ export default class bitmart extends Exchange {
|
|
|
165
154
|
};
|
|
166
155
|
fetchOpenInterest(symbol: string, params?: {}): Promise<import("./base/types.js").OpenInterest>;
|
|
167
156
|
parseOpenInterest(interest: any, market?: Market): import("./base/types.js").OpenInterest;
|
|
168
|
-
setLeverage(leverage:
|
|
157
|
+
setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
|
|
169
158
|
fetchFundingRate(symbol: string, params?: {}): Promise<{
|
|
170
159
|
info: any;
|
|
171
160
|
symbol: string;
|
package/js/src/bitmart.js
CHANGED
|
@@ -2419,7 +2419,7 @@ export default class bitmart extends Exchange {
|
|
|
2419
2419
|
}
|
|
2420
2420
|
const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'trigger_price']);
|
|
2421
2421
|
const isTriggerOrder = triggerPrice !== undefined;
|
|
2422
|
-
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activation_price', price);
|
|
2422
|
+
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activation_price', this.numberToString(price));
|
|
2423
2423
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callback_rate');
|
|
2424
2424
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
2425
2425
|
if (isLimitOrder) {
|