@hfunlabs/hyperliquid 0.30.0-hfunlabs.1 → 0.30.2-hfunlabs.2
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/esm/_dnt.shims.d.ts +2 -0
- package/esm/_dnt.shims.d.ts.map +1 -0
- package/esm/_dnt.shims.js +58 -0
- package/esm/_dnt.shims.js.map +1 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.d.ts +195 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.d.ts.map +1 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.js +457 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.js.map +1 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.d.ts +90 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.d.ts.map +1 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.js +207 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.js.map +1 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.d.ts +159 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.d.ts.map +1 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.js +555 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.js.map +1 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.d.ts +325 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.d.ts.map +1 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.js +1222 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.js.map +1 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.d.ts +76 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.d.ts.map +1 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.js +283 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.js.map +1 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/utils.d.ts +103 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/utils.js +241 -0
- package/esm/deps/jsr.io/@noble/curves/2.0.1/src/utils.js.map +1 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_md.d.ts +49 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_md.d.ts.map +1 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_md.js +147 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_md.js.map +1 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.d.ts +55 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.d.ts.map +1 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.js +67 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.js.map +1 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.d.ts +36 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.d.ts.map +1 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.js +90 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.js.map +1 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.d.ts +199 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.d.ts.map +1 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.js +397 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.js.map +1 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.d.ts +58 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.d.ts.map +1 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.js +254 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.js.map +1 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/utils.d.ts +124 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/utils.js +243 -0
- package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/utils.js.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.d.ts +44 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.d.ts.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.js +144 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.js.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.d.ts +38 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.d.ts.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.js +96 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.js.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.d.ts +23 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.d.ts.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.js +98 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.js.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.d.ts +300 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.js +535 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.js.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.d.ts +98 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.d.ts.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.js +207 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.js.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.d.ts +78 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.d.ts.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.js +298 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.js.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.d.ts +6 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.d.ts.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.js +6 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.js.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.d.ts +66 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.js +180 -0
- package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.js.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.d.ts +877 -0
- package/esm/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.d.ts.map +1 -0
- package/esm/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.js +2001 -0
- package/esm/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.js.map +1 -0
- package/esm/deps/jsr.io/@scure/base/2.0.0/index.d.ts +294 -0
- package/esm/deps/jsr.io/@scure/base/2.0.0/index.d.ts.map +1 -0
- package/esm/deps/jsr.io/@scure/base/2.0.0/index.js +704 -0
- package/esm/deps/jsr.io/@scure/base/2.0.0/index.js.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts +93 -0
- package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js +137 -0
- package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js.map +1 -0
- package/esm/src/api/exchange/_methods/_base/_nonce.d.ts +3 -2
- package/esm/src/api/exchange/_methods/_base/_nonce.d.ts.map +1 -1
- package/esm/src/api/exchange/_methods/_base/_nonce.js +3 -2
- package/esm/src/api/exchange/_methods/_base/_nonce.js.map +1 -1
- package/esm/src/api/exchange/_methods/_base/_semaphore.d.ts +7 -6
- package/esm/src/api/exchange/_methods/_base/_semaphore.d.ts.map +1 -1
- package/esm/src/api/exchange/_methods/_base/_semaphore.js +34 -47
- package/esm/src/api/exchange/_methods/_base/_semaphore.js.map +1 -1
- package/esm/src/api/exchange/_methods/_base/execute.d.ts +14 -3
- package/esm/src/api/exchange/_methods/_base/execute.d.ts.map +1 -1
- package/esm/src/api/exchange/_methods/_base/execute.js +44 -10
- package/esm/src/api/exchange/_methods/_base/execute.js.map +1 -1
- package/esm/src/api/exchange/_methods/batchModify.d.ts +6 -6
- package/esm/src/api/exchange/_methods/createVault.d.ts +5 -5
- package/esm/src/api/exchange/_methods/modify.d.ts +5 -5
- package/esm/src/api/exchange/_methods/order.d.ts +13 -13
- package/esm/src/api/exchange/_methods/order.d.ts.map +1 -1
- package/esm/src/api/exchange/_methods/order.js +4 -2
- package/esm/src/api/exchange/_methods/order.js.map +1 -1
- package/esm/src/api/exchange/client.d.ts +1 -1
- package/esm/src/api/exchange/client.d.ts.map +1 -1
- package/esm/src/api/exchange/client.js.map +1 -1
- package/esm/src/api/exchange/mod.d.ts +1 -1
- package/esm/src/api/exchange/mod.d.ts.map +1 -1
- package/esm/src/api/exchange/mod.js.map +1 -1
- package/esm/src/api/info/_methods/_base/commonSchemas.d.ts +8 -8
- package/esm/src/api/info/_methods/frontendOpenOrders.d.ts +3 -3
- package/esm/src/api/info/_methods/historicalOrders.d.ts +4 -4
- package/esm/src/api/info/_methods/l3Orders.d.ts +11 -11
- package/esm/src/api/info/_methods/l4Orders.d.ts +6 -6
- package/esm/src/api/info/_methods/openOrders.d.ts +3 -3
- package/esm/src/api/info/_methods/orderStatus.d.ts +5 -5
- package/esm/src/api/info/_methods/recentTrades.d.ts +2 -2
- package/esm/src/api/info/_methods/twapHistory.d.ts +4 -4
- package/esm/src/api/info/_methods/userFills.d.ts +3 -3
- package/esm/src/api/info/_methods/userFillsByTime.d.ts +4 -4
- package/esm/src/api/info/_methods/userFunding.d.ts +3 -3
- package/esm/src/api/info/_methods/userFunding.js +2 -2
- package/esm/src/api/info/_methods/userFunding.js.map +1 -1
- package/esm/src/api/info/_methods/userTwapSliceFills.d.ts +4 -4
- package/esm/src/api/info/_methods/userTwapSliceFillsByTime.d.ts +5 -5
- package/esm/src/api/info/_methods/webData2.d.ts +9 -9
- package/esm/src/api/subscription/_methods/assetCtxs.d.ts +2 -0
- package/esm/src/api/subscription/_methods/assetCtxs.d.ts.map +1 -1
- package/esm/src/api/subscription/_methods/assetCtxs.js.map +1 -1
- package/esm/src/api/subscription/_methods/clearinghouseState.d.ts +2 -0
- package/esm/src/api/subscription/_methods/clearinghouseState.d.ts.map +1 -1
- package/esm/src/api/subscription/_methods/clearinghouseState.js +2 -0
- package/esm/src/api/subscription/_methods/clearinghouseState.js.map +1 -1
- package/esm/src/api/subscription/_methods/explorerBlock.d.ts +2 -0
- package/esm/src/api/subscription/_methods/explorerBlock.d.ts.map +1 -1
- package/esm/src/api/subscription/_methods/explorerBlock.js +2 -0
- package/esm/src/api/subscription/_methods/explorerBlock.js.map +1 -1
- package/esm/src/api/subscription/_methods/explorerTxs.d.ts +2 -0
- package/esm/src/api/subscription/_methods/explorerTxs.d.ts.map +1 -1
- package/esm/src/api/subscription/_methods/explorerTxs.js +2 -0
- package/esm/src/api/subscription/_methods/explorerTxs.js.map +1 -1
- package/esm/src/api/subscription/_methods/openOrders.d.ts +5 -5
- package/esm/src/api/subscription/_methods/orderUpdates.d.ts +4 -4
- package/esm/src/api/subscription/_methods/trades.d.ts +3 -3
- package/esm/src/api/subscription/_methods/twapStates.d.ts +9 -4
- package/esm/src/api/subscription/_methods/twapStates.d.ts.map +1 -1
- package/esm/src/api/subscription/_methods/twapStates.js +6 -1
- package/esm/src/api/subscription/_methods/twapStates.js.map +1 -1
- package/esm/src/api/subscription/_methods/userEvents.d.ts +17 -17
- package/esm/src/api/subscription/_methods/userFills.d.ts +5 -5
- package/esm/src/api/subscription/_methods/userHistoricalOrders.d.ts +6 -6
- package/esm/src/api/subscription/_methods/userTwapHistory.d.ts +6 -6
- package/esm/src/api/subscription/_methods/userTwapSliceFills.d.ts +6 -6
- package/esm/src/api/subscription/_methods/webData2.d.ts +11 -11
- package/esm/src/signing/_privateKeySigner.js +1 -1
- package/esm/src/signing/_privateKeySigner.js.map +1 -1
- package/esm/src/signing/mod.js +1 -1
- package/esm/src/signing/mod.js.map +1 -1
- package/package.json +2 -3
- package/script/_dnt.shims.d.ts +2 -0
- package/script/_dnt.shims.d.ts.map +1 -0
- package/script/_dnt.shims.js +61 -0
- package/script/_dnt.shims.js.map +1 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.d.ts +195 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.d.ts.map +1 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.js +468 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.js.map +1 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.d.ts +90 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.d.ts.map +1 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.js +215 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.js.map +1 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.d.ts +159 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.d.ts.map +1 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.js +578 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.js.map +1 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.d.ts +325 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.d.ts.map +1 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.js +1232 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.js.map +1 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.d.ts +76 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.d.ts.map +1 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.js +286 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.js.map +1 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/utils.d.ts +103 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/utils.js +273 -0
- package/script/deps/jsr.io/@noble/curves/2.0.1/src/utils.js.map +1 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_md.d.ts +49 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_md.d.ts.map +1 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_md.js +153 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_md.js.map +1 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.d.ts +55 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.d.ts.map +1 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.js +90 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.js.map +1 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.d.ts +36 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.d.ts.map +1 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.js +95 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.js.map +1 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.d.ts +199 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.d.ts.map +1 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.js +439 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.js.map +1 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.d.ts +58 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.d.ts.map +1 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.js +259 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.js.map +1 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/utils.d.ts +124 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/utils.js +304 -0
- package/script/deps/jsr.io/@noble/hashes/2.0.1/src/utils.js.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.d.ts +44 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.d.ts.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.js +182 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.js.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.d.ts +38 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.d.ts.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.js +99 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.js.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.d.ts +23 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.d.ts.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.js +134 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.js.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.d.ts +300 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.d.ts.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.js +576 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.js.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.d.ts +98 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.d.ts.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.js +211 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.js.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.d.ts +78 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.d.ts.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.js +308 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.js.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.d.ts +6 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.d.ts.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.js +21 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.js.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.d.ts +66 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.js +195 -0
- package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.js.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.d.ts +877 -0
- package/script/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.d.ts.map +1 -0
- package/script/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.js +2032 -0
- package/script/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.js.map +1 -0
- package/script/deps/jsr.io/@scure/base/2.0.0/index.d.ts +294 -0
- package/script/deps/jsr.io/@scure/base/2.0.0/index.d.ts.map +1 -0
- package/script/deps/jsr.io/@scure/base/2.0.0/index.js +710 -0
- package/script/deps/jsr.io/@scure/base/2.0.0/index.js.map +1 -0
- package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts +93 -0
- package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js +141 -0
- package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js.map +1 -0
- package/script/src/api/exchange/_methods/_base/_nonce.d.ts +3 -2
- package/script/src/api/exchange/_methods/_base/_nonce.d.ts.map +1 -1
- package/script/src/api/exchange/_methods/_base/_nonce.js +4 -3
- package/script/src/api/exchange/_methods/_base/_nonce.js.map +1 -1
- package/script/src/api/exchange/_methods/_base/_semaphore.d.ts +7 -6
- package/script/src/api/exchange/_methods/_base/_semaphore.d.ts.map +1 -1
- package/script/src/api/exchange/_methods/_base/_semaphore.js +35 -50
- package/script/src/api/exchange/_methods/_base/_semaphore.js.map +1 -1
- package/script/src/api/exchange/_methods/_base/execute.d.ts +14 -3
- package/script/src/api/exchange/_methods/_base/execute.d.ts.map +1 -1
- package/script/src/api/exchange/_methods/_base/execute.js +43 -9
- package/script/src/api/exchange/_methods/_base/execute.js.map +1 -1
- package/script/src/api/exchange/_methods/batchModify.d.ts +6 -6
- package/script/src/api/exchange/_methods/createVault.d.ts +5 -5
- package/script/src/api/exchange/_methods/modify.d.ts +5 -5
- package/script/src/api/exchange/_methods/order.d.ts +13 -13
- package/script/src/api/exchange/_methods/order.d.ts.map +1 -1
- package/script/src/api/exchange/_methods/order.js +4 -2
- package/script/src/api/exchange/_methods/order.js.map +1 -1
- package/script/src/api/exchange/client.d.ts +1 -1
- package/script/src/api/exchange/client.d.ts.map +1 -1
- package/script/src/api/exchange/client.js.map +1 -1
- package/script/src/api/exchange/mod.d.ts +1 -1
- package/script/src/api/exchange/mod.d.ts.map +1 -1
- package/script/src/api/exchange/mod.js.map +1 -1
- package/script/src/api/info/_methods/_base/commonSchemas.d.ts +8 -8
- package/script/src/api/info/_methods/frontendOpenOrders.d.ts +3 -3
- package/script/src/api/info/_methods/historicalOrders.d.ts +4 -4
- package/script/src/api/info/_methods/l3Orders.d.ts +11 -11
- package/script/src/api/info/_methods/l4Orders.d.ts +6 -6
- package/script/src/api/info/_methods/openOrders.d.ts +3 -3
- package/script/src/api/info/_methods/orderStatus.d.ts +5 -5
- package/script/src/api/info/_methods/recentTrades.d.ts +2 -2
- package/script/src/api/info/_methods/twapHistory.d.ts +4 -4
- package/script/src/api/info/_methods/userFills.d.ts +3 -3
- package/script/src/api/info/_methods/userFillsByTime.d.ts +4 -4
- package/script/src/api/info/_methods/userFunding.d.ts +3 -3
- package/script/src/api/info/_methods/userFunding.js +2 -2
- package/script/src/api/info/_methods/userFunding.js.map +1 -1
- package/script/src/api/info/_methods/userTwapSliceFills.d.ts +4 -4
- package/script/src/api/info/_methods/userTwapSliceFillsByTime.d.ts +5 -5
- package/script/src/api/info/_methods/webData2.d.ts +9 -9
- package/script/src/api/subscription/_methods/assetCtxs.d.ts +2 -0
- package/script/src/api/subscription/_methods/assetCtxs.d.ts.map +1 -1
- package/script/src/api/subscription/_methods/assetCtxs.js.map +1 -1
- package/script/src/api/subscription/_methods/clearinghouseState.d.ts +2 -0
- package/script/src/api/subscription/_methods/clearinghouseState.d.ts.map +1 -1
- package/script/src/api/subscription/_methods/clearinghouseState.js +2 -0
- package/script/src/api/subscription/_methods/clearinghouseState.js.map +1 -1
- package/script/src/api/subscription/_methods/explorerBlock.d.ts +2 -0
- package/script/src/api/subscription/_methods/explorerBlock.d.ts.map +1 -1
- package/script/src/api/subscription/_methods/explorerBlock.js +2 -0
- package/script/src/api/subscription/_methods/explorerBlock.js.map +1 -1
- package/script/src/api/subscription/_methods/explorerTxs.d.ts +2 -0
- package/script/src/api/subscription/_methods/explorerTxs.d.ts.map +1 -1
- package/script/src/api/subscription/_methods/explorerTxs.js +2 -0
- package/script/src/api/subscription/_methods/explorerTxs.js.map +1 -1
- package/script/src/api/subscription/_methods/openOrders.d.ts +5 -5
- package/script/src/api/subscription/_methods/orderUpdates.d.ts +4 -4
- package/script/src/api/subscription/_methods/trades.d.ts +3 -3
- package/script/src/api/subscription/_methods/twapStates.d.ts +9 -4
- package/script/src/api/subscription/_methods/twapStates.d.ts.map +1 -1
- package/script/src/api/subscription/_methods/twapStates.js +6 -1
- package/script/src/api/subscription/_methods/twapStates.js.map +1 -1
- package/script/src/api/subscription/_methods/userEvents.d.ts +17 -17
- package/script/src/api/subscription/_methods/userFills.d.ts +5 -5
- package/script/src/api/subscription/_methods/userHistoricalOrders.d.ts +6 -6
- package/script/src/api/subscription/_methods/userTwapHistory.d.ts +6 -6
- package/script/src/api/subscription/_methods/userTwapSliceFills.d.ts +6 -6
- package/script/src/api/subscription/_methods/webData2.d.ts +11 -11
- package/script/src/signing/_privateKeySigner.js +3 -3
- package/script/src/signing/_privateKeySigner.js.map +1 -1
- package/script/src/signing/mod.js +2 -2
- package/script/src/signing/mod.js.map +1 -1
- package/src/_dnt.shims.ts +60 -0
- package/src/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.ts +633 -0
- package/src/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.ts +292 -0
- package/src/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.ts +621 -0
- package/src/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.ts +1562 -0
- package/src/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.ts +327 -0
- package/src/deps/jsr.io/@noble/curves/2.0.1/src/utils.ts +306 -0
- package/src/deps/jsr.io/@noble/hashes/2.0.1/src/_md.ts +156 -0
- package/src/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.ts +91 -0
- package/src/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.ts +94 -0
- package/src/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.ts +469 -0
- package/src/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.ts +295 -0
- package/src/deps/jsr.io/@noble/hashes/2.0.1/src/utils.ts +340 -0
- package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.ts +212 -0
- package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.ts +100 -0
- package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.ts +104 -0
- package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.ts +626 -0
- package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.ts +274 -0
- package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.ts +391 -0
- package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.ts +12 -0
- package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.ts +233 -0
- package/src/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.ts +2196 -0
- package/src/deps/jsr.io/@scure/base/2.0.0/index.ts +857 -0
- package/src/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.ts +146 -0
- package/src/src/api/exchange/_methods/_base/_nonce.ts +3 -2
- package/src/src/api/exchange/_methods/_base/_semaphore.ts +34 -59
- package/src/src/api/exchange/_methods/_base/execute.ts +60 -12
- package/src/src/api/exchange/_methods/order.ts +5 -3
- package/src/src/api/exchange/client.ts +5 -1
- package/src/src/api/exchange/mod.ts +5 -1
- package/src/src/api/info/_methods/userFunding.ts +2 -2
- package/src/src/api/subscription/_methods/assetCtxs.ts +2 -0
- package/src/src/api/subscription/_methods/clearinghouseState.ts +2 -0
- package/src/src/api/subscription/_methods/explorerBlock.ts +2 -0
- package/src/src/api/subscription/_methods/explorerTxs.ts +2 -0
- package/src/src/api/subscription/_methods/twapStates.ts +9 -1
- package/src/src/signing/_privateKeySigner.ts +1 -1
- package/src/src/signing/mod.ts +1 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts +0 -21
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.js +0 -292
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.js.map +0 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts +0 -44
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.js +0 -46
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.js.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts +0 -21
- package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.js +0 -295
- package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.js.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts +0 -44
- package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.js +0 -62
- package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.js.map +0 -1
- package/src/deps/jsr.io/@std/msgpack/1.0.3/decode.ts +0 -391
- package/src/deps/jsr.io/@std/msgpack/1.0.3/mod.ts +0 -47
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
|
|
4
|
+
/** Internal node for the FIFO waiting queue. */
|
|
5
|
+
interface Node {
|
|
6
|
+
res: () => void;
|
|
7
|
+
next: Node | undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A counting semaphore for limiting concurrent access to a resource.
|
|
12
|
+
*
|
|
13
|
+
* @experimental **UNSTABLE**: New API, yet to be vetted.
|
|
14
|
+
*
|
|
15
|
+
* @example Usage
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { Semaphore } from "@std/async/unstable-semaphore";
|
|
18
|
+
*
|
|
19
|
+
* const sem = new Semaphore(2);
|
|
20
|
+
* {
|
|
21
|
+
* using _permit = await sem.acquire();
|
|
22
|
+
* // critical section
|
|
23
|
+
* } // permit is automatically released when exiting the block
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export class Semaphore {
|
|
27
|
+
#max: number;
|
|
28
|
+
/** Current number of available permits. */
|
|
29
|
+
#count: number;
|
|
30
|
+
/** Head of the waiting queue. */
|
|
31
|
+
#head: Node | undefined;
|
|
32
|
+
/** Tail of the waiting queue. */
|
|
33
|
+
#tail: Node | undefined;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Creates a new semaphore with the specified number of permits.
|
|
37
|
+
*
|
|
38
|
+
* @param max Maximum concurrent permits. Defaults to 1 (mutex).
|
|
39
|
+
*/
|
|
40
|
+
constructor(max: number = 1) {
|
|
41
|
+
if (max < 1) {
|
|
42
|
+
throw new TypeError(
|
|
43
|
+
`Cannot create semaphore as 'max' must be at least 1: current value is ${max}`,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
this.#count = this.#max = max;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Acquires a permit, waiting if none are available.
|
|
51
|
+
*
|
|
52
|
+
* @example Usage
|
|
53
|
+
* ```ts no-assert
|
|
54
|
+
* import { Semaphore } from "@std/async/unstable-semaphore";
|
|
55
|
+
*
|
|
56
|
+
* const sem = new Semaphore(1);
|
|
57
|
+
* await sem.acquire();
|
|
58
|
+
* try {
|
|
59
|
+
* // critical section
|
|
60
|
+
* } finally {
|
|
61
|
+
* sem.release();
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @example Using `using` statement
|
|
66
|
+
* ```ts no-assert
|
|
67
|
+
* import { Semaphore } from "@std/async/unstable-semaphore";
|
|
68
|
+
*
|
|
69
|
+
* const sem = new Semaphore(1);
|
|
70
|
+
* {
|
|
71
|
+
* using _permit = await sem.acquire();
|
|
72
|
+
* // critical section
|
|
73
|
+
* } // permit is automatically released when exiting the block
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @returns A promise that resolves to a {@linkcode Disposable} when a permit is acquired.
|
|
77
|
+
*/
|
|
78
|
+
acquire(): Promise<Disposable> {
|
|
79
|
+
const disposable: Disposable = { [Symbol.dispose]: () => this.release() };
|
|
80
|
+
if (this.#count > 0) {
|
|
81
|
+
this.#count--;
|
|
82
|
+
return Promise.resolve(disposable);
|
|
83
|
+
}
|
|
84
|
+
return new Promise((res) => {
|
|
85
|
+
const node: Node = { res: () => res(disposable), next: undefined };
|
|
86
|
+
if (this.#tail) {
|
|
87
|
+
this.#tail = this.#tail.next = node;
|
|
88
|
+
} else {
|
|
89
|
+
this.#head = this.#tail = node;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Tries to acquire a permit without waiting.
|
|
96
|
+
*
|
|
97
|
+
* @example Usage
|
|
98
|
+
* ```ts no-assert
|
|
99
|
+
* import { Semaphore } from "@std/async/unstable-semaphore";
|
|
100
|
+
*
|
|
101
|
+
* const sem = new Semaphore(1);
|
|
102
|
+
* const permit = sem.tryAcquire();
|
|
103
|
+
* if (permit) {
|
|
104
|
+
* using _ = permit;
|
|
105
|
+
* // critical section
|
|
106
|
+
* } else {
|
|
107
|
+
* // resource is busy
|
|
108
|
+
* }
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* @returns A {@linkcode Disposable} if a permit was acquired, `undefined` otherwise.
|
|
112
|
+
*/
|
|
113
|
+
tryAcquire(): Disposable | undefined {
|
|
114
|
+
if (this.#count > 0) {
|
|
115
|
+
this.#count--;
|
|
116
|
+
return { [Symbol.dispose]: () => this.release() };
|
|
117
|
+
}
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Releases a permit, allowing the next waiter to proceed.
|
|
123
|
+
*
|
|
124
|
+
* @example Usage
|
|
125
|
+
* ```ts no-assert
|
|
126
|
+
* import { Semaphore } from "@std/async/unstable-semaphore";
|
|
127
|
+
*
|
|
128
|
+
* const sem = new Semaphore(1);
|
|
129
|
+
* await sem.acquire();
|
|
130
|
+
* try {
|
|
131
|
+
* // critical section
|
|
132
|
+
* } finally {
|
|
133
|
+
* sem.release();
|
|
134
|
+
* }
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
release(): void {
|
|
138
|
+
if (this.#head) {
|
|
139
|
+
this.#head.res();
|
|
140
|
+
this.#head = this.#head.next;
|
|
141
|
+
if (!this.#head) this.#tail = undefined;
|
|
142
|
+
} else if (this.#count < this.#max) {
|
|
143
|
+
this.#count++;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Nonce manager for generating unique nonces per wallet address and network.
|
|
3
|
+
*
|
|
3
4
|
* Uses lazy cleanup: removes entries when Date.now() > lastNonce.
|
|
4
5
|
*/
|
|
5
6
|
class NonceManager {
|
|
@@ -24,5 +25,5 @@ class NonceManager {
|
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
/**
|
|
28
|
-
export const
|
|
28
|
+
/** Global nonce manager instance. */
|
|
29
|
+
export const globalNonceManager = /* @__PURE__ */ new NonceManager();
|
|
@@ -1,67 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
// Semaphore
|
|
3
|
-
// ============================================================
|
|
4
|
-
|
|
5
|
-
// TODO: Replace with @std/async/semaphore if the PR (https://github.com/denoland/std/pull/6894) will be merged
|
|
6
|
-
|
|
7
|
-
interface Node {
|
|
8
|
-
res: () => void;
|
|
9
|
-
next: Node | undefined;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export class Semaphore {
|
|
13
|
-
#max: number;
|
|
14
|
-
#count: number;
|
|
15
|
-
#head: Node | undefined;
|
|
16
|
-
#tail: Node | undefined;
|
|
17
|
-
|
|
18
|
-
constructor(max: number = 1) {
|
|
19
|
-
if (max < 1) {
|
|
20
|
-
throw new TypeError(
|
|
21
|
-
`Cannot create semaphore as 'max' must be at least 1: current value is ${max}`,
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
this.#count = this.#max = max;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
acquire(): Promise<void> {
|
|
28
|
-
if (this.#count > 0) {
|
|
29
|
-
this.#count--;
|
|
30
|
-
return Promise.resolve();
|
|
31
|
-
}
|
|
32
|
-
return new Promise((res) => {
|
|
33
|
-
const node: Node = { res, next: undefined };
|
|
34
|
-
if (this.#tail) {
|
|
35
|
-
this.#tail = this.#tail.next = node;
|
|
36
|
-
} else {
|
|
37
|
-
this.#head = this.#tail = node;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
release(): void {
|
|
43
|
-
if (this.#head) {
|
|
44
|
-
this.#head.res();
|
|
45
|
-
this.#head = this.#head.next;
|
|
46
|
-
if (!this.#head) this.#tail = undefined;
|
|
47
|
-
} else if (this.#count < this.#max) {
|
|
48
|
-
this.#count++;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// ============================================================
|
|
54
|
-
// RefCounted Registry
|
|
55
|
-
// ============================================================
|
|
1
|
+
import { Semaphore } from "../../../../../deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js";
|
|
56
2
|
|
|
3
|
+
/**
|
|
4
|
+
* A reference-counted registry for lazily creating and reusing per-key values.
|
|
5
|
+
*
|
|
6
|
+
* @template K - Map key type.
|
|
7
|
+
* @template V - Stored value type.
|
|
8
|
+
*/
|
|
57
9
|
class RefCountedRegistry<K, V> {
|
|
58
10
|
#map = new Map<K, { value: V; refs: number }>();
|
|
59
11
|
#factory: () => V;
|
|
60
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new registry instance.
|
|
15
|
+
*
|
|
16
|
+
* @param factory - Factory function used to create a new value when a key is first referenced.
|
|
17
|
+
*/
|
|
61
18
|
constructor(factory: () => V) {
|
|
62
19
|
this.#factory = factory;
|
|
63
20
|
}
|
|
64
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Increments the reference count for a key and returns its value.
|
|
24
|
+
*
|
|
25
|
+
* If the key is not present, a new value is created via the factory.
|
|
26
|
+
*
|
|
27
|
+
* @param key - Registry key.
|
|
28
|
+
* @returns The value associated with the key.
|
|
29
|
+
*/
|
|
65
30
|
ref(key: K): V {
|
|
66
31
|
let entry = this.#map.get(key);
|
|
67
32
|
if (!entry) {
|
|
@@ -72,6 +37,13 @@ class RefCountedRegistry<K, V> {
|
|
|
72
37
|
return entry.value;
|
|
73
38
|
}
|
|
74
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Decrements the reference count for a key.
|
|
42
|
+
*
|
|
43
|
+
* When the count reaches zero, the entry is removed.
|
|
44
|
+
*
|
|
45
|
+
* @param key - Registry key.
|
|
46
|
+
*/
|
|
75
47
|
unref(key: K): void {
|
|
76
48
|
const entry = this.#map.get(key);
|
|
77
49
|
if (!entry) return;
|
|
@@ -81,12 +53,15 @@ class RefCountedRegistry<K, V> {
|
|
|
81
53
|
}
|
|
82
54
|
}
|
|
83
55
|
|
|
84
|
-
// ============================================================
|
|
85
|
-
// Helper
|
|
86
|
-
// ============================================================
|
|
87
|
-
|
|
88
56
|
const semaphores = new RefCountedRegistry(() => new Semaphore(1));
|
|
89
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Acquires a lock for the given key, executes the provided async function, and releases the lock.
|
|
60
|
+
*
|
|
61
|
+
* @param key The key to lock on.
|
|
62
|
+
* @param fn The async function to execute while holding the lock.
|
|
63
|
+
* @returns The result of the async function.
|
|
64
|
+
*/
|
|
90
65
|
export async function withLock<K, T>(key: K, fn: () => Promise<T>): Promise<T> {
|
|
91
66
|
const semaphore = semaphores.ref(key);
|
|
92
67
|
await semaphore.acquire();
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
signUserSignedAction,
|
|
11
11
|
} from "../../../../signing/mod.js";
|
|
12
12
|
import { assertSuccessResponse } from "./errors.js";
|
|
13
|
-
import {
|
|
13
|
+
import { globalNonceManager } from "./_nonce.js";
|
|
14
14
|
import { withLock } from "./_semaphore.js";
|
|
15
15
|
import type { SignatureSchema } from "./commonSchemas.js";
|
|
16
16
|
|
|
@@ -81,8 +81,20 @@ export interface ExchangeMultiSigConfig<T extends IRequestTransport = IRequestTr
|
|
|
81
81
|
multiSigUser: `0x${string}`;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Configuration for external signing Exchange API requests.
|
|
86
|
+
* Use this when signing is handled externally (e.g., by a gRPC server or HSM).
|
|
87
|
+
* The transport receives unsigned action payloads and is responsible for signing.
|
|
88
|
+
*/
|
|
89
|
+
export interface ExchangeExternalSigningConfig<T extends IRequestTransport = IRequestTransport> extends BaseConfig<T> {
|
|
90
|
+
/** Marks this config as external signing mode. */
|
|
91
|
+
externalSigning: true;
|
|
92
|
+
/** The user address for nonce management. */
|
|
93
|
+
userAddress: `0x${string}`;
|
|
94
|
+
}
|
|
95
|
+
|
|
84
96
|
/** Union type for all Exchange API configurations. */
|
|
85
|
-
export type ExchangeConfig = ExchangeSingleWalletConfig | ExchangeMultiSigConfig;
|
|
97
|
+
export type ExchangeConfig = ExchangeSingleWalletConfig | ExchangeMultiSigConfig | ExchangeExternalSigningConfig;
|
|
86
98
|
|
|
87
99
|
// =============================================================
|
|
88
100
|
// Execute L1 Action
|
|
@@ -90,7 +102,7 @@ export type ExchangeConfig = ExchangeSingleWalletConfig | ExchangeMultiSigConfig
|
|
|
90
102
|
|
|
91
103
|
/**
|
|
92
104
|
* Execute an L1 action on the Hyperliquid Exchange.
|
|
93
|
-
* Handles
|
|
105
|
+
* Handles single-wallet, multi-sig, and external signing.
|
|
94
106
|
*/
|
|
95
107
|
export async function executeL1Action<T>(
|
|
96
108
|
config: ExchangeConfig,
|
|
@@ -102,13 +114,14 @@ export async function executeL1Action<T>(
|
|
|
102
114
|
},
|
|
103
115
|
): Promise<T> {
|
|
104
116
|
const { transport } = config;
|
|
105
|
-
const
|
|
106
|
-
|
|
117
|
+
const walletAddress = "externalSigning" in config
|
|
118
|
+
? v.parse(Address, config.userAddress)
|
|
119
|
+
: await getWalletAddress(getLeader(config));
|
|
107
120
|
|
|
108
121
|
// Semaphore ensures requests arrive at server in nonce order (prevents out-of-order delivery)
|
|
109
122
|
const key = `${walletAddress}:${transport.isTestnet}`;
|
|
110
123
|
return await withLock(key, async () => {
|
|
111
|
-
const nonce = await (config.nonceManager?.(walletAddress) ??
|
|
124
|
+
const nonce = await (config.nonceManager?.(walletAddress) ?? globalNonceManager.getNonce(key));
|
|
112
125
|
|
|
113
126
|
// Validate and resolve options
|
|
114
127
|
const vaultAddress = v.parse(
|
|
@@ -124,7 +137,22 @@ export async function executeL1Action<T>(
|
|
|
124
137
|
);
|
|
125
138
|
const signal = options?.signal;
|
|
126
139
|
|
|
140
|
+
// Handle external signing - send unsigned action to transport
|
|
141
|
+
if ("externalSigning" in config) {
|
|
142
|
+
const response = await transport.request("exchange", {
|
|
143
|
+
action,
|
|
144
|
+
nonce,
|
|
145
|
+
vaultAddress,
|
|
146
|
+
expiresAfter,
|
|
147
|
+
isTestnet: transport.isTestnet,
|
|
148
|
+
userAddress: walletAddress,
|
|
149
|
+
}, signal);
|
|
150
|
+
assertSuccessResponse(response);
|
|
151
|
+
return response as T;
|
|
152
|
+
}
|
|
153
|
+
|
|
127
154
|
// Sign action (multi-sig or single wallet)
|
|
155
|
+
const leader = getLeader(config);
|
|
128
156
|
const [finalAction, signature] = "wallet" in config
|
|
129
157
|
? [
|
|
130
158
|
action,
|
|
@@ -168,7 +196,7 @@ function getNonceFieldName(types: Record<string, { name: string; type: string }[
|
|
|
168
196
|
|
|
169
197
|
/**
|
|
170
198
|
* Execute a user-signed action (EIP-712) on the Hyperliquid Exchange.
|
|
171
|
-
* Handles
|
|
199
|
+
* Handles single-wallet, multi-sig, and external signing.
|
|
172
200
|
* Automatically adds signatureChainId, hyperliquidChain, and nonce/time.
|
|
173
201
|
*/
|
|
174
202
|
export async function executeUserSignedAction<T>(
|
|
@@ -180,27 +208,43 @@ export async function executeUserSignedAction<T>(
|
|
|
180
208
|
},
|
|
181
209
|
): Promise<T> {
|
|
182
210
|
const { transport } = config;
|
|
183
|
-
const
|
|
184
|
-
|
|
211
|
+
const walletAddress = "externalSigning" in config
|
|
212
|
+
? v.parse(Address, config.userAddress)
|
|
213
|
+
: await getWalletAddress(getLeader(config));
|
|
185
214
|
|
|
186
215
|
// Semaphore ensures requests arrive at server in nonce order (prevents out-of-order delivery)
|
|
187
216
|
const key = `${walletAddress}:${transport.isTestnet}`;
|
|
188
217
|
return withLock(key, async () => {
|
|
189
|
-
const nonce = await (config.nonceManager?.(walletAddress) ??
|
|
218
|
+
const nonce = await (config.nonceManager?.(walletAddress) ?? globalNonceManager.getNonce(key));
|
|
190
219
|
const signal = options?.signal;
|
|
191
220
|
|
|
192
221
|
// Add system fields for user-signed actions
|
|
193
222
|
const { type, ...restAction } = action;
|
|
194
223
|
const nonceFieldName = getNonceFieldName(types);
|
|
224
|
+
const signatureChainId = await getSignatureChainId(config);
|
|
195
225
|
const fullAction = { // key order is important for multi-sig
|
|
196
226
|
type,
|
|
197
|
-
signatureChainId
|
|
227
|
+
signatureChainId,
|
|
198
228
|
hyperliquidChain: transport.isTestnet ? "Testnet" : "Mainnet",
|
|
199
229
|
...restAction,
|
|
200
230
|
[nonceFieldName]: nonce,
|
|
201
231
|
};
|
|
202
232
|
|
|
233
|
+
// Handle external signing - send unsigned action with types to transport
|
|
234
|
+
if ("externalSigning" in config) {
|
|
235
|
+
const response = await transport.request("exchange", {
|
|
236
|
+
action: fullAction,
|
|
237
|
+
types,
|
|
238
|
+
nonce,
|
|
239
|
+
isTestnet: transport.isTestnet,
|
|
240
|
+
userAddress: walletAddress,
|
|
241
|
+
}, signal);
|
|
242
|
+
assertSuccessResponse(response);
|
|
243
|
+
return response as T;
|
|
244
|
+
}
|
|
245
|
+
|
|
203
246
|
// Sign action (multi-sig or single wallet)
|
|
247
|
+
const leader = getLeader(config);
|
|
204
248
|
const [finalAction, signature] = "wallet" in config
|
|
205
249
|
? [fullAction, await signUserSignedAction({ wallet: leader, action: fullAction, types })]
|
|
206
250
|
: await signMultiSigUserSigned(config, fullAction, types, walletAddress, nonce);
|
|
@@ -334,7 +378,7 @@ async function signMultiSigUserSigned(
|
|
|
334
378
|
// =============================================================
|
|
335
379
|
|
|
336
380
|
/** Get the leader wallet (first signer for the single wallet, or multi-sig). */
|
|
337
|
-
function getLeader(config:
|
|
381
|
+
function getLeader(config: ExchangeSingleWalletConfig | ExchangeMultiSigConfig): AbstractWallet {
|
|
338
382
|
return "wallet" in config ? config.wallet : config.signers[0];
|
|
339
383
|
}
|
|
340
384
|
|
|
@@ -346,5 +390,9 @@ async function getSignatureChainId(config: ExchangeConfig): Promise<`0x${string}
|
|
|
346
390
|
: config.signatureChainId;
|
|
347
391
|
return v.parse(Hex, id);
|
|
348
392
|
}
|
|
393
|
+
// External signing defaults to chain ID 1 (mainnet) if not specified
|
|
394
|
+
if ("externalSigning" in config) {
|
|
395
|
+
return "0x1";
|
|
396
|
+
}
|
|
349
397
|
return getWalletChainId(getLeader(config));
|
|
350
398
|
}
|
|
@@ -141,11 +141,11 @@ export const OrderRequest = /* @__PURE__ */ (() => {
|
|
|
141
141
|
Address,
|
|
142
142
|
v.description("Builder address."),
|
|
143
143
|
),
|
|
144
|
-
/** Builder fee in 0.1bps (1 = 0.0001%). */
|
|
144
|
+
/** Builder fee in 0.1bps (1 = 0.0001%). Max 100 for perps (0.1%), 1000 for spot (1%). */
|
|
145
145
|
f: v.pipe(
|
|
146
146
|
UnsignedInteger,
|
|
147
|
-
v.maxValue(
|
|
148
|
-
v.description("Builder fee in 0.1bps (1 = 0.0001%)."),
|
|
147
|
+
v.maxValue(1000),
|
|
148
|
+
v.description("Builder fee in 0.1bps (1 = 0.0001%). Max 100 for perps (0.1%), 1000 for spot (1%)."),
|
|
149
149
|
),
|
|
150
150
|
})),
|
|
151
151
|
v.description("Builder fee."),
|
|
@@ -259,6 +259,8 @@ export const OrderResponse = /* @__PURE__ */ (() => {
|
|
|
259
259
|
v.description("Error message."),
|
|
260
260
|
),
|
|
261
261
|
}),
|
|
262
|
+
v.literal("waitingForFill"),
|
|
263
|
+
v.literal("waitingForTrigger"),
|
|
262
264
|
]),
|
|
263
265
|
),
|
|
264
266
|
v.description("Array of statuses for each placed order."),
|
|
@@ -681,7 +681,11 @@ export class ExchangeClient<C extends ExchangeConfig = ExchangeSingleWalletConfi
|
|
|
681
681
|
// Type Re-exports
|
|
682
682
|
// =============================================================
|
|
683
683
|
|
|
684
|
-
export type {
|
|
684
|
+
export type {
|
|
685
|
+
ExchangeExternalSigningConfig,
|
|
686
|
+
ExchangeMultiSigConfig,
|
|
687
|
+
ExchangeSingleWalletConfig,
|
|
688
|
+
} from "./_methods/_base/execute.js";
|
|
685
689
|
export { ApiRequestError } from "./_methods/_base/errors.js";
|
|
686
690
|
|
|
687
691
|
export type {
|
|
@@ -37,7 +37,11 @@
|
|
|
37
37
|
* @module
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
|
-
export type {
|
|
40
|
+
export type {
|
|
41
|
+
ExchangeExternalSigningConfig,
|
|
42
|
+
ExchangeMultiSigConfig,
|
|
43
|
+
ExchangeSingleWalletConfig,
|
|
44
|
+
} from "./_methods/_base/execute.js";
|
|
41
45
|
export { ApiRequestError } from "./_methods/_base/errors.js";
|
|
42
46
|
|
|
43
47
|
export * from "./_methods/agentEnableDexAbstraction.js";
|
|
@@ -25,7 +25,7 @@ export const UserFundingRequest = /* @__PURE__ */ (() => {
|
|
|
25
25
|
),
|
|
26
26
|
/** Start time (in ms since epoch). */
|
|
27
27
|
startTime: v.pipe(
|
|
28
|
-
UnsignedInteger,
|
|
28
|
+
v.nullish(UnsignedInteger),
|
|
29
29
|
v.description("Start time (in ms since epoch)."),
|
|
30
30
|
),
|
|
31
31
|
/** End time (in ms since epoch). */
|
|
@@ -131,7 +131,7 @@ export type UserFundingParameters = Omit<v.InferInput<typeof UserFundingRequest>
|
|
|
131
131
|
*
|
|
132
132
|
* const data = await userFunding(
|
|
133
133
|
* { transport },
|
|
134
|
-
* { user: "0x..."
|
|
134
|
+
* { user: "0x..." },
|
|
135
135
|
* );
|
|
136
136
|
* ```
|
|
137
137
|
*
|
|
@@ -80,6 +80,8 @@ export type AssetCtxsParameters = Omit<v.InferInput<typeof AssetCtxsRequest>, "t
|
|
|
80
80
|
* (data) => console.log(data),
|
|
81
81
|
* );
|
|
82
82
|
* ```
|
|
83
|
+
*
|
|
84
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
83
85
|
*/
|
|
84
86
|
export function assetCtxs(
|
|
85
87
|
config: SubscriptionConfig,
|
|
@@ -92,6 +92,8 @@ export type ClearinghouseStateParameters = Omit<v.InferInput<typeof Clearinghous
|
|
|
92
92
|
* (data) => console.log(data),
|
|
93
93
|
* );
|
|
94
94
|
* ```
|
|
95
|
+
*
|
|
96
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
95
97
|
*/
|
|
96
98
|
export function clearinghouseState(
|
|
97
99
|
config: SubscriptionConfig,
|
|
@@ -89,6 +89,8 @@ import type { ISubscription } from "../../../transport/mod.js";
|
|
|
89
89
|
* (data) => console.log(data),
|
|
90
90
|
* );
|
|
91
91
|
* ```
|
|
92
|
+
*
|
|
93
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
92
94
|
*/
|
|
93
95
|
export function explorerBlock(
|
|
94
96
|
config: SubscriptionConfig,
|
|
@@ -59,6 +59,8 @@ import type { ISubscription } from "../../../transport/mod.js";
|
|
|
59
59
|
* (data) => console.log(data),
|
|
60
60
|
* );
|
|
61
61
|
* ```
|
|
62
|
+
*
|
|
63
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
62
64
|
*/
|
|
63
65
|
export function explorerTxs(
|
|
64
66
|
config: SubscriptionConfig,
|
|
@@ -21,6 +21,11 @@ export const TwapStatesRequest = /* @__PURE__ */ (() => {
|
|
|
21
21
|
Address,
|
|
22
22
|
v.description("User address."),
|
|
23
23
|
),
|
|
24
|
+
/** DEX name (empty string for main dex). */
|
|
25
|
+
dex: v.pipe(
|
|
26
|
+
v.optional(v.string()),
|
|
27
|
+
v.description("DEX name (empty string for main dex)."),
|
|
28
|
+
),
|
|
24
29
|
}),
|
|
25
30
|
v.description("Subscribe to TWAP states updates for a specific user."),
|
|
26
31
|
);
|
|
@@ -87,6 +92,8 @@ export type TwapStatesParameters = Omit<v.InferInput<typeof TwapStatesRequest>,
|
|
|
87
92
|
* (data) => console.log(data),
|
|
88
93
|
* );
|
|
89
94
|
* ```
|
|
95
|
+
*
|
|
96
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
90
97
|
*/
|
|
91
98
|
export function twapStates(
|
|
92
99
|
config: SubscriptionConfig,
|
|
@@ -96,9 +103,10 @@ export function twapStates(
|
|
|
96
103
|
const payload = v.parse(TwapStatesRequest, {
|
|
97
104
|
type: "twapStates",
|
|
98
105
|
...params,
|
|
106
|
+
dex: params.dex ?? "", // same value as in response
|
|
99
107
|
});
|
|
100
108
|
return config.transport.subscribe<TwapStatesEvent>(payload.type, payload, (e) => {
|
|
101
|
-
if (e.detail.user === payload.user) {
|
|
109
|
+
if (e.detail.user === payload.user && e.detail.dex === payload.dex) {
|
|
102
110
|
listener(e.detail);
|
|
103
111
|
}
|
|
104
112
|
});
|
package/src/src/signing/mod.ts
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
|
|
64
64
|
import { keccak_256 } from "@noble/hashes/sha3.js";
|
|
65
65
|
import { bytesToHex, concatBytes, hexToBytes } from "@noble/hashes/utils.js";
|
|
66
|
-
import { encode as encodeMsgpack, type ValueType } from "../../deps/jsr.io/@std/msgpack/1.0.3/
|
|
66
|
+
import { encode as encodeMsgpack, type ValueType } from "../../deps/jsr.io/@std/msgpack/1.0.3/encode.js";
|
|
67
67
|
import { type AbstractWallet, type Signature, signTypedData } from "./_abstractWallet.js";
|
|
68
68
|
|
|
69
69
|
export {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ValueType } from "./encode.js";
|
|
2
|
-
/**
|
|
3
|
-
* Decode a value from the {@link https://msgpack.org/ | MessagePack} binary format.
|
|
4
|
-
*
|
|
5
|
-
* If the input is not in valid message pack format, an error will be thrown.
|
|
6
|
-
*
|
|
7
|
-
* @example Usage
|
|
8
|
-
* ```ts
|
|
9
|
-
* import { decode } from "@std/msgpack/decode";
|
|
10
|
-
* import { assertEquals } from "@std/assert";
|
|
11
|
-
*
|
|
12
|
-
* const encoded = new Uint8Array([163, 72, 105, 33]);
|
|
13
|
-
*
|
|
14
|
-
* assertEquals(decode(encoded), "Hi!");
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @param data MessagePack binary data.
|
|
18
|
-
* @returns Decoded value from the MessagePack binary data.
|
|
19
|
-
*/
|
|
20
|
-
export declare function decode(data: Uint8Array): ValueType;
|
|
21
|
-
//# sourceMappingURL=decode.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/msgpack/1.0.3/decode.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAclD"}
|