ccxt 4.2.31 → 4.2.35
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 +741 -501
- 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 +62 -20
- package/dist/cjs/src/bigone.js +21 -1
- package/dist/cjs/src/binance.js +59 -15
- package/dist/cjs/src/bingx.js +4 -3
- package/dist/cjs/src/bit2c.js +12 -0
- package/dist/cjs/src/bitfinex2.js +12 -1
- 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/krakenfutures.js +25 -3
- 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 +17 -13
- 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 +86 -78
- package/js/src/base/Exchange.js +62 -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 +59 -15
- 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/bitfinex2.js +12 -1
- 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/krakenfutures.js +25 -3
- 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 +17 -13
- 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/base/types.d.ts
CHANGED
|
@@ -203,34 +203,118 @@ export interface DepositAddressResponse {
|
|
|
203
203
|
info: any;
|
|
204
204
|
tag?: string;
|
|
205
205
|
}
|
|
206
|
+
export interface FundingRate {
|
|
207
|
+
symbol: string;
|
|
208
|
+
info: any;
|
|
209
|
+
timestamp?: number;
|
|
210
|
+
fundingRate?: number;
|
|
211
|
+
datetime?: string;
|
|
212
|
+
markPrice?: number;
|
|
213
|
+
indexPrice?: number;
|
|
214
|
+
interestRate?: number;
|
|
215
|
+
estimatedSettlePrice?: number;
|
|
216
|
+
fundingTimestamp?: number;
|
|
217
|
+
fundingDatetime?: string;
|
|
218
|
+
nextFundingTimestamp?: number;
|
|
219
|
+
nextFundingDatetime?: string;
|
|
220
|
+
nextFundingRate?: number;
|
|
221
|
+
previousFundingTimestamp?: number;
|
|
222
|
+
previousFundingDatetime?: string;
|
|
223
|
+
previousFundingRate?: number;
|
|
224
|
+
}
|
|
206
225
|
export interface Position {
|
|
207
226
|
symbol: string;
|
|
208
|
-
id
|
|
227
|
+
id?: string;
|
|
228
|
+
info: any;
|
|
209
229
|
timestamp?: number;
|
|
210
|
-
datetime
|
|
230
|
+
datetime?: string;
|
|
211
231
|
contracts?: number;
|
|
212
232
|
contractSize?: number;
|
|
213
233
|
side: string;
|
|
214
234
|
notional?: number;
|
|
215
235
|
leverage?: number;
|
|
216
236
|
unrealizedPnl?: number;
|
|
217
|
-
realizedPnl?: number;
|
|
218
237
|
collateral?: number;
|
|
219
238
|
entryPrice?: number;
|
|
220
239
|
markPrice?: number;
|
|
221
240
|
liquidationPrice?: number;
|
|
241
|
+
marginMode?: string;
|
|
222
242
|
hedged?: boolean;
|
|
223
|
-
|
|
243
|
+
maintenenceMargin?: number;
|
|
224
244
|
maintenanceMarginPercentage?: number;
|
|
225
245
|
initialMargin?: number;
|
|
226
246
|
initialMarginPercentage?: number;
|
|
227
|
-
marginMode: string;
|
|
228
247
|
marginRatio?: number;
|
|
229
248
|
lastUpdateTimestamp?: number;
|
|
230
249
|
lastPrice?: number;
|
|
231
|
-
percentage?: number;
|
|
232
250
|
stopLossPrice?: number;
|
|
233
251
|
takeProfitPrice?: number;
|
|
252
|
+
percentage?: number;
|
|
253
|
+
}
|
|
254
|
+
export interface BorrowInterest {
|
|
255
|
+
account?: string;
|
|
256
|
+
currency?: string;
|
|
257
|
+
interest?: number;
|
|
258
|
+
interestRate?: number;
|
|
259
|
+
amountBorrowed?: number;
|
|
260
|
+
marginMode?: string;
|
|
261
|
+
timestamp?: number;
|
|
262
|
+
datetime?: string;
|
|
263
|
+
info: any;
|
|
264
|
+
}
|
|
265
|
+
export interface LeverageTier {
|
|
266
|
+
tier?: number;
|
|
267
|
+
currency?: string;
|
|
268
|
+
minNotional?: number;
|
|
269
|
+
maxNotional?: number;
|
|
270
|
+
maintenanceMarginRate?: number;
|
|
271
|
+
maxLeverage?: number;
|
|
272
|
+
info: any;
|
|
273
|
+
}
|
|
274
|
+
export interface LedgerEntry {
|
|
275
|
+
id?: string;
|
|
276
|
+
info: any;
|
|
277
|
+
timestamp?: number;
|
|
278
|
+
datetime?: string;
|
|
279
|
+
direction?: string;
|
|
280
|
+
account?: string;
|
|
281
|
+
referenceId?: string;
|
|
282
|
+
referenceAccount?: string;
|
|
283
|
+
type?: string;
|
|
284
|
+
currency?: string;
|
|
285
|
+
amount?: number;
|
|
286
|
+
before?: number;
|
|
287
|
+
after?: number;
|
|
288
|
+
status?: string;
|
|
289
|
+
fee?: Fee;
|
|
290
|
+
}
|
|
291
|
+
export interface DepositWithdrawFeeNetwork {
|
|
292
|
+
fee?: number;
|
|
293
|
+
percentage?: boolean;
|
|
294
|
+
}
|
|
295
|
+
export interface DepositWithdrawFee {
|
|
296
|
+
info: any;
|
|
297
|
+
withdraw?: DepositWithdrawFeeNetwork;
|
|
298
|
+
deposit?: DepositWithdrawFeeNetwork;
|
|
299
|
+
networks?: Dictionary<DepositWithdrawFeeNetwork>;
|
|
300
|
+
}
|
|
301
|
+
export interface TransferEntry {
|
|
302
|
+
info?: any;
|
|
303
|
+
id?: string;
|
|
304
|
+
timestamp?: number;
|
|
305
|
+
datetime?: string;
|
|
306
|
+
currency?: string;
|
|
307
|
+
amount?: number;
|
|
308
|
+
fromAccount?: string;
|
|
309
|
+
toAccount?: string;
|
|
310
|
+
status?: string;
|
|
311
|
+
}
|
|
312
|
+
export interface BorrowRate {
|
|
313
|
+
currency?: string;
|
|
314
|
+
rate?: number;
|
|
315
|
+
period?: number;
|
|
316
|
+
timestamp?: number;
|
|
317
|
+
datetime?: string;
|
|
234
318
|
info: any;
|
|
235
319
|
}
|
|
236
320
|
export interface FundingRateHistory {
|
package/js/src/bigone.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bigone.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 bigone
|
|
5
5
|
* @augments Exchange
|
|
@@ -24,7 +24,7 @@ export default class bigone extends Exchange {
|
|
|
24
24
|
parseType(type: string): string;
|
|
25
25
|
parseOrder(order: any, market?: Market): Order;
|
|
26
26
|
createMarketBuyOrderWithCost(symbol: string, cost: any, 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<Order>;
|
|
29
29
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
30
30
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
@@ -51,29 +51,19 @@ export default class bigone extends Exchange {
|
|
|
51
51
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
52
52
|
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
53
53
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
54
|
-
transfer(code: string, amount:
|
|
55
|
-
info: any;
|
|
56
|
-
id: any;
|
|
57
|
-
timestamp: any;
|
|
58
|
-
datetime: any;
|
|
59
|
-
currency: number;
|
|
60
|
-
amount: any;
|
|
61
|
-
fromAccount: any;
|
|
62
|
-
toAccount: any;
|
|
63
|
-
status: string;
|
|
64
|
-
}>;
|
|
54
|
+
transfer(code: string, amount: number, fromAccount: any, toAccount: any, params?: {}): Promise<TransferEntry>;
|
|
65
55
|
parseTransfer(transfer: any, currency?: Currency): {
|
|
66
56
|
info: any;
|
|
67
57
|
id: any;
|
|
68
58
|
timestamp: any;
|
|
69
59
|
datetime: any;
|
|
70
|
-
currency:
|
|
60
|
+
currency: any;
|
|
71
61
|
amount: any;
|
|
72
62
|
fromAccount: any;
|
|
73
63
|
toAccount: any;
|
|
74
64
|
status: string;
|
|
75
65
|
};
|
|
76
66
|
parseTransferStatus(status: any): string;
|
|
77
|
-
withdraw(code: string, amount:
|
|
67
|
+
withdraw(code: string, amount: number, address: any, tag?: any, params?: {}): Promise<Transaction>;
|
|
78
68
|
handleErrors(httpCode: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
|
|
79
69
|
}
|
package/js/src/bigone.js
CHANGED
|
@@ -521,6 +521,7 @@ export default class bigone extends Exchange {
|
|
|
521
521
|
* @method
|
|
522
522
|
* @name bigone#fetchMarkets
|
|
523
523
|
* @description retrieves data on all markets for bigone
|
|
524
|
+
* @see https://open.big.one/docs/spot_asset_pair.html
|
|
524
525
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
525
526
|
* @returns {object[]} an array of objects representing market data
|
|
526
527
|
*/
|
|
@@ -783,6 +784,7 @@ export default class bigone extends Exchange {
|
|
|
783
784
|
* @method
|
|
784
785
|
* @name bigone#fetchTicker
|
|
785
786
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
787
|
+
* @see https://open.big.one/docs/spot_tickers.html
|
|
786
788
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
787
789
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
788
790
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -825,6 +827,7 @@ export default class bigone extends Exchange {
|
|
|
825
827
|
* @method
|
|
826
828
|
* @name bigone#fetchTickers
|
|
827
829
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
830
|
+
* @see https://open.big.one/docs/spot_tickers.html
|
|
828
831
|
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
829
832
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
830
833
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -912,6 +915,7 @@ export default class bigone extends Exchange {
|
|
|
912
915
|
* @method
|
|
913
916
|
* @name bigone#fetchTime
|
|
914
917
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
918
|
+
* @see https://open.big.one/docs/spot_ping.html
|
|
915
919
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
916
920
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
917
921
|
*/
|
|
@@ -932,6 +936,7 @@ export default class bigone extends Exchange {
|
|
|
932
936
|
* @method
|
|
933
937
|
* @name bigone#fetchOrderBook
|
|
934
938
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
939
|
+
* @see https://open.big.one/docs/contract_misc.html#get-orderbook-snapshot
|
|
935
940
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
936
941
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
937
942
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1174,6 +1179,7 @@ export default class bigone extends Exchange {
|
|
|
1174
1179
|
* @method
|
|
1175
1180
|
* @name bigone#fetchTrades
|
|
1176
1181
|
* @description get the list of most recent trades for a particular symbol
|
|
1182
|
+
* @see https://open.big.one/docs/spot_asset_pair_trade.html
|
|
1177
1183
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
1178
1184
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1179
1185
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -1238,6 +1244,7 @@ export default class bigone extends Exchange {
|
|
|
1238
1244
|
* @method
|
|
1239
1245
|
* @name bigone#fetchOHLCV
|
|
1240
1246
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1247
|
+
* @see https://open.big.one/docs/spot_asset_pair_candle.html
|
|
1241
1248
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1242
1249
|
* @param {string} timeframe the length of time each candle represents
|
|
1243
1250
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -1314,6 +1321,8 @@ export default class bigone extends Exchange {
|
|
|
1314
1321
|
* @method
|
|
1315
1322
|
* @name bigone#fetchBalance
|
|
1316
1323
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
1324
|
+
* @see https://open.big.one/docs/fund_accounts.html
|
|
1325
|
+
* @see https://open.big.one/docs/spot_accounts.html
|
|
1317
1326
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1318
1327
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1319
1328
|
*/
|
|
@@ -1559,6 +1568,7 @@ export default class bigone extends Exchange {
|
|
|
1559
1568
|
* @method
|
|
1560
1569
|
* @name bigone#cancelOrder
|
|
1561
1570
|
* @description cancels an open order
|
|
1571
|
+
* @see https://open.big.one/docs/spot_orders.html#cancel-order
|
|
1562
1572
|
* @param {string} id order id
|
|
1563
1573
|
* @param {string} symbol Not used by bigone cancelOrder ()
|
|
1564
1574
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1587,6 +1597,7 @@ export default class bigone extends Exchange {
|
|
|
1587
1597
|
* @method
|
|
1588
1598
|
* @name bigone#cancelAllOrders
|
|
1589
1599
|
* @description cancel all open orders
|
|
1600
|
+
* @see https://open.big.one/docs/spot_orders.html#cancel-all-orders
|
|
1590
1601
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
1591
1602
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1592
1603
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -1616,6 +1627,7 @@ export default class bigone extends Exchange {
|
|
|
1616
1627
|
* @method
|
|
1617
1628
|
* @name bigone#fetchOrder
|
|
1618
1629
|
* @description fetches information on an order made by the user
|
|
1630
|
+
* @see https://open.big.one/docs/spot_orders.html#get-one-order
|
|
1619
1631
|
* @param {string} symbol not used by bigone fetchOrder
|
|
1620
1632
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1621
1633
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -1631,6 +1643,7 @@ export default class bigone extends Exchange {
|
|
|
1631
1643
|
* @method
|
|
1632
1644
|
* @name bigone#fetchOrders
|
|
1633
1645
|
* @description fetches information on multiple orders made by the user
|
|
1646
|
+
* @see https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
|
|
1634
1647
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1635
1648
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1636
1649
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -1681,6 +1694,7 @@ export default class bigone extends Exchange {
|
|
|
1681
1694
|
* @method
|
|
1682
1695
|
* @name bigone#fetchMyTrades
|
|
1683
1696
|
* @description fetch all trades made by the user
|
|
1697
|
+
* @see https://open.big.one/docs/spot_trade.html#trades-of-user
|
|
1684
1698
|
* @param {string} symbol unified market symbol
|
|
1685
1699
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1686
1700
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -1750,6 +1764,7 @@ export default class bigone extends Exchange {
|
|
|
1750
1764
|
* @method
|
|
1751
1765
|
* @name bigone#fetchOpenOrders
|
|
1752
1766
|
* @description fetch all unfilled currently open orders
|
|
1767
|
+
* @see https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
|
|
1753
1768
|
* @param {string} symbol unified market symbol
|
|
1754
1769
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1755
1770
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -1766,6 +1781,7 @@ export default class bigone extends Exchange {
|
|
|
1766
1781
|
* @method
|
|
1767
1782
|
* @name bigone#fetchClosedOrders
|
|
1768
1783
|
* @description fetches information on multiple closed orders made by the user
|
|
1784
|
+
* @see https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
|
|
1769
1785
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1770
1786
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1771
1787
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -1820,6 +1836,7 @@ export default class bigone extends Exchange {
|
|
|
1820
1836
|
* @method
|
|
1821
1837
|
* @name bigone#fetchDepositAddress
|
|
1822
1838
|
* @description fetch the deposit address for a currency associated with this account
|
|
1839
|
+
* @see https://open.big.one/docs/spot_deposit.html#get-deposite-address-of-one-asset-of-user
|
|
1823
1840
|
* @param {string} code unified currency code
|
|
1824
1841
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1825
1842
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -1970,6 +1987,7 @@ export default class bigone extends Exchange {
|
|
|
1970
1987
|
* @method
|
|
1971
1988
|
* @name bigone#fetchDeposits
|
|
1972
1989
|
* @description fetch all deposits made to an account
|
|
1990
|
+
* @see https://open.big.one/docs/spot_deposit.html#deposit-of-user
|
|
1973
1991
|
* @param {string} code unified currency code
|
|
1974
1992
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
1975
1993
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -2021,6 +2039,7 @@ export default class bigone extends Exchange {
|
|
|
2021
2039
|
* @method
|
|
2022
2040
|
* @name bigone#fetchWithdrawals
|
|
2023
2041
|
* @description fetch all withdrawals made from an account
|
|
2042
|
+
* @see https://open.big.one/docs/spot_withdrawal.html#get-withdrawals-of-user
|
|
2024
2043
|
* @param {string} code unified currency code
|
|
2025
2044
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
2026
2045
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
@@ -2126,7 +2145,7 @@ export default class bigone extends Exchange {
|
|
|
2126
2145
|
'id': undefined,
|
|
2127
2146
|
'timestamp': undefined,
|
|
2128
2147
|
'datetime': undefined,
|
|
2129
|
-
'currency':
|
|
2148
|
+
'currency': undefined,
|
|
2130
2149
|
'amount': undefined,
|
|
2131
2150
|
'fromAccount': undefined,
|
|
2132
2151
|
'toAccount': undefined,
|
|
@@ -2144,6 +2163,7 @@ export default class bigone extends Exchange {
|
|
|
2144
2163
|
* @method
|
|
2145
2164
|
* @name bigone#withdraw
|
|
2146
2165
|
* @description make a withdrawal
|
|
2166
|
+
* @see https://open.big.one/docs/spot_withdrawal.html#create-withdrawal-of-user
|
|
2147
2167
|
* @param {string} code unified currency code
|
|
2148
2168
|
* @param {float} amount the amount to withdraw
|
|
2149
2169
|
* @param {string} address the address to withdraw to
|
package/js/src/binance.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/binance.js';
|
|
2
|
-
import type { Int, OrderSide, Balances, OrderType, Trade, OHLCV, Order, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, Str, Transaction, Ticker, OrderBook, Tickers, Market, Greeks, Strings, Currency, MarketInterface } 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 } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class binance
|
|
5
5
|
* @augments Exchange
|
|
@@ -21,7 +21,7 @@ export default class binance extends Exchange {
|
|
|
21
21
|
fetchMarkets(params?: {}): Promise<any[]>;
|
|
22
22
|
parseMarket(market: any): Market;
|
|
23
23
|
parseBalanceHelper(entry: any): import("./base/types.js").Account;
|
|
24
|
-
|
|
24
|
+
parseBalanceCustom(response: any, type?: any, marginMode?: any): Balances;
|
|
25
25
|
fetchBalance(params?: {}): Promise<Balances>;
|
|
26
26
|
fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
27
27
|
parseTicker(ticker: any, market?: Market): Ticker;
|
|
@@ -48,15 +48,15 @@ export default class binance extends Exchange {
|
|
|
48
48
|
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
49
49
|
parseTrade(trade: any, market?: Market): Trade;
|
|
50
50
|
fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
51
|
-
editSpotOrder(id: string, symbol: any, type: any, side: any, amount:
|
|
52
|
-
editSpotOrderRequest(id: string, symbol: any, type: any, side: any, amount:
|
|
53
|
-
editContractOrder(id: string, symbol: any, type: any, side: any, amount:
|
|
51
|
+
editSpotOrder(id: string, symbol: any, type: any, side: any, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
52
|
+
editSpotOrderRequest(id: string, symbol: any, type: any, side: any, amount: number, price?: number, params?: {}): any;
|
|
53
|
+
editContractOrder(id: string, symbol: any, type: any, side: any, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
54
54
|
editOrder(id: string, symbol: any, type: any, side: any, amount?: any, price?: any, params?: {}): Promise<Order>;
|
|
55
55
|
parseOrderStatus(status: any): string;
|
|
56
56
|
parseOrder(order: any, market?: Market): Order;
|
|
57
57
|
createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
|
|
58
|
-
createOrder(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
59
|
-
createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount:
|
|
58
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
59
|
+
createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): any;
|
|
60
60
|
createMarketOrderWithCost(symbol: string, side: OrderSide, cost: any, params?: {}): Promise<Order>;
|
|
61
61
|
createMarketBuyOrderWithCost(symbol: string, cost: any, params?: {}): Promise<Order>;
|
|
62
62
|
createMarketSellOrderWithCost(symbol: string, cost: any, params?: {}): Promise<Order>;
|
|
@@ -114,17 +114,7 @@ export default class binance extends Exchange {
|
|
|
114
114
|
id: string;
|
|
115
115
|
amount: number;
|
|
116
116
|
};
|
|
117
|
-
transfer(code: string, amount:
|
|
118
|
-
info: any;
|
|
119
|
-
id: string;
|
|
120
|
-
timestamp: number;
|
|
121
|
-
datetime: string;
|
|
122
|
-
currency: string;
|
|
123
|
-
amount: number;
|
|
124
|
-
fromAccount: any;
|
|
125
|
-
toAccount: any;
|
|
126
|
-
status: string;
|
|
127
|
-
}>;
|
|
117
|
+
transfer(code: string, amount: number, fromAccount: any, toAccount: any, params?: {}): Promise<TransferEntry>;
|
|
128
118
|
fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
129
119
|
fetchDepositAddress(code: string, params?: {}): Promise<{
|
|
130
120
|
currency: string;
|
|
@@ -140,7 +130,7 @@ export default class binance extends Exchange {
|
|
|
140
130
|
}>;
|
|
141
131
|
fetchDepositWithdrawFees(codes?: Strings, params?: {}): Promise<any>;
|
|
142
132
|
parseDepositWithdrawFee(fee: any, currency?: Currency): any;
|
|
143
|
-
withdraw(code: string, amount:
|
|
133
|
+
withdraw(code: string, amount: number, address: any, tag?: any, params?: {}): Promise<Transaction>;
|
|
144
134
|
parseTradingFee(fee: any, market?: Market): {
|
|
145
135
|
info: any;
|
|
146
136
|
symbol: string;
|
|
@@ -269,7 +259,7 @@ export default class binance extends Exchange {
|
|
|
269
259
|
fetchAccountPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
|
|
270
260
|
fetchPositionsRisk(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
|
|
271
261
|
fetchFundingHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").FundingHistory[]>;
|
|
272
|
-
setLeverage(leverage:
|
|
262
|
+
setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
|
|
273
263
|
setMarginMode(marginMode: string, symbol?: Str, params?: {}): Promise<any>;
|
|
274
264
|
setPositionMode(hedged: any, symbol?: Str, params?: {}): Promise<any>;
|
|
275
265
|
fetchSettlementHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
@@ -310,7 +300,7 @@ export default class binance extends Exchange {
|
|
|
310
300
|
getExceptionsByUrl(url: any, exactOrBroad: any): any;
|
|
311
301
|
handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
|
|
312
302
|
calculateRateLimiterCost(api: any, method: any, path: any, params: any, config?: {}): any;
|
|
313
|
-
request(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any, config?: {}
|
|
303
|
+
request(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any, config?: {}): Promise<any>;
|
|
314
304
|
modifyMarginHelper(symbol: string, amount: any, addOrReduce: any, params?: {}): Promise<any>;
|
|
315
305
|
parseMarginModification(data: any, market?: Market): {
|
|
316
306
|
info: any;
|
|
@@ -380,7 +370,7 @@ export default class binance extends Exchange {
|
|
|
380
370
|
datetime: any;
|
|
381
371
|
info: any;
|
|
382
372
|
}>;
|
|
383
|
-
borrowCrossMargin(code: string, amount:
|
|
373
|
+
borrowCrossMargin(code: string, amount: number, params?: {}): Promise<{
|
|
384
374
|
id: number;
|
|
385
375
|
currency: string;
|
|
386
376
|
amount: any;
|
|
@@ -389,7 +379,7 @@ export default class binance extends Exchange {
|
|
|
389
379
|
datetime: any;
|
|
390
380
|
info: any;
|
|
391
381
|
}>;
|
|
392
|
-
borrowIsolatedMargin(symbol: string, code: string, amount:
|
|
382
|
+
borrowIsolatedMargin(symbol: string, code: string, amount: number, params?: {}): Promise<{
|
|
393
383
|
id: number;
|
|
394
384
|
currency: string;
|
|
395
385
|
amount: any;
|
package/js/src/binance.js
CHANGED
|
@@ -3139,16 +3139,31 @@ 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
|
};
|
|
3146
3146
|
let timestamp = undefined;
|
|
3147
3147
|
const isolated = marginMode === 'isolated';
|
|
3148
3148
|
const cross = (type === 'margin') || (marginMode === 'cross');
|
|
3149
|
-
if (
|
|
3149
|
+
if (type === 'papi') {
|
|
3150
|
+
for (let i = 0; i < response.length; i++) {
|
|
3151
|
+
const entry = response[i];
|
|
3152
|
+
const account = this.account();
|
|
3153
|
+
const currencyId = this.safeString(entry, 'asset');
|
|
3154
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
3155
|
+
const borrowed = this.safeString(entry, 'crossMarginBorrowed');
|
|
3156
|
+
const interest = this.safeString(entry, 'crossMarginInterest');
|
|
3157
|
+
account['free'] = this.safeString(entry, 'crossMarginFree');
|
|
3158
|
+
account['used'] = this.safeString(entry, 'crossMarginLocked');
|
|
3159
|
+
account['total'] = this.safeString(entry, 'crossMarginAsset');
|
|
3160
|
+
account['debt'] = Precise.stringAdd(borrowed, interest);
|
|
3161
|
+
result[code] = account;
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
else if (!isolated && ((type === 'spot') || cross)) {
|
|
3150
3165
|
timestamp = this.safeInteger(response, 'updateTime');
|
|
3151
|
-
const balances = this.
|
|
3166
|
+
const balances = this.safeList2(response, 'balances', 'userAssets', []);
|
|
3152
3167
|
for (let i = 0; i < balances.length; i++) {
|
|
3153
3168
|
const balance = balances[i];
|
|
3154
3169
|
const currencyId = this.safeString(balance, 'asset');
|
|
@@ -3165,13 +3180,13 @@ export default class binance extends Exchange {
|
|
|
3165
3180
|
}
|
|
3166
3181
|
}
|
|
3167
3182
|
else if (isolated) {
|
|
3168
|
-
const assets = this.
|
|
3183
|
+
const assets = this.safeList(response, 'assets');
|
|
3169
3184
|
for (let i = 0; i < assets.length; i++) {
|
|
3170
3185
|
const asset = assets[i];
|
|
3171
|
-
const marketId = this.
|
|
3186
|
+
const marketId = this.safeString(asset, 'symbol');
|
|
3172
3187
|
const symbol = this.safeSymbol(marketId, undefined, undefined, 'spot');
|
|
3173
|
-
const base = this.
|
|
3174
|
-
const quote = this.
|
|
3188
|
+
const base = this.safeDict(asset, 'baseAsset', {});
|
|
3189
|
+
const quote = this.safeDict(asset, 'quoteAsset', {});
|
|
3175
3190
|
const baseCode = this.safeCurrencyCode(this.safeString(base, 'asset'));
|
|
3176
3191
|
const quoteCode = this.safeCurrencyCode(this.safeString(quote, 'asset'));
|
|
3177
3192
|
const subResult = {};
|
|
@@ -3181,7 +3196,7 @@ export default class binance extends Exchange {
|
|
|
3181
3196
|
}
|
|
3182
3197
|
}
|
|
3183
3198
|
else if (type === 'savings') {
|
|
3184
|
-
const positionAmountVos = this.
|
|
3199
|
+
const positionAmountVos = this.safeList(response, 'positionAmountVos', []);
|
|
3185
3200
|
for (let i = 0; i < positionAmountVos.length; i++) {
|
|
3186
3201
|
const entry = positionAmountVos[i];
|
|
3187
3202
|
const currencyId = this.safeString(entry, 'asset');
|
|
@@ -3210,7 +3225,7 @@ export default class binance extends Exchange {
|
|
|
3210
3225
|
else {
|
|
3211
3226
|
let balances = response;
|
|
3212
3227
|
if (!Array.isArray(response)) {
|
|
3213
|
-
balances = this.
|
|
3228
|
+
balances = this.safeList(response, 'assets', []);
|
|
3214
3229
|
}
|
|
3215
3230
|
for (let i = 0; i < balances.length; i++) {
|
|
3216
3231
|
const balance = balances[i];
|
|
@@ -3240,10 +3255,12 @@ export default class binance extends Exchange {
|
|
|
3240
3255
|
* @see https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data // swap
|
|
3241
3256
|
* @see https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data // future
|
|
3242
3257
|
* @see https://binance-docs.github.io/apidocs/voptions/en/#option-account-information-trade // option
|
|
3258
|
+
* @see https://binance-docs.github.io/apidocs/pm/en/#account-balance-user_data // portfolio margin
|
|
3243
3259
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3244
|
-
* @param {string} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot'
|
|
3260
|
+
* @param {string} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot' or 'papi'
|
|
3245
3261
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
|
|
3246
3262
|
* @param {string[]|undefined} [params.symbols] unified market symbols, only used in isolated margin mode
|
|
3263
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the balance for a portfolio margin account
|
|
3247
3264
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
3248
3265
|
*/
|
|
3249
3266
|
await this.loadMarkets();
|
|
@@ -3251,13 +3268,19 @@ export default class binance extends Exchange {
|
|
|
3251
3268
|
let type = this.safeString(params, 'type', defaultType);
|
|
3252
3269
|
let subType = undefined;
|
|
3253
3270
|
[subType, params] = this.handleSubTypeAndParams('fetchBalance', undefined, params);
|
|
3271
|
+
let isPortfolioMargin = undefined;
|
|
3272
|
+
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchBalance', 'papi', 'portfolioMargin', false);
|
|
3254
3273
|
let marginMode = undefined;
|
|
3255
3274
|
let query = undefined;
|
|
3256
3275
|
[marginMode, query] = this.handleMarginModeAndParams('fetchBalance', params);
|
|
3257
3276
|
query = this.omit(query, 'type');
|
|
3258
3277
|
let response = undefined;
|
|
3259
3278
|
const request = {};
|
|
3260
|
-
if (
|
|
3279
|
+
if (isPortfolioMargin || (type === 'papi')) {
|
|
3280
|
+
type = 'papi';
|
|
3281
|
+
response = await this.papiGetBalance(this.extend(request, query));
|
|
3282
|
+
}
|
|
3283
|
+
else if (this.isLinear(type, subType)) {
|
|
3261
3284
|
type = 'linear';
|
|
3262
3285
|
response = await this.fapiPrivateV2GetAccount(this.extend(request, query));
|
|
3263
3286
|
}
|
|
@@ -3266,7 +3289,7 @@ export default class binance extends Exchange {
|
|
|
3266
3289
|
response = await this.dapiPrivateGetAccount(this.extend(request, query));
|
|
3267
3290
|
}
|
|
3268
3291
|
else if (marginMode === 'isolated') {
|
|
3269
|
-
const paramSymbols = this.
|
|
3292
|
+
const paramSymbols = this.safeList(params, 'symbols');
|
|
3270
3293
|
query = this.omit(query, 'symbols');
|
|
3271
3294
|
if (paramSymbols !== undefined) {
|
|
3272
3295
|
let symbols = '';
|
|
@@ -3482,7 +3505,27 @@ export default class binance extends Exchange {
|
|
|
3482
3505
|
// }
|
|
3483
3506
|
// ]
|
|
3484
3507
|
//
|
|
3485
|
-
|
|
3508
|
+
// portfolio margin
|
|
3509
|
+
//
|
|
3510
|
+
// [
|
|
3511
|
+
// {
|
|
3512
|
+
// "asset": "USDT",
|
|
3513
|
+
// "totalWalletBalance": "66.9923261",
|
|
3514
|
+
// "crossMarginAsset": "35.9697141",
|
|
3515
|
+
// "crossMarginBorrowed": "0.0",
|
|
3516
|
+
// "crossMarginFree": "35.9697141",
|
|
3517
|
+
// "crossMarginInterest": "0.0",
|
|
3518
|
+
// "crossMarginLocked": "0.0",
|
|
3519
|
+
// "umWalletBalance": "31.022612",
|
|
3520
|
+
// "umUnrealizedPNL": "0.0",
|
|
3521
|
+
// "cmWalletBalance": "0.0",
|
|
3522
|
+
// "cmUnrealizedPNL": "0.0",
|
|
3523
|
+
// "updateTime": 0,
|
|
3524
|
+
// "negativeBalance": "0.0"
|
|
3525
|
+
// },
|
|
3526
|
+
// ]
|
|
3527
|
+
//
|
|
3528
|
+
return this.parseBalanceCustom(response, type, marginMode);
|
|
3486
3529
|
}
|
|
3487
3530
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
3488
3531
|
/**
|
|
@@ -5254,7 +5297,7 @@ export default class binance extends Exchange {
|
|
|
5254
5297
|
const stopLossPrice = this.safeValue(params, 'stopLossPrice', triggerPrice); // fallback to stopLoss
|
|
5255
5298
|
const takeProfitPrice = this.safeValue(params, 'takeProfitPrice');
|
|
5256
5299
|
const trailingDelta = this.safeValue(params, 'trailingDelta');
|
|
5257
|
-
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', price);
|
|
5300
|
+
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', this.numberToString(price));
|
|
5258
5301
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
|
|
5259
5302
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
5260
5303
|
const isStopLoss = stopLossPrice !== undefined || trailingDelta !== undefined;
|
|
@@ -9587,7 +9630,7 @@ export default class binance extends Exchange {
|
|
|
9587
9630
|
}
|
|
9588
9631
|
return this.safeValue(config, 'cost', 1);
|
|
9589
9632
|
}
|
|
9590
|
-
async request(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}
|
|
9633
|
+
async request(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}) {
|
|
9591
9634
|
const response = await this.fetch2(path, api, method, params, headers, body, config);
|
|
9592
9635
|
// a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
|
|
9593
9636
|
if (api === 'private') {
|
|
@@ -10220,6 +10263,7 @@ export default class binance extends Exchange {
|
|
|
10220
10263
|
else {
|
|
10221
10264
|
return this.parseOpenInterest(response, market);
|
|
10222
10265
|
}
|
|
10266
|
+
return undefined;
|
|
10223
10267
|
}
|
|
10224
10268
|
parseOpenInterest(interest, market = undefined) {
|
|
10225
10269
|
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;
|