@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,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal Merkle-Damgard hash utils.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
import { abytes, aexists, aoutput, clean, createView, type Hash } from './utils.js';
|
|
6
|
+
|
|
7
|
+
/** Choice: a ? b : c */
|
|
8
|
+
export function Chi(a: number, b: number, c: number): number {
|
|
9
|
+
return (a & b) ^ (~a & c);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Majority function, true if any two inputs is true. */
|
|
13
|
+
export function Maj(a: number, b: number, c: number): number {
|
|
14
|
+
return (a & b) ^ (a & c) ^ (b & c);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Merkle-Damgard hash construction base class.
|
|
19
|
+
* Could be used to create MD5, RIPEMD, SHA1, SHA2.
|
|
20
|
+
*/
|
|
21
|
+
export abstract class HashMD<T extends HashMD<T>> implements Hash<T> {
|
|
22
|
+
protected abstract process(buf: DataView, offset: number): void;
|
|
23
|
+
protected abstract get(): number[];
|
|
24
|
+
protected abstract set(...args: number[]): void;
|
|
25
|
+
abstract destroy(): void;
|
|
26
|
+
protected abstract roundClean(): void;
|
|
27
|
+
|
|
28
|
+
readonly blockLen: number;
|
|
29
|
+
readonly outputLen: number;
|
|
30
|
+
readonly padOffset: number;
|
|
31
|
+
readonly isLE: boolean;
|
|
32
|
+
|
|
33
|
+
// For partial updates less than block size
|
|
34
|
+
protected buffer: Uint8Array;
|
|
35
|
+
protected view: DataView;
|
|
36
|
+
protected finished = false;
|
|
37
|
+
protected length = 0;
|
|
38
|
+
protected pos = 0;
|
|
39
|
+
protected destroyed = false;
|
|
40
|
+
|
|
41
|
+
constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean) {
|
|
42
|
+
this.blockLen = blockLen;
|
|
43
|
+
this.outputLen = outputLen;
|
|
44
|
+
this.padOffset = padOffset;
|
|
45
|
+
this.isLE = isLE;
|
|
46
|
+
this.buffer = new Uint8Array(blockLen);
|
|
47
|
+
this.view = createView(this.buffer);
|
|
48
|
+
}
|
|
49
|
+
update(data: Uint8Array): this {
|
|
50
|
+
aexists(this);
|
|
51
|
+
abytes(data);
|
|
52
|
+
const { view, buffer, blockLen } = this;
|
|
53
|
+
const len = data.length;
|
|
54
|
+
for (let pos = 0; pos < len; ) {
|
|
55
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
|
56
|
+
// Fast path: we have at least one block in input, cast it to view and process
|
|
57
|
+
if (take === blockLen) {
|
|
58
|
+
const dataView = createView(data);
|
|
59
|
+
for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
buffer.set(data.subarray(pos, pos + take), this.pos);
|
|
63
|
+
this.pos += take;
|
|
64
|
+
pos += take;
|
|
65
|
+
if (this.pos === blockLen) {
|
|
66
|
+
this.process(view, 0);
|
|
67
|
+
this.pos = 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
this.length += data.length;
|
|
71
|
+
this.roundClean();
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
digestInto(out: Uint8Array): void {
|
|
75
|
+
aexists(this);
|
|
76
|
+
aoutput(out, this);
|
|
77
|
+
this.finished = true;
|
|
78
|
+
// Padding
|
|
79
|
+
// We can avoid allocation of buffer for padding completely if it
|
|
80
|
+
// was previously not allocated here. But it won't change performance.
|
|
81
|
+
const { buffer, view, blockLen, isLE } = this;
|
|
82
|
+
let { pos } = this;
|
|
83
|
+
// append the bit '1' to the message
|
|
84
|
+
buffer[pos++] = 0b10000000;
|
|
85
|
+
clean(this.buffer.subarray(pos));
|
|
86
|
+
// we have less than padOffset left in buffer, so we cannot put length in
|
|
87
|
+
// current block, need process it and pad again
|
|
88
|
+
if (this.padOffset > blockLen - pos) {
|
|
89
|
+
this.process(view, 0);
|
|
90
|
+
pos = 0;
|
|
91
|
+
}
|
|
92
|
+
// Pad until full block byte with zeros
|
|
93
|
+
for (let i = pos; i < blockLen; i++) buffer[i] = 0;
|
|
94
|
+
// Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that
|
|
95
|
+
// You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.
|
|
96
|
+
// So we just write lowest 64 bits of that value.
|
|
97
|
+
view.setBigUint64(blockLen - 8, BigInt(this.length * 8), isLE);
|
|
98
|
+
this.process(view, 0);
|
|
99
|
+
const oview = createView(out);
|
|
100
|
+
const len = this.outputLen;
|
|
101
|
+
// NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT
|
|
102
|
+
if (len % 4) throw new Error('_sha2: outputLen must be aligned to 32bit');
|
|
103
|
+
const outLen = len / 4;
|
|
104
|
+
const state = this.get();
|
|
105
|
+
if (outLen > state.length) throw new Error('_sha2: outputLen bigger than state');
|
|
106
|
+
for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE);
|
|
107
|
+
}
|
|
108
|
+
digest(): Uint8Array {
|
|
109
|
+
const { buffer, outputLen } = this;
|
|
110
|
+
this.digestInto(buffer);
|
|
111
|
+
const res = buffer.slice(0, outputLen);
|
|
112
|
+
this.destroy();
|
|
113
|
+
return res;
|
|
114
|
+
}
|
|
115
|
+
_cloneInto(to?: T): T {
|
|
116
|
+
to ||= new (this.constructor as any)() as T;
|
|
117
|
+
to.set(...this.get());
|
|
118
|
+
const { blockLen, buffer, length, finished, destroyed, pos } = this;
|
|
119
|
+
to.destroyed = destroyed;
|
|
120
|
+
to.finished = finished;
|
|
121
|
+
to.length = length;
|
|
122
|
+
to.pos = pos;
|
|
123
|
+
if (length % blockLen) to.buffer.set(buffer);
|
|
124
|
+
return to as unknown as any;
|
|
125
|
+
}
|
|
126
|
+
clone(): T {
|
|
127
|
+
return this._cloneInto();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.
|
|
133
|
+
* Check out `test/misc/sha2-gen-iv.js` for recomputation guide.
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */
|
|
137
|
+
export const SHA256_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([
|
|
138
|
+
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,
|
|
139
|
+
]);
|
|
140
|
+
|
|
141
|
+
/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */
|
|
142
|
+
export const SHA224_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([
|
|
143
|
+
0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,
|
|
144
|
+
]);
|
|
145
|
+
|
|
146
|
+
/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */
|
|
147
|
+
export const SHA384_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([
|
|
148
|
+
0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,
|
|
149
|
+
0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,
|
|
150
|
+
]);
|
|
151
|
+
|
|
152
|
+
/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */
|
|
153
|
+
export const SHA512_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([
|
|
154
|
+
0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,
|
|
155
|
+
0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,
|
|
156
|
+
]);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.
|
|
3
|
+
* @todo re-check https://issues.chromium.org/issues/42212588
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
7
|
+
const _32n = /* @__PURE__ */ BigInt(32);
|
|
8
|
+
|
|
9
|
+
function fromBig(
|
|
10
|
+
n: bigint,
|
|
11
|
+
le = false
|
|
12
|
+
): {
|
|
13
|
+
h: number;
|
|
14
|
+
l: number;
|
|
15
|
+
} {
|
|
16
|
+
if (le) return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };
|
|
17
|
+
return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function split(lst: bigint[], le = false): Uint32Array[] {
|
|
21
|
+
const len = lst.length;
|
|
22
|
+
let Ah = new Uint32Array(len);
|
|
23
|
+
let Al = new Uint32Array(len);
|
|
24
|
+
for (let i = 0; i < len; i++) {
|
|
25
|
+
const { h, l } = fromBig(lst[i], le);
|
|
26
|
+
[Ah[i], Al[i]] = [h, l];
|
|
27
|
+
}
|
|
28
|
+
return [Ah, Al];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const toBig = (h: number, l: number): bigint => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);
|
|
32
|
+
// for Shift in [0, 32)
|
|
33
|
+
const shrSH = (h: number, _l: number, s: number): number => h >>> s;
|
|
34
|
+
const shrSL = (h: number, l: number, s: number): number => (h << (32 - s)) | (l >>> s);
|
|
35
|
+
// Right rotate for Shift in [1, 32)
|
|
36
|
+
const rotrSH = (h: number, l: number, s: number): number => (h >>> s) | (l << (32 - s));
|
|
37
|
+
const rotrSL = (h: number, l: number, s: number): number => (h << (32 - s)) | (l >>> s);
|
|
38
|
+
// Right rotate for Shift in (32, 64), NOTE: 32 is special case.
|
|
39
|
+
const rotrBH = (h: number, l: number, s: number): number => (h << (64 - s)) | (l >>> (s - 32));
|
|
40
|
+
const rotrBL = (h: number, l: number, s: number): number => (h >>> (s - 32)) | (l << (64 - s));
|
|
41
|
+
// Right rotate for shift===32 (just swaps l&h)
|
|
42
|
+
const rotr32H = (_h: number, l: number): number => l;
|
|
43
|
+
const rotr32L = (h: number, _l: number): number => h;
|
|
44
|
+
// Left rotate for Shift in [1, 32)
|
|
45
|
+
const rotlSH = (h: number, l: number, s: number): number => (h << s) | (l >>> (32 - s));
|
|
46
|
+
const rotlSL = (h: number, l: number, s: number): number => (l << s) | (h >>> (32 - s));
|
|
47
|
+
// Left rotate for Shift in (32, 64), NOTE: 32 is special case.
|
|
48
|
+
const rotlBH = (h: number, l: number, s: number): number => (l << (s - 32)) | (h >>> (64 - s));
|
|
49
|
+
const rotlBL = (h: number, l: number, s: number): number => (h << (s - 32)) | (l >>> (64 - s));
|
|
50
|
+
|
|
51
|
+
// JS uses 32-bit signed integers for bitwise operations which means we cannot
|
|
52
|
+
// simple take carry out of low bit sum by shift, we need to use division.
|
|
53
|
+
function add(
|
|
54
|
+
Ah: number,
|
|
55
|
+
Al: number,
|
|
56
|
+
Bh: number,
|
|
57
|
+
Bl: number
|
|
58
|
+
): {
|
|
59
|
+
h: number;
|
|
60
|
+
l: number;
|
|
61
|
+
} {
|
|
62
|
+
const l = (Al >>> 0) + (Bl >>> 0);
|
|
63
|
+
return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };
|
|
64
|
+
}
|
|
65
|
+
// Addition with more than 2 elements
|
|
66
|
+
const add3L = (Al: number, Bl: number, Cl: number): number => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
|
|
67
|
+
const add3H = (low: number, Ah: number, Bh: number, Ch: number): number =>
|
|
68
|
+
(Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;
|
|
69
|
+
const add4L = (Al: number, Bl: number, Cl: number, Dl: number): number =>
|
|
70
|
+
(Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
|
|
71
|
+
const add4H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number): number =>
|
|
72
|
+
(Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;
|
|
73
|
+
const add5L = (Al: number, Bl: number, Cl: number, Dl: number, El: number): number =>
|
|
74
|
+
(Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
|
75
|
+
const add5H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number): number =>
|
|
76
|
+
(Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;
|
|
77
|
+
|
|
78
|
+
// prettier-ignore
|
|
79
|
+
export {
|
|
80
|
+
add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig
|
|
81
|
+
};
|
|
82
|
+
// prettier-ignore
|
|
83
|
+
const u64: { fromBig: typeof fromBig; split: typeof split; toBig: (h: number, l: number) => bigint; shrSH: (h: number, _l: number, s: number) => number; shrSL: (h: number, l: number, s: number) => number; rotrSH: (h: number, l: number, s: number) => number; rotrSL: (h: number, l: number, s: number) => number; rotrBH: (h: number, l: number, s: number) => number; rotrBL: (h: number, l: number, s: number) => number; rotr32H: (_h: number, l: number) => number; rotr32L: (h: number, _l: number) => number; rotlSH: (h: number, l: number, s: number) => number; rotlSL: (h: number, l: number, s: number) => number; rotlBH: (h: number, l: number, s: number) => number; rotlBL: (h: number, l: number, s: number) => number; add: typeof add; add3L: (Al: number, Bl: number, Cl: number) => number; add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; } = {
|
|
84
|
+
fromBig, split, toBig,
|
|
85
|
+
shrSH, shrSL,
|
|
86
|
+
rotrSH, rotrSL, rotrBH, rotrBL,
|
|
87
|
+
rotr32H, rotr32L,
|
|
88
|
+
rotlSH, rotlSL, rotlBH, rotlBL,
|
|
89
|
+
add, add3L, add3H, add4L, add4H, add5H, add5L,
|
|
90
|
+
};
|
|
91
|
+
export default u64;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HMAC: RFC2104 message authentication code.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
import { abytes, aexists, ahash, clean, type CHash, type Hash } from './utils.js';
|
|
6
|
+
|
|
7
|
+
/** Internal class for HMAC. */
|
|
8
|
+
export class _HMAC<T extends Hash<T>> implements Hash<_HMAC<T>> {
|
|
9
|
+
oHash: T;
|
|
10
|
+
iHash: T;
|
|
11
|
+
blockLen: number;
|
|
12
|
+
outputLen: number;
|
|
13
|
+
private finished = false;
|
|
14
|
+
private destroyed = false;
|
|
15
|
+
|
|
16
|
+
constructor(hash: CHash, key: Uint8Array) {
|
|
17
|
+
ahash(hash);
|
|
18
|
+
abytes(key, undefined, 'key');
|
|
19
|
+
this.iHash = hash.create() as T;
|
|
20
|
+
if (typeof this.iHash.update !== 'function')
|
|
21
|
+
throw new Error('Expected instance of class which extends utils.Hash');
|
|
22
|
+
this.blockLen = this.iHash.blockLen;
|
|
23
|
+
this.outputLen = this.iHash.outputLen;
|
|
24
|
+
const blockLen = this.blockLen;
|
|
25
|
+
const pad = new Uint8Array(blockLen);
|
|
26
|
+
// blockLen can be bigger than outputLen
|
|
27
|
+
pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);
|
|
28
|
+
for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36;
|
|
29
|
+
this.iHash.update(pad);
|
|
30
|
+
// By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone
|
|
31
|
+
this.oHash = hash.create() as T;
|
|
32
|
+
// Undo internal XOR && apply outer XOR
|
|
33
|
+
for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36 ^ 0x5c;
|
|
34
|
+
this.oHash.update(pad);
|
|
35
|
+
clean(pad);
|
|
36
|
+
}
|
|
37
|
+
update(buf: Uint8Array): this {
|
|
38
|
+
aexists(this);
|
|
39
|
+
this.iHash.update(buf);
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
digestInto(out: Uint8Array): void {
|
|
43
|
+
aexists(this);
|
|
44
|
+
abytes(out, this.outputLen, 'output');
|
|
45
|
+
this.finished = true;
|
|
46
|
+
this.iHash.digestInto(out);
|
|
47
|
+
this.oHash.update(out);
|
|
48
|
+
this.oHash.digestInto(out);
|
|
49
|
+
this.destroy();
|
|
50
|
+
}
|
|
51
|
+
digest(): Uint8Array {
|
|
52
|
+
const out = new Uint8Array(this.oHash.outputLen);
|
|
53
|
+
this.digestInto(out);
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
_cloneInto(to?: _HMAC<T>): _HMAC<T> {
|
|
57
|
+
// Create new instance without calling constructor since key already in state and we don't know it.
|
|
58
|
+
to ||= Object.create(Object.getPrototypeOf(this), {});
|
|
59
|
+
const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;
|
|
60
|
+
to = to as this;
|
|
61
|
+
to.finished = finished;
|
|
62
|
+
to.destroyed = destroyed;
|
|
63
|
+
to.blockLen = blockLen;
|
|
64
|
+
to.outputLen = outputLen;
|
|
65
|
+
to.oHash = oHash._cloneInto(to.oHash);
|
|
66
|
+
to.iHash = iHash._cloneInto(to.iHash);
|
|
67
|
+
return to;
|
|
68
|
+
}
|
|
69
|
+
clone(): _HMAC<T> {
|
|
70
|
+
return this._cloneInto();
|
|
71
|
+
}
|
|
72
|
+
destroy(): void {
|
|
73
|
+
this.destroyed = true;
|
|
74
|
+
this.oHash.destroy();
|
|
75
|
+
this.iHash.destroy();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* HMAC: RFC2104 message authentication code.
|
|
81
|
+
* @param hash - function that would be used e.g. sha256
|
|
82
|
+
* @param key - message key
|
|
83
|
+
* @param message - message data
|
|
84
|
+
* @example
|
|
85
|
+
* import { hmac } from '@noble/hashes/hmac';
|
|
86
|
+
* import { sha256 } from '@noble/hashes/sha2';
|
|
87
|
+
* const mac1 = hmac(sha256, 'key', 'message');
|
|
88
|
+
*/
|
|
89
|
+
export const hmac: {
|
|
90
|
+
(hash: CHash, key: Uint8Array, message: Uint8Array): Uint8Array;
|
|
91
|
+
create(hash: CHash, key: Uint8Array): _HMAC<any>;
|
|
92
|
+
} = (hash: CHash, key: Uint8Array, message: Uint8Array): Uint8Array =>
|
|
93
|
+
new _HMAC<any>(hash, key).update(message).digest();
|
|
94
|
+
hmac.create = (hash: CHash, key: Uint8Array) => new _HMAC<any>(hash, key);
|