ccxt 4.5.49 → 4.5.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +48 -13
- package/dist/cjs/src/bitget.js +1 -0
- package/dist/cjs/src/gate.js +0 -1
- package/dist/cjs/src/hibachi.js +1 -1
- package/dist/cjs/src/lighter.js +306 -141
- package/dist/cjs/src/okx.js +46 -1
- package/dist/cjs/src/pro/hyperliquid.js +361 -1
- package/dist/cjs/src/pro/lighter.js +1 -0
- package/dist/cjs/src/weex.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/myokx.d.ts +34 -0
- package/js/src/abstract/okx.d.ts +34 -0
- package/js/src/abstract/okxus.d.ts +34 -0
- package/js/src/base/Exchange.d.ts +5 -1
- package/js/src/base/Exchange.js +48 -13
- package/js/src/bitget.js +1 -0
- package/js/src/gate.js +0 -1
- package/js/src/hibachi.js +1 -1
- package/js/src/lighter.d.ts +11 -2
- package/js/src/lighter.js +307 -142
- package/js/src/okx.js +46 -1
- package/js/src/pro/hyperliquid.d.ts +48 -1
- package/js/src/pro/hyperliquid.js +362 -2
- package/js/src/pro/lighter.js +1 -0
- package/js/src/weex.js +1 -1
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -202,7 +202,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
202
202
|
|
|
203
203
|
//-----------------------------------------------------------------------------
|
|
204
204
|
// this is updated by vss.js when building
|
|
205
|
-
const version = '4.5.
|
|
205
|
+
const version = '4.5.50';
|
|
206
206
|
Exchange["default"].ccxtVersion = version;
|
|
207
207
|
const exchanges = {
|
|
208
208
|
'aftermath': aftermath["default"],
|
|
@@ -1610,7 +1610,7 @@ class Exchange {
|
|
|
1610
1610
|
unlockId() {
|
|
1611
1611
|
return undefined; // c# stub
|
|
1612
1612
|
}
|
|
1613
|
-
async loadLighterLibrary(libraryPath, chainId, privateKey, apiKeyIndex, accountIndex) {
|
|
1613
|
+
async loadLighterLibrary(libraryPath, chainId, privateKey, apiKeyIndex, accountIndex, createClient = false) {
|
|
1614
1614
|
// wasmExecPathExample: '/opt/homebrew/opt/go/libexec/lib/wasm/wasm_exec.js';
|
|
1615
1615
|
// libraryPath eg: '/Users/cjg/Git/lighter-go/lighter.wasm';
|
|
1616
1616
|
if (libraryPath === undefined || libraryPath === '') {
|
|
@@ -1630,11 +1630,16 @@ class Exchange {
|
|
|
1630
1630
|
const bytes = new Uint8Array(readFile(libraryPath, null)); // it should point to lighter.wasm
|
|
1631
1631
|
const { instance } = await WebAssembly.instantiate(bytes, go.importObject);
|
|
1632
1632
|
go.run(instance);
|
|
1633
|
-
|
|
1633
|
+
if (createClient) {
|
|
1634
|
+
this.lighterCreateClient(undefined, chainId, privateKey, apiKeyIndex, accountIndex);
|
|
1635
|
+
}
|
|
1636
|
+
return {}; // empty object we will read it from globalThis
|
|
1637
|
+
}
|
|
1638
|
+
lighterCreateClient(signer, chainId, privateKey, apiKeyIndex, accountIndex) {
|
|
1634
1639
|
const url = this.implodeHostname(this.urls['api']['public']);
|
|
1635
1640
|
const res = globalThis.CreateClient(url, privateKey, chainId, apiKeyIndex, accountIndex);
|
|
1636
1641
|
this.checkLighterSignedError(res);
|
|
1637
|
-
return
|
|
1642
|
+
return signer;
|
|
1638
1643
|
}
|
|
1639
1644
|
// eslint-disable-next-line no-unused-vars
|
|
1640
1645
|
lighterSignCreateGroupedOrders(signer, request) {
|
|
@@ -1655,13 +1660,15 @@ class Exchange {
|
|
|
1655
1660
|
'OrderExpiry': order['order_expiry'],
|
|
1656
1661
|
});
|
|
1657
1662
|
}
|
|
1658
|
-
const res = globalThis.SignCreateGroupedOrders(request['grouping_type'], ordersArr, orders.length,
|
|
1663
|
+
const res = globalThis.SignCreateGroupedOrders(request['grouping_type'], ordersArr, orders.length, 0, // skip nonce
|
|
1664
|
+
request['nonce'], request['api_key_index'], request['account_index']);
|
|
1659
1665
|
this.checkLighterSignedError(res);
|
|
1660
1666
|
return [res.txType, res.txInfo];
|
|
1661
1667
|
}
|
|
1662
1668
|
// eslint-disable-next-line no-unused-vars
|
|
1663
1669
|
lighterSignCreateOrder(signer, request) {
|
|
1664
|
-
const res = (globalThis.SignCreateOrder(parseInt(request['market_index']), request['client_order_index'], request['base_amount'], request['avg_execution_price'], request['is_ask'], request['order_type'], request['time_in_force'], request['reduce_only'], request['trigger_price'], request['order_expiry'], request['
|
|
1670
|
+
const res = (globalThis.SignCreateOrder(parseInt(request['market_index']), request['client_order_index'], request['base_amount'], request['avg_execution_price'], request['is_ask'], request['order_type'], request['time_in_force'], request['reduce_only'], request['trigger_price'], request['order_expiry'], request['integrator_account_index'], request['integrator_taker_fee'], request['integrator_maker_fee'], 0, // skip nonce
|
|
1671
|
+
request['nonce'], request['api_key_index'], request['account_index']));
|
|
1665
1672
|
this.checkLighterSignedError(res);
|
|
1666
1673
|
return [res.txType, res.txInfo];
|
|
1667
1674
|
}
|
|
@@ -1671,38 +1678,45 @@ class Exchange {
|
|
|
1671
1678
|
}
|
|
1672
1679
|
}
|
|
1673
1680
|
lighterSignCancelOrder(signer, request) {
|
|
1674
|
-
const res = (globalThis.SignCancelOrder(request['market_index'], request['order_index'],
|
|
1681
|
+
const res = (globalThis.SignCancelOrder(request['market_index'], request['order_index'], 0, // skip nonce
|
|
1682
|
+
request['nonce'], request['api_key_index'], request['account_index']));
|
|
1675
1683
|
this.checkLighterSignedError(res);
|
|
1676
1684
|
return [res.txType, res.txInfo];
|
|
1677
1685
|
}
|
|
1678
1686
|
lighterSignWithdraw(signer, request) {
|
|
1679
|
-
const res = (globalThis.SignWithdraw(request['asset_index'], request['route_type'], request['amount'],
|
|
1687
|
+
const res = (globalThis.SignWithdraw(request['asset_index'], request['route_type'], request['amount'], 0, // skip nonce
|
|
1688
|
+
request['nonce'], request['api_key_index'], request['account_index']));
|
|
1680
1689
|
this.checkLighterSignedError(res);
|
|
1681
1690
|
return [res.txType, res.txInfo];
|
|
1682
1691
|
}
|
|
1683
1692
|
// eslint-disable-next-line no-unused-vars
|
|
1684
1693
|
lighterSignCreateSubAccount(signer, request) {
|
|
1685
|
-
const res = (globalThis.SignCreateSubAccount(
|
|
1694
|
+
const res = (globalThis.SignCreateSubAccount(0, // skip nonce
|
|
1695
|
+
request['nonce'], request['api_key_index'], request['account_index']));
|
|
1686
1696
|
this.checkLighterSignedError(res);
|
|
1687
1697
|
return [res.txType, res.txInfo];
|
|
1688
1698
|
}
|
|
1689
1699
|
lighterSignCancelAllOrders(signer, request) {
|
|
1690
|
-
const res = (globalThis.SignCancelAllOrders(request['time_in_force'], request['time'],
|
|
1700
|
+
const res = (globalThis.SignCancelAllOrders(request['time_in_force'], request['time'], 0, // skip nonce
|
|
1701
|
+
request['nonce'], request['api_key_index'], request['account_index']));
|
|
1691
1702
|
this.checkLighterSignedError(res);
|
|
1692
1703
|
return [res.txType, res.txInfo];
|
|
1693
1704
|
}
|
|
1694
1705
|
lighterSignModifyOrder(signer, request) {
|
|
1695
|
-
const res = (globalThis.SignModifyOrder(request['market_index'], request['index'], request['base_amount'], request['price'], request['trigger_price'], request['
|
|
1706
|
+
const res = (globalThis.SignModifyOrder(request['market_index'], request['index'], request['base_amount'], request['price'], request['trigger_price'], request['integrator_account_index'], request['integrator_taker_fee'], request['integrator_maker_fee'], 0, // skip nonce
|
|
1707
|
+
request['nonce'], request['api_key_index'], request['account_index']));
|
|
1696
1708
|
this.checkLighterSignedError(res);
|
|
1697
1709
|
return [res.txType, res.txInfo];
|
|
1698
1710
|
}
|
|
1699
1711
|
lighterSignTransfer(signer, request) {
|
|
1700
|
-
const res = globalThis.SignTransfer(request['to_account_index'], request['asset_index'], request['from_route_type'], request['to_route_type'], request['amount'], request['usdc_fee'], request['memo'],
|
|
1712
|
+
const res = globalThis.SignTransfer(request['to_account_index'], request['asset_index'], request['from_route_type'], request['to_route_type'], request['amount'], request['usdc_fee'], request['memo'], 0, // skip nonce
|
|
1713
|
+
request['nonce'], request['api_key_index'], request['account_index']);
|
|
1701
1714
|
this.checkLighterSignedError(res);
|
|
1702
1715
|
return [res.txType, res.txInfo];
|
|
1703
1716
|
}
|
|
1704
1717
|
lighterSignUpdateLeverage(signer, request) {
|
|
1705
|
-
const res = (globalThis.SignUpdateLeverage(request['market_index'], request['initial_margin_fraction'], request['margin_mode'],
|
|
1718
|
+
const res = (globalThis.SignUpdateLeverage(request['market_index'], request['initial_margin_fraction'], request['margin_mode'], 0, // skip nonce
|
|
1719
|
+
request['nonce'], request['api_key_index'], request['account_index']));
|
|
1706
1720
|
this.checkLighterSignedError(res);
|
|
1707
1721
|
return [res.txType, res.txInfo];
|
|
1708
1722
|
}
|
|
@@ -1712,10 +1726,31 @@ class Exchange {
|
|
|
1712
1726
|
return res.authToken;
|
|
1713
1727
|
}
|
|
1714
1728
|
lighterSignUpdateMargin(signer, request) {
|
|
1715
|
-
const res = globalThis.SignUpdateMargin(request['market_index'], request['usdc_amount'], request['direction'],
|
|
1729
|
+
const res = globalThis.SignUpdateMargin(request['market_index'], request['usdc_amount'], request['direction'], 0, // skip nonce
|
|
1730
|
+
request['nonce'], request['api_key_index'], request['account_index']);
|
|
1716
1731
|
this.checkLighterSignedError(res);
|
|
1717
1732
|
return [res.txType, res.txInfo];
|
|
1718
1733
|
}
|
|
1734
|
+
// eslint-disable-next-line no-unused-vars
|
|
1735
|
+
lighterSignApproveIntegrator(signer, request) {
|
|
1736
|
+
const res = globalThis.SignApproveIntegrator(request['integrator_account_index'], request['integrator_taker_fee'], request['integrator_maker_fee'], request['integrator_taker_fee'], request['integrator_maker_fee'], request['approval_expiry'], 0, // skip nonce
|
|
1737
|
+
request['nonce'], request['api_key_index'], request['account_index']);
|
|
1738
|
+
this.checkLighterSignedError(res);
|
|
1739
|
+
return [res.txType, res.txInfo, res.messageToSign];
|
|
1740
|
+
}
|
|
1741
|
+
// eslint-disable-next-line no-unused-vars
|
|
1742
|
+
lighterGenerateApiKey(signer) {
|
|
1743
|
+
const res = globalThis.GenerateAPIKey();
|
|
1744
|
+
this.checkLighterSignedError(res);
|
|
1745
|
+
return [res.privateKey, res.publicKey];
|
|
1746
|
+
}
|
|
1747
|
+
// eslint-disable-next-line no-unused-vars
|
|
1748
|
+
lighterSignChangePubkey(signer, request) {
|
|
1749
|
+
const res = globalThis.SignChangePubKey(Buffer.from(request['pubkey']).toString(), 0, // skip nonce
|
|
1750
|
+
request['nonce'], request['api_key_index'], request['account_index']);
|
|
1751
|
+
this.checkLighterSignedError(res);
|
|
1752
|
+
return [res.txType, res.txInfo, res.messageToSign];
|
|
1753
|
+
}
|
|
1719
1754
|
/* eslint-enable */
|
|
1720
1755
|
// ------------------------------------------------------------------------
|
|
1721
1756
|
// ########################################################################
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -1393,6 +1393,7 @@ class bitget extends bitget$1["default"] {
|
|
|
1393
1393
|
'43115': errors.OnMaintenance,
|
|
1394
1394
|
'45110': errors.InvalidOrder,
|
|
1395
1395
|
'40774': errors.InvalidOrder,
|
|
1396
|
+
'40917': errors.InvalidOrder,
|
|
1396
1397
|
'45122': errors.InvalidOrder,
|
|
1397
1398
|
// spot
|
|
1398
1399
|
'invalid sign': errors.AuthenticationError,
|
package/dist/cjs/src/gate.js
CHANGED
package/dist/cjs/src/hibachi.js
CHANGED
|
@@ -1738,7 +1738,7 @@ class hibachi extends hibachi$1["default"] {
|
|
|
1738
1738
|
// "status": "pending",
|
|
1739
1739
|
// "timestampSec": 1752692872,
|
|
1740
1740
|
// "token": "USDT",
|
|
1741
|
-
// "transactionHash": "
|
|
1741
|
+
// "transactionHash": "0x408e48881e0ba77d8638e3fe57bc06bdec513ddaa8b672e0aefa7e22e2f18b4e",
|
|
1742
1742
|
// "transactionType": "deposit"
|
|
1743
1743
|
// },
|
|
1744
1744
|
// {
|