ccxt 4.3.42 → 4.3.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +169 -44
- package/dist/cjs/src/btcmarkets.js +31 -2
- package/dist/cjs/src/coinex.js +106 -107
- package/dist/cjs/src/phemex.js +5 -4
- package/dist/cjs/src/pro/bitget.js +28 -21
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/dist/cjs/src/pro/mexc.js +1 -1
- package/dist/cjs/src/tradeogre.js +11 -5
- package/dist/cjs/src/wavesexchange.js +2 -2
- package/dist/cjs/src/wazirx.js +38 -15
- package/dist/cjs/src/zonda.js +9 -1
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +1 -1
- package/js/src/abstract/coinex.d.ts +2 -1
- package/js/src/binance.js +169 -44
- package/js/src/btcmarkets.d.ts +2 -2
- package/js/src/btcmarkets.js +31 -2
- package/js/src/coinex.js +106 -107
- package/js/src/phemex.js +6 -5
- package/js/src/pro/bitget.js +28 -21
- package/js/src/pro/bybit.js +1 -1
- package/js/src/pro/mexc.js +1 -1
- package/js/src/tradeogre.d.ts +1 -1
- package/js/src/tradeogre.js +12 -6
- package/js/src/wavesexchange.d.ts +1 -20
- package/js/src/wavesexchange.js +2 -2
- package/js/src/wazirx.d.ts +1 -1
- package/js/src/wazirx.js +38 -15
- package/js/src/zonda.d.ts +1 -1
- package/js/src/zonda.js +9 -1
- package/package.json +1 -1
|
@@ -1225,23 +1225,30 @@ class bitget extends bitget$1 {
|
|
|
1225
1225
|
// isolated and cross margin
|
|
1226
1226
|
//
|
|
1227
1227
|
// {
|
|
1228
|
-
//
|
|
1229
|
-
//
|
|
1230
|
-
//
|
|
1231
|
-
//
|
|
1232
|
-
//
|
|
1233
|
-
//
|
|
1234
|
-
//
|
|
1235
|
-
//
|
|
1236
|
-
//
|
|
1237
|
-
//
|
|
1238
|
-
//
|
|
1239
|
-
//
|
|
1240
|
-
//
|
|
1241
|
-
//
|
|
1242
|
-
//
|
|
1243
|
-
//
|
|
1244
|
-
//
|
|
1228
|
+
// enterPointSource: "web",
|
|
1229
|
+
// feeDetail: [
|
|
1230
|
+
// {
|
|
1231
|
+
// feeCoin: "AAVE",
|
|
1232
|
+
// deduction: "no",
|
|
1233
|
+
// totalDeductionFee: "0",
|
|
1234
|
+
// totalFee: "-0.00010740",
|
|
1235
|
+
// },
|
|
1236
|
+
// ],
|
|
1237
|
+
// force: "gtc",
|
|
1238
|
+
// orderType: "limit",
|
|
1239
|
+
// price: "93.170000000",
|
|
1240
|
+
// fillPrice: "93.170000000",
|
|
1241
|
+
// baseSize: "0.110600000", // total amount of order
|
|
1242
|
+
// quoteSize: "10.304602000", // total cost of order (independently if order is filled or pending)
|
|
1243
|
+
// baseVolume: "0.107400000", // filled amount of order (during order's lifecycle, and not for this specific incoming update)
|
|
1244
|
+
// fillTotalAmount: "10.006458000", // filled cost of order (during order's lifecycle, and not for this specific incoming update)
|
|
1245
|
+
// side: "buy",
|
|
1246
|
+
// status: "partially_filled",
|
|
1247
|
+
// cTime: "1717875017306",
|
|
1248
|
+
// clientOid: "b57afe789a06454e9c560a2aab7f7201",
|
|
1249
|
+
// loanType: "auto-loan",
|
|
1250
|
+
// orderId: "1183419084588060673",
|
|
1251
|
+
// }
|
|
1245
1252
|
//
|
|
1246
1253
|
const isSpot = !('posMode' in order);
|
|
1247
1254
|
const isMargin = ('loanType' in order);
|
|
@@ -1282,12 +1289,12 @@ class bitget extends bitget$1 {
|
|
|
1282
1289
|
let filledAmount = undefined;
|
|
1283
1290
|
let cost = undefined;
|
|
1284
1291
|
let remaining = undefined;
|
|
1285
|
-
|
|
1292
|
+
let totalFilled = this.safeString(order, 'accBaseVolume');
|
|
1286
1293
|
if (isSpot) {
|
|
1287
1294
|
if (isMargin) {
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
cost = this.safeString(order, '
|
|
1295
|
+
totalAmount = this.safeString(order, 'baseSize');
|
|
1296
|
+
totalFilled = this.safeString(order, 'baseVolume');
|
|
1297
|
+
cost = this.safeString(order, 'fillTotalAmount');
|
|
1291
1298
|
}
|
|
1292
1299
|
else {
|
|
1293
1300
|
const partialFillAmount = this.safeString(order, 'baseVolume');
|
package/dist/cjs/src/pro/mexc.js
CHANGED
|
@@ -449,7 +449,7 @@ class tradeogre extends tradeogre$1 {
|
|
|
449
449
|
* @name tradeogre#createOrder
|
|
450
450
|
* @description create a trade order
|
|
451
451
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
452
|
-
* @param {string} type
|
|
452
|
+
* @param {string} type must be 'limit'
|
|
453
453
|
* @param {string} side 'buy' or 'sell'
|
|
454
454
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
455
455
|
* @param {float} price the price at which the order is to be fullfilled, in units of the quote currency
|
|
@@ -458,14 +458,17 @@ class tradeogre extends tradeogre$1 {
|
|
|
458
458
|
*/
|
|
459
459
|
await this.loadMarkets();
|
|
460
460
|
const market = this.market(symbol);
|
|
461
|
+
if (type === 'market') {
|
|
462
|
+
throw new errors.BadRequest(this.id + ' createOrder does not support market orders');
|
|
463
|
+
}
|
|
464
|
+
if (price === undefined) {
|
|
465
|
+
throw new errors.ArgumentsRequired(this.id + ' createOrder requires a limit parameter');
|
|
466
|
+
}
|
|
461
467
|
const request = {
|
|
462
468
|
'market': market['id'],
|
|
463
469
|
'quantity': this.parseToNumeric(this.amountToPrecision(symbol, amount)),
|
|
464
470
|
'price': this.parseToNumeric(this.priceToPrecision(symbol, price)),
|
|
465
471
|
};
|
|
466
|
-
if (type === 'market') {
|
|
467
|
-
throw new errors.BadRequest(this.id + ' createOrder does not support market orders');
|
|
468
|
-
}
|
|
469
472
|
let response = undefined;
|
|
470
473
|
if (side === 'buy') {
|
|
471
474
|
response = await this.privatePostOrderBuy(this.extend(request, params));
|
|
@@ -502,7 +505,10 @@ class tradeogre extends tradeogre$1 {
|
|
|
502
505
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
503
506
|
*/
|
|
504
507
|
await this.loadMarkets();
|
|
505
|
-
|
|
508
|
+
const response = await this.cancelOrder('all', symbol, params);
|
|
509
|
+
return [
|
|
510
|
+
response,
|
|
511
|
+
];
|
|
506
512
|
}
|
|
507
513
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
508
514
|
/**
|
|
@@ -1499,7 +1499,7 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
1499
1499
|
const firstMessage = this.safeValue(message, 0);
|
|
1500
1500
|
const firstOrder = this.safeValue(firstMessage, 0);
|
|
1501
1501
|
const returnedId = this.safeString(firstOrder, 'orderId');
|
|
1502
|
-
return {
|
|
1502
|
+
return this.safeOrder({
|
|
1503
1503
|
'info': response,
|
|
1504
1504
|
'id': returnedId,
|
|
1505
1505
|
'clientOrderId': undefined,
|
|
@@ -1518,7 +1518,7 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
1518
1518
|
'status': undefined,
|
|
1519
1519
|
'fee': undefined,
|
|
1520
1520
|
'trades': undefined,
|
|
1521
|
-
};
|
|
1521
|
+
});
|
|
1522
1522
|
}
|
|
1523
1523
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
1524
1524
|
/**
|
package/dist/cjs/src/wazirx.js
CHANGED
|
@@ -792,7 +792,26 @@ class wazirx extends wazirx$1 {
|
|
|
792
792
|
const request = {
|
|
793
793
|
'symbol': market['id'],
|
|
794
794
|
};
|
|
795
|
-
|
|
795
|
+
const response = await this.privateDeleteOpenOrders(this.extend(request, params));
|
|
796
|
+
//
|
|
797
|
+
// [
|
|
798
|
+
// {
|
|
799
|
+
// id: "4565421197",
|
|
800
|
+
// symbol: "adausdt",
|
|
801
|
+
// type: "limit",
|
|
802
|
+
// side: "buy",
|
|
803
|
+
// status: "wait",
|
|
804
|
+
// price: "0.41",
|
|
805
|
+
// origQty: "11.00",
|
|
806
|
+
// executedQty: "0.00",
|
|
807
|
+
// avgPrice: "0.00",
|
|
808
|
+
// createdTime: "1718089507000",
|
|
809
|
+
// updatedTime: "1718089507000",
|
|
810
|
+
// clientOrderId: "93d2a838-e272-405d-91e7-3a7bc6d3a003"
|
|
811
|
+
// }
|
|
812
|
+
// ]
|
|
813
|
+
//
|
|
814
|
+
return this.parseOrders(response);
|
|
796
815
|
}
|
|
797
816
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
798
817
|
/**
|
|
@@ -868,18 +887,22 @@ class wazirx extends wazirx$1 {
|
|
|
868
887
|
return this.parseOrder(response, market);
|
|
869
888
|
}
|
|
870
889
|
parseOrder(order, market = undefined) {
|
|
871
|
-
//
|
|
872
|
-
//
|
|
873
|
-
//
|
|
874
|
-
//
|
|
875
|
-
//
|
|
876
|
-
//
|
|
877
|
-
//
|
|
878
|
-
//
|
|
879
|
-
//
|
|
880
|
-
//
|
|
881
|
-
//
|
|
882
|
-
//
|
|
890
|
+
//
|
|
891
|
+
// {
|
|
892
|
+
// "id": 1949417813,
|
|
893
|
+
// "symbol": "ltcusdt",
|
|
894
|
+
// "type": "limit",
|
|
895
|
+
// "side": "sell",
|
|
896
|
+
// "status": "done",
|
|
897
|
+
// "price": "146.2",
|
|
898
|
+
// "origQty": "0.05",
|
|
899
|
+
// "executedQty": "0.05",
|
|
900
|
+
// "avgPrice": "0.00",
|
|
901
|
+
// "createdTime": 1641252564000,
|
|
902
|
+
// "updatedTime": 1641252564000
|
|
903
|
+
// "clientOrderId": "93d2a838-e272-405d-91e7-3a7bc6d3a003"
|
|
904
|
+
// }
|
|
905
|
+
//
|
|
883
906
|
const created = this.safeInteger(order, 'createdTime');
|
|
884
907
|
const updated = this.safeInteger(order, 'updatedTime');
|
|
885
908
|
const marketId = this.safeString(order, 'symbol');
|
|
@@ -894,7 +917,7 @@ class wazirx extends wazirx$1 {
|
|
|
894
917
|
return this.safeOrder({
|
|
895
918
|
'info': order,
|
|
896
919
|
'id': id,
|
|
897
|
-
'clientOrderId':
|
|
920
|
+
'clientOrderId': this.safeString(order, 'clientOrderId'),
|
|
898
921
|
'timestamp': created,
|
|
899
922
|
'datetime': this.iso8601(created),
|
|
900
923
|
'lastTradeTimestamp': updated,
|
|
@@ -910,7 +933,7 @@ class wazirx extends wazirx$1 {
|
|
|
910
933
|
'remaining': undefined,
|
|
911
934
|
'cost': undefined,
|
|
912
935
|
'fee': undefined,
|
|
913
|
-
'average':
|
|
936
|
+
'average': this.safeString(order, 'avgPrice'),
|
|
914
937
|
'trades': [],
|
|
915
938
|
}, market);
|
|
916
939
|
}
|
package/dist/cjs/src/zonda.js
CHANGED
|
@@ -440,6 +440,13 @@ class zonda extends zonda$1 {
|
|
|
440
440
|
// "secondBalanceId": "ab43023b-4079-414c-b340-056e3430a3af"
|
|
441
441
|
// }
|
|
442
442
|
//
|
|
443
|
+
// cancelOrder
|
|
444
|
+
//
|
|
445
|
+
// {
|
|
446
|
+
// status: "Ok",
|
|
447
|
+
// errors: []
|
|
448
|
+
// }
|
|
449
|
+
//
|
|
443
450
|
const marketId = this.safeString(order, 'market');
|
|
444
451
|
const symbol = this.safeSymbol(marketId, market, '-');
|
|
445
452
|
const timestamp = this.safeInteger(order, 'time');
|
|
@@ -1497,9 +1504,10 @@ class zonda extends zonda$1 {
|
|
|
1497
1504
|
'side': side,
|
|
1498
1505
|
'price': price,
|
|
1499
1506
|
};
|
|
1507
|
+
const response = await this.v1_01PrivateDeleteTradingOfferSymbolIdSidePrice(this.extend(request, params));
|
|
1500
1508
|
// { status: "Fail", errors: [ "NOT_RECOGNIZED_OFFER_TYPE" ] } -- if required params are missing
|
|
1501
1509
|
// { status: "Ok", errors: [] }
|
|
1502
|
-
return
|
|
1510
|
+
return this.parseOrder(response);
|
|
1503
1511
|
}
|
|
1504
1512
|
isFiat(currency) {
|
|
1505
1513
|
const fiatCurrencies = {
|
package/js/ccxt.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { Exchange } from './src/base/Exchange.js';
|
|
|
2
2
|
import { Precise } from './src/base/Precise.js';
|
|
3
3
|
import * as functions from './src/base/functions.js';
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, TransferEntries, LeverageTiers } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.3.
|
|
7
|
+
declare const version = "4.3.42";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
|
@@ -528,5 +528,5 @@ declare const ccxt: {
|
|
|
528
528
|
zaif: typeof zaif;
|
|
529
529
|
zonda: typeof zonda;
|
|
530
530
|
} & typeof functions & typeof errors;
|
|
531
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout,
|
|
531
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, TransferEntries, LeverageTiers, 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, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, woofipro, yobit, zaif, zonda, };
|
|
532
532
|
export default ccxt;
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } 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.43';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -144,6 +144,8 @@ interface Exchange {
|
|
|
144
144
|
v2PublicGetFuturesPositionLevel(params?: {}): Promise<implicitReturnType>;
|
|
145
145
|
v2PublicGetFuturesLiquidationHistory(params?: {}): Promise<implicitReturnType>;
|
|
146
146
|
v2PublicGetFuturesBasisHistory(params?: {}): Promise<implicitReturnType>;
|
|
147
|
+
v2PublicGetAssetsDepositWithdrawConfig(params?: {}): Promise<implicitReturnType>;
|
|
148
|
+
v2PublicGetAssetsAllDepositWithdrawConfig(params?: {}): Promise<implicitReturnType>;
|
|
147
149
|
v2PrivateGetAccountSubs(params?: {}): Promise<implicitReturnType>;
|
|
148
150
|
v2PrivateGetAccountSubsApiDetail(params?: {}): Promise<implicitReturnType>;
|
|
149
151
|
v2PrivateGetAccountSubsInfo(params?: {}): Promise<implicitReturnType>;
|
|
@@ -162,7 +164,6 @@ interface Exchange {
|
|
|
162
164
|
v2PrivateGetAssetsDepositAddress(params?: {}): Promise<implicitReturnType>;
|
|
163
165
|
v2PrivateGetAssetsDepositHistory(params?: {}): Promise<implicitReturnType>;
|
|
164
166
|
v2PrivateGetAssetsWithdraw(params?: {}): Promise<implicitReturnType>;
|
|
165
|
-
v2PrivateGetAssetsDepositWithdrawConfig(params?: {}): Promise<implicitReturnType>;
|
|
166
167
|
v2PrivateGetAssetsTransferHistory(params?: {}): Promise<implicitReturnType>;
|
|
167
168
|
v2PrivateGetSpotOrderStatus(params?: {}): Promise<implicitReturnType>;
|
|
168
169
|
v2PrivateGetSpotBatchOrderStatus(params?: {}): Promise<implicitReturnType>;
|
package/js/src/binance.js
CHANGED
|
@@ -8111,8 +8111,56 @@ export default class binance extends Exchange {
|
|
|
8111
8111
|
// "tranId": 43000126248
|
|
8112
8112
|
// }
|
|
8113
8113
|
//
|
|
8114
|
-
|
|
8115
|
-
|
|
8114
|
+
// {
|
|
8115
|
+
// "orderType": "C2C", // Enum:PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment), REMITTANCE(Send cash)
|
|
8116
|
+
// "transactionId": "M_P_71505104267788288",
|
|
8117
|
+
// "transactionTime": 1610090460133, //trade timestamp
|
|
8118
|
+
// "amount": "23.72469206", //order amount(up to 8 decimal places), positive is income, negative is expenditure
|
|
8119
|
+
// "currency": "BNB",
|
|
8120
|
+
// "walletType": 1, //main wallet type, 1 for funding wallet, 2 for spot wallet, 3 for fiat wallet, 4 or 6 for card payment, 5 for earn wallet
|
|
8121
|
+
// "walletTypes": [1,2], //array format,there are multiple values when using combination payment
|
|
8122
|
+
// "fundsDetail": [ // details
|
|
8123
|
+
// {
|
|
8124
|
+
// "currency": "USDT", //asset
|
|
8125
|
+
// "amount": "1.2",
|
|
8126
|
+
// "walletAssetCost":[ //details of asset cost per wallet
|
|
8127
|
+
// {"1":"0.6"},
|
|
8128
|
+
// {"2":"0.6"}
|
|
8129
|
+
// ]
|
|
8130
|
+
// },
|
|
8131
|
+
// {
|
|
8132
|
+
// "currency": "ETH",
|
|
8133
|
+
// "amount": "0.0001",
|
|
8134
|
+
// "walletAssetCost":[
|
|
8135
|
+
// {"1":"0.00005"},
|
|
8136
|
+
// {"2":"0.00005"}
|
|
8137
|
+
// ]
|
|
8138
|
+
// }
|
|
8139
|
+
// ],
|
|
8140
|
+
// "payerInfo":{
|
|
8141
|
+
// "name":"Jack", //nickname or merchant name
|
|
8142
|
+
// "type":"USER", //account type,USER for personal,MERCHANT for merchant
|
|
8143
|
+
// "binanceId":"12345678", //binance uid
|
|
8144
|
+
// "accountId":"67736251" //binance pay id
|
|
8145
|
+
// },
|
|
8146
|
+
// "receiverInfo":{
|
|
8147
|
+
// "name":"Alan", //nickname or merchant name
|
|
8148
|
+
// "type":"MERCHANT", //account type,USER for personal,MERCHANT for merchant
|
|
8149
|
+
// "email":"alan@binance.com", //email
|
|
8150
|
+
// "binanceId":"34355667", //binance uid
|
|
8151
|
+
// "accountId":"21326891", //binance pay id
|
|
8152
|
+
// "countryCode":"1", //International area code
|
|
8153
|
+
// "phoneNumber":"8057651210",
|
|
8154
|
+
// "mobileCode":"US", //country code
|
|
8155
|
+
// "extend":[ //extension field
|
|
8156
|
+
// "institutionName": "",
|
|
8157
|
+
// "cardNumber": "",
|
|
8158
|
+
// "digitalWalletId": ""
|
|
8159
|
+
// ]
|
|
8160
|
+
// }
|
|
8161
|
+
// }
|
|
8162
|
+
const id = this.safeString2(transfer, 'tranId', 'transactionId');
|
|
8163
|
+
const currencyId = this.safeString2(transfer, 'asset', 'currency');
|
|
8116
8164
|
const code = this.safeCurrencyCode(currencyId, currency);
|
|
8117
8165
|
const amount = this.safeNumber(transfer, 'amount');
|
|
8118
8166
|
const type = this.safeString(transfer, 'type');
|
|
@@ -8126,7 +8174,14 @@ export default class binance extends Exchange {
|
|
|
8126
8174
|
fromAccount = this.safeString(accountsById, fromAccount, fromAccount);
|
|
8127
8175
|
toAccount = this.safeString(accountsById, toAccount, toAccount);
|
|
8128
8176
|
}
|
|
8129
|
-
const
|
|
8177
|
+
const walletType = this.safeInteger(transfer, 'walletType');
|
|
8178
|
+
if (walletType !== undefined) {
|
|
8179
|
+
const payer = this.safeDict(transfer, 'payerInfo', {});
|
|
8180
|
+
const receiver = this.safeDict(transfer, 'receiverInfo', {});
|
|
8181
|
+
fromAccount = this.safeString(payer, 'accountId');
|
|
8182
|
+
toAccount = this.safeString(receiver, 'accountId');
|
|
8183
|
+
}
|
|
8184
|
+
const timestamp = this.safeInteger2(transfer, 'timestamp', 'transactionTime');
|
|
8130
8185
|
const status = this.parseTransferStatus(this.safeString(transfer, 'status'));
|
|
8131
8186
|
return {
|
|
8132
8187
|
'info': transfer,
|
|
@@ -8278,74 +8333,144 @@ export default class binance extends Exchange {
|
|
|
8278
8333
|
* @name binance#fetchTransfers
|
|
8279
8334
|
* @description fetch a history of internal transfers made on an account
|
|
8280
8335
|
* @see https://binance-docs.github.io/apidocs/spot/en/#query-user-universal-transfer-history-user_data
|
|
8336
|
+
* @see https://binance-docs.github.io/apidocs/spot/en/#pay-endpoints
|
|
8281
8337
|
* @param {string} code unified currency code of the currency transferred
|
|
8282
8338
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
8283
8339
|
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
8284
8340
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8285
8341
|
* @param {int} [params.until] the latest time in ms to fetch transfers for
|
|
8286
8342
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
8343
|
+
* @param {boolean} [params.internal] default false, when true will fetch pay trade history
|
|
8287
8344
|
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
8288
8345
|
*/
|
|
8289
8346
|
await this.loadMarkets();
|
|
8347
|
+
const internal = this.safeBool(params, 'internal');
|
|
8348
|
+
params = this.omit(params, 'internal');
|
|
8290
8349
|
let paginate = false;
|
|
8291
8350
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchTransfers', 'paginate');
|
|
8292
|
-
if (paginate) {
|
|
8351
|
+
if (paginate && !internal) {
|
|
8293
8352
|
return await this.fetchPaginatedCallDynamic('fetchTransfers', code, since, limit, params);
|
|
8294
8353
|
}
|
|
8295
8354
|
let currency = undefined;
|
|
8296
8355
|
if (code !== undefined) {
|
|
8297
8356
|
currency = this.currency(code);
|
|
8298
8357
|
}
|
|
8299
|
-
const
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8358
|
+
const request = {};
|
|
8359
|
+
let limitKey = 'limit';
|
|
8360
|
+
if (!internal) {
|
|
8361
|
+
const defaultType = this.safeString2(this.options, 'fetchTransfers', 'defaultType', 'spot');
|
|
8362
|
+
const fromAccount = this.safeString(params, 'fromAccount', defaultType);
|
|
8363
|
+
const defaultTo = (fromAccount === 'future') ? 'spot' : 'future';
|
|
8364
|
+
const toAccount = this.safeString(params, 'toAccount', defaultTo);
|
|
8365
|
+
let type = this.safeString(params, 'type');
|
|
8366
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
8367
|
+
const fromId = this.safeString(accountsByType, fromAccount);
|
|
8368
|
+
const toId = this.safeString(accountsByType, toAccount);
|
|
8369
|
+
if (type === undefined) {
|
|
8370
|
+
if (fromId === undefined) {
|
|
8371
|
+
const keys = Object.keys(accountsByType);
|
|
8372
|
+
throw new ExchangeError(this.id + ' fromAccount parameter must be one of ' + keys.join(', '));
|
|
8373
|
+
}
|
|
8374
|
+
if (toId === undefined) {
|
|
8375
|
+
const keys = Object.keys(accountsByType);
|
|
8376
|
+
throw new ExchangeError(this.id + ' toAccount parameter must be one of ' + keys.join(', '));
|
|
8377
|
+
}
|
|
8378
|
+
type = fromId + '_' + toId;
|
|
8315
8379
|
}
|
|
8316
|
-
type =
|
|
8380
|
+
request['type'] = type;
|
|
8381
|
+
limitKey = 'size';
|
|
8382
|
+
}
|
|
8383
|
+
if (limit !== undefined) {
|
|
8384
|
+
request[limitKey] = limit;
|
|
8317
8385
|
}
|
|
8318
|
-
const request = {
|
|
8319
|
-
'type': type,
|
|
8320
|
-
};
|
|
8321
8386
|
if (since !== undefined) {
|
|
8322
8387
|
request['startTime'] = since;
|
|
8323
8388
|
}
|
|
8324
|
-
if (limit !== undefined) {
|
|
8325
|
-
request['size'] = limit;
|
|
8326
|
-
}
|
|
8327
8389
|
const until = this.safeInteger(params, 'until');
|
|
8328
8390
|
if (until !== undefined) {
|
|
8329
8391
|
params = this.omit(params, 'until');
|
|
8330
8392
|
request['endTime'] = until;
|
|
8331
8393
|
}
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8394
|
+
let response = undefined;
|
|
8395
|
+
if (internal) {
|
|
8396
|
+
response = await this.sapiGetPayTransactions(this.extend(request, params));
|
|
8397
|
+
//
|
|
8398
|
+
// {
|
|
8399
|
+
// "code": "000000",
|
|
8400
|
+
// "message": "success",
|
|
8401
|
+
// "data": [
|
|
8402
|
+
// {
|
|
8403
|
+
// "orderType": "C2C", // Enum:PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment), REMITTANCE(Send cash)
|
|
8404
|
+
// "transactionId": "M_P_71505104267788288",
|
|
8405
|
+
// "transactionTime": 1610090460133, //trade timestamp
|
|
8406
|
+
// "amount": "23.72469206", //order amount(up to 8 decimal places), positive is income, negative is expenditure
|
|
8407
|
+
// "currency": "BNB",
|
|
8408
|
+
// "walletType": 1, //main wallet type, 1 for funding wallet, 2 for spot wallet, 3 for fiat wallet, 4 or 6 for card payment, 5 for earn wallet
|
|
8409
|
+
// "walletTypes": [1,2], //array format,there are multiple values when using combination payment
|
|
8410
|
+
// "fundsDetail": [ // details
|
|
8411
|
+
// {
|
|
8412
|
+
// "currency": "USDT", //asset
|
|
8413
|
+
// "amount": "1.2",
|
|
8414
|
+
// "walletAssetCost":[ //details of asset cost per wallet
|
|
8415
|
+
// {"1":"0.6"},
|
|
8416
|
+
// {"2":"0.6"}
|
|
8417
|
+
// ]
|
|
8418
|
+
// },
|
|
8419
|
+
// {
|
|
8420
|
+
// "currency": "ETH",
|
|
8421
|
+
// "amount": "0.0001",
|
|
8422
|
+
// "walletAssetCost":[
|
|
8423
|
+
// {"1":"0.00005"},
|
|
8424
|
+
// {"2":"0.00005"}
|
|
8425
|
+
// ]
|
|
8426
|
+
// }
|
|
8427
|
+
// ],
|
|
8428
|
+
// "payerInfo":{
|
|
8429
|
+
// "name":"Jack", //nickname or merchant name
|
|
8430
|
+
// "type":"USER", //account type,USER for personal,MERCHANT for merchant
|
|
8431
|
+
// "binanceId":"12345678", //binance uid
|
|
8432
|
+
// "accountId":"67736251" //binance pay id
|
|
8433
|
+
// },
|
|
8434
|
+
// "receiverInfo":{
|
|
8435
|
+
// "name":"Alan", //nickname or merchant name
|
|
8436
|
+
// "type":"MERCHANT", //account type,USER for personal,MERCHANT for merchant
|
|
8437
|
+
// "email":"alan@binance.com", //email
|
|
8438
|
+
// "binanceId":"34355667", //binance uid
|
|
8439
|
+
// "accountId":"21326891", //binance pay id
|
|
8440
|
+
// "countryCode":"1", //International area code
|
|
8441
|
+
// "phoneNumber":"8057651210",
|
|
8442
|
+
// "mobileCode":"US", //country code
|
|
8443
|
+
// "extend":[ //extension field
|
|
8444
|
+
// "institutionName": "",
|
|
8445
|
+
// "cardNumber": "",
|
|
8446
|
+
// "digitalWalletId": ""
|
|
8447
|
+
// ]
|
|
8448
|
+
// }
|
|
8449
|
+
// }
|
|
8450
|
+
// ],
|
|
8451
|
+
// "success": true
|
|
8452
|
+
// }
|
|
8453
|
+
//
|
|
8454
|
+
}
|
|
8455
|
+
else {
|
|
8456
|
+
response = await this.sapiGetAssetTransfer(this.extend(request, params));
|
|
8457
|
+
//
|
|
8458
|
+
// {
|
|
8459
|
+
// "total": 3,
|
|
8460
|
+
// "rows": [
|
|
8461
|
+
// {
|
|
8462
|
+
// "timestamp": 1614640878000,
|
|
8463
|
+
// "asset": "USDT",
|
|
8464
|
+
// "amount": "25",
|
|
8465
|
+
// "type": "MAIN_UMFUTURE",
|
|
8466
|
+
// "status": "CONFIRMED",
|
|
8467
|
+
// "tranId": 43000126248
|
|
8468
|
+
// },
|
|
8469
|
+
// ]
|
|
8470
|
+
// }
|
|
8471
|
+
//
|
|
8472
|
+
}
|
|
8473
|
+
const rows = this.safeList2(response, 'rows', 'data', []);
|
|
8349
8474
|
return this.parseTransfers(rows, currency, since, limit);
|
|
8350
8475
|
}
|
|
8351
8476
|
async fetchDepositAddress(code, params = {}) {
|
package/js/src/btcmarkets.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ export default class btcmarkets extends Exchange {
|
|
|
27
27
|
parseTrade(trade: Dict, market?: Market): Trade;
|
|
28
28
|
fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
29
29
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
30
|
-
cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<
|
|
31
|
-
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<
|
|
30
|
+
cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<Order[]>;
|
|
31
|
+
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
32
32
|
calculateFee(symbol: any, type: any, side: any, amount: any, price: any, takerOrMaker?: string, params?: {}): {
|
|
33
33
|
type: string;
|
|
34
34
|
currency: any;
|