ccxt 4.3.44 → 4.3.46
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 +130 -130
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +6 -1
- package/dist/cjs/src/abstract/oxfun.js +9 -0
- package/dist/cjs/src/base/Exchange.js +1 -0
- package/dist/cjs/src/binance.js +2 -0
- package/dist/cjs/src/bingx.js +25 -17
- package/dist/cjs/src/bitmart.js +5 -0
- package/dist/cjs/src/bitstamp.js +18 -2
- package/dist/cjs/src/bitteam.js +5 -7
- package/dist/cjs/src/coinmetro.js +8 -17
- package/dist/cjs/src/hyperliquid.js +29 -21
- package/dist/cjs/src/idex.js +1 -0
- package/dist/cjs/src/kucoin.js +28 -1
- package/dist/cjs/src/luno.js +9 -1
- package/dist/cjs/src/mexc.js +8 -6
- package/dist/cjs/src/okx.js +1 -0
- package/dist/cjs/src/oxfun.js +2900 -0
- package/dist/cjs/src/pro/binanceus.js +0 -8
- package/dist/cjs/src/pro/oxfun.js +1034 -0
- package/dist/cjs/src/tokocrypto.js +8 -10
- package/dist/cjs/src/wavesexchange.js +122 -110
- package/dist/cjs/src/woofipro.js +1 -0
- package/dist/cjs/src/xt.js +1 -1
- package/js/ccxt.d.ts +8 -2
- package/js/ccxt.js +6 -2
- package/js/src/abstract/binance.d.ts +2 -0
- package/js/src/abstract/binancecoinm.d.ts +2 -0
- package/js/src/abstract/binanceus.d.ts +2 -0
- package/js/src/abstract/binanceusdm.d.ts +2 -0
- package/js/src/abstract/bitstamp.d.ts +16 -0
- package/js/src/abstract/kucoin.d.ts +14 -0
- package/js/src/abstract/kucoinfutures.d.ts +14 -0
- package/js/src/abstract/mexc.d.ts +2 -0
- package/js/src/abstract/oxfun.d.ts +37 -0
- package/js/src/abstract/oxfun.js +11 -0
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +1 -0
- package/js/src/binance.js +2 -0
- package/js/src/bingx.js +26 -18
- package/js/src/bitmart.js +5 -0
- package/js/src/bitstamp.js +18 -2
- package/js/src/bitteam.js +6 -8
- package/js/src/coinmetro.js +9 -18
- package/js/src/hyperliquid.d.ts +3 -3
- package/js/src/hyperliquid.js +29 -21
- package/js/src/idex.js +1 -0
- package/js/src/kucoin.js +28 -1
- package/js/src/luno.d.ts +1 -1
- package/js/src/luno.js +9 -1
- package/js/src/mexc.js +8 -6
- package/js/src/okx.js +1 -0
- package/js/src/oxfun.d.ts +129 -0
- package/js/src/oxfun.js +2901 -0
- package/js/src/pro/binanceus.js +0 -8
- package/js/src/pro/oxfun.d.ts +38 -0
- package/js/src/pro/oxfun.js +1035 -0
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/js/src/tokocrypto.js +9 -11
- package/js/src/wavesexchange.d.ts +7 -7
- package/js/src/wavesexchange.js +123 -111
- package/js/src/woofipro.js +1 -0
- package/js/src/xt.js +1 -1
- package/package.json +1 -1
|
@@ -667,6 +667,8 @@ interface binance {
|
|
|
667
667
|
privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
|
|
668
668
|
privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
|
|
669
669
|
privatePostOrderListOco(params?: {}): Promise<implicitReturnType>;
|
|
670
|
+
privatePostOrderListOto(params?: {}): Promise<implicitReturnType>;
|
|
671
|
+
privatePostOrderListOtoco(params?: {}): Promise<implicitReturnType>;
|
|
670
672
|
privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
|
|
671
673
|
privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
|
|
672
674
|
privatePostOrder(params?: {}): Promise<implicitReturnType>;
|
|
@@ -615,6 +615,8 @@ interface binance {
|
|
|
615
615
|
privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
|
|
616
616
|
privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
|
|
617
617
|
privatePostOrderListOco(params?: {}): Promise<implicitReturnType>;
|
|
618
|
+
privatePostOrderListOto(params?: {}): Promise<implicitReturnType>;
|
|
619
|
+
privatePostOrderListOtoco(params?: {}): Promise<implicitReturnType>;
|
|
618
620
|
privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
|
|
619
621
|
privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
|
|
620
622
|
privatePostOrder(params?: {}): Promise<implicitReturnType>;
|
|
@@ -239,6 +239,22 @@ interface Exchange {
|
|
|
239
239
|
privatePostVchfAddress(params?: {}): Promise<implicitReturnType>;
|
|
240
240
|
privatePostVeurWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
241
241
|
privatePostVeurAddress(params?: {}): Promise<implicitReturnType>;
|
|
242
|
+
privatePostTrufWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
243
|
+
privatePostTrufAddress(params?: {}): Promise<implicitReturnType>;
|
|
244
|
+
privatePostWifWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
245
|
+
privatePostWifAddress(params?: {}): Promise<implicitReturnType>;
|
|
246
|
+
privatePostSmtWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
247
|
+
privatePostSmtAddress(params?: {}): Promise<implicitReturnType>;
|
|
248
|
+
privatePostSuiWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
249
|
+
privatePostSuiAddress(params?: {}): Promise<implicitReturnType>;
|
|
250
|
+
privatePostJupWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
251
|
+
privatePostJupAddress(params?: {}): Promise<implicitReturnType>;
|
|
252
|
+
privatePostOndoWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
253
|
+
privatePostOndoAddress(params?: {}): Promise<implicitReturnType>;
|
|
254
|
+
privatePostBobaWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
255
|
+
privatePostBobaAddress(params?: {}): Promise<implicitReturnType>;
|
|
256
|
+
privatePostPythWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
257
|
+
privatePostPythAddress(params?: {}): Promise<implicitReturnType>;
|
|
242
258
|
}
|
|
243
259
|
declare abstract class Exchange extends _Exchange {
|
|
244
260
|
}
|
|
@@ -192,11 +192,25 @@ interface Exchange {
|
|
|
192
192
|
brokerGetBrokerNdAccount(params?: {}): Promise<implicitReturnType>;
|
|
193
193
|
brokerGetBrokerNdAccountApikey(params?: {}): Promise<implicitReturnType>;
|
|
194
194
|
brokerGetBrokerNdRebaseDownload(params?: {}): Promise<implicitReturnType>;
|
|
195
|
+
brokerGetBrokerNdTransferDetail(params?: {}): Promise<implicitReturnType>;
|
|
196
|
+
brokerGetBrokerNdDepositDetail(params?: {}): Promise<implicitReturnType>;
|
|
197
|
+
brokerGetBrokerNdWithdrawDetail(params?: {}): Promise<implicitReturnType>;
|
|
195
198
|
brokerPostBrokerNdTransfer(params?: {}): Promise<implicitReturnType>;
|
|
196
199
|
brokerPostBrokerNdAccount(params?: {}): Promise<implicitReturnType>;
|
|
197
200
|
brokerPostBrokerNdAccountApikey(params?: {}): Promise<implicitReturnType>;
|
|
198
201
|
brokerPostBrokerNdAccountUpdateApikey(params?: {}): Promise<implicitReturnType>;
|
|
199
202
|
brokerDeleteBrokerNdAccountApikey(params?: {}): Promise<implicitReturnType>;
|
|
203
|
+
earnGetOtcLoanLoan(params?: {}): Promise<implicitReturnType>;
|
|
204
|
+
earnGetOtcLoanAccounts(params?: {}): Promise<implicitReturnType>;
|
|
205
|
+
earnGetEarnRedeemPreview(params?: {}): Promise<implicitReturnType>;
|
|
206
|
+
earnGetEarnSavingProducts(params?: {}): Promise<implicitReturnType>;
|
|
207
|
+
earnGetEarnHoldAssets(params?: {}): Promise<implicitReturnType>;
|
|
208
|
+
earnGetEarnPromotionProducts(params?: {}): Promise<implicitReturnType>;
|
|
209
|
+
earnGetEarnKcsStakingProducts(params?: {}): Promise<implicitReturnType>;
|
|
210
|
+
earnGetEarnStakingProducts(params?: {}): Promise<implicitReturnType>;
|
|
211
|
+
earnGetEarnEthStakingProducts(params?: {}): Promise<implicitReturnType>;
|
|
212
|
+
earnPostEarnOrders(params?: {}): Promise<implicitReturnType>;
|
|
213
|
+
earnDeleteEarnOrders(params?: {}): Promise<implicitReturnType>;
|
|
200
214
|
}
|
|
201
215
|
declare abstract class Exchange extends _Exchange {
|
|
202
216
|
}
|
|
@@ -211,11 +211,25 @@ interface kucoin {
|
|
|
211
211
|
brokerGetBrokerNdAccount(params?: {}): Promise<implicitReturnType>;
|
|
212
212
|
brokerGetBrokerNdAccountApikey(params?: {}): Promise<implicitReturnType>;
|
|
213
213
|
brokerGetBrokerNdRebaseDownload(params?: {}): Promise<implicitReturnType>;
|
|
214
|
+
brokerGetBrokerNdTransferDetail(params?: {}): Promise<implicitReturnType>;
|
|
215
|
+
brokerGetBrokerNdDepositDetail(params?: {}): Promise<implicitReturnType>;
|
|
216
|
+
brokerGetBrokerNdWithdrawDetail(params?: {}): Promise<implicitReturnType>;
|
|
214
217
|
brokerPostBrokerNdTransfer(params?: {}): Promise<implicitReturnType>;
|
|
215
218
|
brokerPostBrokerNdAccount(params?: {}): Promise<implicitReturnType>;
|
|
216
219
|
brokerPostBrokerNdAccountApikey(params?: {}): Promise<implicitReturnType>;
|
|
217
220
|
brokerPostBrokerNdAccountUpdateApikey(params?: {}): Promise<implicitReturnType>;
|
|
218
221
|
brokerDeleteBrokerNdAccountApikey(params?: {}): Promise<implicitReturnType>;
|
|
222
|
+
earnGetOtcLoanLoan(params?: {}): Promise<implicitReturnType>;
|
|
223
|
+
earnGetOtcLoanAccounts(params?: {}): Promise<implicitReturnType>;
|
|
224
|
+
earnGetEarnRedeemPreview(params?: {}): Promise<implicitReturnType>;
|
|
225
|
+
earnGetEarnSavingProducts(params?: {}): Promise<implicitReturnType>;
|
|
226
|
+
earnGetEarnHoldAssets(params?: {}): Promise<implicitReturnType>;
|
|
227
|
+
earnGetEarnPromotionProducts(params?: {}): Promise<implicitReturnType>;
|
|
228
|
+
earnGetEarnKcsStakingProducts(params?: {}): Promise<implicitReturnType>;
|
|
229
|
+
earnGetEarnStakingProducts(params?: {}): Promise<implicitReturnType>;
|
|
230
|
+
earnGetEarnEthStakingProducts(params?: {}): Promise<implicitReturnType>;
|
|
231
|
+
earnPostEarnOrders(params?: {}): Promise<implicitReturnType>;
|
|
232
|
+
earnDeleteEarnOrders(params?: {}): Promise<implicitReturnType>;
|
|
219
233
|
}
|
|
220
234
|
declare abstract class kucoin extends _kucoin {
|
|
221
235
|
}
|
|
@@ -63,6 +63,7 @@ interface Exchange {
|
|
|
63
63
|
spotPrivatePostSubAccountMargin(params?: {}): Promise<implicitReturnType>;
|
|
64
64
|
spotPrivatePostBatchOrders(params?: {}): Promise<implicitReturnType>;
|
|
65
65
|
spotPrivatePostCapitalWithdrawApply(params?: {}): Promise<implicitReturnType>;
|
|
66
|
+
spotPrivatePostCapitalWithdraw(params?: {}): Promise<implicitReturnType>;
|
|
66
67
|
spotPrivatePostCapitalTransfer(params?: {}): Promise<implicitReturnType>;
|
|
67
68
|
spotPrivatePostCapitalTransferInternal(params?: {}): Promise<implicitReturnType>;
|
|
68
69
|
spotPrivatePostCapitalDepositAddress(params?: {}): Promise<implicitReturnType>;
|
|
@@ -77,6 +78,7 @@ interface Exchange {
|
|
|
77
78
|
spotPrivateDeleteMarginOrder(params?: {}): Promise<implicitReturnType>;
|
|
78
79
|
spotPrivateDeleteMarginOpenOrders(params?: {}): Promise<implicitReturnType>;
|
|
79
80
|
spotPrivateDeleteUserDataStream(params?: {}): Promise<implicitReturnType>;
|
|
81
|
+
spotPrivateDeleteCapitalWithdraw(params?: {}): Promise<implicitReturnType>;
|
|
80
82
|
contractPublicGetPing(params?: {}): Promise<implicitReturnType>;
|
|
81
83
|
contractPublicGetDetail(params?: {}): Promise<implicitReturnType>;
|
|
82
84
|
contractPublicGetSupportCurrencies(params?: {}): Promise<implicitReturnType>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { implicitReturnType } from '../base/types.js';
|
|
2
|
+
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
3
|
+
interface Exchange {
|
|
4
|
+
publicGetV3Markets(params?: {}): Promise<implicitReturnType>;
|
|
5
|
+
publicGetV3Assets(params?: {}): Promise<implicitReturnType>;
|
|
6
|
+
publicGetV3Tickers(params?: {}): Promise<implicitReturnType>;
|
|
7
|
+
publicGetV3FundingEstimates(params?: {}): Promise<implicitReturnType>;
|
|
8
|
+
publicGetV3Candles(params?: {}): Promise<implicitReturnType>;
|
|
9
|
+
publicGetV3Depth(params?: {}): Promise<implicitReturnType>;
|
|
10
|
+
publicGetV3MarketsOperational(params?: {}): Promise<implicitReturnType>;
|
|
11
|
+
publicGetV3ExchangeTrades(params?: {}): Promise<implicitReturnType>;
|
|
12
|
+
publicGetV3FundingRates(params?: {}): Promise<implicitReturnType>;
|
|
13
|
+
publicGetV3LeverageTiers(params?: {}): Promise<implicitReturnType>;
|
|
14
|
+
privateGetV3Account(params?: {}): Promise<implicitReturnType>;
|
|
15
|
+
privateGetV3AccountNames(params?: {}): Promise<implicitReturnType>;
|
|
16
|
+
privateGetV3Wallet(params?: {}): Promise<implicitReturnType>;
|
|
17
|
+
privateGetV3Transfer(params?: {}): Promise<implicitReturnType>;
|
|
18
|
+
privateGetV3Balances(params?: {}): Promise<implicitReturnType>;
|
|
19
|
+
privateGetV3Positions(params?: {}): Promise<implicitReturnType>;
|
|
20
|
+
privateGetV3Funding(params?: {}): Promise<implicitReturnType>;
|
|
21
|
+
privateGetV3DepositAddresses(params?: {}): Promise<implicitReturnType>;
|
|
22
|
+
privateGetV3Deposit(params?: {}): Promise<implicitReturnType>;
|
|
23
|
+
privateGetV3WithdrawalAddresses(params?: {}): Promise<implicitReturnType>;
|
|
24
|
+
privateGetV3Withdrawal(params?: {}): Promise<implicitReturnType>;
|
|
25
|
+
privateGetV3WithdrawalFees(params?: {}): Promise<implicitReturnType>;
|
|
26
|
+
privateGetV3OrdersStatus(params?: {}): Promise<implicitReturnType>;
|
|
27
|
+
privateGetV3OrdersWorking(params?: {}): Promise<implicitReturnType>;
|
|
28
|
+
privateGetV3Trades(params?: {}): Promise<implicitReturnType>;
|
|
29
|
+
privatePostV3Transfer(params?: {}): Promise<implicitReturnType>;
|
|
30
|
+
privatePostV3Withdrawal(params?: {}): Promise<implicitReturnType>;
|
|
31
|
+
privatePostV3OrdersPlace(params?: {}): Promise<implicitReturnType>;
|
|
32
|
+
privateDeleteV3OrdersCancel(params?: {}): Promise<implicitReturnType>;
|
|
33
|
+
privateDeleteV3OrdersCancelAll(params?: {}): Promise<implicitReturnType>;
|
|
34
|
+
}
|
|
35
|
+
declare abstract class Exchange extends _Exchange {
|
|
36
|
+
}
|
|
37
|
+
export default Exchange;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// ----------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
+
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
+
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
+
|
|
7
|
+
// -------------------------------------------------------------------------------
|
|
8
|
+
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
9
|
+
class Exchange extends _Exchange {
|
|
10
|
+
}
|
|
11
|
+
export default Exchange;
|
package/js/src/base/Exchange.js
CHANGED
package/js/src/binance.js
CHANGED
package/js/src/bingx.js
CHANGED
|
@@ -9,7 +9,7 @@ import Exchange from './abstract/bingx.js';
|
|
|
9
9
|
import { AuthenticationError, PermissionDenied, AccountSuspended, ExchangeError, InsufficientFunds, BadRequest, OrderNotFound, DDoSProtection, BadSymbol, ArgumentsRequired, NotSupported, OperationFailed } from './base/errors.js';
|
|
10
10
|
import { Precise } from './base/Precise.js';
|
|
11
11
|
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
|
|
12
|
-
import {
|
|
12
|
+
import { TICK_SIZE } from './base/functions/number.js';
|
|
13
13
|
// ---------------------------------------------------------------------------
|
|
14
14
|
/**
|
|
15
15
|
* @class bingx
|
|
@@ -388,7 +388,7 @@ export default class bingx extends Exchange {
|
|
|
388
388
|
'1w': '1w',
|
|
389
389
|
'1M': '1M',
|
|
390
390
|
},
|
|
391
|
-
'precisionMode':
|
|
391
|
+
'precisionMode': TICK_SIZE,
|
|
392
392
|
'exceptions': {
|
|
393
393
|
'exact': {
|
|
394
394
|
'400': BadRequest,
|
|
@@ -613,18 +613,26 @@ export default class bingx extends Exchange {
|
|
|
613
613
|
// "msg": "",
|
|
614
614
|
// "data": [
|
|
615
615
|
// {
|
|
616
|
-
//
|
|
617
|
-
//
|
|
618
|
-
//
|
|
619
|
-
//
|
|
620
|
-
//
|
|
621
|
-
//
|
|
622
|
-
//
|
|
623
|
-
//
|
|
624
|
-
//
|
|
625
|
-
//
|
|
626
|
-
//
|
|
627
|
-
//
|
|
616
|
+
// "contractId": "100",
|
|
617
|
+
// "symbol": "BTC-USDT",
|
|
618
|
+
// "size": "0.0001",
|
|
619
|
+
// "quantityPrecision": "4",
|
|
620
|
+
// "pricePrecision": "1",
|
|
621
|
+
// "feeRate": "0.0005",
|
|
622
|
+
// "makerFeeRate": "0.0002",
|
|
623
|
+
// "takerFeeRate": "0.0005",
|
|
624
|
+
// "tradeMinLimit": "0",
|
|
625
|
+
// "tradeMinQuantity": "0.0001",
|
|
626
|
+
// "tradeMinUSDT": "2",
|
|
627
|
+
// "maxLongLeverage": "125",
|
|
628
|
+
// "maxShortLeverage": "125",
|
|
629
|
+
// "currency": "USDT",
|
|
630
|
+
// "asset": "BTC",
|
|
631
|
+
// "status": "1",
|
|
632
|
+
// "apiStateOpen": "true",
|
|
633
|
+
// "apiStateClose": "true",
|
|
634
|
+
// "ensureTrigger": true,
|
|
635
|
+
// "triggerFeeRate": "0.00020000"
|
|
628
636
|
// },
|
|
629
637
|
// ...
|
|
630
638
|
// ]
|
|
@@ -642,13 +650,13 @@ export default class bingx extends Exchange {
|
|
|
642
650
|
const quote = this.safeCurrencyCode(quoteId);
|
|
643
651
|
const currency = this.safeString(market, 'currency');
|
|
644
652
|
const settle = this.safeCurrencyCode(currency);
|
|
645
|
-
let pricePrecision = this.
|
|
653
|
+
let pricePrecision = this.safeNumber(market, 'tickSize');
|
|
646
654
|
if (pricePrecision === undefined) {
|
|
647
|
-
pricePrecision = this.
|
|
655
|
+
pricePrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'pricePrecision')));
|
|
648
656
|
}
|
|
649
|
-
let quantityPrecision = this.
|
|
657
|
+
let quantityPrecision = this.safeNumber(market, 'stepSize');
|
|
650
658
|
if (quantityPrecision === undefined) {
|
|
651
|
-
quantityPrecision = this.
|
|
659
|
+
quantityPrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'quantityPrecision')));
|
|
652
660
|
}
|
|
653
661
|
const type = (settle !== undefined) ? 'swap' : 'spot';
|
|
654
662
|
const spot = type === 'spot';
|
package/js/src/bitmart.js
CHANGED
|
@@ -2743,6 +2743,11 @@ export default class bitmart extends Exchange {
|
|
|
2743
2743
|
if (ioc) {
|
|
2744
2744
|
request['type'] = 'ioc';
|
|
2745
2745
|
}
|
|
2746
|
+
const clientOrderId = this.safeString(params, 'clientOrderId');
|
|
2747
|
+
if (clientOrderId !== undefined) {
|
|
2748
|
+
params = this.omit(params, 'clientOrderId');
|
|
2749
|
+
request['client_order_id'] = clientOrderId;
|
|
2750
|
+
}
|
|
2746
2751
|
return this.extend(request, params);
|
|
2747
2752
|
}
|
|
2748
2753
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
package/js/src/bitstamp.js
CHANGED
|
@@ -222,7 +222,7 @@ export default class bitstamp extends Exchange {
|
|
|
222
222
|
'uni_withdrawal/': 1,
|
|
223
223
|
'uni_address/': 1,
|
|
224
224
|
'yfi_withdrawal/': 1,
|
|
225
|
-
'yfi_address': 1,
|
|
225
|
+
'yfi_address/': 1,
|
|
226
226
|
'audio_withdrawal/': 1,
|
|
227
227
|
'audio_address/': 1,
|
|
228
228
|
'crv_withdrawal/': 1,
|
|
@@ -231,7 +231,7 @@ export default class bitstamp extends Exchange {
|
|
|
231
231
|
'algo_address/': 1,
|
|
232
232
|
'comp_withdrawal/': 1,
|
|
233
233
|
'comp_address/': 1,
|
|
234
|
-
'grt_withdrawal': 1,
|
|
234
|
+
'grt_withdrawal/': 1,
|
|
235
235
|
'grt_address/': 1,
|
|
236
236
|
'usdt_withdrawal/': 1,
|
|
237
237
|
'usdt_address/': 1,
|
|
@@ -369,6 +369,22 @@ export default class bitstamp extends Exchange {
|
|
|
369
369
|
'vchf_address/': 1,
|
|
370
370
|
'veur_withdrawal/': 1,
|
|
371
371
|
'veur_address/': 1,
|
|
372
|
+
'truf_withdrawal/': 1,
|
|
373
|
+
'truf_address/': 1,
|
|
374
|
+
'wif_withdrawal/': 1,
|
|
375
|
+
'wif_address/': 1,
|
|
376
|
+
'smt_withdrawal/': 1,
|
|
377
|
+
'smt_address/': 1,
|
|
378
|
+
'sui_withdrawal/': 1,
|
|
379
|
+
'sui_address/': 1,
|
|
380
|
+
'jup_withdrawal/': 1,
|
|
381
|
+
'jup_address/': 1,
|
|
382
|
+
'ondo_withdrawal/': 1,
|
|
383
|
+
'ondo_address/': 1,
|
|
384
|
+
'boba_withdrawal/': 1,
|
|
385
|
+
'boba_address/': 1,
|
|
386
|
+
'pyth_withdrawal/': 1,
|
|
387
|
+
'pyth_address/': 1,
|
|
372
388
|
},
|
|
373
389
|
},
|
|
374
390
|
},
|
package/js/src/bitteam.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import Exchange from './abstract/bitteam.js';
|
|
9
9
|
import { ArgumentsRequired, AuthenticationError, BadRequest, BadSymbol, ExchangeError, ExchangeNotAvailable, InsufficientFunds, OrderNotFound } from './base/errors.js';
|
|
10
|
-
import {
|
|
10
|
+
import { TICK_SIZE } from './base/functions/number.js';
|
|
11
11
|
import { Precise } from './base/Precise.js';
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
13
13
|
/**
|
|
@@ -193,7 +193,7 @@ export default class bitteam extends Exchange {
|
|
|
193
193
|
'maker': this.parseNumber('0.002'),
|
|
194
194
|
},
|
|
195
195
|
},
|
|
196
|
-
'precisionMode':
|
|
196
|
+
'precisionMode': TICK_SIZE,
|
|
197
197
|
// exchange-specific options
|
|
198
198
|
'options': {
|
|
199
199
|
'networksById': {
|
|
@@ -354,8 +354,6 @@ export default class bitteam extends Exchange {
|
|
|
354
354
|
const base = this.safeCurrencyCode(baseId);
|
|
355
355
|
const quote = this.safeCurrencyCode(quoteId);
|
|
356
356
|
const active = this.safeValue(market, 'active');
|
|
357
|
-
const amountPrecision = this.safeInteger(market, 'baseStep');
|
|
358
|
-
const pricePrecision = this.safeInteger(market, 'quoteStep');
|
|
359
357
|
const timeStart = this.safeString(market, 'timeStart');
|
|
360
358
|
const created = this.parse8601(timeStart);
|
|
361
359
|
let minCost = undefined;
|
|
@@ -391,8 +389,8 @@ export default class bitteam extends Exchange {
|
|
|
391
389
|
'strike': undefined,
|
|
392
390
|
'optionType': undefined,
|
|
393
391
|
'precision': {
|
|
394
|
-
'amount':
|
|
395
|
-
'price':
|
|
392
|
+
'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseStep'))),
|
|
393
|
+
'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quoteStep'))),
|
|
396
394
|
},
|
|
397
395
|
'limits': {
|
|
398
396
|
'leverage': {
|
|
@@ -548,7 +546,7 @@ export default class bitteam extends Exchange {
|
|
|
548
546
|
const numericId = this.safeInteger(currency, 'id');
|
|
549
547
|
const code = this.safeCurrencyCode(id);
|
|
550
548
|
const active = this.safeBool(currency, 'active', false);
|
|
551
|
-
const precision = this.
|
|
549
|
+
const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'precision')));
|
|
552
550
|
const txLimits = this.safeValue(currency, 'txLimits', {});
|
|
553
551
|
const minWithdraw = this.safeString(txLimits, 'minWithdraw');
|
|
554
552
|
const maxWithdraw = this.safeString(txLimits, 'maxWithdraw');
|
|
@@ -570,7 +568,7 @@ export default class bitteam extends Exchange {
|
|
|
570
568
|
const withdraw = this.safeValue(statuses, 'withdrawStatus');
|
|
571
569
|
const networkIds = Object.keys(feesByNetworkId);
|
|
572
570
|
const networks = {};
|
|
573
|
-
const networkPrecision = this.
|
|
571
|
+
const networkPrecision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals')));
|
|
574
572
|
for (let j = 0; j < networkIds.length; j++) {
|
|
575
573
|
const networkId = networkIds[j];
|
|
576
574
|
const networkCode = this.networkIdToCode(networkId, code);
|
package/js/src/coinmetro.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import Exchange from './abstract/coinmetro.js';
|
|
9
9
|
import { ArgumentsRequired, BadRequest, BadSymbol, InsufficientFunds, InvalidOrder, ExchangeError, OrderNotFound, PermissionDenied, RateLimitExceeded } from './base/errors.js';
|
|
10
|
-
import {
|
|
10
|
+
import { TICK_SIZE } from './base/functions/number.js';
|
|
11
11
|
import { Precise } from './base/Precise.js';
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
13
13
|
/**
|
|
@@ -208,7 +208,7 @@ export default class coinmetro extends Exchange {
|
|
|
208
208
|
'maker': this.parseNumber('0'),
|
|
209
209
|
},
|
|
210
210
|
},
|
|
211
|
-
'precisionMode':
|
|
211
|
+
'precisionMode': TICK_SIZE,
|
|
212
212
|
// exchange-specific options
|
|
213
213
|
'options': {
|
|
214
214
|
'currenciesByIdForParseMarket': undefined,
|
|
@@ -312,7 +312,6 @@ export default class coinmetro extends Exchange {
|
|
|
312
312
|
const deposit = this.safeValue(currency, 'canDeposit');
|
|
313
313
|
const canTrade = this.safeValue(currency, 'canTrade');
|
|
314
314
|
const active = canTrade ? withdraw : true;
|
|
315
|
-
const precision = this.safeInteger(currency, 'digits');
|
|
316
315
|
const minAmount = this.safeNumber(currency, 'minQty');
|
|
317
316
|
result[code] = this.safeCurrencyStructure({
|
|
318
317
|
'id': id,
|
|
@@ -323,7 +322,7 @@ export default class coinmetro extends Exchange {
|
|
|
323
322
|
'deposit': deposit,
|
|
324
323
|
'withdraw': withdraw,
|
|
325
324
|
'fee': undefined,
|
|
326
|
-
'precision':
|
|
325
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'digits'))),
|
|
327
326
|
'limits': {
|
|
328
327
|
'amount': { 'min': minAmount, 'max': undefined },
|
|
329
328
|
'withdraw': { 'min': undefined, 'max': undefined },
|
|
@@ -354,19 +353,14 @@ export default class coinmetro extends Exchange {
|
|
|
354
353
|
//
|
|
355
354
|
// [
|
|
356
355
|
// {
|
|
357
|
-
// "pair": "
|
|
358
|
-
// "precision": 5,
|
|
359
|
-
// "margin": false
|
|
360
|
-
// },
|
|
361
|
-
// {
|
|
362
|
-
// "pair": "PERPUSD",
|
|
356
|
+
// "pair": "YFIEUR",
|
|
363
357
|
// "precision": 5,
|
|
364
358
|
// "margin": false
|
|
365
359
|
// },
|
|
366
360
|
// {
|
|
367
|
-
// "pair": "
|
|
368
|
-
// "precision":
|
|
369
|
-
// "margin":
|
|
361
|
+
// "pair": "BTCEUR",
|
|
362
|
+
// "precision": 2,
|
|
363
|
+
// "margin": true
|
|
370
364
|
// },
|
|
371
365
|
// ...
|
|
372
366
|
// ]
|
|
@@ -412,9 +406,7 @@ export default class coinmetro extends Exchange {
|
|
|
412
406
|
'optionType': undefined,
|
|
413
407
|
'precision': {
|
|
414
408
|
'amount': basePrecisionAndLimits['precision'],
|
|
415
|
-
'price':
|
|
416
|
-
'base': basePrecisionAndLimits['precision'],
|
|
417
|
-
'quote': quotePrecisionAndLimits['precision'],
|
|
409
|
+
'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'precision'))),
|
|
418
410
|
},
|
|
419
411
|
'limits': {
|
|
420
412
|
'leverage': {
|
|
@@ -469,12 +461,11 @@ export default class coinmetro extends Exchange {
|
|
|
469
461
|
parseMarketPrecisionAndLimits(currencyId) {
|
|
470
462
|
const currencies = this.safeValue(this.options, 'currenciesByIdForParseMarket', {});
|
|
471
463
|
const currency = this.safeValue(currencies, currencyId, {});
|
|
472
|
-
const precision = this.safeInteger(currency, 'precision');
|
|
473
464
|
const limits = this.safeValue(currency, 'limits', {});
|
|
474
465
|
const amountLimits = this.safeValue(limits, 'amount', {});
|
|
475
466
|
const minLimit = this.safeNumber(amountLimits, 'min');
|
|
476
467
|
const result = {
|
|
477
|
-
'precision': precision,
|
|
468
|
+
'precision': this.safeNumber(currency, 'precision'),
|
|
478
469
|
'minLimit': minLimit,
|
|
479
470
|
};
|
|
480
471
|
return result;
|
package/js/src/hyperliquid.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/hyperliquid.js';
|
|
2
|
-
import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num, MarginModification, Currencies, CancellationRequest, int } from './base/types.js';
|
|
2
|
+
import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num, MarginModification, Currencies, CancellationRequest, int, Transaction } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class hyperliquid
|
|
5
5
|
* @augments Exchange
|
|
@@ -36,7 +36,7 @@ export default class hyperliquid extends Exchange {
|
|
|
36
36
|
};
|
|
37
37
|
actionHash(action: any, vaultAddress: any, nonce: any): any;
|
|
38
38
|
signL1Action(action: any, nonce: any, vaultAdress?: any): object;
|
|
39
|
-
|
|
39
|
+
signUserSignedAction(messageTypes: any, message: any): {
|
|
40
40
|
r: string;
|
|
41
41
|
s: string;
|
|
42
42
|
v: any;
|
|
@@ -77,7 +77,7 @@ export default class hyperliquid extends Exchange {
|
|
|
77
77
|
modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
|
|
78
78
|
parseMarginModification(data: Dict, market?: Market): MarginModification;
|
|
79
79
|
transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
|
|
80
|
-
withdraw(code: string, amount:
|
|
80
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
81
81
|
formatVaultAddress(address?: Str): string;
|
|
82
82
|
handlePublicAddress(methodName: string, params: Dict): any[];
|
|
83
83
|
coinToMarketId(coin: Str): string;
|
package/js/src/hyperliquid.js
CHANGED
|
@@ -27,6 +27,7 @@ export default class hyperliquid extends Exchange {
|
|
|
27
27
|
'rateLimit': 50,
|
|
28
28
|
'certified': false,
|
|
29
29
|
'pro': true,
|
|
30
|
+
'dex': true,
|
|
30
31
|
'has': {
|
|
31
32
|
'CORS': undefined,
|
|
32
33
|
'spot': true,
|
|
@@ -971,11 +972,12 @@ export default class hyperliquid extends Exchange {
|
|
|
971
972
|
const signature = this.signMessage(msg, this.privateKey);
|
|
972
973
|
return signature;
|
|
973
974
|
}
|
|
974
|
-
|
|
975
|
+
signUserSignedAction(messageTypes, message) {
|
|
975
976
|
const zeroAddress = this.safeString(this.options, 'zeroAddress');
|
|
977
|
+
const chainId = 421614; // check this out
|
|
976
978
|
const domain = {
|
|
977
979
|
'chainId': chainId,
|
|
978
|
-
'name': '
|
|
980
|
+
'name': 'HyperliquidSignTransaction',
|
|
979
981
|
'verifyingContract': zeroAddress,
|
|
980
982
|
'version': '1',
|
|
981
983
|
};
|
|
@@ -984,28 +986,26 @@ export default class hyperliquid extends Exchange {
|
|
|
984
986
|
return signature;
|
|
985
987
|
}
|
|
986
988
|
buildTransferSig(message) {
|
|
987
|
-
const isSandboxMode = this.safeBool(this.options, 'sandboxMode');
|
|
988
|
-
const chainId = (isSandboxMode) ? 421614 : 42161;
|
|
989
989
|
const messageTypes = {
|
|
990
|
-
'
|
|
990
|
+
'HyperliquidTransaction:UsdSend': [
|
|
991
|
+
{ 'name': 'hyperliquidChain', 'type': 'string' },
|
|
991
992
|
{ 'name': 'destination', 'type': 'string' },
|
|
992
993
|
{ 'name': 'amount', 'type': 'string' },
|
|
993
994
|
{ 'name': 'time', 'type': 'uint64' },
|
|
994
995
|
],
|
|
995
996
|
};
|
|
996
|
-
return this.
|
|
997
|
+
return this.signUserSignedAction(messageTypes, message);
|
|
997
998
|
}
|
|
998
999
|
buildWithdrawSig(message) {
|
|
999
|
-
const isSandboxMode = this.safeBool(this.options, 'sandboxMode');
|
|
1000
|
-
const chainId = (isSandboxMode) ? 421614 : 42161;
|
|
1001
1000
|
const messageTypes = {
|
|
1002
|
-
'
|
|
1001
|
+
'HyperliquidTransaction:Withdraw': [
|
|
1002
|
+
{ 'name': 'hyperliquidChain', 'type': 'string' },
|
|
1003
1003
|
{ 'name': 'destination', 'type': 'string' },
|
|
1004
|
-
{ 'name': '
|
|
1004
|
+
{ 'name': 'amount', 'type': 'string' },
|
|
1005
1005
|
{ 'name': 'time', 'type': 'uint64' },
|
|
1006
1006
|
],
|
|
1007
1007
|
};
|
|
1008
|
-
return this.
|
|
1008
|
+
return this.signUserSignedAction(messageTypes, message);
|
|
1009
1009
|
}
|
|
1010
1010
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
1011
1011
|
/**
|
|
@@ -2408,10 +2408,11 @@ export default class hyperliquid extends Exchange {
|
|
|
2408
2408
|
if (code !== undefined) {
|
|
2409
2409
|
code = code.toUpperCase();
|
|
2410
2410
|
if (code !== 'USDC') {
|
|
2411
|
-
throw new NotSupported(this.id + '
|
|
2411
|
+
throw new NotSupported(this.id + 'transfer() only support USDC');
|
|
2412
2412
|
}
|
|
2413
2413
|
}
|
|
2414
2414
|
const payload = {
|
|
2415
|
+
'hyperliquidChain': isSandboxMode ? 'Testnet' : 'Mainnet',
|
|
2415
2416
|
'destination': toAccount,
|
|
2416
2417
|
'amount': this.numberToString(amount),
|
|
2417
2418
|
'time': nonce,
|
|
@@ -2419,9 +2420,12 @@ export default class hyperliquid extends Exchange {
|
|
|
2419
2420
|
const sig = this.buildTransferSig(payload);
|
|
2420
2421
|
const request = {
|
|
2421
2422
|
'action': {
|
|
2422
|
-
'
|
|
2423
|
-
'
|
|
2424
|
-
'
|
|
2423
|
+
'hyperliquidChain': payload['hyperliquidChain'],
|
|
2424
|
+
'signatureChainId': '0x66eee',
|
|
2425
|
+
'destination': toAccount,
|
|
2426
|
+
'amount': amount.toString(),
|
|
2427
|
+
'time': nonce,
|
|
2428
|
+
'type': 'usdSend',
|
|
2425
2429
|
},
|
|
2426
2430
|
'nonce': nonce,
|
|
2427
2431
|
'signature': sig,
|
|
@@ -2451,25 +2455,29 @@ export default class hyperliquid extends Exchange {
|
|
|
2451
2455
|
throw new NotSupported(this.id + 'withdraw() only support USDC');
|
|
2452
2456
|
}
|
|
2453
2457
|
}
|
|
2454
|
-
const isSandboxMode = this.safeBool(this.options, 'sandboxMode');
|
|
2458
|
+
const isSandboxMode = this.safeBool(this.options, 'sandboxMode', false);
|
|
2455
2459
|
const nonce = this.milliseconds();
|
|
2456
2460
|
const payload = {
|
|
2461
|
+
'hyperliquidChain': isSandboxMode ? 'Testnet' : 'Mainnet',
|
|
2457
2462
|
'destination': address,
|
|
2458
|
-
'
|
|
2463
|
+
'amount': amount.toString(),
|
|
2459
2464
|
'time': nonce,
|
|
2460
2465
|
};
|
|
2461
2466
|
const sig = this.buildWithdrawSig(payload);
|
|
2462
2467
|
const request = {
|
|
2463
2468
|
'action': {
|
|
2464
|
-
'
|
|
2465
|
-
'
|
|
2466
|
-
'
|
|
2469
|
+
'hyperliquidChain': payload['hyperliquidChain'],
|
|
2470
|
+
'signatureChainId': '0x66eee',
|
|
2471
|
+
'destination': address,
|
|
2472
|
+
'amount': amount.toString(),
|
|
2473
|
+
'time': nonce,
|
|
2474
|
+
'type': 'withdraw3',
|
|
2467
2475
|
},
|
|
2468
2476
|
'nonce': nonce,
|
|
2469
2477
|
'signature': sig,
|
|
2470
2478
|
};
|
|
2471
2479
|
const response = await this.privatePostExchange(this.extend(request, params));
|
|
2472
|
-
return response;
|
|
2480
|
+
return this.parseTransaction(response);
|
|
2473
2481
|
}
|
|
2474
2482
|
formatVaultAddress(address = undefined) {
|
|
2475
2483
|
if (address === undefined) {
|