ccxt 4.5.18 → 4.5.20
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 +7 -6
- package/dist/ccxt.browser.min.js +40 -16
- package/dist/cjs/_virtual/index.cjs.js +1459 -9
- package/dist/cjs/ccxt.js +8 -2
- package/dist/cjs/src/abstract/dydx.js +11 -0
- package/dist/cjs/src/base/Exchange.js +164 -10
- package/dist/cjs/src/base/ws/Client.js +3 -1
- package/dist/cjs/src/binance.js +8 -1
- package/dist/cjs/src/bingx.js +20 -0
- package/dist/cjs/src/bitget.js +43 -41
- package/dist/cjs/src/bybit.js +21 -23
- package/dist/cjs/src/deribit.js +6 -0
- package/dist/cjs/src/dydx.js +2454 -0
- package/dist/cjs/src/gate.js +4 -4
- package/dist/cjs/src/hibachi.js +1 -1
- package/dist/cjs/src/hyperliquid.js +207 -9
- package/dist/cjs/src/kucoin.js +711 -109
- package/dist/cjs/src/mexc.js +2 -3
- package/dist/cjs/src/pro/binance.js +59 -144
- package/dist/cjs/src/pro/dydx.js +418 -0
- package/dist/cjs/src/pro/kraken.js +4 -3
- package/dist/cjs/src/pro/xt.js +218 -4
- package/dist/cjs/src/protobuf/mexc/compiled.cjs.js +1 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/base/v1beta1/coin.js +56 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/v1beta1/multisig.js +56 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/crypto/secp256k1/keys.js +48 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.js +343 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.js +717 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/accountplus/tx.js +60 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/clob_pair.js +45 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order.js +380 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order_removals.js +72 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/tx.js +211 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/transfer.js +195 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/tx.js +49 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/subaccount.js +57 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/google/protobuf/any.js +56 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/helpers.js +79 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/long/index.cjs.js +9 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/onboarding.js +59 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/registry.js +39 -0
- package/dist/cjs/src/static_dependencies/noble-hashes/pbkdf2.js +69 -0
- package/dist/cjs/src/static_dependencies/noble-hashes/ripemd160.js +108 -0
- package/dist/cjs/src/static_dependencies/noble-hashes/utils.js +50 -1
- package/dist/cjs/src/static_dependencies/scure-base/index.js +29 -0
- package/dist/cjs/src/static_dependencies/scure-bip32/index.js +278 -0
- package/dist/cjs/src/static_dependencies/scure-bip39/index.js +97 -0
- package/dist/cjs/src/static_dependencies/scure-bip39/wordlists/english.js +2060 -0
- package/dist/cjs/src/static_dependencies/zklink/zklink-sdk-web.js +2 -0
- package/dist/cjs/src/toobit.js +2 -1
- package/js/ccxt.d.ts +8 -2
- package/js/ccxt.js +6 -2
- package/js/src/abstract/binance.d.ts +7 -0
- package/js/src/abstract/binancecoinm.d.ts +7 -0
- package/js/src/abstract/binanceus.d.ts +7 -0
- package/js/src/abstract/binanceusdm.d.ts +7 -0
- package/js/src/abstract/bitget.d.ts +1 -0
- package/js/src/abstract/dydx.d.ts +61 -0
- package/js/src/abstract/dydx.js +11 -0
- package/js/src/abstract/kucoin.d.ts +1 -1
- package/js/src/abstract/kucoinfutures.d.ts +1 -1
- package/js/src/base/Exchange.d.ts +7 -0
- package/js/src/base/Exchange.js +163 -10
- package/js/src/base/ws/Client.js +3 -1
- package/js/src/binance.js +8 -1
- package/js/src/bingx.js +20 -0
- package/js/src/bitget.d.ts +3 -3
- package/js/src/bitget.js +43 -41
- package/js/src/bybit.d.ts +3 -3
- package/js/src/bybit.js +21 -23
- package/js/src/deribit.js +6 -0
- package/js/src/dydx.d.ts +364 -0
- package/js/src/dydx.js +2453 -0
- package/js/src/gate.d.ts +2 -2
- package/js/src/gate.js +4 -4
- package/js/src/hibachi.js +1 -1
- package/js/src/hyperliquid.d.ts +17 -0
- package/js/src/hyperliquid.js +207 -9
- package/js/src/kucoin.d.ts +48 -1
- package/js/src/kucoin.js +711 -109
- package/js/src/mexc.js +2 -3
- package/js/src/pro/binance.d.ts +2 -2
- package/js/src/pro/binance.js +59 -144
- package/js/src/pro/dydx.d.ts +81 -0
- package/js/src/pro/dydx.js +417 -0
- package/js/src/pro/kraken.js +4 -3
- package/js/src/pro/xt.d.ts +85 -2
- package/js/src/pro/xt.js +218 -4
- package/js/src/static_dependencies/dydx-v4-client/cosmos/base/v1beta1/coin.d.ts +90 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/base/v1beta1/coin.js +163 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/keys.d.ts +26 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/keys.js +51 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/v1beta1/multisig.d.ts +48 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/v1beta1/multisig.js +85 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/secp256k1/keys.d.ts +40 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/secp256k1/keys.js +77 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.d.ts +162 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.js +329 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.d.ts +460 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.js +698 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/accountplus/tx.d.ts +127 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/accountplus/tx.js +286 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/block_rate_limit_config.d.ts +66 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/block_rate_limit_config.js +109 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/clob_pair.d.ts +127 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/clob_pair.js +257 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/equity_tier_limit_config.d.ts +48 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/equity_tier_limit_config.js +93 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/finalize_block.d.ts +23 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/finalize_block.js +43 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations.d.ts +92 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations.js +164 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations_config.d.ts +124 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations_config.js +196 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/matches.d.ts +159 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/matches.js +324 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order.d.ts +546 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order.js +872 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order_removals.d.ts +84 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order_removals.js +181 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/tx.d.ts +397 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/tx.js +757 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/transfer.d.ts +120 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/transfer.js +246 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/tx.d.ts +79 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/tx.js +147 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/asset_position.d.ts +32 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/asset_position.js +59 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/perpetual_position.d.ts +34 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/perpetual_position.js +66 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/subaccount.d.ts +62 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/subaccount.js +111 -0
- package/js/src/static_dependencies/dydx-v4-client/google/protobuf/any.d.ts +207 -0
- package/js/src/static_dependencies/dydx-v4-client/google/protobuf/any.js +50 -0
- package/js/src/static_dependencies/dydx-v4-client/helpers.d.ts +82 -0
- package/js/src/static_dependencies/dydx-v4-client/helpers.js +172 -0
- package/js/src/static_dependencies/dydx-v4-client/long/index.cjs +1473 -0
- package/js/src/static_dependencies/dydx-v4-client/long/index.d.cts +2 -0
- package/js/src/static_dependencies/dydx-v4-client/onboarding.d.ts +35 -0
- package/js/src/static_dependencies/dydx-v4-client/onboarding.js +56 -0
- package/js/src/static_dependencies/dydx-v4-client/registry.d.ts +7 -0
- package/js/src/static_dependencies/dydx-v4-client/registry.js +36 -0
- package/js/src/static_dependencies/noble-hashes/utils.d.ts +1 -0
- package/js/src/static_dependencies/noble-hashes/utils.js +4 -0
- package/js/src/static_dependencies/scure-bip32/index.d.ts +49 -0
- package/js/src/static_dependencies/scure-bip32/index.js +295 -0
- package/js/src/static_dependencies/scure-bip39/index.d.ts +54 -0
- package/js/src/static_dependencies/scure-bip39/index.js +140 -0
- package/js/src/static_dependencies/scure-bip39/wordlists/english.d.ts +1 -0
- package/js/src/static_dependencies/scure-bip39/wordlists/english.js +2054 -0
- package/js/src/toobit.js +2 -1
- package/package.json +9 -3
package/js/src/bybit.js
CHANGED
|
@@ -7463,7 +7463,7 @@ export default class bybit extends Exchange {
|
|
|
7463
7463
|
* @method
|
|
7464
7464
|
* @name bybit#borrowCrossMargin
|
|
7465
7465
|
* @description create a loan to borrow margin
|
|
7466
|
-
* @see https://bybit-exchange.github.io/docs/v5/
|
|
7466
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/borrow
|
|
7467
7467
|
* @param {string} code unified currency code of the currency to borrow
|
|
7468
7468
|
* @param {float} amount the amount to borrow
|
|
7469
7469
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -7474,32 +7474,29 @@ export default class bybit extends Exchange {
|
|
|
7474
7474
|
const currency = this.currency(code);
|
|
7475
7475
|
const request = {
|
|
7476
7476
|
'coin': currency['id'],
|
|
7477
|
-
'
|
|
7477
|
+
'amount': this.currencyToPrecision(code, amount),
|
|
7478
7478
|
};
|
|
7479
|
-
const response = await this.
|
|
7479
|
+
const response = await this.privatePostV5AccountBorrow(this.extend(request, params));
|
|
7480
7480
|
//
|
|
7481
7481
|
// {
|
|
7482
7482
|
// "retCode": 0,
|
|
7483
7483
|
// "retMsg": "success",
|
|
7484
7484
|
// "result": {
|
|
7485
|
-
// "
|
|
7485
|
+
// "coin": "BTC",
|
|
7486
|
+
// "amount": "0.001"
|
|
7486
7487
|
// },
|
|
7487
|
-
// "retExtInfo":
|
|
7488
|
-
// "time":
|
|
7488
|
+
// "retExtInfo": {},
|
|
7489
|
+
// "time": 1763194940073
|
|
7489
7490
|
// }
|
|
7490
7491
|
//
|
|
7491
7492
|
const result = this.safeDict(response, 'result', {});
|
|
7492
|
-
|
|
7493
|
-
return this.extend(transaction, {
|
|
7494
|
-
'symbol': undefined,
|
|
7495
|
-
'amount': amount,
|
|
7496
|
-
});
|
|
7493
|
+
return this.parseMarginLoan(result, currency);
|
|
7497
7494
|
}
|
|
7498
7495
|
/**
|
|
7499
7496
|
* @method
|
|
7500
7497
|
* @name bybit#repayCrossMargin
|
|
7501
7498
|
* @description repay borrowed margin and interest
|
|
7502
|
-
* @see https://bybit-exchange.github.io/docs/v5/
|
|
7499
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/no-convert-repay
|
|
7503
7500
|
* @param {string} code unified currency code of the currency to repay
|
|
7504
7501
|
* @param {float} amount the amount to repay
|
|
7505
7502
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -7510,24 +7507,23 @@ export default class bybit extends Exchange {
|
|
|
7510
7507
|
const currency = this.currency(code);
|
|
7511
7508
|
const request = {
|
|
7512
7509
|
'coin': currency['id'],
|
|
7513
|
-
'
|
|
7510
|
+
'amount': this.numberToString(amount),
|
|
7514
7511
|
};
|
|
7515
|
-
const response = await this.
|
|
7512
|
+
const response = await this.privatePostV5AccountNoConvertRepay(this.extend(request, params));
|
|
7516
7513
|
//
|
|
7517
7514
|
// {
|
|
7518
7515
|
// "retCode": 0,
|
|
7519
7516
|
// "retMsg": "success",
|
|
7520
7517
|
// "result": {
|
|
7521
|
-
//
|
|
7518
|
+
// "resultStatus": "SU"
|
|
7522
7519
|
// },
|
|
7523
|
-
// "retExtInfo":
|
|
7524
|
-
// "time":
|
|
7520
|
+
// "retExtInfo": {},
|
|
7521
|
+
// "time": 1763195201119
|
|
7525
7522
|
// }
|
|
7526
7523
|
//
|
|
7527
7524
|
const result = this.safeDict(response, 'result', {});
|
|
7528
7525
|
const transaction = this.parseMarginLoan(result, currency);
|
|
7529
7526
|
return this.extend(transaction, {
|
|
7530
|
-
'symbol': undefined,
|
|
7531
7527
|
'amount': amount,
|
|
7532
7528
|
});
|
|
7533
7529
|
}
|
|
@@ -7536,19 +7532,21 @@ export default class bybit extends Exchange {
|
|
|
7536
7532
|
// borrowCrossMargin
|
|
7537
7533
|
//
|
|
7538
7534
|
// {
|
|
7539
|
-
// "
|
|
7535
|
+
// "coin": "BTC",
|
|
7536
|
+
// "amount": "0.001"
|
|
7540
7537
|
// }
|
|
7541
7538
|
//
|
|
7542
7539
|
// repayCrossMargin
|
|
7543
7540
|
//
|
|
7544
7541
|
// {
|
|
7545
|
-
// "
|
|
7542
|
+
// "resultStatus": "SU"
|
|
7546
7543
|
// }
|
|
7547
7544
|
//
|
|
7545
|
+
const currencyId = this.safeString(info, 'coin');
|
|
7548
7546
|
return {
|
|
7549
|
-
'id':
|
|
7550
|
-
'currency': this.
|
|
7551
|
-
'amount':
|
|
7547
|
+
'id': undefined,
|
|
7548
|
+
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
7549
|
+
'amount': this.safeString(info, 'amount'),
|
|
7552
7550
|
'symbol': undefined,
|
|
7553
7551
|
'timestamp': undefined,
|
|
7554
7552
|
'datetime': undefined,
|
package/js/src/deribit.js
CHANGED
|
@@ -2334,6 +2334,12 @@ export default class deribit extends Exchange {
|
|
|
2334
2334
|
const request = {};
|
|
2335
2335
|
let market = undefined;
|
|
2336
2336
|
let response = undefined;
|
|
2337
|
+
if (limit !== undefined) {
|
|
2338
|
+
request['count'] = limit;
|
|
2339
|
+
}
|
|
2340
|
+
else {
|
|
2341
|
+
request['count'] = 1000; // max value
|
|
2342
|
+
}
|
|
2337
2343
|
if (symbol === undefined) {
|
|
2338
2344
|
const code = this.codeFromOptions('fetchClosedOrders', params);
|
|
2339
2345
|
const currency = this.currency(code);
|
package/js/src/dydx.d.ts
ADDED
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import Exchange from './abstract/dydx.js';
|
|
2
|
+
import type { Int, Market, Dict, int, Trade, OHLCV, Balances, Str, FundingRateHistory, Order, OrderSide, OrderType, Strings, Num, Position, OrderBook, Currency, LedgerEntry, TransferEntry, Transaction, Account } from './base/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* @class dydx
|
|
5
|
+
* @augments Exchange
|
|
6
|
+
*/
|
|
7
|
+
export default class dydx extends Exchange {
|
|
8
|
+
describe(): any;
|
|
9
|
+
/**
|
|
10
|
+
* @method
|
|
11
|
+
* @name dydx#fetchTime
|
|
12
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
13
|
+
* @see https://docs.dydx.xyz/indexer-client/http#get-time
|
|
14
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
15
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
16
|
+
*/
|
|
17
|
+
fetchTime(params?: {}): Promise<Int>;
|
|
18
|
+
parseMarket(market: Dict): Market;
|
|
19
|
+
/**
|
|
20
|
+
* @method
|
|
21
|
+
* @name dydx#fetchMarkets
|
|
22
|
+
* @description retrieves data on all markets for hyperliquid
|
|
23
|
+
* @see https://docs.dydx.xyz/indexer-client/http#get-perpetual-markets
|
|
24
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
25
|
+
* @returns {object[]} an array of objects representing market data
|
|
26
|
+
*/
|
|
27
|
+
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
28
|
+
parseTrade(trade: Dict, market?: Market): Trade;
|
|
29
|
+
/**
|
|
30
|
+
* @method
|
|
31
|
+
* @name dydx#fetchTrades
|
|
32
|
+
* @description get the list of most recent trades for a particular symbol
|
|
33
|
+
* @see https://developer.woox.io/api-reference/endpoint/public_data/marketTrades
|
|
34
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
35
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
36
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
37
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
38
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
39
|
+
*/
|
|
40
|
+
fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
41
|
+
parseOHLCV(ohlcv: any, market?: Market): OHLCV;
|
|
42
|
+
/**
|
|
43
|
+
* @method
|
|
44
|
+
* @name dydx#fetchOHLCV
|
|
45
|
+
* @see https://docs.dydx.xyz/indexer-client/http#get-candles
|
|
46
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
47
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
48
|
+
* @param {string} timeframe the length of time each candle represents
|
|
49
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
50
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
51
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
52
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
53
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
54
|
+
*/
|
|
55
|
+
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
56
|
+
/**
|
|
57
|
+
* @method
|
|
58
|
+
* @name dydx#fetchFundingRateHistory
|
|
59
|
+
* @description fetches historical funding rate prices
|
|
60
|
+
* @see https://docs.dydx.xyz/indexer-client/http#get-historical-funding
|
|
61
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
62
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
63
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
64
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
65
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
66
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
67
|
+
*/
|
|
68
|
+
fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
|
|
69
|
+
handlePublicAddress(methodName: string, params: Dict): any[];
|
|
70
|
+
parseOrder(order: Dict, market?: Market): Order;
|
|
71
|
+
parseOrderStatus(status: Str): string;
|
|
72
|
+
parseOrderType(type: Str): string;
|
|
73
|
+
/**
|
|
74
|
+
* @method
|
|
75
|
+
* @name dydx#fetchOrder
|
|
76
|
+
* @description fetches information on an order made by the user
|
|
77
|
+
* @see https://docs.dydx.xyz/indexer-client/http#get-order
|
|
78
|
+
* @param {string} id the order id
|
|
79
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
80
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
81
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
82
|
+
*/
|
|
83
|
+
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
84
|
+
/**
|
|
85
|
+
* @method
|
|
86
|
+
* @name dydx#fetchOrders
|
|
87
|
+
* @description fetches information on multiple orders made by the user
|
|
88
|
+
* @see https://docs.dydx.xyz/indexer-client/http#list-orders
|
|
89
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
90
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
91
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
92
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
93
|
+
* @param {string} [params.address] wallet address that made trades
|
|
94
|
+
* @param {string} [params.subAccountNumber] sub account number
|
|
95
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
96
|
+
*/
|
|
97
|
+
fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
98
|
+
/**
|
|
99
|
+
* @method
|
|
100
|
+
* @name dydx#fetchOpenOrders
|
|
101
|
+
* @description fetch all unfilled currently open orders
|
|
102
|
+
* @see https://docs.dydx.xyz/indexer-client/http#list-orders
|
|
103
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
104
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
105
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
106
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
107
|
+
* @param {string} [params.address] wallet address that made trades
|
|
108
|
+
* @param {string} [params.subAccountNumber] sub account number
|
|
109
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
110
|
+
*/
|
|
111
|
+
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
112
|
+
/**
|
|
113
|
+
* @method
|
|
114
|
+
* @name dydx#fetchClosedOrders
|
|
115
|
+
* @description fetches information on multiple closed orders made by the user
|
|
116
|
+
* @see https://docs.dydx.xyz/indexer-client/http#list-orders
|
|
117
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
118
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
119
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
120
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
121
|
+
* @param {string} [params.address] wallet address that made trades
|
|
122
|
+
* @param {string} [params.subAccountNumber] sub account number
|
|
123
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
124
|
+
*/
|
|
125
|
+
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
126
|
+
parsePosition(position: Dict, market?: Market): Position;
|
|
127
|
+
/**
|
|
128
|
+
* @method
|
|
129
|
+
* @name dydx#fetchPosition
|
|
130
|
+
* @description fetch data on an open position
|
|
131
|
+
* @see https://docs.dydx.xyz/indexer-client/http#list-positions
|
|
132
|
+
* @param {string} symbol unified market symbol of the market the position is held in
|
|
133
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
134
|
+
* @param {string} [params.address] wallet address that made trades
|
|
135
|
+
* @param {string} [params.subAccountNumber] sub account number
|
|
136
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
137
|
+
*/
|
|
138
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
139
|
+
/**
|
|
140
|
+
* @method
|
|
141
|
+
* @name dydx#fetchPositions
|
|
142
|
+
* @description fetch all open positions
|
|
143
|
+
* @see https://docs.dydx.xyz/indexer-client/http#list-positions
|
|
144
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
145
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
146
|
+
* @param {string} [params.address] wallet address that made trades
|
|
147
|
+
* @param {string} [params.subAccountNumber] sub account number
|
|
148
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
149
|
+
*/
|
|
150
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
151
|
+
hashMessage(message: any): any;
|
|
152
|
+
signHash(hash: any, privateKey: any): {
|
|
153
|
+
r: string;
|
|
154
|
+
s: string;
|
|
155
|
+
v: any;
|
|
156
|
+
};
|
|
157
|
+
signMessage(message: any, privateKey: any): {
|
|
158
|
+
r: string;
|
|
159
|
+
s: string;
|
|
160
|
+
v: any;
|
|
161
|
+
};
|
|
162
|
+
signOnboardingAction(): object;
|
|
163
|
+
signDydxTx(privateKey: string, message: any, memo: string, chainId: string, account: any, authenticators: any, fee?: any): string;
|
|
164
|
+
retrieveCredentials(): any;
|
|
165
|
+
fetchDydxAccount(): Promise<import("./base/types.js").Dictionary<any>>;
|
|
166
|
+
pow(n: string, m: string): string;
|
|
167
|
+
createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): any[];
|
|
168
|
+
createOrderIdFromParts(address: string, subAccountNumber: number, clientOrderId: number, orderFlags: number, clobPairId: number): string;
|
|
169
|
+
fetchLatestBlockHeight(params?: {}): Promise<int>;
|
|
170
|
+
/**
|
|
171
|
+
* @method
|
|
172
|
+
* @name dydx#createOrder
|
|
173
|
+
* @see https://docs.dydx.xyz/interaction/trading#place-an-order
|
|
174
|
+
* @description create a trade order
|
|
175
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
176
|
+
* @param {string} type 'market' or 'limit'
|
|
177
|
+
* @param {string} side 'buy' or 'sell'
|
|
178
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
179
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
180
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
181
|
+
* @param {string} [params.timeInForce] "GTT", "IOC", or "PO"
|
|
182
|
+
* @param {float} [params.triggerPrice] The price a trigger order is triggered at
|
|
183
|
+
* @param {float} [params.stopLossPrice] price for a stoploss order
|
|
184
|
+
* @param {float} [params.takeProfitPrice] price for a takeprofit order
|
|
185
|
+
* @param {string} [params.clientOrderId] a unique id for the order
|
|
186
|
+
* @param {bool} [params.postOnly] true or false whether the order is post-only
|
|
187
|
+
* @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
|
|
188
|
+
* @param {float} [params.goodTillBlock] expired block number for the order, required for market order and non limit GTT order, default value is latestBlockHeight + 20
|
|
189
|
+
* @param {float} [params.goodTillBlockTimeInSeconds] expired time elapsed for the order, required for limit GTT order and conditional, default value is 30 days
|
|
190
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
191
|
+
*/
|
|
192
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
193
|
+
/**
|
|
194
|
+
* @method
|
|
195
|
+
* @name dydx#cancelOrder
|
|
196
|
+
* @description cancels an open order
|
|
197
|
+
* @see https://docs.dydx.xyz/interaction/trading/#cancel-an-order
|
|
198
|
+
* @param {string} id it should be the clientOrderId in this case
|
|
199
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
200
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
201
|
+
* @param {string} [params.clientOrderId] client order id used when creating the order
|
|
202
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
203
|
+
* @param {float} [params.orderFlags] default is 64, orderFlags for the order, market order and non limit GTT order is 0, limit GTT order is 64 and conditional order is 32
|
|
204
|
+
* @param {float} [params.goodTillBlock] expired block number for the order, required for market order and non limit GTT order (orderFlags = 0), default value is latestBlockHeight + 20
|
|
205
|
+
* @param {float} [params.goodTillBlockTimeInSeconds] expired time elapsed for the order, required for limit GTT order and conditional (orderFlagss > 0), default value is 30 days
|
|
206
|
+
* @param {int} [params.subAccountId] sub account id, default is 0
|
|
207
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
208
|
+
*/
|
|
209
|
+
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
210
|
+
/**
|
|
211
|
+
* @method
|
|
212
|
+
* @name dydx#cancelOrders
|
|
213
|
+
* @description cancel multiple orders
|
|
214
|
+
* @param {string[]} ids order ids
|
|
215
|
+
* @param {string} [symbol] unified market symbol
|
|
216
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
217
|
+
* @param {string[]} [params.clientOrderIds] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
|
|
218
|
+
* @param {int} [params.subAccountId] sub account id, default is 0
|
|
219
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
220
|
+
*/
|
|
221
|
+
cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise<Order[]>;
|
|
222
|
+
/**
|
|
223
|
+
* @method
|
|
224
|
+
* @name dydx#fetchOrderBook
|
|
225
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
226
|
+
* @see https://docs.dydx.xyz/indexer-client/http#get-perpetual-market-orderbook
|
|
227
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
228
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
229
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
230
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
231
|
+
*/
|
|
232
|
+
fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
233
|
+
parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
|
|
234
|
+
parseLedgerEntryType(type: any): string;
|
|
235
|
+
/**
|
|
236
|
+
* @method
|
|
237
|
+
* @name dydx#fetchLedger
|
|
238
|
+
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
239
|
+
* @see https://docs.dydx.xyz/indexer-client/http#get-transfers
|
|
240
|
+
* @param {string} [code] unified currency code, default is undefined
|
|
241
|
+
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
242
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
243
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
244
|
+
* @param {string} [params.address] wallet address that made trades
|
|
245
|
+
* @param {string} [params.subAccountNumber] sub account number
|
|
246
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
247
|
+
*/
|
|
248
|
+
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
249
|
+
estimateTxFee(message: any, memo: string, account: any): Promise<any>;
|
|
250
|
+
/**
|
|
251
|
+
* @method
|
|
252
|
+
* @name dydx#transfer
|
|
253
|
+
* @description transfer currency internally between wallets on the same account
|
|
254
|
+
* @param {string} code unified currency code
|
|
255
|
+
* @param {float} amount amount to transfer
|
|
256
|
+
* @param {string} fromAccount account to transfer from *main, subaccount*
|
|
257
|
+
* @param {string} toAccount account to transfer to *subaccount, address*
|
|
258
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
259
|
+
* @param {string} [params.vaultAddress] the vault address for order
|
|
260
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
261
|
+
*/
|
|
262
|
+
transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
|
|
263
|
+
parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
|
|
264
|
+
/**
|
|
265
|
+
* @method
|
|
266
|
+
* @name dydx#fetchTransfers
|
|
267
|
+
* @description fetch a history of internal transfers made on an account
|
|
268
|
+
* @see https://docs.dydx.xyz/indexer-client/http#get-transfers
|
|
269
|
+
* @param {string} code unified currency code of the currency transferred
|
|
270
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
271
|
+
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
272
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
273
|
+
* @param {string} [params.address] wallet address that made trades
|
|
274
|
+
* @param {string} [params.subAccountNumber] sub account number
|
|
275
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
276
|
+
*/
|
|
277
|
+
fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<TransferEntry[]>;
|
|
278
|
+
parseTransaction(transaction: Dict, currency?: Currency): Transaction;
|
|
279
|
+
/**
|
|
280
|
+
* @method
|
|
281
|
+
* @name dydx#withdraw
|
|
282
|
+
* @description make a withdrawal
|
|
283
|
+
* @param {string} code unified currency code
|
|
284
|
+
* @param {float} amount the amount to withdraw
|
|
285
|
+
* @param {string} address the address to withdraw to
|
|
286
|
+
* @param {string} tag
|
|
287
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
288
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
289
|
+
*/
|
|
290
|
+
withdraw(code: string, amount: number, address: string, tag?: Str, params?: {}): Promise<Transaction>;
|
|
291
|
+
/**
|
|
292
|
+
* @method
|
|
293
|
+
* @name dydx#fetchWithdrawals
|
|
294
|
+
* @description fetch all withdrawals made from an account
|
|
295
|
+
* @see https://docs.dydx.xyz/indexer-client/http#get-transfers
|
|
296
|
+
* @param {string} code unified currency code
|
|
297
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
298
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
299
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
300
|
+
* @param {string} [params.address] wallet address that made trades
|
|
301
|
+
* @param {string} [params.subAccountNumber] sub account number
|
|
302
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
303
|
+
*/
|
|
304
|
+
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
305
|
+
/**
|
|
306
|
+
* @method
|
|
307
|
+
* @name dydx#fetchDeposits
|
|
308
|
+
* @description fetch all deposits made to an account
|
|
309
|
+
* @see https://docs.dydx.xyz/indexer-client/http#get-transfers
|
|
310
|
+
* @param {string} code unified currency code
|
|
311
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
312
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
313
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
314
|
+
* @param {string} [params.address] wallet address that made trades
|
|
315
|
+
* @param {string} [params.subAccountNumber] sub account number
|
|
316
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
317
|
+
*/
|
|
318
|
+
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
319
|
+
/**
|
|
320
|
+
* @method
|
|
321
|
+
* @name dydx#fetchDepositsWithdrawals
|
|
322
|
+
* @description fetch history of deposits and withdrawals
|
|
323
|
+
* @see https://docs.dydx.xyz/indexer-client/http#get-transfers
|
|
324
|
+
* @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
|
|
325
|
+
* @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
|
|
326
|
+
* @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
|
|
327
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
328
|
+
* @param {string} [params.address] wallet address that made trades
|
|
329
|
+
* @param {string} [params.subAccountNumber] sub account number
|
|
330
|
+
* @returns {object} a list of [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
331
|
+
*/
|
|
332
|
+
fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
333
|
+
fetchTransactionsHelper(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any[]>;
|
|
334
|
+
/**
|
|
335
|
+
* @method
|
|
336
|
+
* @name dydx#fetchAccounts
|
|
337
|
+
* @description fetch all the accounts associated with a profile
|
|
338
|
+
* @see https://docs.dydx.xyz/indexer-client/http#get-subaccounts
|
|
339
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
340
|
+
* @param {string} [params.address] wallet address that made trades
|
|
341
|
+
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
342
|
+
*/
|
|
343
|
+
fetchAccounts(params?: {}): Promise<Account[]>;
|
|
344
|
+
/**
|
|
345
|
+
* @method
|
|
346
|
+
* @name dydx#fetchBalance
|
|
347
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
348
|
+
* @see https://docs.dydx.xyz/indexer-client/http#get-subaccount
|
|
349
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
350
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
351
|
+
*/
|
|
352
|
+
fetchBalance(params?: {}): Promise<Balances>;
|
|
353
|
+
parseBalance(response: any): Balances;
|
|
354
|
+
nonce(): number;
|
|
355
|
+
getWalletAddress(): string;
|
|
356
|
+
sign(path: any, section?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
357
|
+
url: string;
|
|
358
|
+
method: string;
|
|
359
|
+
body: any;
|
|
360
|
+
headers: any;
|
|
361
|
+
};
|
|
362
|
+
handleErrors(httpCode: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
|
|
363
|
+
setSandboxMode(enable: boolean): void;
|
|
364
|
+
}
|