lighter-sdk-client 0.2.11
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 +574 -0
- package/dist/api/exchange/change-account-tier.cjs +6 -0
- package/dist/api/exchange/change-account-tier.d.cts +14 -0
- package/dist/api/exchange/change-account-tier.d.ts +14 -0
- package/dist/api/exchange/change-account-tier.js +6 -0
- package/dist/api/exchange/fastwithdraw.cjs +6 -0
- package/dist/api/exchange/fastwithdraw.d.cts +14 -0
- package/dist/api/exchange/fastwithdraw.d.ts +14 -0
- package/dist/api/exchange/fastwithdraw.js +6 -0
- package/dist/api/exchange/index.cjs +37 -0
- package/dist/api/exchange/index.d.cts +8 -0
- package/dist/api/exchange/index.d.ts +8 -0
- package/dist/api/exchange/index.js +37 -0
- package/dist/api/exchange/notification-ack.cjs +6 -0
- package/dist/api/exchange/notification-ack.d.cts +13 -0
- package/dist/api/exchange/notification-ack.d.ts +13 -0
- package/dist/api/exchange/notification-ack.js +6 -0
- package/dist/api/exchange/send-tx-batch.cjs +6 -0
- package/dist/api/exchange/send-tx-batch.d.cts +22 -0
- package/dist/api/exchange/send-tx-batch.d.ts +22 -0
- package/dist/api/exchange/send-tx-batch.js +6 -0
- package/dist/api/exchange/send-tx.cjs +12 -0
- package/dist/api/exchange/send-tx.d.cts +33 -0
- package/dist/api/exchange/send-tx.d.ts +33 -0
- package/dist/api/exchange/send-tx.js +12 -0
- package/dist/api/exchange/tokens-create.cjs +6 -0
- package/dist/api/exchange/tokens-create.d.cts +24 -0
- package/dist/api/exchange/tokens-create.d.ts +24 -0
- package/dist/api/exchange/tokens-create.js +6 -0
- package/dist/api/exchange/tokens-revoke.cjs +6 -0
- package/dist/api/exchange/tokens-revoke.d.cts +15 -0
- package/dist/api/exchange/tokens-revoke.d.ts +15 -0
- package/dist/api/exchange/tokens-revoke.js +6 -0
- package/dist/api/info/account-by-l1-address.cjs +6 -0
- package/dist/api/info/account-by-l1-address.d.cts +28 -0
- package/dist/api/info/account-by-l1-address.d.ts +28 -0
- package/dist/api/info/account-by-l1-address.js +6 -0
- package/dist/api/info/account.cjs +6 -0
- package/dist/api/info/account.d.cts +67 -0
- package/dist/api/info/account.d.ts +67 -0
- package/dist/api/info/account.js +6 -0
- package/dist/api/info/announcement.cjs +6 -0
- package/dist/api/info/announcement.d.cts +15 -0
- package/dist/api/info/announcement.d.ts +15 -0
- package/dist/api/info/announcement.js +6 -0
- package/dist/api/info/api-keys.cjs +6 -0
- package/dist/api/info/api-keys.d.cts +19 -0
- package/dist/api/info/api-keys.d.ts +19 -0
- package/dist/api/info/api-keys.js +6 -0
- package/dist/api/info/asset-details.cjs +6 -0
- package/dist/api/info/asset-details.d.cts +26 -0
- package/dist/api/info/asset-details.d.ts +26 -0
- package/dist/api/info/asset-details.js +6 -0
- package/dist/api/info/candles.cjs +6 -0
- package/dist/api/info/candles.d.cts +23 -0
- package/dist/api/info/candles.d.ts +23 -0
- package/dist/api/info/candles.js +6 -0
- package/dist/api/info/exchange-stats.cjs +6 -0
- package/dist/api/info/exchange-stats.d.cts +11 -0
- package/dist/api/info/exchange-stats.d.ts +11 -0
- package/dist/api/info/exchange-stats.js +6 -0
- package/dist/api/info/fastbridge-info.cjs +6 -0
- package/dist/api/info/fastbridge-info.d.cts +10 -0
- package/dist/api/info/fastbridge-info.d.ts +10 -0
- package/dist/api/info/fastbridge-info.js +6 -0
- package/dist/api/info/funding-rates.cjs +6 -0
- package/dist/api/info/funding-rates.d.cts +16 -0
- package/dist/api/info/funding-rates.d.ts +16 -0
- package/dist/api/info/funding-rates.js +6 -0
- package/dist/api/info/fundings.cjs +6 -0
- package/dist/api/info/fundings.d.cts +21 -0
- package/dist/api/info/fundings.d.ts +21 -0
- package/dist/api/info/fundings.js +6 -0
- package/dist/api/info/index.cjs +85 -0
- package/dist/api/info/index.d.cts +22 -0
- package/dist/api/info/index.d.ts +22 -0
- package/dist/api/info/index.js +85 -0
- package/dist/api/info/next-nonce.cjs +6 -0
- package/dist/api/info/next-nonce.d.cts +14 -0
- package/dist/api/info/next-nonce.d.ts +14 -0
- package/dist/api/info/next-nonce.js +6 -0
- package/dist/api/info/order-book-details.cjs +8 -0
- package/dist/api/info/order-book-details.d.cts +95 -0
- package/dist/api/info/order-book-details.d.ts +95 -0
- package/dist/api/info/order-book-details.js +8 -0
- package/dist/api/info/order-books.cjs +6 -0
- package/dist/api/info/order-books.d.cts +16 -0
- package/dist/api/info/order-books.d.ts +16 -0
- package/dist/api/info/order-books.js +6 -0
- package/dist/api/info/recent-trades.cjs +6 -0
- package/dist/api/info/recent-trades.d.cts +11 -0
- package/dist/api/info/recent-trades.d.ts +11 -0
- package/dist/api/info/recent-trades.js +6 -0
- package/dist/api/info/root-info.cjs +6 -0
- package/dist/api/info/root-info.d.cts +8 -0
- package/dist/api/info/root-info.d.ts +8 -0
- package/dist/api/info/root-info.js +6 -0
- package/dist/api/info/root-status.cjs +6 -0
- package/dist/api/info/root-status.d.cts +10 -0
- package/dist/api/info/root-status.d.ts +10 -0
- package/dist/api/info/root-status.js +6 -0
- package/dist/api/info/tx-from-l1-hash.cjs +6 -0
- package/dist/api/info/tx-from-l1-hash.d.cts +9 -0
- package/dist/api/info/tx-from-l1-hash.d.ts +9 -0
- package/dist/api/info/tx-from-l1-hash.js +6 -0
- package/dist/api/info/tx.cjs +6 -0
- package/dist/api/info/tx.d.cts +33 -0
- package/dist/api/info/tx.d.ts +33 -0
- package/dist/api/info/tx.js +6 -0
- package/dist/api/info/txs.cjs +6 -0
- package/dist/api/info/txs.d.cts +11 -0
- package/dist/api/info/txs.d.ts +11 -0
- package/dist/api/info/txs.js +6 -0
- package/dist/api/info/withdrawal-delay.cjs +6 -0
- package/dist/api/info/withdrawal-delay.d.cts +8 -0
- package/dist/api/info/withdrawal-delay.d.ts +8 -0
- package/dist/api/info/withdrawal-delay.js +6 -0
- package/dist/api/info-private/account-active-orders.cjs +6 -0
- package/dist/api/info-private/account-active-orders.d.cts +11 -0
- package/dist/api/info-private/account-active-orders.d.ts +11 -0
- package/dist/api/info-private/account-active-orders.js +6 -0
- package/dist/api/info-private/account-inactive-orders.cjs +6 -0
- package/dist/api/info-private/account-inactive-orders.d.cts +52 -0
- package/dist/api/info-private/account-inactive-orders.d.ts +52 -0
- package/dist/api/info-private/account-inactive-orders.js +6 -0
- package/dist/api/info-private/account-limits.cjs +6 -0
- package/dist/api/info-private/account-limits.d.cts +16 -0
- package/dist/api/info-private/account-limits.d.ts +16 -0
- package/dist/api/info-private/account-limits.js +6 -0
- package/dist/api/info-private/account-metadata.cjs +6 -0
- package/dist/api/info-private/account-metadata.d.cts +22 -0
- package/dist/api/info-private/account-metadata.d.ts +22 -0
- package/dist/api/info-private/account-metadata.js +6 -0
- package/dist/api/info-private/deposit-history.cjs +6 -0
- package/dist/api/info-private/deposit-history.d.cts +27 -0
- package/dist/api/info-private/deposit-history.d.ts +27 -0
- package/dist/api/info-private/deposit-history.js +6 -0
- package/dist/api/info-private/export.cjs +6 -0
- package/dist/api/info-private/export.d.cts +16 -0
- package/dist/api/info-private/export.d.ts +16 -0
- package/dist/api/info-private/export.js +6 -0
- package/dist/api/info-private/fastwithdraw-info.cjs +6 -0
- package/dist/api/info-private/fastwithdraw-info.d.cts +16 -0
- package/dist/api/info-private/fastwithdraw-info.d.ts +16 -0
- package/dist/api/info-private/fastwithdraw-info.js +6 -0
- package/dist/api/info-private/index.cjs +75 -0
- package/dist/api/info-private/index.d.cts +19 -0
- package/dist/api/info-private/index.d.ts +19 -0
- package/dist/api/info-private/index.js +75 -0
- package/dist/api/info-private/l1-metadata.cjs +6 -0
- package/dist/api/info-private/l1-metadata.d.cts +16 -0
- package/dist/api/info-private/l1-metadata.d.ts +16 -0
- package/dist/api/info-private/l1-metadata.js +6 -0
- package/dist/api/info-private/liquidations.cjs +6 -0
- package/dist/api/info-private/liquidations.d.cts +66 -0
- package/dist/api/info-private/liquidations.d.ts +66 -0
- package/dist/api/info-private/liquidations.js +6 -0
- package/dist/api/info-private/pnl.cjs +6 -0
- package/dist/api/info-private/pnl.d.cts +24 -0
- package/dist/api/info-private/pnl.d.ts +24 -0
- package/dist/api/info-private/pnl.js +6 -0
- package/dist/api/info-private/position-funding.cjs +6 -0
- package/dist/api/info-private/position-funding.d.cts +28 -0
- package/dist/api/info-private/position-funding.d.ts +28 -0
- package/dist/api/info-private/position-funding.js +6 -0
- package/dist/api/info-private/public-pools-metadata.cjs +6 -0
- package/dist/api/info-private/public-pools-metadata.d.cts +24 -0
- package/dist/api/info-private/public-pools-metadata.d.ts +24 -0
- package/dist/api/info-private/public-pools-metadata.js +6 -0
- package/dist/api/info-private/referral-points.cjs +6 -0
- package/dist/api/info-private/referral-points.d.cts +24 -0
- package/dist/api/info-private/referral-points.d.ts +24 -0
- package/dist/api/info-private/referral-points.js +6 -0
- package/dist/api/info-private/tokens.cjs +6 -0
- package/dist/api/info-private/tokens.d.cts +24 -0
- package/dist/api/info-private/tokens.d.ts +24 -0
- package/dist/api/info-private/tokens.js +6 -0
- package/dist/api/info-private/trades.cjs +6 -0
- package/dist/api/info-private/trades.d.cts +49 -0
- package/dist/api/info-private/trades.d.ts +49 -0
- package/dist/api/info-private/trades.js +6 -0
- package/dist/api/info-private/transfer-fee-info.cjs +6 -0
- package/dist/api/info-private/transfer-fee-info.d.cts +15 -0
- package/dist/api/info-private/transfer-fee-info.d.ts +15 -0
- package/dist/api/info-private/transfer-fee-info.js +6 -0
- package/dist/api/info-private/transfer-history.cjs +6 -0
- package/dist/api/info-private/transfer-history.d.cts +27 -0
- package/dist/api/info-private/transfer-history.d.ts +27 -0
- package/dist/api/info-private/transfer-history.js +6 -0
- package/dist/api/info-private/withdraw-history.cjs +6 -0
- package/dist/api/info-private/withdraw-history.d.cts +27 -0
- package/dist/api/info-private/withdraw-history.d.ts +27 -0
- package/dist/api/info-private/withdraw-history.js +6 -0
- package/dist/chunk-2R5COGAH.cjs +10 -0
- package/dist/chunk-3OSXAPI3.js +8 -0
- package/dist/chunk-3R4OL3TU.cjs +17 -0
- package/dist/chunk-3SKO62BC.js +0 -0
- package/dist/chunk-3Y76Q54G.js +18 -0
- package/dist/chunk-3ZIFHX7Q.cjs +1 -0
- package/dist/chunk-467IJZRE.js +14 -0
- package/dist/chunk-472ULOSN.js +10 -0
- package/dist/chunk-4LNJ2577.js +17 -0
- package/dist/chunk-4MZ3XQUJ.cjs +13 -0
- package/dist/chunk-4TIJW7PH.cjs +14 -0
- package/dist/chunk-4VAZ7ZA2.js +10 -0
- package/dist/chunk-5JDRAN7L.cjs +22 -0
- package/dist/chunk-5P5CPB5A.js +18 -0
- package/dist/chunk-5U6X6DI7.cjs +13 -0
- package/dist/chunk-5WEMEUUI.js +22 -0
- package/dist/chunk-5YGIBBTZ.js +357 -0
- package/dist/chunk-62KDFQ7D.js +367 -0
- package/dist/chunk-6CD3YMMG.cjs +1 -0
- package/dist/chunk-6GCE6YQR.cjs +8 -0
- package/dist/chunk-6LUEPRL7.cjs +16 -0
- package/dist/chunk-76SPKVHT.js +48 -0
- package/dist/chunk-77QSYYAW.js +13 -0
- package/dist/chunk-7U2USLAM.cjs +8 -0
- package/dist/chunk-A2APDMN3.js +13 -0
- package/dist/chunk-AKEQDKGA.js +167 -0
- package/dist/chunk-AMNDQGYL.js +18 -0
- package/dist/chunk-BA2QFD27.cjs +19 -0
- package/dist/chunk-BES73YEF.js +8 -0
- package/dist/chunk-BKIL4UXV.cjs +22 -0
- package/dist/chunk-BKJGDTS3.js +8 -0
- package/dist/chunk-BVC2AA7Y.cjs +8 -0
- package/dist/chunk-BXMXWCMD.js +13 -0
- package/dist/chunk-C7OTZCGC.js +0 -0
- package/dist/chunk-DCKMNDS3.js +0 -0
- package/dist/chunk-DOZF64YC.cjs +17 -0
- package/dist/chunk-DW6W5SX2.cjs +18 -0
- package/dist/chunk-E3GJJZER.cjs +8 -0
- package/dist/chunk-EBSW5ZYW.js +19 -0
- package/dist/chunk-F24JA2OV.cjs +22 -0
- package/dist/chunk-FJJWUBKM.js +17 -0
- package/dist/chunk-FM4WWIRI.cjs +17 -0
- package/dist/chunk-FODEDUT4.js +8 -0
- package/dist/chunk-GEWTGUEG.cjs +1 -0
- package/dist/chunk-GI4WUHSL.cjs +1 -0
- package/dist/chunk-GYABNQWH.js +8 -0
- package/dist/chunk-GYQ6HJQY.cjs +21 -0
- package/dist/chunk-INCL3WRA.cjs +13 -0
- package/dist/chunk-IQQRFW4A.cjs +8 -0
- package/dist/chunk-IT6LK2G5.cjs +19 -0
- package/dist/chunk-IXF4QUC6.js +8 -0
- package/dist/chunk-J3UZK77O.cjs +18 -0
- package/dist/chunk-J7GXRK7R.cjs +19 -0
- package/dist/chunk-JNTYHWDJ.js +22 -0
- package/dist/chunk-JTE4UBAX.js +8 -0
- package/dist/chunk-JTP6DTDN.js +0 -0
- package/dist/chunk-K7ZQARON.js +8 -0
- package/dist/chunk-KV6G2ZCR.js +539 -0
- package/dist/chunk-L5SDFTHR.cjs +242 -0
- package/dist/chunk-LBVNEQ5R.cjs +21 -0
- package/dist/chunk-LYNZNSLV.js +18 -0
- package/dist/chunk-MAPH47LH.cjs +1 -0
- package/dist/chunk-MO4PMYTS.js +0 -0
- package/dist/chunk-MOMFTZ7N.cjs +357 -0
- package/dist/chunk-MZCKU6FF.js +8 -0
- package/dist/chunk-NIMYOIVU.cjs +1 -0
- package/dist/chunk-NIT6TCVS.cjs +8 -0
- package/dist/chunk-NOFXPTLU.js +8 -0
- package/dist/chunk-NRZGE42C.js +23 -0
- package/dist/chunk-NSFKW27X.js +0 -0
- package/dist/chunk-O3PA6HV2.js +18 -0
- package/dist/chunk-ON64OVOQ.cjs +20 -0
- package/dist/chunk-OPSCTD6W.js +17 -0
- package/dist/chunk-P32EPCEM.js +19 -0
- package/dist/chunk-PEALQBVN.js +19 -0
- package/dist/chunk-PP4Q2W66.cjs +10 -0
- package/dist/chunk-PPU2VWXX.js +12 -0
- package/dist/chunk-Q2MT7FZ7.js +242 -0
- package/dist/chunk-QCE5PEXE.cjs +8 -0
- package/dist/chunk-QMXZQNBK.cjs +8 -0
- package/dist/chunk-QNM3HYIV.cjs +8 -0
- package/dist/chunk-QXGO7TJ2.js +17 -0
- package/dist/chunk-RGVFMOQI.js +20 -0
- package/dist/chunk-RYDJEI67.cjs +48 -0
- package/dist/chunk-S4OE3IME.js +13 -0
- package/dist/chunk-SA6CXVP6.js +22 -0
- package/dist/chunk-SK6Y2YH6.js +0 -0
- package/dist/chunk-TELGVFFP.js +13 -0
- package/dist/chunk-TPGO4YD3.js +21 -0
- package/dist/chunk-TSHQJVUP.js +0 -0
- package/dist/chunk-TWGXKYO2.cjs +23 -0
- package/dist/chunk-U25GSCR7.cjs +17 -0
- package/dist/chunk-U2SM46CP.cjs +17 -0
- package/dist/chunk-UICTRTWB.cjs +367 -0
- package/dist/chunk-UORSMHI2.js +21 -0
- package/dist/chunk-VDBWTSBC.cjs +1 -0
- package/dist/chunk-VNQKWIQG.cjs +13 -0
- package/dist/chunk-VT3N7TOX.js +325 -0
- package/dist/chunk-VW77SNCY.js +24 -0
- package/dist/chunk-W2BVNVOC.cjs +1 -0
- package/dist/chunk-W2CTGWUW.cjs +539 -0
- package/dist/chunk-W5VY4TWP.js +16 -0
- package/dist/chunk-WDQ4YM6C.cjs +167 -0
- package/dist/chunk-WK6OQRMG.cjs +8 -0
- package/dist/chunk-WWLOQFSW.cjs +12 -0
- package/dist/chunk-X7E6XJVQ.cjs +18 -0
- package/dist/chunk-XOG6T533.cjs +18 -0
- package/dist/chunk-XPZBVL56.cjs +325 -0
- package/dist/chunk-XQGOXCT4.js +22 -0
- package/dist/chunk-YVJVFJ24.cjs +19 -0
- package/dist/chunk-YWN57BJF.js +8 -0
- package/dist/chunk-Z5XTWR2A.cjs +8 -0
- package/dist/chunk-ZDNQFOED.js +17 -0
- package/dist/chunk-ZGWYI7Q2.cjs +24 -0
- package/dist/chunk-ZIMFMYT2.cjs +22 -0
- package/dist/chunk-ZJVQD6JD.cjs +18 -0
- package/dist/chunk-ZKFXRN6W.cjs +13 -0
- package/dist/chunk-ZWYNOAL3.js +19 -0
- package/dist/client/exchange-client.cjs +14 -0
- package/dist/client/exchange-client.d.cts +352 -0
- package/dist/client/exchange-client.d.ts +352 -0
- package/dist/client/exchange-client.js +14 -0
- package/dist/client/index.cjs +71 -0
- package/dist/client/index.d.cts +53 -0
- package/dist/client/index.d.ts +53 -0
- package/dist/client/index.js +71 -0
- package/dist/client/info-client.cjs +27 -0
- package/dist/client/info-client.d.cts +255 -0
- package/dist/client/info-client.d.ts +255 -0
- package/dist/client/info-client.js +27 -0
- package/dist/client/info-private-client.cjs +25 -0
- package/dist/client/info-private-client.d.cts +293 -0
- package/dist/client/info-private-client.d.ts +293 -0
- package/dist/client/info-private-client.js +25 -0
- package/dist/client/l1-bridge-client.cjs +6 -0
- package/dist/client/l1-bridge-client.d.cts +45 -0
- package/dist/client/l1-bridge-client.d.ts +45 -0
- package/dist/client/l1-bridge-client.js +6 -0
- package/dist/client/ws-client.cjs +6 -0
- package/dist/client/ws-client.d.cts +63 -0
- package/dist/client/ws-client.d.ts +63 -0
- package/dist/client/ws-client.js +6 -0
- package/dist/index.cjs +79 -0
- package/dist/index.d.cts +53 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +79 -0
- package/dist/signing/index.cjs +7 -0
- package/dist/signing/index.d.cts +1 -0
- package/dist/signing/index.d.ts +1 -0
- package/dist/signing/index.js +7 -0
- package/dist/signing/wasm-signer.cjs +6 -0
- package/dist/signing/wasm-signer.d.cts +101 -0
- package/dist/signing/wasm-signer.d.ts +101 -0
- package/dist/signing/wasm-signer.js +6 -0
- package/dist/types/bridge.cjs +1 -0
- package/dist/types/bridge.d.cts +24 -0
- package/dist/types/bridge.d.ts +24 -0
- package/dist/types/bridge.js +1 -0
- package/dist/types/index.cjs +3 -0
- package/dist/types/index.d.cts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +3 -0
- package/dist/types/ws.cjs +1 -0
- package/dist/types/ws.d.cts +351 -0
- package/dist/types/ws.d.ts +351 -0
- package/dist/types/ws.js +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { L1BridgeConfig, L1DepositParams, L1DepositResult } from '../types/bridge.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* L1 Bridge Client for handling Ethereum to Lighter L2 deposits
|
|
5
|
+
*/
|
|
6
|
+
declare class L1BridgeClient {
|
|
7
|
+
private config;
|
|
8
|
+
constructor(config: L1BridgeConfig);
|
|
9
|
+
/**
|
|
10
|
+
* Deposit USDC from L1 to L2
|
|
11
|
+
* @param params - Deposit parameters
|
|
12
|
+
* @returns Promise<L1DepositResult>
|
|
13
|
+
*/
|
|
14
|
+
depositToL2(params: L1DepositParams): Promise<L1DepositResult>;
|
|
15
|
+
/**
|
|
16
|
+
* Check USDC balance for an address
|
|
17
|
+
* @param address - Ethereum address
|
|
18
|
+
* @returns Promise<string> - Balance in USDC units
|
|
19
|
+
*/
|
|
20
|
+
getUSDCBalance(address: string): Promise<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Check USDC allowance for bridge contract
|
|
23
|
+
* @param address - Ethereum address
|
|
24
|
+
* @returns Promise<string> - Allowance in USDC units
|
|
25
|
+
*/
|
|
26
|
+
getUSDCAllowance(address: string): Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Get transaction status
|
|
29
|
+
* @param txHash - Transaction hash
|
|
30
|
+
* @returns Promise<L1DepositResult>
|
|
31
|
+
*/
|
|
32
|
+
getTransactionStatus(txHash: string): Promise<L1DepositResult>;
|
|
33
|
+
/**
|
|
34
|
+
* Get default bridge configuration for mainnet
|
|
35
|
+
* @returns L1BridgeConfig
|
|
36
|
+
*/
|
|
37
|
+
static getMainnetConfig(): L1BridgeConfig;
|
|
38
|
+
/**
|
|
39
|
+
* Get default bridge configuration for testnet
|
|
40
|
+
* @returns L1BridgeConfig
|
|
41
|
+
*/
|
|
42
|
+
static getTestnetConfig(): L1BridgeConfig;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { L1BridgeClient };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { WebSocketConfig, WebSocketSubscription, WsOrderBookUpdate, WsMarketStatsUpdate, WsSpotMarketStatsUpdate, WsTradeUpdate, WsAccountAllUpdate, WsAccountMarketUpdate, WsUserStatsUpdate, WsTransactionUpdate, WsAccountAllOrdersUpdate, WsHeightUpdate, WsPoolDataUpdate, WsPoolInfoUpdate, WsNotificationUpdate, WsAccountOrdersUpdate, WsAccountAllTradesUpdate, WsAccountAllPositionsUpdate } from '../types/ws.cjs';
|
|
2
|
+
|
|
3
|
+
declare class WsClient {
|
|
4
|
+
private ws;
|
|
5
|
+
private config;
|
|
6
|
+
private readonly url;
|
|
7
|
+
private reconnectAttempts;
|
|
8
|
+
private reconnectTimer;
|
|
9
|
+
private subscriptions;
|
|
10
|
+
private isConnecting;
|
|
11
|
+
private isConnected;
|
|
12
|
+
constructor(config?: WebSocketConfig);
|
|
13
|
+
connect(): Promise<void>;
|
|
14
|
+
disconnect(): void;
|
|
15
|
+
subscribe<TPayload = any>(subscription: WebSocketSubscription<TPayload>): void;
|
|
16
|
+
subscribeOrderBook(marketIndex: number, handler: (update: WsOrderBookUpdate) => void): void;
|
|
17
|
+
unsubscribeOrderBook(marketIndex: number): void;
|
|
18
|
+
subscribeMarketStats(market: number | "all", handler: (update: WsMarketStatsUpdate) => void): void;
|
|
19
|
+
unsubscribeMarketStats(market: number | "all"): void;
|
|
20
|
+
subscribeSpotMarketStats(market: number | "all", handler: (update: WsSpotMarketStatsUpdate) => void): void;
|
|
21
|
+
unsubscribeSpotMarketStats(market: number | "all"): void;
|
|
22
|
+
subscribeTrades(marketIndex: number, handler: (update: WsTradeUpdate) => void): void;
|
|
23
|
+
unsubscribeTrades(marketIndex: number): void;
|
|
24
|
+
subscribeAccountAll(accountId: number, handler: (update: WsAccountAllUpdate) => void): void;
|
|
25
|
+
unsubscribeAccountAll(accountId: number): void;
|
|
26
|
+
subscribeAccountMarket(marketId: number, accountId: number, auth: string, handler: (update: WsAccountMarketUpdate) => void): void;
|
|
27
|
+
unsubscribeAccountMarket(marketId: number, accountId: number): void;
|
|
28
|
+
subscribeUserStats(accountId: number, handler: (update: WsUserStatsUpdate) => void): void;
|
|
29
|
+
unsubscribeUserStats(accountId: number): void;
|
|
30
|
+
subscribeTransactions(handler: (update: WsTransactionUpdate) => void): void;
|
|
31
|
+
unsubscribeTransactions(): void;
|
|
32
|
+
subscribeExecutedTransactions(handler: (update: WsTransactionUpdate) => void): void;
|
|
33
|
+
unsubscribeExecutedTransactions(): void;
|
|
34
|
+
subscribeAccountTransactions(accountId: number, auth: string, handler: (update: WsTransactionUpdate) => void): void;
|
|
35
|
+
unsubscribeAccountTransactions(accountId: number): void;
|
|
36
|
+
subscribeAccountAllOrders(accountId: number, auth: string, handler: (update: WsAccountAllOrdersUpdate) => void): void;
|
|
37
|
+
unsubscribeAccountAllOrders(accountId: number): void;
|
|
38
|
+
subscribeHeight(handler: (update: WsHeightUpdate) => void): void;
|
|
39
|
+
unsubscribeHeight(): void;
|
|
40
|
+
subscribePoolData(accountId: number, auth: string, handler: (update: WsPoolDataUpdate) => void): void;
|
|
41
|
+
unsubscribePoolData(accountId: number): void;
|
|
42
|
+
subscribePoolInfo(accountId: number, auth: string, handler: (update: WsPoolInfoUpdate) => void): void;
|
|
43
|
+
unsubscribePoolInfo(accountId: number): void;
|
|
44
|
+
subscribeNotifications(accountId: number, auth: string, handler: (update: WsNotificationUpdate) => void): void;
|
|
45
|
+
unsubscribeNotifications(accountId: number): void;
|
|
46
|
+
subscribeAccountOrders(marketIndex: number, accountId: number, auth: string, handler: (update: WsAccountOrdersUpdate) => void): void;
|
|
47
|
+
unsubscribeAccountOrders(marketIndex: number, accountId: number): void;
|
|
48
|
+
subscribeAccountAllTrades(accountId: number, auth: string, handler: (update: WsAccountAllTradesUpdate) => void): void;
|
|
49
|
+
unsubscribeAccountAllTrades(accountId: number): void;
|
|
50
|
+
subscribeAccountAllPositions(accountId: number, auth: string, handler: (update: WsAccountAllPositionsUpdate) => void): void;
|
|
51
|
+
unsubscribeAccountAllPositions(accountId: number): void;
|
|
52
|
+
unsubscribe(channel: string): void;
|
|
53
|
+
send(message: any): void;
|
|
54
|
+
private normalizeChannel;
|
|
55
|
+
private passthroughParser;
|
|
56
|
+
private handleSubscriptionMessage;
|
|
57
|
+
private attemptReconnect;
|
|
58
|
+
private resubscribeAll;
|
|
59
|
+
isConnectedToWebSocket(): boolean;
|
|
60
|
+
getSubscriptions(): WebSocketSubscription[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { WsClient };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { WebSocketConfig, WebSocketSubscription, WsOrderBookUpdate, WsMarketStatsUpdate, WsSpotMarketStatsUpdate, WsTradeUpdate, WsAccountAllUpdate, WsAccountMarketUpdate, WsUserStatsUpdate, WsTransactionUpdate, WsAccountAllOrdersUpdate, WsHeightUpdate, WsPoolDataUpdate, WsPoolInfoUpdate, WsNotificationUpdate, WsAccountOrdersUpdate, WsAccountAllTradesUpdate, WsAccountAllPositionsUpdate } from '../types/ws.js';
|
|
2
|
+
|
|
3
|
+
declare class WsClient {
|
|
4
|
+
private ws;
|
|
5
|
+
private config;
|
|
6
|
+
private readonly url;
|
|
7
|
+
private reconnectAttempts;
|
|
8
|
+
private reconnectTimer;
|
|
9
|
+
private subscriptions;
|
|
10
|
+
private isConnecting;
|
|
11
|
+
private isConnected;
|
|
12
|
+
constructor(config?: WebSocketConfig);
|
|
13
|
+
connect(): Promise<void>;
|
|
14
|
+
disconnect(): void;
|
|
15
|
+
subscribe<TPayload = any>(subscription: WebSocketSubscription<TPayload>): void;
|
|
16
|
+
subscribeOrderBook(marketIndex: number, handler: (update: WsOrderBookUpdate) => void): void;
|
|
17
|
+
unsubscribeOrderBook(marketIndex: number): void;
|
|
18
|
+
subscribeMarketStats(market: number | "all", handler: (update: WsMarketStatsUpdate) => void): void;
|
|
19
|
+
unsubscribeMarketStats(market: number | "all"): void;
|
|
20
|
+
subscribeSpotMarketStats(market: number | "all", handler: (update: WsSpotMarketStatsUpdate) => void): void;
|
|
21
|
+
unsubscribeSpotMarketStats(market: number | "all"): void;
|
|
22
|
+
subscribeTrades(marketIndex: number, handler: (update: WsTradeUpdate) => void): void;
|
|
23
|
+
unsubscribeTrades(marketIndex: number): void;
|
|
24
|
+
subscribeAccountAll(accountId: number, handler: (update: WsAccountAllUpdate) => void): void;
|
|
25
|
+
unsubscribeAccountAll(accountId: number): void;
|
|
26
|
+
subscribeAccountMarket(marketId: number, accountId: number, auth: string, handler: (update: WsAccountMarketUpdate) => void): void;
|
|
27
|
+
unsubscribeAccountMarket(marketId: number, accountId: number): void;
|
|
28
|
+
subscribeUserStats(accountId: number, handler: (update: WsUserStatsUpdate) => void): void;
|
|
29
|
+
unsubscribeUserStats(accountId: number): void;
|
|
30
|
+
subscribeTransactions(handler: (update: WsTransactionUpdate) => void): void;
|
|
31
|
+
unsubscribeTransactions(): void;
|
|
32
|
+
subscribeExecutedTransactions(handler: (update: WsTransactionUpdate) => void): void;
|
|
33
|
+
unsubscribeExecutedTransactions(): void;
|
|
34
|
+
subscribeAccountTransactions(accountId: number, auth: string, handler: (update: WsTransactionUpdate) => void): void;
|
|
35
|
+
unsubscribeAccountTransactions(accountId: number): void;
|
|
36
|
+
subscribeAccountAllOrders(accountId: number, auth: string, handler: (update: WsAccountAllOrdersUpdate) => void): void;
|
|
37
|
+
unsubscribeAccountAllOrders(accountId: number): void;
|
|
38
|
+
subscribeHeight(handler: (update: WsHeightUpdate) => void): void;
|
|
39
|
+
unsubscribeHeight(): void;
|
|
40
|
+
subscribePoolData(accountId: number, auth: string, handler: (update: WsPoolDataUpdate) => void): void;
|
|
41
|
+
unsubscribePoolData(accountId: number): void;
|
|
42
|
+
subscribePoolInfo(accountId: number, auth: string, handler: (update: WsPoolInfoUpdate) => void): void;
|
|
43
|
+
unsubscribePoolInfo(accountId: number): void;
|
|
44
|
+
subscribeNotifications(accountId: number, auth: string, handler: (update: WsNotificationUpdate) => void): void;
|
|
45
|
+
unsubscribeNotifications(accountId: number): void;
|
|
46
|
+
subscribeAccountOrders(marketIndex: number, accountId: number, auth: string, handler: (update: WsAccountOrdersUpdate) => void): void;
|
|
47
|
+
unsubscribeAccountOrders(marketIndex: number, accountId: number): void;
|
|
48
|
+
subscribeAccountAllTrades(accountId: number, auth: string, handler: (update: WsAccountAllTradesUpdate) => void): void;
|
|
49
|
+
unsubscribeAccountAllTrades(accountId: number): void;
|
|
50
|
+
subscribeAccountAllPositions(accountId: number, auth: string, handler: (update: WsAccountAllPositionsUpdate) => void): void;
|
|
51
|
+
unsubscribeAccountAllPositions(accountId: number): void;
|
|
52
|
+
unsubscribe(channel: string): void;
|
|
53
|
+
send(message: any): void;
|
|
54
|
+
private normalizeChannel;
|
|
55
|
+
private passthroughParser;
|
|
56
|
+
private handleSubscriptionMessage;
|
|
57
|
+
private attemptReconnect;
|
|
58
|
+
private resubscribeAll;
|
|
59
|
+
isConnectedToWebSocket(): boolean;
|
|
60
|
+
getSubscriptions(): WebSocketSubscription[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { WsClient };
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-W2BVNVOC.cjs');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkWDQ4YM6Ccjs = require('./chunk-WDQ4YM6C.cjs');
|
|
5
|
+
require('./chunk-NIMYOIVU.cjs');
|
|
6
|
+
require('./chunk-VDBWTSBC.cjs');
|
|
7
|
+
require('./chunk-GEWTGUEG.cjs');
|
|
8
|
+
require('./chunk-MAPH47LH.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunkL5SDFTHRcjs = require('./chunk-L5SDFTHR.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunkMOMFTZ7Ncjs = require('./chunk-MOMFTZ7N.cjs');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var _chunkW2CTGWUWcjs = require('./chunk-W2CTGWUW.cjs');
|
|
18
|
+
require('./chunk-6CD3YMMG.cjs');
|
|
19
|
+
require('./chunk-ZIMFMYT2.cjs');
|
|
20
|
+
require('./chunk-RYDJEI67.cjs');
|
|
21
|
+
require('./chunk-ZGWYI7Q2.cjs');
|
|
22
|
+
require('./chunk-GYQ6HJQY.cjs');
|
|
23
|
+
require('./chunk-F24JA2OV.cjs');
|
|
24
|
+
require('./chunk-5JDRAN7L.cjs');
|
|
25
|
+
require('./chunk-3R4OL3TU.cjs');
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
var _chunkXPZBVL56cjs = require('./chunk-XPZBVL56.cjs');
|
|
29
|
+
require('./chunk-3ZIFHX7Q.cjs');
|
|
30
|
+
require('./chunk-QCE5PEXE.cjs');
|
|
31
|
+
require('./chunk-BA2QFD27.cjs');
|
|
32
|
+
require('./chunk-WK6OQRMG.cjs');
|
|
33
|
+
require('./chunk-ZKFXRN6W.cjs');
|
|
34
|
+
require('./chunk-QNM3HYIV.cjs');
|
|
35
|
+
require('./chunk-IQQRFW4A.cjs');
|
|
36
|
+
require('./chunk-WWLOQFSW.cjs');
|
|
37
|
+
require('./chunk-VNQKWIQG.cjs');
|
|
38
|
+
require('./chunk-7U2USLAM.cjs');
|
|
39
|
+
require('./chunk-5U6X6DI7.cjs');
|
|
40
|
+
require('./chunk-NIT6TCVS.cjs');
|
|
41
|
+
require('./chunk-6GCE6YQR.cjs');
|
|
42
|
+
require('./chunk-BVC2AA7Y.cjs');
|
|
43
|
+
require('./chunk-Z5XTWR2A.cjs');
|
|
44
|
+
require('./chunk-QMXZQNBK.cjs');
|
|
45
|
+
require('./chunk-4MZ3XQUJ.cjs');
|
|
46
|
+
require('./chunk-2R5COGAH.cjs');
|
|
47
|
+
require('./chunk-PP4Q2W66.cjs');
|
|
48
|
+
require('./chunk-E3GJJZER.cjs');
|
|
49
|
+
require('./chunk-INCL3WRA.cjs');
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
var _chunkUICTRTWBcjs = require('./chunk-UICTRTWB.cjs');
|
|
53
|
+
require('./chunk-GI4WUHSL.cjs');
|
|
54
|
+
require('./chunk-4TIJW7PH.cjs');
|
|
55
|
+
require('./chunk-J3UZK77O.cjs');
|
|
56
|
+
require('./chunk-DW6W5SX2.cjs');
|
|
57
|
+
require('./chunk-J7GXRK7R.cjs');
|
|
58
|
+
require('./chunk-DOZF64YC.cjs');
|
|
59
|
+
require('./chunk-ON64OVOQ.cjs');
|
|
60
|
+
require('./chunk-TWGXKYO2.cjs');
|
|
61
|
+
require('./chunk-LBVNEQ5R.cjs');
|
|
62
|
+
require('./chunk-X7E6XJVQ.cjs');
|
|
63
|
+
require('./chunk-6LUEPRL7.cjs');
|
|
64
|
+
require('./chunk-U2SM46CP.cjs');
|
|
65
|
+
require('./chunk-XOG6T533.cjs');
|
|
66
|
+
require('./chunk-BKIL4UXV.cjs');
|
|
67
|
+
require('./chunk-U25GSCR7.cjs');
|
|
68
|
+
require('./chunk-ZJVQD6JD.cjs');
|
|
69
|
+
require('./chunk-YVJVFJ24.cjs');
|
|
70
|
+
require('./chunk-IT6LK2G5.cjs');
|
|
71
|
+
require('./chunk-FM4WWIRI.cjs');
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
exports.ExchangeClient = _chunkW2CTGWUWcjs.ExchangeClient; exports.InfoClient = _chunkXPZBVL56cjs.InfoClient; exports.InfoPrivateClient = _chunkUICTRTWBcjs.InfoPrivateClient; exports.L1BridgeClient = _chunkL5SDFTHRcjs.L1BridgeClient; exports.WasmSigner = _chunkWDQ4YM6Ccjs.WasmSigner; exports.WsClient = _chunkMOMFTZ7Ncjs.WsClient;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export { ExchangeClient, ExchangeClientConfig } from './client/exchange-client.cjs';
|
|
2
|
+
export { InfoClient, InfoClientConfig } from './client/info-client.cjs';
|
|
3
|
+
export { InfoPrivateClient, InfoPrivateClientConfig } from './client/info-private-client.cjs';
|
|
4
|
+
export { L1BridgeClient } from './client/l1-bridge-client.cjs';
|
|
5
|
+
export { WsClient } from './client/ws-client.cjs';
|
|
6
|
+
export { APIKeyResponse, AuthTokenResponse, CreateOrderRequest, ErrorResponse, TxResponse, WasmConfig, WasmSigner } from './signing/wasm-signer.cjs';
|
|
7
|
+
export { L1BridgeConfig, L1DepositParams, L1DepositResult } from './types/bridge.cjs';
|
|
8
|
+
export { WebSocketConfig, WebSocketSubscription, WsAccountAllOrdersUpdate, WsAccountAllPositionsUpdate, WsAccountAllTradesUpdate, WsAccountAllUpdate, WsAccountMarketUpdate, WsAccountOrdersUpdate, WsAccountPosition, WsAnnouncementNotificationContent, WsDeleverageNotificationContent, WsFundingHistoryEntry, WsHeightUpdate, WsLiquidationNotificationContent, WsMarketStats, WsMarketStatsUpdate, WsNotification, WsNotificationBase, WsNotificationContent, WsNotificationUpdate, WsOrder, WsOrderBookSnapshot, WsOrderBookUpdate, WsPoolDataUpdate, WsPoolInfo, WsPoolInfoDailyMetric, WsPoolInfoUpdate, WsPoolShare, WsPositionFunding, WsPriceLevel, WsSpotMarketStats, WsSpotMarketStatsUpdate, WsStatsBreakdown, WsTrade, WsTradeUpdate, WsTransaction, WsTransactionUpdate, WsUserStats, WsUserStatsUpdate } from './types/ws.cjs';
|
|
9
|
+
import './api/exchange/change-account-tier.cjs';
|
|
10
|
+
import 'axios';
|
|
11
|
+
import './api/exchange/fastwithdraw.cjs';
|
|
12
|
+
import './api/exchange/notification-ack.cjs';
|
|
13
|
+
import './api/exchange/send-tx.cjs';
|
|
14
|
+
import './api/exchange/send-tx-batch.cjs';
|
|
15
|
+
import './api/exchange/tokens-create.cjs';
|
|
16
|
+
import './api/exchange/tokens-revoke.cjs';
|
|
17
|
+
import './api/info/account.cjs';
|
|
18
|
+
import './api/info/account-by-l1-address.cjs';
|
|
19
|
+
import './api/info/announcement.cjs';
|
|
20
|
+
import './api/info/api-keys.cjs';
|
|
21
|
+
import './api/info/asset-details.cjs';
|
|
22
|
+
import './api/info/candles.cjs';
|
|
23
|
+
import './api/info/exchange-stats.cjs';
|
|
24
|
+
import './api/info/fastbridge-info.cjs';
|
|
25
|
+
import './api/info/funding-rates.cjs';
|
|
26
|
+
import './api/info/fundings.cjs';
|
|
27
|
+
import './api/info/next-nonce.cjs';
|
|
28
|
+
import './api/info/order-book-details.cjs';
|
|
29
|
+
import './api/info/order-books.cjs';
|
|
30
|
+
import './api/info/recent-trades.cjs';
|
|
31
|
+
import './api/info-private/trades.cjs';
|
|
32
|
+
import './api/info/root-status.cjs';
|
|
33
|
+
import './api/info/tx.cjs';
|
|
34
|
+
import './api/info/tx-from-l1-hash.cjs';
|
|
35
|
+
import './api/info/txs.cjs';
|
|
36
|
+
import './api/info/withdrawal-delay.cjs';
|
|
37
|
+
import './api/info-private/account-active-orders.cjs';
|
|
38
|
+
import './api/info-private/account-inactive-orders.cjs';
|
|
39
|
+
import './api/info-private/account-limits.cjs';
|
|
40
|
+
import './api/info-private/account-metadata.cjs';
|
|
41
|
+
import './api/info-private/deposit-history.cjs';
|
|
42
|
+
import './api/info-private/export.cjs';
|
|
43
|
+
import './api/info-private/fastwithdraw-info.cjs';
|
|
44
|
+
import './api/info-private/l1-metadata.cjs';
|
|
45
|
+
import './api/info-private/liquidations.cjs';
|
|
46
|
+
import './api/info-private/pnl.cjs';
|
|
47
|
+
import './api/info-private/position-funding.cjs';
|
|
48
|
+
import './api/info-private/public-pools-metadata.cjs';
|
|
49
|
+
import './api/info-private/referral-points.cjs';
|
|
50
|
+
import './api/info-private/tokens.cjs';
|
|
51
|
+
import './api/info-private/transfer-fee-info.cjs';
|
|
52
|
+
import './api/info-private/transfer-history.cjs';
|
|
53
|
+
import './api/info-private/withdraw-history.cjs';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export { ExchangeClient, ExchangeClientConfig } from './client/exchange-client.js';
|
|
2
|
+
export { InfoClient, InfoClientConfig } from './client/info-client.js';
|
|
3
|
+
export { InfoPrivateClient, InfoPrivateClientConfig } from './client/info-private-client.js';
|
|
4
|
+
export { L1BridgeClient } from './client/l1-bridge-client.js';
|
|
5
|
+
export { WsClient } from './client/ws-client.js';
|
|
6
|
+
export { APIKeyResponse, AuthTokenResponse, CreateOrderRequest, ErrorResponse, TxResponse, WasmConfig, WasmSigner } from './signing/wasm-signer.js';
|
|
7
|
+
export { L1BridgeConfig, L1DepositParams, L1DepositResult } from './types/bridge.js';
|
|
8
|
+
export { WebSocketConfig, WebSocketSubscription, WsAccountAllOrdersUpdate, WsAccountAllPositionsUpdate, WsAccountAllTradesUpdate, WsAccountAllUpdate, WsAccountMarketUpdate, WsAccountOrdersUpdate, WsAccountPosition, WsAnnouncementNotificationContent, WsDeleverageNotificationContent, WsFundingHistoryEntry, WsHeightUpdate, WsLiquidationNotificationContent, WsMarketStats, WsMarketStatsUpdate, WsNotification, WsNotificationBase, WsNotificationContent, WsNotificationUpdate, WsOrder, WsOrderBookSnapshot, WsOrderBookUpdate, WsPoolDataUpdate, WsPoolInfo, WsPoolInfoDailyMetric, WsPoolInfoUpdate, WsPoolShare, WsPositionFunding, WsPriceLevel, WsSpotMarketStats, WsSpotMarketStatsUpdate, WsStatsBreakdown, WsTrade, WsTradeUpdate, WsTransaction, WsTransactionUpdate, WsUserStats, WsUserStatsUpdate } from './types/ws.js';
|
|
9
|
+
import './api/exchange/change-account-tier.js';
|
|
10
|
+
import 'axios';
|
|
11
|
+
import './api/exchange/fastwithdraw.js';
|
|
12
|
+
import './api/exchange/notification-ack.js';
|
|
13
|
+
import './api/exchange/send-tx.js';
|
|
14
|
+
import './api/exchange/send-tx-batch.js';
|
|
15
|
+
import './api/exchange/tokens-create.js';
|
|
16
|
+
import './api/exchange/tokens-revoke.js';
|
|
17
|
+
import './api/info/account.js';
|
|
18
|
+
import './api/info/account-by-l1-address.js';
|
|
19
|
+
import './api/info/announcement.js';
|
|
20
|
+
import './api/info/api-keys.js';
|
|
21
|
+
import './api/info/asset-details.js';
|
|
22
|
+
import './api/info/candles.js';
|
|
23
|
+
import './api/info/exchange-stats.js';
|
|
24
|
+
import './api/info/fastbridge-info.js';
|
|
25
|
+
import './api/info/funding-rates.js';
|
|
26
|
+
import './api/info/fundings.js';
|
|
27
|
+
import './api/info/next-nonce.js';
|
|
28
|
+
import './api/info/order-book-details.js';
|
|
29
|
+
import './api/info/order-books.js';
|
|
30
|
+
import './api/info/recent-trades.js';
|
|
31
|
+
import './api/info-private/trades.js';
|
|
32
|
+
import './api/info/root-status.js';
|
|
33
|
+
import './api/info/tx.js';
|
|
34
|
+
import './api/info/tx-from-l1-hash.js';
|
|
35
|
+
import './api/info/txs.js';
|
|
36
|
+
import './api/info/withdrawal-delay.js';
|
|
37
|
+
import './api/info-private/account-active-orders.js';
|
|
38
|
+
import './api/info-private/account-inactive-orders.js';
|
|
39
|
+
import './api/info-private/account-limits.js';
|
|
40
|
+
import './api/info-private/account-metadata.js';
|
|
41
|
+
import './api/info-private/deposit-history.js';
|
|
42
|
+
import './api/info-private/export.js';
|
|
43
|
+
import './api/info-private/fastwithdraw-info.js';
|
|
44
|
+
import './api/info-private/l1-metadata.js';
|
|
45
|
+
import './api/info-private/liquidations.js';
|
|
46
|
+
import './api/info-private/pnl.js';
|
|
47
|
+
import './api/info-private/position-funding.js';
|
|
48
|
+
import './api/info-private/public-pools-metadata.js';
|
|
49
|
+
import './api/info-private/referral-points.js';
|
|
50
|
+
import './api/info-private/tokens.js';
|
|
51
|
+
import './api/info-private/transfer-fee-info.js';
|
|
52
|
+
import './api/info-private/transfer-history.js';
|
|
53
|
+
import './api/info-private/withdraw-history.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import "./chunk-3SKO62BC.js";
|
|
2
|
+
import {
|
|
3
|
+
WasmSigner
|
|
4
|
+
} from "./chunk-AKEQDKGA.js";
|
|
5
|
+
import "./chunk-SK6Y2YH6.js";
|
|
6
|
+
import "./chunk-NSFKW27X.js";
|
|
7
|
+
import "./chunk-C7OTZCGC.js";
|
|
8
|
+
import "./chunk-JTP6DTDN.js";
|
|
9
|
+
import {
|
|
10
|
+
L1BridgeClient
|
|
11
|
+
} from "./chunk-Q2MT7FZ7.js";
|
|
12
|
+
import {
|
|
13
|
+
WsClient
|
|
14
|
+
} from "./chunk-5YGIBBTZ.js";
|
|
15
|
+
import {
|
|
16
|
+
ExchangeClient
|
|
17
|
+
} from "./chunk-KV6G2ZCR.js";
|
|
18
|
+
import "./chunk-DCKMNDS3.js";
|
|
19
|
+
import "./chunk-JNTYHWDJ.js";
|
|
20
|
+
import "./chunk-76SPKVHT.js";
|
|
21
|
+
import "./chunk-VW77SNCY.js";
|
|
22
|
+
import "./chunk-UORSMHI2.js";
|
|
23
|
+
import "./chunk-5WEMEUUI.js";
|
|
24
|
+
import "./chunk-SA6CXVP6.js";
|
|
25
|
+
import "./chunk-FJJWUBKM.js";
|
|
26
|
+
import {
|
|
27
|
+
InfoClient
|
|
28
|
+
} from "./chunk-VT3N7TOX.js";
|
|
29
|
+
import "./chunk-MO4PMYTS.js";
|
|
30
|
+
import "./chunk-K7ZQARON.js";
|
|
31
|
+
import "./chunk-ZWYNOAL3.js";
|
|
32
|
+
import "./chunk-3OSXAPI3.js";
|
|
33
|
+
import "./chunk-BXMXWCMD.js";
|
|
34
|
+
import "./chunk-IXF4QUC6.js";
|
|
35
|
+
import "./chunk-NOFXPTLU.js";
|
|
36
|
+
import "./chunk-PPU2VWXX.js";
|
|
37
|
+
import "./chunk-TELGVFFP.js";
|
|
38
|
+
import "./chunk-GYABNQWH.js";
|
|
39
|
+
import "./chunk-A2APDMN3.js";
|
|
40
|
+
import "./chunk-JTE4UBAX.js";
|
|
41
|
+
import "./chunk-BKJGDTS3.js";
|
|
42
|
+
import "./chunk-BES73YEF.js";
|
|
43
|
+
import "./chunk-FODEDUT4.js";
|
|
44
|
+
import "./chunk-MZCKU6FF.js";
|
|
45
|
+
import "./chunk-77QSYYAW.js";
|
|
46
|
+
import "./chunk-4VAZ7ZA2.js";
|
|
47
|
+
import "./chunk-472ULOSN.js";
|
|
48
|
+
import "./chunk-YWN57BJF.js";
|
|
49
|
+
import "./chunk-S4OE3IME.js";
|
|
50
|
+
import {
|
|
51
|
+
InfoPrivateClient
|
|
52
|
+
} from "./chunk-62KDFQ7D.js";
|
|
53
|
+
import "./chunk-TSHQJVUP.js";
|
|
54
|
+
import "./chunk-467IJZRE.js";
|
|
55
|
+
import "./chunk-LYNZNSLV.js";
|
|
56
|
+
import "./chunk-3Y76Q54G.js";
|
|
57
|
+
import "./chunk-PEALQBVN.js";
|
|
58
|
+
import "./chunk-QXGO7TJ2.js";
|
|
59
|
+
import "./chunk-RGVFMOQI.js";
|
|
60
|
+
import "./chunk-NRZGE42C.js";
|
|
61
|
+
import "./chunk-TPGO4YD3.js";
|
|
62
|
+
import "./chunk-O3PA6HV2.js";
|
|
63
|
+
import "./chunk-W5VY4TWP.js";
|
|
64
|
+
import "./chunk-OPSCTD6W.js";
|
|
65
|
+
import "./chunk-AMNDQGYL.js";
|
|
66
|
+
import "./chunk-XQGOXCT4.js";
|
|
67
|
+
import "./chunk-4LNJ2577.js";
|
|
68
|
+
import "./chunk-5P5CPB5A.js";
|
|
69
|
+
import "./chunk-P32EPCEM.js";
|
|
70
|
+
import "./chunk-EBSW5ZYW.js";
|
|
71
|
+
import "./chunk-ZDNQFOED.js";
|
|
72
|
+
export {
|
|
73
|
+
ExchangeClient,
|
|
74
|
+
InfoClient,
|
|
75
|
+
InfoPrivateClient,
|
|
76
|
+
L1BridgeClient,
|
|
77
|
+
WasmSigner,
|
|
78
|
+
WsClient
|
|
79
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { APIKeyResponse, AuthTokenResponse, CreateOrderRequest, ErrorResponse, TxResponse, WasmConfig, WasmSigner } from './wasm-signer.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { APIKeyResponse, AuthTokenResponse, CreateOrderRequest, ErrorResponse, TxResponse, WasmConfig, WasmSigner } from './wasm-signer.js';
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
interface WasmConfig {
|
|
2
|
+
url?: string;
|
|
3
|
+
chainId?: number;
|
|
4
|
+
wasmPath?: string;
|
|
5
|
+
wasmExecPath?: string;
|
|
6
|
+
}
|
|
7
|
+
interface TxResponse {
|
|
8
|
+
txType?: string;
|
|
9
|
+
txInfo?: string;
|
|
10
|
+
txHash?: string;
|
|
11
|
+
messageToSign?: string;
|
|
12
|
+
error?: string;
|
|
13
|
+
}
|
|
14
|
+
interface AuthTokenResponse {
|
|
15
|
+
authToken?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
interface APIKeyResponse {
|
|
19
|
+
privateKey?: string;
|
|
20
|
+
publicKey?: string;
|
|
21
|
+
error?: string;
|
|
22
|
+
}
|
|
23
|
+
interface ErrorResponse {
|
|
24
|
+
error?: string;
|
|
25
|
+
}
|
|
26
|
+
interface CreateOrderRequest {
|
|
27
|
+
MarketIndex: number;
|
|
28
|
+
ClientOrderIndex: number;
|
|
29
|
+
BaseAmount: number;
|
|
30
|
+
Price: number;
|
|
31
|
+
IsAsk: number;
|
|
32
|
+
Type: number;
|
|
33
|
+
TimeInForce: number;
|
|
34
|
+
ReduceOnly: number;
|
|
35
|
+
TriggerPrice: number;
|
|
36
|
+
OrderExpiry: number;
|
|
37
|
+
}
|
|
38
|
+
declare global {
|
|
39
|
+
interface Window {
|
|
40
|
+
Go: any;
|
|
41
|
+
GenerateAPIKey: (seed: string) => APIKeyResponse;
|
|
42
|
+
CreateClient: (url: string, privateKey: string, chainId: number, apiKeyIndex: number, accountIndex: number) => ErrorResponse;
|
|
43
|
+
CheckClient: (apiKeyIndex: number, accountIndex: number) => ErrorResponse;
|
|
44
|
+
CreateAuthToken: (deadline: number, apiKeyIndex: number, accountIndex: number) => AuthTokenResponse;
|
|
45
|
+
SignChangePubKey: (pubKeyHex: string, nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
46
|
+
SignCreateOrder: (marketIndex: number, clientOrderIndex: number, baseAmount: number, price: number, isAsk: number, orderType: number, timeInForce: number, reduceOnly: number, triggerPrice: number, orderExpiry: number, nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
47
|
+
SignCancelOrder: (marketIndex: number, orderIndex: number, nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
48
|
+
SignCancelAllOrders: (timeInForce: number, time: number, nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
49
|
+
SignTransfer: (toAccount: number, usdcAmount: number, fee: number, memo: string, nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
50
|
+
SignWithdraw: (usdcAmount: number, nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
51
|
+
SignUpdateLeverage: (marketIndex: number, fraction: number, marginMode: number, nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
52
|
+
SignModifyOrder: (marketIndex: number, index: number, baseAmount: number, price: number, triggerPrice: number, nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
53
|
+
SignCreateSubAccount: (nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
54
|
+
SignCreatePublicPool: (operatorFee: number, initialTotalShares: number, minOperatorShareRate: number, nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
55
|
+
SignUpdatePublicPool: (publicPoolIndex: number, status: number, operatorFee: number, minOperatorShareRate: number, nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
56
|
+
SignMintShares: (publicPoolIndex: number, shareAmount: number, nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
57
|
+
SignBurnShares: (publicPoolIndex: number, shareAmount: number, nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
58
|
+
SignUpdateMargin: (marketIndex: number, usdcAmount: number, direction: number, nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
59
|
+
SignCreateGroupedOrders: (groupingType: number, orders: CreateOrderRequest[], nonce: number, apiKeyIndex: number, accountIndex: number) => TxResponse;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
declare class WasmSigner {
|
|
63
|
+
private readonly url;
|
|
64
|
+
private readonly chainId;
|
|
65
|
+
private readonly wasmPath;
|
|
66
|
+
private readonly wasmExecPath;
|
|
67
|
+
private apiKeyIndex;
|
|
68
|
+
private accountIndex;
|
|
69
|
+
private privateKey;
|
|
70
|
+
constructor(config?: WasmConfig);
|
|
71
|
+
initialize(): Promise<void>;
|
|
72
|
+
generateAPIKey(seed: string): APIKeyResponse;
|
|
73
|
+
setAccount(privateKey: string, apiKeyIndex: number, accountIndex: number): void;
|
|
74
|
+
getAccount(): {
|
|
75
|
+
privateKey: string;
|
|
76
|
+
apiKeyIndex: number;
|
|
77
|
+
accountIndex: number;
|
|
78
|
+
};
|
|
79
|
+
createClient(): ErrorResponse;
|
|
80
|
+
checkClient(): ErrorResponse;
|
|
81
|
+
createAuthToken(deadline: number): AuthTokenResponse;
|
|
82
|
+
signChangePubKey(pubKeyHex: string, nonce: number): TxResponse;
|
|
83
|
+
signCreateOrder(marketIndex: number, clientOrderIndex: number, baseAmount: number, price: number, isAsk: number, orderType: number, timeInForce: number, reduceOnly: number, triggerPrice: number, orderExpiry: number, nonce: number): TxResponse;
|
|
84
|
+
signCancelOrder(marketIndex: number, orderIndex: number, nonce: number): TxResponse;
|
|
85
|
+
signCancelAllOrders(timeInForce: number, time: number, nonce: number): TxResponse;
|
|
86
|
+
signTransfer(toAccount: number, usdcAmount: number, fee: number, memo: string, nonce: number): TxResponse;
|
|
87
|
+
signWithdraw(usdcAmount: number, nonce: number): TxResponse;
|
|
88
|
+
signUpdateLeverage(marketIndex: number, fraction: number, marginMode: number, nonce: number): TxResponse;
|
|
89
|
+
signModifyOrder(marketIndex: number, index: number, baseAmount: number, price: number, triggerPrice: number, nonce: number): TxResponse;
|
|
90
|
+
signCreateSubAccount(nonce: number): TxResponse;
|
|
91
|
+
signCreatePublicPool(operatorFee: number, initialTotalShares: number, minOperatorShareRate: number, nonce: number): TxResponse;
|
|
92
|
+
signUpdatePublicPool(publicPoolIndex: number, status: number, operatorFee: number, minOperatorShareRate: number, nonce: number): TxResponse;
|
|
93
|
+
signMintShares(publicPoolIndex: number, shareAmount: number, nonce: number): TxResponse;
|
|
94
|
+
signBurnShares(publicPoolIndex: number, shareAmount: number, nonce: number): TxResponse;
|
|
95
|
+
signUpdateMargin(marketIndex: number, usdcAmount: number, direction: number, nonce: number): TxResponse;
|
|
96
|
+
signCreateGroupedOrders(groupingType: number, orders: CreateOrderRequest[], nonce: number): TxResponse;
|
|
97
|
+
private loadScript;
|
|
98
|
+
private loadWasm;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { type APIKeyResponse, type AuthTokenResponse, type CreateOrderRequest, type ErrorResponse, type TxResponse, type WasmConfig, WasmSigner };
|