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,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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('../chunk-VDBWTSBC.cjs');
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface L1DepositParams {
|
|
2
|
+
ethPrivateKey: string;
|
|
3
|
+
usdcAmount: number;
|
|
4
|
+
l2AccountIndex: number;
|
|
5
|
+
rpcUrl?: string;
|
|
6
|
+
gasPrice?: string;
|
|
7
|
+
gasLimit?: number;
|
|
8
|
+
}
|
|
9
|
+
interface L1DepositResult {
|
|
10
|
+
l1TxHash: string;
|
|
11
|
+
l2AccountIndex: number;
|
|
12
|
+
amount: string;
|
|
13
|
+
status: "pending" | "completed" | "failed";
|
|
14
|
+
blockNumber?: number;
|
|
15
|
+
gasUsed?: string;
|
|
16
|
+
}
|
|
17
|
+
interface L1BridgeConfig {
|
|
18
|
+
l1BridgeContract: string;
|
|
19
|
+
usdcContract: string;
|
|
20
|
+
rpcUrl: string;
|
|
21
|
+
chainId: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type { L1BridgeConfig, L1DepositParams, L1DepositResult };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface L1DepositParams {
|
|
2
|
+
ethPrivateKey: string;
|
|
3
|
+
usdcAmount: number;
|
|
4
|
+
l2AccountIndex: number;
|
|
5
|
+
rpcUrl?: string;
|
|
6
|
+
gasPrice?: string;
|
|
7
|
+
gasLimit?: number;
|
|
8
|
+
}
|
|
9
|
+
interface L1DepositResult {
|
|
10
|
+
l1TxHash: string;
|
|
11
|
+
l2AccountIndex: number;
|
|
12
|
+
amount: string;
|
|
13
|
+
status: "pending" | "completed" | "failed";
|
|
14
|
+
blockNumber?: number;
|
|
15
|
+
gasUsed?: string;
|
|
16
|
+
}
|
|
17
|
+
interface L1BridgeConfig {
|
|
18
|
+
l1BridgeContract: string;
|
|
19
|
+
usdcContract: string;
|
|
20
|
+
rpcUrl: string;
|
|
21
|
+
chainId: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type { L1BridgeConfig, L1DepositParams, L1DepositResult };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../chunk-NSFKW27X.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { L1BridgeConfig, L1DepositParams, L1DepositResult } from './bridge.cjs';
|
|
2
|
+
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 './ws.cjs';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { L1BridgeConfig, L1DepositParams, L1DepositResult } from './bridge.js';
|
|
2
|
+
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 './ws.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('../chunk-GEWTGUEG.cjs');
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
interface WebSocketConfig {
|
|
2
|
+
url?: string;
|
|
3
|
+
reconnectInterval?: number;
|
|
4
|
+
maxReconnectAttempts?: number;
|
|
5
|
+
onMessage?: (data: any) => void;
|
|
6
|
+
onError?: (error: Error) => void;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
onOpen?: () => void;
|
|
9
|
+
}
|
|
10
|
+
interface WebSocketSubscription<TPayload = any> {
|
|
11
|
+
channel: string;
|
|
12
|
+
auth?: string;
|
|
13
|
+
params?: Record<string, any>;
|
|
14
|
+
parser?: (payload: any) => TPayload;
|
|
15
|
+
handler?: (payload: TPayload) => void;
|
|
16
|
+
}
|
|
17
|
+
interface WsPriceLevel {
|
|
18
|
+
price: string;
|
|
19
|
+
size: string;
|
|
20
|
+
}
|
|
21
|
+
interface WsOrderBookSnapshot {
|
|
22
|
+
code: number;
|
|
23
|
+
asks: WsPriceLevel[];
|
|
24
|
+
bids: WsPriceLevel[];
|
|
25
|
+
offset: number;
|
|
26
|
+
}
|
|
27
|
+
interface WsOrderBookUpdate {
|
|
28
|
+
channel: string;
|
|
29
|
+
offset: number;
|
|
30
|
+
order_book: WsOrderBookSnapshot;
|
|
31
|
+
type: "subscribed/order_book" | "update/order_book";
|
|
32
|
+
}
|
|
33
|
+
interface WsMarketStats {
|
|
34
|
+
market_id: number;
|
|
35
|
+
index_price: string;
|
|
36
|
+
mark_price: string;
|
|
37
|
+
open_interest: string;
|
|
38
|
+
last_trade_price: string;
|
|
39
|
+
current_funding_rate: string;
|
|
40
|
+
funding_rate: string;
|
|
41
|
+
funding_timestamp: number;
|
|
42
|
+
daily_base_token_volume: number;
|
|
43
|
+
daily_quote_token_volume: number;
|
|
44
|
+
daily_price_low: number;
|
|
45
|
+
daily_price_high: number;
|
|
46
|
+
daily_price_change: number;
|
|
47
|
+
}
|
|
48
|
+
interface WsMarketStatsUpdate {
|
|
49
|
+
channel: string;
|
|
50
|
+
market_stats: Record<string, WsMarketStats>;
|
|
51
|
+
type: "update/market_stats" | "subscribed/market_stats";
|
|
52
|
+
}
|
|
53
|
+
interface WsSpotMarketStats {
|
|
54
|
+
symbol: string;
|
|
55
|
+
market_id: number;
|
|
56
|
+
index_price: string;
|
|
57
|
+
mid_price: string;
|
|
58
|
+
last_trade_price: string;
|
|
59
|
+
daily_base_token_volume: number;
|
|
60
|
+
daily_quote_token_volume: number;
|
|
61
|
+
daily_price_low: number;
|
|
62
|
+
daily_price_high: number;
|
|
63
|
+
daily_price_change: number;
|
|
64
|
+
}
|
|
65
|
+
interface WsSpotMarketStatsUpdate {
|
|
66
|
+
channel: string;
|
|
67
|
+
spot_market_stats: Record<string, WsSpotMarketStats>;
|
|
68
|
+
type: "update/spot_market_stats" | "subscribed/spot_market_stats";
|
|
69
|
+
}
|
|
70
|
+
interface WsTrade {
|
|
71
|
+
trade_id: number;
|
|
72
|
+
tx_hash: string;
|
|
73
|
+
type: string;
|
|
74
|
+
market_id: number;
|
|
75
|
+
size: string;
|
|
76
|
+
price: string;
|
|
77
|
+
usd_amount: string;
|
|
78
|
+
ask_id: number;
|
|
79
|
+
bid_id: number;
|
|
80
|
+
ask_account_id: number;
|
|
81
|
+
bid_account_id: number;
|
|
82
|
+
is_maker_ask: boolean;
|
|
83
|
+
block_height: number;
|
|
84
|
+
timestamp: number;
|
|
85
|
+
taker_fee?: number;
|
|
86
|
+
taker_position_size_before?: string;
|
|
87
|
+
taker_entry_quote_before?: string;
|
|
88
|
+
taker_initial_margin_fraction_before?: number;
|
|
89
|
+
taker_position_sign_changed?: boolean;
|
|
90
|
+
maker_fee?: number;
|
|
91
|
+
maker_position_size_before?: string;
|
|
92
|
+
maker_entry_quote_before?: string;
|
|
93
|
+
maker_initial_margin_fraction_before?: number;
|
|
94
|
+
maker_position_sign_changed?: boolean;
|
|
95
|
+
}
|
|
96
|
+
interface WsTradeUpdate {
|
|
97
|
+
channel: string;
|
|
98
|
+
trades: WsTrade[];
|
|
99
|
+
type: "update/trade";
|
|
100
|
+
}
|
|
101
|
+
interface WsOrder {
|
|
102
|
+
order_index: number;
|
|
103
|
+
client_order_index: number;
|
|
104
|
+
order_id: string;
|
|
105
|
+
client_order_id: string;
|
|
106
|
+
market_index: number;
|
|
107
|
+
owner_account_index: number;
|
|
108
|
+
initial_base_amount: string;
|
|
109
|
+
price: string;
|
|
110
|
+
nonce: number;
|
|
111
|
+
remaining_base_amount: string;
|
|
112
|
+
is_ask: boolean;
|
|
113
|
+
base_size: number;
|
|
114
|
+
base_price: number;
|
|
115
|
+
filled_base_amount: string;
|
|
116
|
+
filled_quote_amount: string;
|
|
117
|
+
side: string;
|
|
118
|
+
type: string;
|
|
119
|
+
time_in_force: string;
|
|
120
|
+
reduce_only: boolean;
|
|
121
|
+
trigger_price: string;
|
|
122
|
+
order_expiry: number;
|
|
123
|
+
status: string;
|
|
124
|
+
trigger_status: string;
|
|
125
|
+
trigger_time: number;
|
|
126
|
+
parent_order_index: number;
|
|
127
|
+
parent_order_id: string;
|
|
128
|
+
to_trigger_order_id_0?: string;
|
|
129
|
+
to_trigger_order_id_1?: string;
|
|
130
|
+
to_cancel_order_id_0?: string;
|
|
131
|
+
to_cancel_order_id_1?: string;
|
|
132
|
+
block_height: number;
|
|
133
|
+
timestamp: number;
|
|
134
|
+
}
|
|
135
|
+
interface WsFundingHistoryEntry {
|
|
136
|
+
timestamp: number;
|
|
137
|
+
market_id: number;
|
|
138
|
+
funding_id: number;
|
|
139
|
+
change: string;
|
|
140
|
+
rate: string;
|
|
141
|
+
position_size: string;
|
|
142
|
+
position_side: string;
|
|
143
|
+
}
|
|
144
|
+
interface WsAccountPosition {
|
|
145
|
+
market_id: number;
|
|
146
|
+
symbol: string;
|
|
147
|
+
initial_margin_fraction: string;
|
|
148
|
+
open_order_count: number;
|
|
149
|
+
pending_order_count: number;
|
|
150
|
+
position_tied_order_count: number;
|
|
151
|
+
sign: number;
|
|
152
|
+
position: string;
|
|
153
|
+
avg_entry_price: string;
|
|
154
|
+
position_value: string;
|
|
155
|
+
unrealized_pnl: string;
|
|
156
|
+
realized_pnl: string;
|
|
157
|
+
liquidation_price: string;
|
|
158
|
+
total_funding_paid_out?: string;
|
|
159
|
+
margin_mode: number;
|
|
160
|
+
allocated_margin: string;
|
|
161
|
+
}
|
|
162
|
+
interface WsPoolShare {
|
|
163
|
+
public_pool_index: number;
|
|
164
|
+
shares_amount: number;
|
|
165
|
+
entry_usdc: string;
|
|
166
|
+
}
|
|
167
|
+
interface WsAccountAllUpdate {
|
|
168
|
+
account: number;
|
|
169
|
+
channel: string;
|
|
170
|
+
daily_trades_count: number;
|
|
171
|
+
daily_volume: number;
|
|
172
|
+
weekly_trades_count: number;
|
|
173
|
+
weekly_volume: number;
|
|
174
|
+
monthly_trades_count: number;
|
|
175
|
+
monthly_volume: number;
|
|
176
|
+
total_trades_count: number;
|
|
177
|
+
total_volume: number;
|
|
178
|
+
funding_histories: Record<string, WsFundingHistoryEntry[]>;
|
|
179
|
+
positions: Record<string, WsAccountPosition>;
|
|
180
|
+
shares: WsPoolShare[];
|
|
181
|
+
trades: Record<string, WsTrade[]>;
|
|
182
|
+
type: "update/account_all";
|
|
183
|
+
}
|
|
184
|
+
interface WsAccountMarketUpdate {
|
|
185
|
+
account: number;
|
|
186
|
+
channel: string;
|
|
187
|
+
funding_history?: WsFundingHistoryEntry;
|
|
188
|
+
orders: WsOrder[];
|
|
189
|
+
position?: WsAccountPosition;
|
|
190
|
+
trades: WsTrade[];
|
|
191
|
+
type: "update/account_market";
|
|
192
|
+
}
|
|
193
|
+
interface WsStatsBreakdown {
|
|
194
|
+
collateral: string;
|
|
195
|
+
portfolio_value: string;
|
|
196
|
+
leverage: string;
|
|
197
|
+
available_balance: string;
|
|
198
|
+
margin_usage: string;
|
|
199
|
+
buying_power: string;
|
|
200
|
+
}
|
|
201
|
+
interface WsUserStats {
|
|
202
|
+
collateral: string;
|
|
203
|
+
portfolio_value: string;
|
|
204
|
+
leverage: string;
|
|
205
|
+
available_balance: string;
|
|
206
|
+
margin_usage: string;
|
|
207
|
+
buying_power: string;
|
|
208
|
+
cross_stats: WsStatsBreakdown;
|
|
209
|
+
total_stats: WsStatsBreakdown;
|
|
210
|
+
}
|
|
211
|
+
interface WsUserStatsUpdate {
|
|
212
|
+
channel: string;
|
|
213
|
+
stats: WsUserStats;
|
|
214
|
+
type: "update/user_stats";
|
|
215
|
+
}
|
|
216
|
+
interface WsTransaction {
|
|
217
|
+
hash: string;
|
|
218
|
+
type: number;
|
|
219
|
+
info: string;
|
|
220
|
+
event_info: string;
|
|
221
|
+
status: number;
|
|
222
|
+
transaction_index: number;
|
|
223
|
+
l1_address: string;
|
|
224
|
+
account_index: number;
|
|
225
|
+
nonce: number;
|
|
226
|
+
expire_at: number;
|
|
227
|
+
block_height: number;
|
|
228
|
+
queued_at: number;
|
|
229
|
+
executed_at: number;
|
|
230
|
+
sequence_index: number;
|
|
231
|
+
parent_hash: string;
|
|
232
|
+
}
|
|
233
|
+
interface WsTransactionUpdate {
|
|
234
|
+
channel: string;
|
|
235
|
+
txs: WsTransaction[];
|
|
236
|
+
type: "update/transaction";
|
|
237
|
+
}
|
|
238
|
+
interface WsHeightUpdate {
|
|
239
|
+
channel: string;
|
|
240
|
+
height: number;
|
|
241
|
+
type: "update/height";
|
|
242
|
+
}
|
|
243
|
+
interface WsPositionFunding {
|
|
244
|
+
timestamp: number;
|
|
245
|
+
market_id: number;
|
|
246
|
+
funding_id: number;
|
|
247
|
+
change: string;
|
|
248
|
+
rate: string;
|
|
249
|
+
position_size: string;
|
|
250
|
+
position_side: string;
|
|
251
|
+
}
|
|
252
|
+
interface WsPoolDataUpdate {
|
|
253
|
+
channel: string;
|
|
254
|
+
account: number;
|
|
255
|
+
trades: Record<string, WsTrade[]>;
|
|
256
|
+
orders: Record<string, WsOrder[]>;
|
|
257
|
+
positions: Record<string, WsAccountPosition>;
|
|
258
|
+
shares: WsPoolShare[];
|
|
259
|
+
funding_histories: Record<string, WsPositionFunding[]>;
|
|
260
|
+
type: "subscribed/pool_data" | "update/pool_data";
|
|
261
|
+
}
|
|
262
|
+
interface WsPoolInfoDailyMetric {
|
|
263
|
+
timestamp: number;
|
|
264
|
+
daily_return?: number;
|
|
265
|
+
share_price?: number;
|
|
266
|
+
}
|
|
267
|
+
interface WsPoolInfo {
|
|
268
|
+
status: number;
|
|
269
|
+
operator_fee: string;
|
|
270
|
+
min_operator_share_rate: string;
|
|
271
|
+
total_shares: number;
|
|
272
|
+
operator_shares: number;
|
|
273
|
+
annual_percentage_yield: number;
|
|
274
|
+
daily_returns: WsPoolInfoDailyMetric[];
|
|
275
|
+
share_prices: WsPoolInfoDailyMetric[];
|
|
276
|
+
}
|
|
277
|
+
interface WsPoolInfoUpdate {
|
|
278
|
+
channel: string;
|
|
279
|
+
pool_info: WsPoolInfo;
|
|
280
|
+
type: "subscribed/pool_info" | "update/pool_info";
|
|
281
|
+
}
|
|
282
|
+
interface WsNotificationBase {
|
|
283
|
+
id: string;
|
|
284
|
+
created_at: string;
|
|
285
|
+
updated_at: string;
|
|
286
|
+
kind: string;
|
|
287
|
+
account_index: number;
|
|
288
|
+
ack: boolean;
|
|
289
|
+
acked_at: string | null;
|
|
290
|
+
}
|
|
291
|
+
interface WsLiquidationNotificationContent {
|
|
292
|
+
id: string;
|
|
293
|
+
is_ask: boolean;
|
|
294
|
+
usdc_amount: string;
|
|
295
|
+
size: string;
|
|
296
|
+
market_index: number;
|
|
297
|
+
price: string;
|
|
298
|
+
timestamp: number;
|
|
299
|
+
avg_price: string;
|
|
300
|
+
}
|
|
301
|
+
interface WsDeleverageNotificationContent {
|
|
302
|
+
id: string;
|
|
303
|
+
usdc_amount: string;
|
|
304
|
+
size: string;
|
|
305
|
+
market_index: number;
|
|
306
|
+
settlement_price: string;
|
|
307
|
+
timestamp: number;
|
|
308
|
+
}
|
|
309
|
+
interface WsAnnouncementNotificationContent {
|
|
310
|
+
title: string;
|
|
311
|
+
content: string;
|
|
312
|
+
created_at: number;
|
|
313
|
+
}
|
|
314
|
+
type WsNotificationContent = WsLiquidationNotificationContent | WsDeleverageNotificationContent | WsAnnouncementNotificationContent | Record<string, any>;
|
|
315
|
+
interface WsNotification extends WsNotificationBase {
|
|
316
|
+
content: WsNotificationContent;
|
|
317
|
+
}
|
|
318
|
+
interface WsNotificationUpdate {
|
|
319
|
+
channel: string;
|
|
320
|
+
notifs: WsNotification[];
|
|
321
|
+
type: "subscribed/notification" | "update/notification";
|
|
322
|
+
}
|
|
323
|
+
interface WsAccountAllOrdersUpdate {
|
|
324
|
+
channel: string;
|
|
325
|
+
orders: Record<string, WsOrder[]>;
|
|
326
|
+
type: "update/account_all_orders";
|
|
327
|
+
}
|
|
328
|
+
interface WsAccountOrdersUpdate {
|
|
329
|
+
account: number;
|
|
330
|
+
channel: string;
|
|
331
|
+
nonce?: number;
|
|
332
|
+
orders: Record<string, WsOrder[]>;
|
|
333
|
+
type: "update/account_orders";
|
|
334
|
+
}
|
|
335
|
+
interface WsAccountAllTradesUpdate {
|
|
336
|
+
channel: string;
|
|
337
|
+
trades: Record<string, WsTrade[]>;
|
|
338
|
+
total_volume: number;
|
|
339
|
+
monthly_volume: number;
|
|
340
|
+
weekly_volume: number;
|
|
341
|
+
daily_volume: number;
|
|
342
|
+
type: "update/account_all_trades";
|
|
343
|
+
}
|
|
344
|
+
interface WsAccountAllPositionsUpdate {
|
|
345
|
+
channel: string;
|
|
346
|
+
positions: Record<string, WsAccountPosition>;
|
|
347
|
+
shares: WsPoolShare[];
|
|
348
|
+
type: "update/account_all_positions";
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export type { 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 };
|