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/base/Exchange.js
CHANGED
|
@@ -28,16 +28,26 @@ import { getStarkKey, ethSigToPrivate, sign as starknetCurveSign } from '../stat
|
|
|
28
28
|
import init, * as zklink from '../static_dependencies/zklink/zklink-sdk-web.js';
|
|
29
29
|
import * as Starknet from '../static_dependencies/starknet/index.js';
|
|
30
30
|
import { sha256 } from '../static_dependencies/noble-hashes/sha256.js';
|
|
31
|
+
import { sha1 } from '../static_dependencies/noble-hashes/sha1.js';
|
|
32
|
+
import { exportMnemonicAndPrivateKey, deriveHDKeyFromMnemonic } from '../static_dependencies/dydx-v4-client/onboarding.js';
|
|
33
|
+
import { Long } from '../static_dependencies/dydx-v4-client/helpers.js';
|
|
31
34
|
const { isNode, selfIsDefined, deepExtend, extend, clone, flatten, unique, indexBy, sortBy, sortBy2, safeFloat2, groupBy, aggregate, uuid, unCamelCase, precisionFromString, Throttler, capitalize, now, decimalToPrecision, safeValue, safeValue2, safeString, safeString2, seconds, milliseconds, binaryToBase16, numberToBE, base16ToBinary, iso8601, omit, isJsonEncodedObject, safeInteger, sum, omitZero, implodeParams, extractParams, json, merge, binaryConcat, hash,
|
|
32
35
|
// ecdsa,
|
|
33
36
|
arrayConcat, encode, urlencode, hmac, numberToString, roundTimeframe, parseTimeframe, safeInteger2, safeStringLower, parse8601, yyyymmdd, safeStringUpper, safeTimestamp, binaryConcatArray, uuidv1, numberToLE, ymdhms, stringToBase64, decode, uuid22, safeIntegerProduct2, safeIntegerProduct, safeStringLower2, yymmdd, base58ToBinary, binaryToBase58, safeTimestamp2, rawencode, keysort, sort, inArray, isEmpty, ordered, filterBy, uuid16, safeFloat, base64ToBinary, safeStringUpper2, urlencodeWithArrayRepeat, microseconds, binaryToBase64, strip, toArray, safeFloatN, safeIntegerN, safeIntegerProductN, safeTimestampN, safeValueN, safeStringN, safeStringLowerN, safeStringUpperN, urlencodeNested, urlencodeBase64, parseDate, ymd, base64ToString, crc32, packb, TRUNCATE, ROUND, DECIMAL_PLACES, NO_PADDING, TICK_SIZE, SIGNIFICANT_DIGITS, sleep, } = functions;
|
|
34
37
|
// ----------------------------------------------------------------------------
|
|
35
38
|
let protobufMexc = undefined;
|
|
39
|
+
let encodeAsAny = undefined;
|
|
40
|
+
let AuthInfo = undefined;
|
|
41
|
+
let Tx = undefined;
|
|
42
|
+
let TxBody = undefined;
|
|
43
|
+
let TxRaw = undefined;
|
|
44
|
+
let SignDoc = undefined;
|
|
45
|
+
let SignMode = undefined;
|
|
36
46
|
(async () => {
|
|
37
47
|
try {
|
|
38
48
|
protobufMexc = await import('../protobuf/mexc/compiled.cjs');
|
|
39
49
|
}
|
|
40
|
-
catch {
|
|
50
|
+
catch (e) {
|
|
41
51
|
// TODO: handle error
|
|
42
52
|
}
|
|
43
53
|
})();
|
|
@@ -369,6 +379,29 @@ export default class Exchange {
|
|
|
369
379
|
this.setSandboxMode(true);
|
|
370
380
|
}
|
|
371
381
|
}
|
|
382
|
+
uuid5(namespace, name) {
|
|
383
|
+
const nsBytes = namespace
|
|
384
|
+
.replace(/-/g, '')
|
|
385
|
+
.match(/.{1,2}/g)
|
|
386
|
+
.map((byte) => parseInt(byte, 16));
|
|
387
|
+
const nameBytes = new TextEncoder().encode(name);
|
|
388
|
+
const data = new Uint8Array([...nsBytes, ...nameBytes]);
|
|
389
|
+
const nsHash = sha1(data);
|
|
390
|
+
// eslint-disable-next-line
|
|
391
|
+
nsHash[6] = (nsHash[6] & 0x0f) | 0x50;
|
|
392
|
+
// eslint-disable-next-line
|
|
393
|
+
nsHash[8] = (nsHash[8] & 0x3f) | 0x80;
|
|
394
|
+
const hex = [...nsHash.slice(0, 16)]
|
|
395
|
+
.map((b) => b.toString(16).padStart(2, '0'))
|
|
396
|
+
.join('');
|
|
397
|
+
return [
|
|
398
|
+
hex.substring(0, 8),
|
|
399
|
+
hex.substring(8, 12),
|
|
400
|
+
hex.substring(12, 16),
|
|
401
|
+
hex.substring(16, 20),
|
|
402
|
+
hex.substring(20, 32),
|
|
403
|
+
].join('-');
|
|
404
|
+
}
|
|
372
405
|
encodeURIComponent(...args) {
|
|
373
406
|
// @ts-expect-error
|
|
374
407
|
return encodeURIComponent(...args);
|
|
@@ -1342,6 +1375,128 @@ export default class Exchange {
|
|
|
1342
1375
|
const zkSign = tx?.signature?.signature;
|
|
1343
1376
|
return zkSign;
|
|
1344
1377
|
}
|
|
1378
|
+
async loadDydxProtos() {
|
|
1379
|
+
// load dydx protos
|
|
1380
|
+
const tasks = [
|
|
1381
|
+
import('../static_dependencies/dydx-v4-client/registry.js'),
|
|
1382
|
+
import('../static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.js'),
|
|
1383
|
+
import('../static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.js'),
|
|
1384
|
+
];
|
|
1385
|
+
const modules = await Promise.all(tasks);
|
|
1386
|
+
encodeAsAny = modules[0].encodeAsAny;
|
|
1387
|
+
AuthInfo = modules[1].AuthInfo;
|
|
1388
|
+
Tx = modules[1].Tx;
|
|
1389
|
+
TxBody = modules[1].TxBody;
|
|
1390
|
+
TxRaw = modules[1].TxRaw;
|
|
1391
|
+
SignDoc = modules[1].SignDoc;
|
|
1392
|
+
SignMode = modules[2].SignMode;
|
|
1393
|
+
}
|
|
1394
|
+
toDydxLong(numStr) {
|
|
1395
|
+
return Long.fromString(numStr);
|
|
1396
|
+
}
|
|
1397
|
+
retrieveDydxCredentials(entropy) {
|
|
1398
|
+
let credentials = undefined;
|
|
1399
|
+
if (entropy.indexOf(' ') > 0) {
|
|
1400
|
+
credentials = deriveHDKeyFromMnemonic(entropy);
|
|
1401
|
+
credentials['mnemonic'] = entropy;
|
|
1402
|
+
return credentials;
|
|
1403
|
+
}
|
|
1404
|
+
credentials = exportMnemonicAndPrivateKey(this.base16ToBinary(entropy));
|
|
1405
|
+
return credentials;
|
|
1406
|
+
}
|
|
1407
|
+
encodeDydxTxForSimulation(message, memo, sequence, publicKey) {
|
|
1408
|
+
if (!encodeAsAny) {
|
|
1409
|
+
throw new NotSupported(this.id + ' requires protobuf to encode messages, please install it with `npm install protobufjs`');
|
|
1410
|
+
}
|
|
1411
|
+
if (!publicKey) {
|
|
1412
|
+
throw new Error('Public key cannot be undefined');
|
|
1413
|
+
}
|
|
1414
|
+
const messages = [message];
|
|
1415
|
+
const encodedMessages = messages.map((msg) => encodeAsAny(msg));
|
|
1416
|
+
const tx = Tx.fromPartial({
|
|
1417
|
+
'body': TxBody.fromPartial({
|
|
1418
|
+
'messages': encodedMessages,
|
|
1419
|
+
'memo': memo,
|
|
1420
|
+
}),
|
|
1421
|
+
'authInfo': AuthInfo.fromPartial({
|
|
1422
|
+
'fee': {},
|
|
1423
|
+
'signerInfos': [
|
|
1424
|
+
{
|
|
1425
|
+
'publicKey': encodeAsAny({
|
|
1426
|
+
'typeUrl': '/cosmos.crypto.secp256k1.PubKey',
|
|
1427
|
+
'value': publicKey,
|
|
1428
|
+
}),
|
|
1429
|
+
'sequence': sequence,
|
|
1430
|
+
'modeInfo': { 'single': { 'mode': SignMode.SIGN_MODE_UNSPECIFIED } },
|
|
1431
|
+
},
|
|
1432
|
+
],
|
|
1433
|
+
}),
|
|
1434
|
+
'signatures': [new Uint8Array()],
|
|
1435
|
+
});
|
|
1436
|
+
return this.binaryToBase64(Tx.encode(tx).finish());
|
|
1437
|
+
}
|
|
1438
|
+
encodeDydxTxForSigning(message, memo, chainId, account, authenticators, fee = undefined) {
|
|
1439
|
+
if (!encodeAsAny) {
|
|
1440
|
+
throw new NotSupported(this.id + ' requires protobuf to encode messages, please install it with `npm install protobufjs`');
|
|
1441
|
+
}
|
|
1442
|
+
if (!account.pub_key) {
|
|
1443
|
+
throw new Error('Public key cannot be undefined');
|
|
1444
|
+
}
|
|
1445
|
+
const messages = [message];
|
|
1446
|
+
const sequence = this.milliseconds();
|
|
1447
|
+
if (fee === undefined) {
|
|
1448
|
+
fee = {
|
|
1449
|
+
'amount': [],
|
|
1450
|
+
'gasLimit': 1000000,
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
const encodedMessages = messages.map((msg) => encodeAsAny(msg));
|
|
1454
|
+
const nonCriticalExtensionOptions = [
|
|
1455
|
+
encodeAsAny({
|
|
1456
|
+
'typeUrl': '/dydxprotocol.accountplus.TxExtension',
|
|
1457
|
+
'value': {
|
|
1458
|
+
'selectedAuthenticators': authenticators ?? [],
|
|
1459
|
+
},
|
|
1460
|
+
}),
|
|
1461
|
+
];
|
|
1462
|
+
const txBodyBytes = TxBody.encode(TxBody.fromPartial({
|
|
1463
|
+
'messages': encodedMessages,
|
|
1464
|
+
'memo': memo,
|
|
1465
|
+
'extensionOptions': [],
|
|
1466
|
+
'nonCriticalExtensionOptions': nonCriticalExtensionOptions,
|
|
1467
|
+
})).finish();
|
|
1468
|
+
const authInfoBytes = AuthInfo.encode(AuthInfo.fromPartial({
|
|
1469
|
+
'fee': fee,
|
|
1470
|
+
'signerInfos': [
|
|
1471
|
+
{
|
|
1472
|
+
'publicKey': encodeAsAny({
|
|
1473
|
+
'typeUrl': '/cosmos.crypto.secp256k1.PubKey',
|
|
1474
|
+
'value': account.pub_key,
|
|
1475
|
+
}),
|
|
1476
|
+
'sequence': sequence,
|
|
1477
|
+
'modeInfo': { 'single': { 'mode': SignMode.SIGN_MODE_DIRECT } },
|
|
1478
|
+
},
|
|
1479
|
+
],
|
|
1480
|
+
})).finish();
|
|
1481
|
+
const signDoc = SignDoc.fromPartial({
|
|
1482
|
+
'accountNumber': account.account_number,
|
|
1483
|
+
'authInfoBytes': authInfoBytes,
|
|
1484
|
+
'bodyBytes': txBodyBytes,
|
|
1485
|
+
'chainId': chainId,
|
|
1486
|
+
});
|
|
1487
|
+
const signingHash = this.hash(SignDoc.encode(signDoc).finish(), sha256, 'hex');
|
|
1488
|
+
return [signingHash, signDoc];
|
|
1489
|
+
}
|
|
1490
|
+
encodeDydxTxRaw(signDoc, signature) {
|
|
1491
|
+
if (!encodeAsAny) {
|
|
1492
|
+
throw new NotSupported(this.id + ' requires protobuf to encode messages, please install it with `npm install protobufjs`');
|
|
1493
|
+
}
|
|
1494
|
+
return '0x' + this.binaryToBase16(TxRaw.encode(TxRaw.fromPartial({
|
|
1495
|
+
'bodyBytes': signDoc.bodyBytes,
|
|
1496
|
+
'authInfoBytes': signDoc.authInfoBytes,
|
|
1497
|
+
'signatures': [this.base16ToBinary(signature)],
|
|
1498
|
+
})).finish());
|
|
1499
|
+
}
|
|
1345
1500
|
intToBase16(elem) {
|
|
1346
1501
|
return elem.toString(16);
|
|
1347
1502
|
}
|
|
@@ -3123,6 +3278,7 @@ export default class Exchange {
|
|
|
3123
3278
|
this.symbols = sourceExchange.symbols;
|
|
3124
3279
|
this.ids = sourceExchange.ids;
|
|
3125
3280
|
this.currencies = sourceExchange.currencies;
|
|
3281
|
+
this.currencies_by_id = sourceExchange.currencies_by_id;
|
|
3126
3282
|
this.baseCurrencies = sourceExchange.baseCurrencies;
|
|
3127
3283
|
this.quoteCurrencies = sourceExchange.quoteCurrencies;
|
|
3128
3284
|
this.codes = sourceExchange.codes;
|
|
@@ -4849,10 +5005,6 @@ export default class Exchange {
|
|
|
4849
5005
|
});
|
|
4850
5006
|
}
|
|
4851
5007
|
safeMarket(marketId = undefined, market = undefined, delimiter = undefined, marketType = undefined) {
|
|
4852
|
-
const result = this.safeMarketStructure({
|
|
4853
|
-
'symbol': marketId,
|
|
4854
|
-
'marketId': marketId,
|
|
4855
|
-
});
|
|
4856
5008
|
if (marketId !== undefined) {
|
|
4857
5009
|
if ((this.markets_by_id !== undefined) && (marketId in this.markets_by_id)) {
|
|
4858
5010
|
const markets = this.markets_by_id[marketId];
|
|
@@ -4880,23 +5032,24 @@ export default class Exchange {
|
|
|
4880
5032
|
else if (delimiter !== undefined && delimiter !== '') {
|
|
4881
5033
|
const parts = marketId.split(delimiter);
|
|
4882
5034
|
const partsLength = parts.length;
|
|
5035
|
+
const result = this.safeMarketStructure({
|
|
5036
|
+
'symbol': marketId,
|
|
5037
|
+
'marketId': marketId,
|
|
5038
|
+
});
|
|
4883
5039
|
if (partsLength === 2) {
|
|
4884
5040
|
result['baseId'] = this.safeString(parts, 0);
|
|
4885
5041
|
result['quoteId'] = this.safeString(parts, 1);
|
|
4886
5042
|
result['base'] = this.safeCurrencyCode(result['baseId']);
|
|
4887
5043
|
result['quote'] = this.safeCurrencyCode(result['quoteId']);
|
|
4888
5044
|
result['symbol'] = result['base'] + '/' + result['quote'];
|
|
4889
|
-
return result;
|
|
4890
|
-
}
|
|
4891
|
-
else {
|
|
4892
|
-
return result;
|
|
4893
5045
|
}
|
|
5046
|
+
return result;
|
|
4894
5047
|
}
|
|
4895
5048
|
}
|
|
4896
5049
|
if (market !== undefined) {
|
|
4897
5050
|
return market;
|
|
4898
5051
|
}
|
|
4899
|
-
return
|
|
5052
|
+
return this.safeMarketStructure({ 'symbol': marketId, 'marketId': marketId });
|
|
4900
5053
|
}
|
|
4901
5054
|
marketOrNull(symbol) {
|
|
4902
5055
|
if (symbol === undefined) {
|
package/js/src/base/ws/Client.js
CHANGED
|
@@ -153,7 +153,9 @@ export default class Client {
|
|
|
153
153
|
if (this.ping) {
|
|
154
154
|
message = this.ping(this);
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
if (this.verbose) {
|
|
157
|
+
this.log(new Date(), 'onPingInterval', '|', this.url);
|
|
158
|
+
}
|
|
157
159
|
if (message) {
|
|
158
160
|
this.send(message).catch((error) => {
|
|
159
161
|
this.onError(error);
|
package/js/src/binance.js
CHANGED
|
@@ -903,6 +903,9 @@ export default class binance extends Exchange {
|
|
|
903
903
|
'symbolConfig': 5,
|
|
904
904
|
'accountConfig': 5,
|
|
905
905
|
'convert/orderStatus': 5,
|
|
906
|
+
'algoOrder': 1,
|
|
907
|
+
'openAlgoOrders': 1,
|
|
908
|
+
'allAlgoOrders': 5,
|
|
906
909
|
},
|
|
907
910
|
'post': {
|
|
908
911
|
'batchOrders': 5,
|
|
@@ -910,6 +913,7 @@ export default class binance extends Exchange {
|
|
|
910
913
|
'positionMargin': 1,
|
|
911
914
|
'marginType': 1,
|
|
912
915
|
'order': 4,
|
|
916
|
+
'order/test': 1,
|
|
913
917
|
'leverage': 1,
|
|
914
918
|
'listenKey': 1,
|
|
915
919
|
'countdownCancelAll': 10,
|
|
@@ -920,6 +924,7 @@ export default class binance extends Exchange {
|
|
|
920
924
|
'feeBurn': 1,
|
|
921
925
|
'convert/getQuote': 200,
|
|
922
926
|
'convert/acceptQuote': 20,
|
|
927
|
+
'algoOrder': 1,
|
|
923
928
|
},
|
|
924
929
|
'put': {
|
|
925
930
|
'listenKey': 1,
|
|
@@ -931,6 +936,8 @@ export default class binance extends Exchange {
|
|
|
931
936
|
'order': 1,
|
|
932
937
|
'allOpenOrders': 1,
|
|
933
938
|
'listenKey': 1,
|
|
939
|
+
'algoOrder': 1,
|
|
940
|
+
'algoOpenOrders': 1,
|
|
934
941
|
},
|
|
935
942
|
},
|
|
936
943
|
'fapiPublicV2': {
|
|
@@ -4061,7 +4068,7 @@ export default class binance extends Exchange {
|
|
|
4061
4068
|
//
|
|
4062
4069
|
// {
|
|
4063
4070
|
// "symbol": "BTCUSDT",
|
|
4064
|
-
// "markPrice": "11793.
|
|
4071
|
+
// "markPrice": "11793.63104562", // mark price
|
|
4065
4072
|
// "indexPrice": "11781.80495970", // index price
|
|
4066
4073
|
// "estimatedSettlePrice": "11781.16138815", // Estimated Settle Price, only useful in the last hour before the settlement starts
|
|
4067
4074
|
// "lastFundingRate": "0.00038246", // This is the lastest estimated funding rate
|
package/js/src/bingx.js
CHANGED
|
@@ -33,6 +33,9 @@ export default class bingx extends Exchange {
|
|
|
33
33
|
'future': false,
|
|
34
34
|
'option': false,
|
|
35
35
|
'addMargin': true,
|
|
36
|
+
'borrowCrossMargin': false,
|
|
37
|
+
'borrowIsolatedMargin': false,
|
|
38
|
+
'borrowMargin': false,
|
|
36
39
|
'cancelAllOrders': true,
|
|
37
40
|
'cancelAllOrdersAfter': true,
|
|
38
41
|
'cancelOrder': true,
|
|
@@ -53,9 +56,18 @@ export default class bingx extends Exchange {
|
|
|
53
56
|
'createTrailingPercentOrder': true,
|
|
54
57
|
'createTriggerOrder': true,
|
|
55
58
|
'editOrder': true,
|
|
59
|
+
'fetchAllGreeks': false,
|
|
56
60
|
'fetchBalance': true,
|
|
61
|
+
'fetchBorrowInterest': false,
|
|
62
|
+
'fetchBorrowRate': false,
|
|
63
|
+
'fetchBorrowRateHistories': false,
|
|
64
|
+
'fetchBorrowRateHistory': false,
|
|
65
|
+
'fetchBorrowRates': false,
|
|
66
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
57
67
|
'fetchCanceledOrders': true,
|
|
58
68
|
'fetchClosedOrders': true,
|
|
69
|
+
'fetchCrossBorrowRate': false,
|
|
70
|
+
'fetchCrossBorrowRates': false,
|
|
59
71
|
'fetchCurrencies': true,
|
|
60
72
|
'fetchDepositAddress': true,
|
|
61
73
|
'fetchDepositAddresses': false,
|
|
@@ -66,6 +78,9 @@ export default class bingx extends Exchange {
|
|
|
66
78
|
'fetchFundingRate': true,
|
|
67
79
|
'fetchFundingRateHistory': true,
|
|
68
80
|
'fetchFundingRates': true,
|
|
81
|
+
'fetchGreeks': false,
|
|
82
|
+
'fetchIsolatedBorrowRate': false,
|
|
83
|
+
'fetchIsolatedBorrowRates': false,
|
|
69
84
|
'fetchLeverage': true,
|
|
70
85
|
'fetchLiquidations': false,
|
|
71
86
|
'fetchMarginAdjustmentHistory': false,
|
|
@@ -79,6 +94,8 @@ export default class bingx extends Exchange {
|
|
|
79
94
|
'fetchOHLCV': true,
|
|
80
95
|
'fetchOpenInterest': true,
|
|
81
96
|
'fetchOpenOrders': true,
|
|
97
|
+
'fetchOption': false,
|
|
98
|
+
'fetchOptionChain': false,
|
|
82
99
|
'fetchOrder': true,
|
|
83
100
|
'fetchOrderBook': true,
|
|
84
101
|
'fetchOrders': true,
|
|
@@ -93,8 +110,11 @@ export default class bingx extends Exchange {
|
|
|
93
110
|
'fetchTrades': true,
|
|
94
111
|
'fetchTradingFee': true,
|
|
95
112
|
'fetchTransfers': true,
|
|
113
|
+
'fetchVolatilityHistory': false,
|
|
96
114
|
'fetchWithdrawals': true,
|
|
97
115
|
'reduceMargin': true,
|
|
116
|
+
'repayCrossMargin': false,
|
|
117
|
+
'repayIsolatedMargin': false,
|
|
98
118
|
'sandbox': true,
|
|
99
119
|
'setLeverage': true,
|
|
100
120
|
'setMargin': true,
|
package/js/src/bitget.d.ts
CHANGED
|
@@ -363,6 +363,7 @@ export default class bitget extends Exchange {
|
|
|
363
363
|
* @name bitget#editOrder
|
|
364
364
|
* @description edit a trade order
|
|
365
365
|
* @see https://www.bitget.com/api-doc/spot/plan/Modify-Plan-Order
|
|
366
|
+
* @see https://www.bitget.com/api-doc/spot/trade/Cancel-Replace-Order
|
|
366
367
|
* @see https://www.bitget.com/api-doc/contract/trade/Modify-Order
|
|
367
368
|
* @see https://www.bitget.com/api-doc/contract/plan/Modify-Tpsl-Order
|
|
368
369
|
* @see https://www.bitget.com/api-doc/contract/plan/Modify-Plan-Order
|
|
@@ -444,9 +445,8 @@ export default class bitget extends Exchange {
|
|
|
444
445
|
* @see https://www.bitget.com/api-doc/spot/trade/Cancel-Symbol-Orders
|
|
445
446
|
* @see https://www.bitget.com/api-doc/spot/plan/Batch-Cancel-Plan-Order
|
|
446
447
|
* @see https://www.bitget.com/api-doc/contract/trade/Batch-Cancel-Orders
|
|
447
|
-
* @see https://
|
|
448
|
-
* @see https://
|
|
449
|
-
* @see https://www.bitget.com/api-doc/uta/trade/Cancel-All-Order
|
|
448
|
+
* @see https://www.bitget.com/api-doc/margin/cross/trade/Cross-Batch-Cancel-Order
|
|
449
|
+
* @see https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Batch-Cancel-Orders
|
|
450
450
|
* @param {string} symbol unified market symbol
|
|
451
451
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
452
452
|
* @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
|
package/js/src/bitget.js
CHANGED
|
@@ -408,6 +408,7 @@ export default class bitget extends Exchange {
|
|
|
408
408
|
'v2/spot/trade/place-plan-order': 1,
|
|
409
409
|
'v2/spot/trade/modify-plan-order': 1,
|
|
410
410
|
'v2/spot/trade/cancel-plan-order': 1,
|
|
411
|
+
'v2/spot/trade/cancel-replace-order': 2,
|
|
411
412
|
'v2/spot/trade/batch-cancel-plan-order': 2,
|
|
412
413
|
'v2/spot/wallet/transfer': 2,
|
|
413
414
|
'v2/spot/wallet/subaccount-transfer': 2,
|
|
@@ -1414,6 +1415,7 @@ export default class bitget extends Exchange {
|
|
|
1414
1415
|
'spot': {
|
|
1415
1416
|
'1m': '1min',
|
|
1416
1417
|
'5m': '5min',
|
|
1418
|
+
'3m': '3min',
|
|
1417
1419
|
'15m': '15min',
|
|
1418
1420
|
'30m': '30min',
|
|
1419
1421
|
'1h': '1h',
|
|
@@ -1476,6 +1478,7 @@ export default class bitget extends Exchange {
|
|
|
1476
1478
|
'15m': 30,
|
|
1477
1479
|
'30m': 30,
|
|
1478
1480
|
'1h': 60,
|
|
1481
|
+
'2h': 120,
|
|
1479
1482
|
'4h': 240,
|
|
1480
1483
|
'6h': 360,
|
|
1481
1484
|
'12h': 720,
|
|
@@ -4246,11 +4249,17 @@ export default class bitget extends Exchange {
|
|
|
4246
4249
|
request['startTime'] = since;
|
|
4247
4250
|
if (!untilDefined) {
|
|
4248
4251
|
calculatedEndTime = this.sum(calculatedStartTime, limitMultipliedDuration);
|
|
4252
|
+
if (calculatedEndTime > now) {
|
|
4253
|
+
calculatedEndTime = now;
|
|
4254
|
+
}
|
|
4249
4255
|
request['endTime'] = calculatedEndTime;
|
|
4250
4256
|
}
|
|
4251
4257
|
}
|
|
4252
4258
|
if (untilDefined) {
|
|
4253
4259
|
calculatedEndTime = until;
|
|
4260
|
+
if (calculatedEndTime > now) {
|
|
4261
|
+
calculatedEndTime = now;
|
|
4262
|
+
}
|
|
4254
4263
|
request['endTime'] = calculatedEndTime;
|
|
4255
4264
|
if (!sinceDefined) {
|
|
4256
4265
|
calculatedStartTime = calculatedEndTime - limitMultipliedDuration;
|
|
@@ -5652,6 +5661,7 @@ export default class bitget extends Exchange {
|
|
|
5652
5661
|
* @name bitget#editOrder
|
|
5653
5662
|
* @description edit a trade order
|
|
5654
5663
|
* @see https://www.bitget.com/api-doc/spot/plan/Modify-Plan-Order
|
|
5664
|
+
* @see https://www.bitget.com/api-doc/spot/trade/Cancel-Replace-Order
|
|
5655
5665
|
* @see https://www.bitget.com/api-doc/contract/trade/Modify-Order
|
|
5656
5666
|
* @see https://www.bitget.com/api-doc/contract/plan/Modify-Tpsl-Order
|
|
5657
5667
|
* @see https://www.bitget.com/api-doc/contract/plan/Modify-Plan-Order
|
|
@@ -5685,8 +5695,16 @@ export default class bitget extends Exchange {
|
|
|
5685
5695
|
await this.loadMarkets();
|
|
5686
5696
|
const market = this.market(symbol);
|
|
5687
5697
|
const request = {
|
|
5688
|
-
|
|
5698
|
+
// 'orderId': id,
|
|
5689
5699
|
};
|
|
5700
|
+
const clientOrderId = this.safeString2(params, 'clientOrderId', 'clientOid');
|
|
5701
|
+
if (clientOrderId !== undefined) {
|
|
5702
|
+
params = this.omit(params, ['clientOrderId']);
|
|
5703
|
+
request['clientOid'] = clientOrderId;
|
|
5704
|
+
}
|
|
5705
|
+
else {
|
|
5706
|
+
request['orderId'] = id;
|
|
5707
|
+
}
|
|
5690
5708
|
const isMarketOrder = type === 'market';
|
|
5691
5709
|
const triggerPrice = this.safeValue2(params, 'stopPrice', 'triggerPrice');
|
|
5692
5710
|
const isTriggerOrder = triggerPrice !== undefined;
|
|
@@ -5704,10 +5722,6 @@ export default class bitget extends Exchange {
|
|
|
5704
5722
|
if (this.sum(isTriggerOrder, isStopLossOrder, isTakeProfitOrder, isTrailingPercentOrder) > 1) {
|
|
5705
5723
|
throw new ExchangeError(this.id + ' editOrder() params can only contain one of triggerPrice, stopLossPrice, takeProfitPrice, trailingPercent');
|
|
5706
5724
|
}
|
|
5707
|
-
const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
|
|
5708
|
-
if (clientOrderId !== undefined) {
|
|
5709
|
-
request['clientOid'] = clientOrderId;
|
|
5710
|
-
}
|
|
5711
5725
|
params = this.omit(params, ['stopPrice', 'triggerType', 'stopLossPrice', 'takeProfitPrice', 'stopLoss', 'takeProfit', 'clientOrderId', 'trailingTriggerPrice', 'trailingPercent']);
|
|
5712
5726
|
let response = undefined;
|
|
5713
5727
|
let productType = undefined;
|
|
@@ -5754,28 +5768,38 @@ export default class bitget extends Exchange {
|
|
|
5754
5768
|
}
|
|
5755
5769
|
}
|
|
5756
5770
|
else if (market['spot']) {
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
}
|
|
5771
|
+
const cost = this.safeString(params, 'cost');
|
|
5772
|
+
params = this.omit(params, 'cost');
|
|
5760
5773
|
const editMarketBuyOrderRequiresPrice = this.safeBool(this.options, 'editMarketBuyOrderRequiresPrice', true);
|
|
5761
|
-
if (editMarketBuyOrderRequiresPrice && isMarketOrder && (side === 'buy')) {
|
|
5762
|
-
if (price === undefined) {
|
|
5763
|
-
throw new InvalidOrder(this.id + ' editOrder() requires price argument for market buy orders on spot markets to calculate the total amount to spend (amount * price), alternatively
|
|
5774
|
+
if ((editMarketBuyOrderRequiresPrice || (cost !== undefined)) && isMarketOrder && (side === 'buy')) {
|
|
5775
|
+
if (price === undefined && cost === undefined) {
|
|
5776
|
+
throw new InvalidOrder(this.id + ' editOrder() requires price argument for market buy orders on spot markets to calculate the total amount to spend (amount * price), alternatively provide `cost` in the params');
|
|
5764
5777
|
}
|
|
5765
5778
|
else {
|
|
5766
5779
|
const amountString = this.numberToString(amount);
|
|
5767
5780
|
const priceString = this.numberToString(price);
|
|
5768
|
-
const
|
|
5769
|
-
request['size'] = this.priceToPrecision(symbol,
|
|
5781
|
+
const finalCost = (cost === undefined) ? (Precise.stringMul(amountString, priceString)) : cost;
|
|
5782
|
+
request['size'] = this.priceToPrecision(symbol, finalCost);
|
|
5770
5783
|
}
|
|
5771
5784
|
}
|
|
5772
5785
|
else {
|
|
5773
5786
|
request['size'] = this.amountToPrecision(symbol, amount);
|
|
5774
5787
|
}
|
|
5775
5788
|
request['orderType'] = type;
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5789
|
+
if (triggerPrice !== undefined) {
|
|
5790
|
+
request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
5791
|
+
request['executePrice'] = this.priceToPrecision(symbol, price);
|
|
5792
|
+
}
|
|
5793
|
+
else {
|
|
5794
|
+
request['price'] = this.priceToPrecision(symbol, price);
|
|
5795
|
+
}
|
|
5796
|
+
if (triggerPrice !== undefined) {
|
|
5797
|
+
response = await this.privateSpotPostV2SpotTradeModifyPlanOrder(this.extend(request, params));
|
|
5798
|
+
}
|
|
5799
|
+
else {
|
|
5800
|
+
request['symbol'] = market['id'];
|
|
5801
|
+
response = await this.privateSpotPostV2SpotTradeCancelReplaceOrder(this.extend(request, params));
|
|
5802
|
+
}
|
|
5779
5803
|
}
|
|
5780
5804
|
else {
|
|
5781
5805
|
if ((!market['swap']) && (!market['future'])) {
|
|
@@ -6178,9 +6202,8 @@ export default class bitget extends Exchange {
|
|
|
6178
6202
|
* @see https://www.bitget.com/api-doc/spot/trade/Cancel-Symbol-Orders
|
|
6179
6203
|
* @see https://www.bitget.com/api-doc/spot/plan/Batch-Cancel-Plan-Order
|
|
6180
6204
|
* @see https://www.bitget.com/api-doc/contract/trade/Batch-Cancel-Orders
|
|
6181
|
-
* @see https://
|
|
6182
|
-
* @see https://
|
|
6183
|
-
* @see https://www.bitget.com/api-doc/uta/trade/Cancel-All-Order
|
|
6205
|
+
* @see https://www.bitget.com/api-doc/margin/cross/trade/Cross-Batch-Cancel-Order
|
|
6206
|
+
* @see https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Batch-Cancel-Orders
|
|
6184
6207
|
* @param {string} symbol unified market symbol
|
|
6185
6208
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6186
6209
|
* @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
|
|
@@ -6232,28 +6255,7 @@ export default class bitget extends Exchange {
|
|
|
6232
6255
|
}
|
|
6233
6256
|
else if (market['spot']) {
|
|
6234
6257
|
if (marginMode !== undefined) {
|
|
6235
|
-
|
|
6236
|
-
response = await this.privateMarginPostMarginV1CrossOrderBatchCancelOrder(this.extend(request, params));
|
|
6237
|
-
}
|
|
6238
|
-
else {
|
|
6239
|
-
response = await this.privateMarginPostMarginV1IsolatedOrderBatchCancelOrder(this.extend(request, params));
|
|
6240
|
-
}
|
|
6241
|
-
//
|
|
6242
|
-
// {
|
|
6243
|
-
// "code": "00000",
|
|
6244
|
-
// "msg": "success",
|
|
6245
|
-
// "requestTime": 1700717155622,
|
|
6246
|
-
// "data": {
|
|
6247
|
-
// "resultList": [
|
|
6248
|
-
// {
|
|
6249
|
-
// "orderId": "1111453253721796609",
|
|
6250
|
-
// "clientOid": "2ae7fc8a4ff949b6b60d770ca3950e2d"
|
|
6251
|
-
// },
|
|
6252
|
-
// ],
|
|
6253
|
-
// "failure": []
|
|
6254
|
-
// }
|
|
6255
|
-
// }
|
|
6256
|
-
//
|
|
6258
|
+
throw new NotSupported(this.id + ' cancelAllOrders() does not support margin markets, you can use cancelOrders() instead');
|
|
6257
6259
|
}
|
|
6258
6260
|
else {
|
|
6259
6261
|
if (trigger) {
|
package/js/src/bybit.d.ts
CHANGED
|
@@ -805,18 +805,18 @@ export default class bybit extends Exchange {
|
|
|
805
805
|
* @method
|
|
806
806
|
* @name bybit#borrowCrossMargin
|
|
807
807
|
* @description create a loan to borrow margin
|
|
808
|
-
* @see https://bybit-exchange.github.io/docs/v5/
|
|
808
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/borrow
|
|
809
809
|
* @param {string} code unified currency code of the currency to borrow
|
|
810
810
|
* @param {float} amount the amount to borrow
|
|
811
811
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
812
812
|
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
813
813
|
*/
|
|
814
|
-
borrowCrossMargin(code: string, amount: number, params?: {}): Promise<
|
|
814
|
+
borrowCrossMargin(code: string, amount: number, params?: {}): Promise<Dict>;
|
|
815
815
|
/**
|
|
816
816
|
* @method
|
|
817
817
|
* @name bybit#repayCrossMargin
|
|
818
818
|
* @description repay borrowed margin and interest
|
|
819
|
-
* @see https://bybit-exchange.github.io/docs/v5/
|
|
819
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/no-convert-repay
|
|
820
820
|
* @param {string} code unified currency code of the currency to repay
|
|
821
821
|
* @param {float} amount the amount to repay
|
|
822
822
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|