ccxt 4.3.10 → 4.3.12
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/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +15 -0
- package/dist/cjs/src/bigone.js +22 -22
- package/dist/cjs/src/binance.js +5 -5
- package/dist/cjs/src/bingx.js +2 -2
- package/dist/cjs/src/bitget.js +7 -4
- package/dist/cjs/src/bitmart.js +3 -8
- package/dist/cjs/src/bitmex.js +2 -2
- package/dist/cjs/src/blofin.js +2 -0
- package/dist/cjs/src/bybit.js +81 -71
- package/dist/cjs/src/coinbase.js +8 -8
- package/dist/cjs/src/coinbaseinternational.js +2 -2
- package/dist/cjs/src/coinex.js +513 -449
- package/dist/cjs/src/coinlist.js +12 -12
- package/dist/cjs/src/coinmetro.js +2 -2
- package/dist/cjs/src/cryptocom.js +16 -16
- package/dist/cjs/src/gate.js +2 -2
- package/dist/cjs/src/hitbtc.js +3 -3
- package/dist/cjs/src/htx.js +3 -7
- package/dist/cjs/src/indodax.js +2 -2
- package/dist/cjs/src/kraken.js +3 -1
- package/dist/cjs/src/kucoin.js +4 -4
- package/dist/cjs/src/kucoinfutures.js +6 -6
- package/dist/cjs/src/mexc.js +5 -5
- package/dist/cjs/src/okx.js +6 -6
- package/dist/cjs/src/poloniexfutures.js +4 -4
- package/dist/cjs/src/pro/bitget.js +140 -89
- package/dist/cjs/src/pro/bybit.js +196 -11
- package/dist/cjs/src/pro/coinbase.js +107 -29
- package/dist/cjs/src/pro/mexc.js +21 -1
- package/dist/cjs/src/probit.js +2 -2
- package/dist/cjs/src/whitebit.js +76 -1
- package/dist/cjs/src/woo.js +2 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/blofin.d.ts +2 -0
- package/js/src/base/Exchange.d.ts +10 -6
- package/js/src/base/Exchange.js +15 -0
- package/js/src/base/types.d.ts +17 -2
- package/js/src/bigone.js +22 -22
- package/js/src/binance.d.ts +2 -9
- package/js/src/binance.js +5 -5
- package/js/src/bingx.js +2 -2
- package/js/src/bitget.d.ts +4 -31
- package/js/src/bitget.js +7 -4
- package/js/src/bitmart.d.ts +4 -24
- package/js/src/bitmart.js +3 -8
- package/js/src/bitmex.js +2 -2
- package/js/src/blofin.js +2 -0
- package/js/src/bybit.d.ts +7 -9
- package/js/src/bybit.js +81 -71
- package/js/src/coinbase.js +8 -8
- package/js/src/coinbaseinternational.js +2 -2
- package/js/src/coinex.d.ts +4 -24
- package/js/src/coinex.js +513 -449
- package/js/src/coinlist.js +12 -12
- package/js/src/coinmetro.js +2 -2
- package/js/src/cryptocom.js +16 -16
- package/js/src/digifinex.d.ts +3 -10
- package/js/src/gate.js +2 -2
- package/js/src/hitbtc.js +3 -3
- package/js/src/htx.d.ts +3 -13
- package/js/src/htx.js +3 -7
- package/js/src/indodax.js +2 -2
- package/js/src/kraken.js +3 -1
- package/js/src/kucoin.js +4 -4
- package/js/src/kucoinfutures.js +6 -6
- package/js/src/mexc.js +5 -5
- package/js/src/okx.d.ts +3 -10
- package/js/src/okx.js +6 -6
- package/js/src/poloniexfutures.js +4 -4
- package/js/src/pro/bitget.js +140 -89
- package/js/src/pro/bybit.d.ts +5 -1
- package/js/src/pro/bybit.js +196 -11
- package/js/src/pro/coinbase.d.ts +4 -0
- package/js/src/pro/coinbase.js +107 -29
- package/js/src/pro/mexc.js +21 -1
- package/js/src/probit.js +2 -2
- package/js/src/whitebit.d.ts +1 -0
- package/js/src/whitebit.js +76 -1
- package/js/src/woo.js +2 -2
- package/package.json +6 -5
- package/dist/cjs/src/flowbtc.js +0 -35
package/js/src/bigone.js
CHANGED
|
@@ -440,16 +440,16 @@ export default class bigone extends Exchange {
|
|
|
440
440
|
// ],
|
|
441
441
|
// }
|
|
442
442
|
//
|
|
443
|
-
const currenciesData = this.
|
|
443
|
+
const currenciesData = this.safeList(data, 'data', []);
|
|
444
444
|
const result = {};
|
|
445
445
|
for (let i = 0; i < currenciesData.length; i++) {
|
|
446
446
|
const currency = currenciesData[i];
|
|
447
447
|
const id = this.safeString(currency, 'symbol');
|
|
448
448
|
const code = this.safeCurrencyCode(id);
|
|
449
449
|
const name = this.safeString(currency, 'name');
|
|
450
|
-
const type = this.
|
|
450
|
+
const type = this.safeBool(currency, 'is_fiat') ? 'fiat' : 'crypto';
|
|
451
451
|
const networks = {};
|
|
452
|
-
const chains = this.
|
|
452
|
+
const chains = this.safeList(currency, 'binding_gateways', []);
|
|
453
453
|
let currencyMaxPrecision = this.parsePrecision(this.safeString2(currency, 'withdrawal_scale', 'scale'));
|
|
454
454
|
let currencyDepositEnabled = undefined;
|
|
455
455
|
let currencyWithdrawEnabled = undefined;
|
|
@@ -457,8 +457,8 @@ export default class bigone extends Exchange {
|
|
|
457
457
|
const chain = chains[j];
|
|
458
458
|
const networkId = this.safeString(chain, 'gateway_name');
|
|
459
459
|
const networkCode = this.networkIdToCode(networkId);
|
|
460
|
-
const deposit = this.
|
|
461
|
-
const withdraw = this.
|
|
460
|
+
const deposit = this.safeBool(chain, 'is_deposit_enabled');
|
|
461
|
+
const withdraw = this.safeBool(chain, 'is_withdrawal_enabled');
|
|
462
462
|
const isActive = (deposit && withdraw);
|
|
463
463
|
const minDepositAmount = this.safeString(chain, 'min_deposit_amount');
|
|
464
464
|
const minWithdrawalAmount = this.safeString(chain, 'min_withdrawal_amount');
|
|
@@ -581,12 +581,12 @@ export default class bigone extends Exchange {
|
|
|
581
581
|
// ...
|
|
582
582
|
// ]
|
|
583
583
|
//
|
|
584
|
-
const markets = this.
|
|
584
|
+
const markets = this.safeList(response, 'data', []);
|
|
585
585
|
const result = [];
|
|
586
586
|
for (let i = 0; i < markets.length; i++) {
|
|
587
587
|
const market = markets[i];
|
|
588
|
-
const baseAsset = this.
|
|
589
|
-
const quoteAsset = this.
|
|
588
|
+
const baseAsset = this.safeDict(market, 'base_asset', {});
|
|
589
|
+
const quoteAsset = this.safeDict(market, 'quote_asset', {});
|
|
590
590
|
const baseId = this.safeString(baseAsset, 'symbol');
|
|
591
591
|
const quoteId = this.safeString(quoteAsset, 'symbol');
|
|
592
592
|
const base = this.safeCurrencyCode(baseId);
|
|
@@ -651,7 +651,7 @@ export default class bigone extends Exchange {
|
|
|
651
651
|
const base = this.safeCurrencyCode(baseId);
|
|
652
652
|
const quote = this.safeCurrencyCode(quoteId);
|
|
653
653
|
const settle = this.safeCurrencyCode(settleId);
|
|
654
|
-
const inverse = this.
|
|
654
|
+
const inverse = this.safeBool(market, 'isInverse');
|
|
655
655
|
result.push(this.safeMarketStructure({
|
|
656
656
|
'id': marketId,
|
|
657
657
|
'symbol': base + '/' + quote + ':' + settle,
|
|
@@ -667,7 +667,7 @@ export default class bigone extends Exchange {
|
|
|
667
667
|
'swap': true,
|
|
668
668
|
'future': false,
|
|
669
669
|
'option': false,
|
|
670
|
-
'active': this.
|
|
670
|
+
'active': this.safeBool(market, 'enable'),
|
|
671
671
|
'contract': true,
|
|
672
672
|
'linear': !inverse,
|
|
673
673
|
'inverse': inverse,
|
|
@@ -754,8 +754,8 @@ export default class bigone extends Exchange {
|
|
|
754
754
|
const marketId = this.safeString2(ticker, 'asset_pair_name', 'symbol');
|
|
755
755
|
const symbol = this.safeSymbol(marketId, market, '-', marketType);
|
|
756
756
|
const close = this.safeString2(ticker, 'close', 'latestPrice');
|
|
757
|
-
const bid = this.
|
|
758
|
-
const ask = this.
|
|
757
|
+
const bid = this.safeDict(ticker, 'bid', {});
|
|
758
|
+
const ask = this.safeDict(ticker, 'ask', {});
|
|
759
759
|
return this.safeTicker({
|
|
760
760
|
'symbol': symbol,
|
|
761
761
|
'timestamp': undefined,
|
|
@@ -877,7 +877,7 @@ export default class bigone extends Exchange {
|
|
|
877
877
|
// ]
|
|
878
878
|
// }
|
|
879
879
|
//
|
|
880
|
-
data = this.
|
|
880
|
+
data = this.safeList(response, 'data', []);
|
|
881
881
|
}
|
|
882
882
|
else {
|
|
883
883
|
data = await this.contractPublicGetInstruments(params);
|
|
@@ -927,7 +927,7 @@ export default class bigone extends Exchange {
|
|
|
927
927
|
// }
|
|
928
928
|
// }
|
|
929
929
|
//
|
|
930
|
-
const data = this.
|
|
930
|
+
const data = this.safeDict(response, 'data', {});
|
|
931
931
|
const timestamp = this.safeInteger(data, 'Timestamp');
|
|
932
932
|
return this.parseToInt(timestamp / 1000000);
|
|
933
933
|
}
|
|
@@ -1304,7 +1304,7 @@ export default class bigone extends Exchange {
|
|
|
1304
1304
|
'timestamp': undefined,
|
|
1305
1305
|
'datetime': undefined,
|
|
1306
1306
|
};
|
|
1307
|
-
const balances = this.
|
|
1307
|
+
const balances = this.safeList(response, 'data', []);
|
|
1308
1308
|
for (let i = 0; i < balances.length; i++) {
|
|
1309
1309
|
const balance = balances[i];
|
|
1310
1310
|
const symbol = this.safeString(balance, 'asset_symbol');
|
|
@@ -1392,7 +1392,7 @@ export default class bigone extends Exchange {
|
|
|
1392
1392
|
if (Precise.stringEq(triggerPrice, '0')) {
|
|
1393
1393
|
triggerPrice = undefined;
|
|
1394
1394
|
}
|
|
1395
|
-
const immediateOrCancel = this.
|
|
1395
|
+
const immediateOrCancel = this.safeBool(order, 'immediate_or_cancel');
|
|
1396
1396
|
let timeInForce = undefined;
|
|
1397
1397
|
if (immediateOrCancel) {
|
|
1398
1398
|
timeInForce = 'IOC';
|
|
@@ -1419,7 +1419,7 @@ export default class bigone extends Exchange {
|
|
|
1419
1419
|
'symbol': symbol,
|
|
1420
1420
|
'type': type,
|
|
1421
1421
|
'timeInForce': timeInForce,
|
|
1422
|
-
'postOnly': this.
|
|
1422
|
+
'postOnly': this.safeBool(order, 'post_only'),
|
|
1423
1423
|
'side': side,
|
|
1424
1424
|
'price': price,
|
|
1425
1425
|
'stopPrice': triggerPrice,
|
|
@@ -1869,14 +1869,14 @@ export default class bigone extends Exchange {
|
|
|
1869
1869
|
// ]
|
|
1870
1870
|
// }
|
|
1871
1871
|
//
|
|
1872
|
-
const data = this.
|
|
1872
|
+
const data = this.safeList(response, 'data', []);
|
|
1873
1873
|
const dataLength = data.length;
|
|
1874
1874
|
if (dataLength < 1) {
|
|
1875
1875
|
throw new ExchangeError(this.id + ' fetchDepositAddress() returned empty address response');
|
|
1876
1876
|
}
|
|
1877
1877
|
const chainsIndexedById = this.indexBy(data, 'chain');
|
|
1878
1878
|
const selectedNetworkId = this.selectNetworkIdFromRawNetworks(code, networkCode, chainsIndexedById);
|
|
1879
|
-
const addressObject = this.
|
|
1879
|
+
const addressObject = this.safeDict(chainsIndexedById, selectedNetworkId, {});
|
|
1880
1880
|
const address = this.safeString(addressObject, 'value');
|
|
1881
1881
|
const tag = this.safeString(addressObject, 'memo');
|
|
1882
1882
|
this.checkAddress(address);
|
|
@@ -1962,7 +1962,7 @@ export default class bigone extends Exchange {
|
|
|
1962
1962
|
const address = this.safeString(transaction, 'target_address');
|
|
1963
1963
|
const tag = this.safeString(transaction, 'memo');
|
|
1964
1964
|
const type = ('customer_id' in transaction) ? 'withdrawal' : 'deposit';
|
|
1965
|
-
const internal = this.
|
|
1965
|
+
const internal = this.safeBool(transaction, 'is_internal');
|
|
1966
1966
|
return {
|
|
1967
1967
|
'info': transaction,
|
|
1968
1968
|
'id': id,
|
|
@@ -2105,7 +2105,7 @@ export default class bigone extends Exchange {
|
|
|
2105
2105
|
*/
|
|
2106
2106
|
await this.loadMarkets();
|
|
2107
2107
|
const currency = this.currency(code);
|
|
2108
|
-
const accountsByType = this.
|
|
2108
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
2109
2109
|
const fromId = this.safeString(accountsByType, fromAccount, fromAccount);
|
|
2110
2110
|
const toId = this.safeString(accountsByType, toAccount, toAccount);
|
|
2111
2111
|
const guid = this.safeString(params, 'guid', this.uuid());
|
|
@@ -2126,7 +2126,7 @@ export default class bigone extends Exchange {
|
|
|
2126
2126
|
// }
|
|
2127
2127
|
//
|
|
2128
2128
|
const transfer = this.parseTransfer(response, currency);
|
|
2129
|
-
const transferOptions = this.
|
|
2129
|
+
const transferOptions = this.safeDict(this.options, 'transfer', {});
|
|
2130
2130
|
const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
|
|
2131
2131
|
if (fillResponseFromRequest) {
|
|
2132
2132
|
transfer['fromAccount'] = fromAccount;
|
package/js/src/binance.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/binance.js';
|
|
2
|
-
import type { TransferEntry, Int, OrderSide, Balances, OrderType, Trade, OHLCV, Order, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, Str, Transaction, Ticker, OrderBook, Tickers, Market, Greeks, Strings, Currency, MarketInterface, MarginMode, MarginModes, Leverage, Leverages, Num, Option, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Int, OrderSide, Balances, OrderType, Trade, OHLCV, Order, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, Str, Transaction, Ticker, OrderBook, Tickers, Market, Greeks, Strings, Currency, MarketInterface, MarginMode, MarginModes, Leverage, Leverages, Num, Option, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CrossBorrowRate } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class binance
|
|
5
5
|
* @augments Exchange
|
|
@@ -303,14 +303,7 @@ export default class binance extends Exchange {
|
|
|
303
303
|
parseMarginModification(data: any, market?: Market): MarginModification;
|
|
304
304
|
reduceMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
|
|
305
305
|
addMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
|
|
306
|
-
fetchCrossBorrowRate(code: string, params?: {}): Promise<
|
|
307
|
-
currency: string;
|
|
308
|
-
rate: number;
|
|
309
|
-
period: number;
|
|
310
|
-
timestamp: number;
|
|
311
|
-
datetime: string;
|
|
312
|
-
info: any;
|
|
313
|
-
}>;
|
|
306
|
+
fetchCrossBorrowRate(code: string, params?: {}): Promise<CrossBorrowRate>;
|
|
314
307
|
fetchBorrowRateHistory(code: string, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
315
308
|
parseBorrowRateHistory(response: any, code: any, since: any, limit: any): any;
|
|
316
309
|
parseBorrowRate(info: any, currency?: Currency): {
|
package/js/src/binance.js
CHANGED
|
@@ -1102,7 +1102,7 @@ export default class binance extends Exchange {
|
|
|
1102
1102
|
'feeSide': 'quote',
|
|
1103
1103
|
'tierBased': true,
|
|
1104
1104
|
'percentage': true,
|
|
1105
|
-
'taker': this.parseNumber('0.
|
|
1105
|
+
'taker': this.parseNumber('0.000500'),
|
|
1106
1106
|
'maker': this.parseNumber('0.000200'),
|
|
1107
1107
|
'tiers': {
|
|
1108
1108
|
'taker': [
|
|
@@ -9042,9 +9042,9 @@ export default class binance extends Exchange {
|
|
|
9042
9042
|
if (since !== undefined) {
|
|
9043
9043
|
request['startTime'] = since;
|
|
9044
9044
|
}
|
|
9045
|
-
const until = this.
|
|
9045
|
+
const until = this.safeInteger(params, 'until'); // unified in milliseconds
|
|
9046
9046
|
const endTime = this.safeInteger(params, 'endTime', until); // exchange-specific in milliseconds
|
|
9047
|
-
params = this.omit(params, ['endTime', '
|
|
9047
|
+
params = this.omit(params, ['endTime', 'until']);
|
|
9048
9048
|
if (endTime !== undefined) {
|
|
9049
9049
|
request['endTime'] = endTime;
|
|
9050
9050
|
}
|
|
@@ -11797,9 +11797,9 @@ export default class binance extends Exchange {
|
|
|
11797
11797
|
if (since !== undefined) {
|
|
11798
11798
|
request['startTime'] = since;
|
|
11799
11799
|
}
|
|
11800
|
-
const until = this.
|
|
11800
|
+
const until = this.safeInteger(params, 'until'); // unified in milliseconds
|
|
11801
11801
|
const endTime = this.safeInteger(params, 'endTime', until); // exchange-specific in milliseconds
|
|
11802
|
-
params = this.omit(params, ['endTime', 'until'
|
|
11802
|
+
params = this.omit(params, ['endTime', 'until']);
|
|
11803
11803
|
if (endTime) {
|
|
11804
11804
|
request['endTime'] = endTime;
|
|
11805
11805
|
}
|
package/js/src/bingx.js
CHANGED
|
@@ -2924,9 +2924,9 @@ export default class bingx extends Exchange {
|
|
|
2924
2924
|
if (since !== undefined) {
|
|
2925
2925
|
request['startTime'] = since;
|
|
2926
2926
|
}
|
|
2927
|
-
const until = this.
|
|
2927
|
+
const until = this.safeInteger(params, 'until'); // unified in milliseconds
|
|
2928
2928
|
const endTime = this.safeInteger(params, 'endTime', until); // exchange-specific in milliseconds
|
|
2929
|
-
params = this.omit(params, ['endTime', '
|
|
2929
|
+
params = this.omit(params, ['endTime', 'until']);
|
|
2930
2930
|
if (endTime !== undefined) {
|
|
2931
2931
|
request['endTime'] = endTime;
|
|
2932
2932
|
}
|
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, TransferEntry, Leverage, MarginMode, Num, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion } 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, Leverage, MarginMode, Num, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CrossBorrowRate, IsolatedBorrowRate } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bitget
|
|
5
5
|
* @augments Exchange
|
|
@@ -228,36 +228,9 @@ export default class bitget extends Exchange {
|
|
|
228
228
|
};
|
|
229
229
|
fetchMyLiquidations(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
|
|
230
230
|
parseLiquidation(liquidation: any, market?: Market): Liquidation;
|
|
231
|
-
fetchIsolatedBorrowRate(symbol: string, params?: {}): Promise<
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
baseRate: number;
|
|
235
|
-
quote: string;
|
|
236
|
-
quoteRate: number;
|
|
237
|
-
period: number;
|
|
238
|
-
timestamp: number;
|
|
239
|
-
datetime: string;
|
|
240
|
-
info: any;
|
|
241
|
-
}>;
|
|
242
|
-
parseIsolatedBorrowRate(info: any, market?: Market): {
|
|
243
|
-
symbol: string;
|
|
244
|
-
base: string;
|
|
245
|
-
baseRate: number;
|
|
246
|
-
quote: string;
|
|
247
|
-
quoteRate: number;
|
|
248
|
-
period: number;
|
|
249
|
-
timestamp: number;
|
|
250
|
-
datetime: string;
|
|
251
|
-
info: any;
|
|
252
|
-
};
|
|
253
|
-
fetchCrossBorrowRate(code: string, params?: {}): Promise<{
|
|
254
|
-
currency: string;
|
|
255
|
-
rate: number;
|
|
256
|
-
period: number;
|
|
257
|
-
timestamp: number;
|
|
258
|
-
datetime: string;
|
|
259
|
-
info: any;
|
|
260
|
-
}>;
|
|
231
|
+
fetchIsolatedBorrowRate(symbol: string, params?: {}): Promise<IsolatedBorrowRate>;
|
|
232
|
+
parseIsolatedBorrowRate(info: any, market?: Market): IsolatedBorrowRate;
|
|
233
|
+
fetchCrossBorrowRate(code: string, params?: {}): Promise<CrossBorrowRate>;
|
|
261
234
|
parseBorrowRate(info: any, currency?: Currency): {
|
|
262
235
|
currency: string;
|
|
263
236
|
rate: number;
|
package/js/src/bitget.js
CHANGED
|
@@ -3364,11 +3364,11 @@ export default class bitget extends Exchange {
|
|
|
3364
3364
|
'symbol': market['id'],
|
|
3365
3365
|
'granularity': this.safeString(timeframes, timeframe, timeframe),
|
|
3366
3366
|
};
|
|
3367
|
-
const until = this.
|
|
3367
|
+
const until = this.safeInteger(params, 'until');
|
|
3368
3368
|
const limitDefined = limit !== undefined;
|
|
3369
3369
|
const sinceDefined = since !== undefined;
|
|
3370
3370
|
const untilDefined = until !== undefined;
|
|
3371
|
-
params = this.omit(params, ['until'
|
|
3371
|
+
params = this.omit(params, ['until']);
|
|
3372
3372
|
let response = undefined;
|
|
3373
3373
|
const now = this.milliseconds();
|
|
3374
3374
|
// retrievable periods listed here:
|
|
@@ -4614,6 +4614,9 @@ export default class bitget extends Exchange {
|
|
|
4614
4614
|
params = this.omit(params, ['stopPrice', 'triggerType', 'stopLossPrice', 'takeProfitPrice', 'stopLoss', 'takeProfit', 'clientOrderId', 'trailingTriggerPrice', 'trailingPercent']);
|
|
4615
4615
|
let response = undefined;
|
|
4616
4616
|
if (market['spot']) {
|
|
4617
|
+
if (triggerPrice === undefined) {
|
|
4618
|
+
throw new NotSupported(this.id + 'editOrder() only supports plan/trigger spot orders');
|
|
4619
|
+
}
|
|
4617
4620
|
const editMarketBuyOrderRequiresPrice = this.safeBool(this.options, 'editMarketBuyOrderRequiresPrice', true);
|
|
4618
4621
|
if (editMarketBuyOrderRequiresPrice && isMarketOrder && (side === 'buy')) {
|
|
4619
4622
|
if (price === undefined) {
|
|
@@ -5646,8 +5649,8 @@ export default class bitget extends Exchange {
|
|
|
5646
5649
|
if (symbol === undefined) {
|
|
5647
5650
|
throw new ArgumentsRequired(this.id + ' fetchCanceledAndClosedOrders() requires a symbol argument');
|
|
5648
5651
|
}
|
|
5649
|
-
const endTime = this.safeIntegerN(params, ['endTime', 'until'
|
|
5650
|
-
params = this.omit(params, ['until'
|
|
5652
|
+
const endTime = this.safeIntegerN(params, ['endTime', 'until']);
|
|
5653
|
+
params = this.omit(params, ['until']);
|
|
5651
5654
|
if (since === undefined) {
|
|
5652
5655
|
since = now - 7776000000;
|
|
5653
5656
|
request['startTime'] = since;
|
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, TransferEntry, Num, TradingFeeInterface, Currencies } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, Balances, OrderType, OHLCV, Order, Str, Trade, Transaction, Ticker, OrderBook, Tickers, Strings, Currency, Market, TransferEntry, Num, TradingFeeInterface, Currencies, IsolatedBorrowRates, IsolatedBorrowRate } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bitmart
|
|
5
5
|
* @augments Exchange
|
|
@@ -99,29 +99,9 @@ export default class bitmart extends Exchange {
|
|
|
99
99
|
datetime: any;
|
|
100
100
|
info: any;
|
|
101
101
|
};
|
|
102
|
-
fetchIsolatedBorrowRate(symbol: string, params?: {}): Promise<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
baseRate: number;
|
|
106
|
-
quote: string;
|
|
107
|
-
quoteRate: number;
|
|
108
|
-
period: number;
|
|
109
|
-
timestamp: any;
|
|
110
|
-
datetime: any;
|
|
111
|
-
info: any;
|
|
112
|
-
}>;
|
|
113
|
-
parseIsolatedBorrowRate(info: any, market?: Market): {
|
|
114
|
-
symbol: string;
|
|
115
|
-
base: string;
|
|
116
|
-
baseRate: number;
|
|
117
|
-
quote: string;
|
|
118
|
-
quoteRate: number;
|
|
119
|
-
period: number;
|
|
120
|
-
timestamp: any;
|
|
121
|
-
datetime: any;
|
|
122
|
-
info: any;
|
|
123
|
-
};
|
|
124
|
-
fetchIsolatedBorrowRates(params?: {}): Promise<any[]>;
|
|
102
|
+
fetchIsolatedBorrowRate(symbol: string, params?: {}): Promise<IsolatedBorrowRate>;
|
|
103
|
+
parseIsolatedBorrowRate(info: any, market?: Market): IsolatedBorrowRate;
|
|
104
|
+
fetchIsolatedBorrowRates(params?: {}): Promise<IsolatedBorrowRates>;
|
|
125
105
|
transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
|
|
126
106
|
parseTransferStatus(status: any): string;
|
|
127
107
|
parseTransferToAccount(type: any): string;
|
package/js/src/bitmart.js
CHANGED
|
@@ -3713,12 +3713,7 @@ export default class bitmart extends Exchange {
|
|
|
3713
3713
|
//
|
|
3714
3714
|
const data = this.safeValue(response, 'data', {});
|
|
3715
3715
|
const symbols = this.safeValue(data, 'symbols', []);
|
|
3716
|
-
|
|
3717
|
-
for (let i = 0; i < symbols.length; i++) {
|
|
3718
|
-
const symbol = this.safeValue(symbols, i);
|
|
3719
|
-
result.push(this.parseIsolatedBorrowRate(symbol));
|
|
3720
|
-
}
|
|
3721
|
-
return result;
|
|
3716
|
+
return this.parseIsolatedBorrowRates(symbols);
|
|
3722
3717
|
}
|
|
3723
3718
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
3724
3719
|
/**
|
|
@@ -3894,9 +3889,9 @@ export default class bitmart extends Exchange {
|
|
|
3894
3889
|
if (limit !== undefined) {
|
|
3895
3890
|
request['limit'] = limit;
|
|
3896
3891
|
}
|
|
3897
|
-
const until = this.
|
|
3892
|
+
const until = this.safeInteger(params, 'until'); // unified in milliseconds
|
|
3898
3893
|
const endTime = this.safeInteger(params, 'time_end', until); // exchange-specific in milliseconds
|
|
3899
|
-
params = this.omit(params, ['
|
|
3894
|
+
params = this.omit(params, ['until']);
|
|
3900
3895
|
if (endTime !== undefined) {
|
|
3901
3896
|
request['time_end'] = endTime;
|
|
3902
3897
|
}
|
package/js/src/bitmex.js
CHANGED
|
@@ -2572,8 +2572,8 @@ export default class bitmex extends Exchange {
|
|
|
2572
2572
|
if (limit !== undefined) {
|
|
2573
2573
|
request['count'] = limit;
|
|
2574
2574
|
}
|
|
2575
|
-
const until = this.
|
|
2576
|
-
params = this.omit(params, ['until'
|
|
2575
|
+
const until = this.safeInteger(params, 'until');
|
|
2576
|
+
params = this.omit(params, ['until']);
|
|
2577
2577
|
if (until !== undefined) {
|
|
2578
2578
|
request['endTime'] = this.iso8601(until);
|
|
2579
2579
|
}
|
package/js/src/blofin.js
CHANGED
package/js/src/bybit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bybit.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Trade, Order, OHLCV, FundingRateHistory, OpenInterest, OrderRequest, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Liquidation, Leverage, Num, FundingHistory, Option, OptionChain, TradingFeeInterface, Currencies, TradingFees, CancellationRequest, Position } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Trade, Order, OHLCV, FundingRateHistory, OpenInterest, OrderRequest, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Liquidation, Leverage, Num, FundingHistory, Option, OptionChain, TradingFeeInterface, Currencies, TradingFees, CancellationRequest, Position, CrossBorrowRate } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bybit
|
|
5
5
|
* @augments Exchange
|
|
@@ -62,8 +62,13 @@ export default class bybit extends Exchange {
|
|
|
62
62
|
createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
|
|
63
63
|
createUsdcOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
64
64
|
editUsdcOrder(id: any, symbol: any, type: any, side: any, amount?: any, price?: any, params?: {}): Promise<Order>;
|
|
65
|
+
editOrderRequest(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): {
|
|
66
|
+
symbol: string;
|
|
67
|
+
orderId: string;
|
|
68
|
+
};
|
|
65
69
|
editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
|
|
66
70
|
cancelUsdcOrder(id: any, symbol?: Str, params?: {}): Promise<Order>;
|
|
71
|
+
cancelOrderRequest(id: string, symbol?: Str, params?: {}): any;
|
|
67
72
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
68
73
|
cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<Order[]>;
|
|
69
74
|
cancelOrdersForSymbols(orders: CancellationRequest[], params?: {}): Promise<Order[]>;
|
|
@@ -136,14 +141,7 @@ export default class bybit extends Exchange {
|
|
|
136
141
|
fetchOpenInterest(symbol: string, params?: {}): Promise<OpenInterest>;
|
|
137
142
|
fetchOpenInterestHistory(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OpenInterest[]>;
|
|
138
143
|
parseOpenInterest(interest: any, market?: Market): OpenInterest;
|
|
139
|
-
fetchCrossBorrowRate(code: string, params?: {}): Promise<
|
|
140
|
-
currency: string;
|
|
141
|
-
rate: number;
|
|
142
|
-
period: number;
|
|
143
|
-
timestamp: number;
|
|
144
|
-
datetime: string;
|
|
145
|
-
info: any;
|
|
146
|
-
}>;
|
|
144
|
+
fetchCrossBorrowRate(code: string, params?: {}): Promise<CrossBorrowRate>;
|
|
147
145
|
parseBorrowRate(info: any, currency?: Currency): {
|
|
148
146
|
currency: string;
|
|
149
147
|
rate: number;
|