@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,98 @@
|
|
|
1
|
+
import { type TxCoder, type TxType } from './tx-internal.js';
|
|
2
|
+
declare const TX_DEFAULTS: {
|
|
3
|
+
readonly accessList: readonly [];
|
|
4
|
+
readonly authorizationList: readonly [];
|
|
5
|
+
readonly chainId: bigint;
|
|
6
|
+
readonly data: "";
|
|
7
|
+
readonly gasLimit: bigint;
|
|
8
|
+
readonly maxPriorityFeePerGas: bigint;
|
|
9
|
+
readonly type: "eip1559";
|
|
10
|
+
};
|
|
11
|
+
type DefaultField = keyof typeof TX_DEFAULTS;
|
|
12
|
+
type DefaultType = (typeof TX_DEFAULTS)['type'];
|
|
13
|
+
type DefaultsOptional<T> = {
|
|
14
|
+
[P in keyof T as P extends DefaultField ? P : never]?: T[P];
|
|
15
|
+
} & {
|
|
16
|
+
[P in keyof T as P extends DefaultField ? never : P]: T[P];
|
|
17
|
+
};
|
|
18
|
+
type HumanInputInner<T extends TxType> = DefaultsOptional<{
|
|
19
|
+
type: T;
|
|
20
|
+
} & TxCoder<T>>;
|
|
21
|
+
type HumanInputInnerDefault = DefaultsOptional<TxCoder<DefaultType>>;
|
|
22
|
+
type Required<T> = T extends undefined ? never : T;
|
|
23
|
+
type HumanInput<T extends TxType | undefined> = T extends undefined ? HumanInputInnerDefault : HumanInputInner<Required<T>>;
|
|
24
|
+
export declare class Transaction<T extends TxType> {
|
|
25
|
+
readonly type: T;
|
|
26
|
+
readonly raw: TxCoder<T>;
|
|
27
|
+
readonly isSigned: boolean;
|
|
28
|
+
constructor(type: T, raw: TxCoder<T>, strict?: boolean, allowSignatureFields?: boolean);
|
|
29
|
+
static prepare<T extends {
|
|
30
|
+
type: undefined;
|
|
31
|
+
}>(data: T & HumanInputInnerDefault, strict?: boolean): Transaction<(typeof TX_DEFAULTS)['type']>;
|
|
32
|
+
static prepare<TT extends TxType, T extends {
|
|
33
|
+
type: TT;
|
|
34
|
+
} & HumanInput<TT>>(data: HumanInput<TT>, strict?: boolean): Transaction<T['type']>;
|
|
35
|
+
/**
|
|
36
|
+
* Creates transaction which sends whole account balance. Does two things:
|
|
37
|
+
* 1. `amount = accountBalance - maxFeePerGas * gasLimit`
|
|
38
|
+
* 2. `maxPriorityFeePerGas = maxFeePerGas`
|
|
39
|
+
*
|
|
40
|
+
* Every eth block sets a fee for all its transactions, called base fee.
|
|
41
|
+
* maxFeePerGas indicates how much gas user is able to spend in the worst case.
|
|
42
|
+
* If the block's base fee is 5 gwei, while user is able to spend 10 gwei in maxFeePerGas,
|
|
43
|
+
* the transaction would only consume 5 gwei. That means, base fee is unknown
|
|
44
|
+
* before the transaction is included in a block.
|
|
45
|
+
*
|
|
46
|
+
* By setting priorityFee to maxFee, we make the process deterministic:
|
|
47
|
+
* `maxFee = 10, maxPriority = 10, baseFee = 5` would always spend 10 gwei.
|
|
48
|
+
* In the end, the balance would become 0.
|
|
49
|
+
*
|
|
50
|
+
* WARNING: using the method would decrease privacy of a transfer, because
|
|
51
|
+
* payments for services have specific amounts, and not *the whole amount*.
|
|
52
|
+
* @param accountBalance - account balance in wei
|
|
53
|
+
* @param burnRemaining - send unspent fee to miners. When false, some "small amount" would remain
|
|
54
|
+
* @returns new transaction with adjusted amounts
|
|
55
|
+
*/
|
|
56
|
+
setWholeAmount(accountBalance: bigint, burnRemaining?: boolean): Transaction<T>;
|
|
57
|
+
static fromRawBytes(bytes: Uint8Array, strict?: boolean): Transaction<'legacy' | 'eip2930' | 'eip1559' | 'eip4844' | 'eip7702'>;
|
|
58
|
+
static fromHex(hex: string, strict?: boolean): Transaction<'eip1559' | 'legacy' | 'eip2930' | 'eip4844' | 'eip7702'>;
|
|
59
|
+
private assertIsSigned;
|
|
60
|
+
/**
|
|
61
|
+
* Converts transaction to RLP.
|
|
62
|
+
* @param includeSignature whether to include signature
|
|
63
|
+
*/
|
|
64
|
+
toBytes(includeSignature?: boolean): Uint8Array;
|
|
65
|
+
/**
|
|
66
|
+
* Converts transaction to hex.
|
|
67
|
+
* @param includeSignature whether to include signature
|
|
68
|
+
*/
|
|
69
|
+
toHex(includeSignature?: boolean): string;
|
|
70
|
+
/** Calculates keccak-256 hash of signed transaction. Used in block explorers. */
|
|
71
|
+
get hash(): string;
|
|
72
|
+
/** Returns sender's address. */
|
|
73
|
+
get sender(): string;
|
|
74
|
+
/**
|
|
75
|
+
* For legacy transactions, but can be used with libraries when yParity presented as v.
|
|
76
|
+
*/
|
|
77
|
+
get v(): bigint | undefined;
|
|
78
|
+
private calcHash;
|
|
79
|
+
/** Calculates MAXIMUM fee in wei that could be spent. */
|
|
80
|
+
get fee(): bigint;
|
|
81
|
+
clone(): Transaction<T>;
|
|
82
|
+
verifySignature(): boolean;
|
|
83
|
+
removeSignature(): Transaction<T>;
|
|
84
|
+
/**
|
|
85
|
+
* Signs transaction with a private key.
|
|
86
|
+
* @param privateKey key in hex or Uint8Array format
|
|
87
|
+
* @param opts extraEntropy will increase security of sig by mixing rfc6979 randomness
|
|
88
|
+
* @returns new "same" transaction, but signed
|
|
89
|
+
*/
|
|
90
|
+
signBy(privateKey: string | Uint8Array, extraEntropy?: boolean | Uint8Array): Transaction<T>;
|
|
91
|
+
/** Calculates public key and address from signed transaction's signature. */
|
|
92
|
+
recoverSender(): {
|
|
93
|
+
publicKey: string;
|
|
94
|
+
address: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export {};
|
|
98
|
+
//# sourceMappingURL=tx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../../../../../../src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.ts"],"names":[],"mappings":"AAKA,OAAO,EAOL,KAAK,OAAO,EACZ,KAAK,MAAM,EACZ,MAAM,kBAAkB,CAAC;AAoB1B,QAAA,MAAM,WAAW;;;sBAGwB,MAAM;;uBAED,MAAM;mCACmB,MAAM;;CAEnE,CAAC;AACX,KAAK,YAAY,GAAG,MAAM,OAAO,WAAW,CAAC;AAC7C,KAAK,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAChD,KAAK,gBAAgB,CAAC,CAAC,IAAI;KACxB,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,YAAY,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAC5D,GAAG;KACD,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,YAAY,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC3D,CAAC;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", { value: true });
|
|
3
|
+
exports.Transaction = void 0;
|
|
4
|
+
/*! micro-eth-signer - MIT License (c) 2021 Paul Miller (paulmillr.com) */
|
|
5
|
+
const sha3_js_1 = require("../../../../../@noble/hashes/2.0.1/src/sha3.js");
|
|
6
|
+
const utils_js_1 = require("../../../../../@noble/hashes/2.0.1/src/utils.js");
|
|
7
|
+
const address_js_1 = require("./address.js");
|
|
8
|
+
const tx_internal_js_1 = require("./tx-internal.js");
|
|
9
|
+
// prettier-ignore
|
|
10
|
+
const secp256k1_js_1 = require("../../../../../@noble/curves/2.0.1/src/secp256k1.js");
|
|
11
|
+
const utils_js_2 = require("../utils.js");
|
|
12
|
+
// The file exports Transaction, but actual (RLP) parsing logic is done in `./tx`
|
|
13
|
+
// Transaction-related utils.
|
|
14
|
+
// 4 fields are required. Others are pre-filled with default values.
|
|
15
|
+
const TX_DEFAULTS = {
|
|
16
|
+
accessList: [], // needs to be .slice()-d to create new reference
|
|
17
|
+
authorizationList: [],
|
|
18
|
+
chainId: BigInt(1), // mainnet
|
|
19
|
+
data: '',
|
|
20
|
+
gasLimit: BigInt(21000), // TODO: investigate if limit is smaller in eip4844 txs
|
|
21
|
+
maxPriorityFeePerGas: (BigInt(1) * utils_js_2.amounts.GWEI), // Reduce fingerprinting by using standard, popular value
|
|
22
|
+
type: 'eip1559',
|
|
23
|
+
};
|
|
24
|
+
// Changes:
|
|
25
|
+
// - legacy: instead of hardfork now accepts additional param chainId
|
|
26
|
+
// if chainId is present, we enable relay protection
|
|
27
|
+
// This removes hardfork param and simplifies replay protection logic
|
|
28
|
+
// - tx parametrized over type: you cannot access fields from different tx version
|
|
29
|
+
// - legacy: 'v' param is hidden in coders. Transaction operates in terms chainId and yParity.
|
|
30
|
+
// TODO: tx is kinda immutable, but user can change .raw values before signing
|
|
31
|
+
// need to think about re-validation?
|
|
32
|
+
class Transaction {
|
|
33
|
+
type;
|
|
34
|
+
raw;
|
|
35
|
+
isSigned;
|
|
36
|
+
// Doesn't force any defaults, catches if fields incompatible with type
|
|
37
|
+
constructor(type, raw, strict = true, allowSignatureFields = true) {
|
|
38
|
+
this.type = type;
|
|
39
|
+
this.raw = raw;
|
|
40
|
+
(0, tx_internal_js_1.validateFields)(type, raw, strict, allowSignatureFields);
|
|
41
|
+
this.isSigned = typeof raw.r === 'bigint' && typeof raw.s === 'bigint';
|
|
42
|
+
}
|
|
43
|
+
static prepare(data, strict = true) {
|
|
44
|
+
const type = (data.type !== undefined ? data.type : TX_DEFAULTS.type);
|
|
45
|
+
if (!tx_internal_js_1.TxVersions.hasOwnProperty(type))
|
|
46
|
+
throw new Error(`wrong transaction type=${type}`);
|
|
47
|
+
const coder = tx_internal_js_1.TxVersions[type];
|
|
48
|
+
const fields = new Set(coder.fields);
|
|
49
|
+
// Copy default fields, but only if the field is present on the tx type.
|
|
50
|
+
const raw = { type };
|
|
51
|
+
for (const f in TX_DEFAULTS) {
|
|
52
|
+
if (f !== 'type' && fields.has(f)) {
|
|
53
|
+
raw[f] = TX_DEFAULTS[f];
|
|
54
|
+
if (['accessList', 'authorizationList'].includes(f))
|
|
55
|
+
raw[f] = (0, utils_js_2.cloneDeep)(raw[f]);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Copy all fields, so we can validate unexpected ones.
|
|
59
|
+
return new Transaction(type, (0, tx_internal_js_1.sortRawData)(Object.assign(raw, data)), strict, false);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Creates transaction which sends whole account balance. Does two things:
|
|
63
|
+
* 1. `amount = accountBalance - maxFeePerGas * gasLimit`
|
|
64
|
+
* 2. `maxPriorityFeePerGas = maxFeePerGas`
|
|
65
|
+
*
|
|
66
|
+
* Every eth block sets a fee for all its transactions, called base fee.
|
|
67
|
+
* maxFeePerGas indicates how much gas user is able to spend in the worst case.
|
|
68
|
+
* If the block's base fee is 5 gwei, while user is able to spend 10 gwei in maxFeePerGas,
|
|
69
|
+
* the transaction would only consume 5 gwei. That means, base fee is unknown
|
|
70
|
+
* before the transaction is included in a block.
|
|
71
|
+
*
|
|
72
|
+
* By setting priorityFee to maxFee, we make the process deterministic:
|
|
73
|
+
* `maxFee = 10, maxPriority = 10, baseFee = 5` would always spend 10 gwei.
|
|
74
|
+
* In the end, the balance would become 0.
|
|
75
|
+
*
|
|
76
|
+
* WARNING: using the method would decrease privacy of a transfer, because
|
|
77
|
+
* payments for services have specific amounts, and not *the whole amount*.
|
|
78
|
+
* @param accountBalance - account balance in wei
|
|
79
|
+
* @param burnRemaining - send unspent fee to miners. When false, some "small amount" would remain
|
|
80
|
+
* @returns new transaction with adjusted amounts
|
|
81
|
+
*/
|
|
82
|
+
setWholeAmount(accountBalance, burnRemaining = true) {
|
|
83
|
+
const _0n = BigInt(0);
|
|
84
|
+
if (typeof accountBalance !== 'bigint' || accountBalance <= _0n)
|
|
85
|
+
throw new Error('account balance must be bigger than 0');
|
|
86
|
+
const fee = this.fee;
|
|
87
|
+
const amountToSend = accountBalance - fee;
|
|
88
|
+
if (amountToSend <= _0n)
|
|
89
|
+
throw new Error('account balance must be bigger than fee of ' + fee);
|
|
90
|
+
const raw = { ...this.raw, value: amountToSend };
|
|
91
|
+
if (!['legacy', 'eip2930'].includes(this.type) && burnRemaining) {
|
|
92
|
+
const r = raw;
|
|
93
|
+
r.maxPriorityFeePerGas = r.maxFeePerGas;
|
|
94
|
+
}
|
|
95
|
+
return new Transaction(this.type, raw);
|
|
96
|
+
}
|
|
97
|
+
static fromRawBytes(bytes, strict = false) {
|
|
98
|
+
const raw = tx_internal_js_1.RawTx.decode(bytes);
|
|
99
|
+
return new Transaction(raw.type, raw.data, strict);
|
|
100
|
+
}
|
|
101
|
+
static fromHex(hex, strict = false) {
|
|
102
|
+
return Transaction.fromRawBytes(utils_js_2.ethHexNoLeadingZero.decode(hex), strict);
|
|
103
|
+
}
|
|
104
|
+
assertIsSigned() {
|
|
105
|
+
if (!this.isSigned)
|
|
106
|
+
throw new Error('expected signed transaction');
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Converts transaction to RLP.
|
|
110
|
+
* @param includeSignature whether to include signature
|
|
111
|
+
*/
|
|
112
|
+
toBytes(includeSignature = this.isSigned) {
|
|
113
|
+
// cloneDeep is not necessary here
|
|
114
|
+
let data = Object.assign({}, this.raw);
|
|
115
|
+
if (includeSignature) {
|
|
116
|
+
this.assertIsSigned();
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
(0, tx_internal_js_1.removeSig)(data);
|
|
120
|
+
}
|
|
121
|
+
return tx_internal_js_1.RawTx.encode({ type: this.type, data }); // TODO: remove any
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Converts transaction to hex.
|
|
125
|
+
* @param includeSignature whether to include signature
|
|
126
|
+
*/
|
|
127
|
+
toHex(includeSignature = this.isSigned) {
|
|
128
|
+
return utils_js_2.ethHex.encode(this.toBytes(includeSignature));
|
|
129
|
+
}
|
|
130
|
+
/** Calculates keccak-256 hash of signed transaction. Used in block explorers. */
|
|
131
|
+
get hash() {
|
|
132
|
+
this.assertIsSigned();
|
|
133
|
+
return (0, utils_js_1.bytesToHex)(this.calcHash(true));
|
|
134
|
+
}
|
|
135
|
+
/** Returns sender's address. */
|
|
136
|
+
get sender() {
|
|
137
|
+
return this.recoverSender().address;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* For legacy transactions, but can be used with libraries when yParity presented as v.
|
|
141
|
+
*/
|
|
142
|
+
get v() {
|
|
143
|
+
return (0, tx_internal_js_1.decodeLegacyV)(this.raw);
|
|
144
|
+
}
|
|
145
|
+
calcHash(includeSignature) {
|
|
146
|
+
return (0, sha3_js_1.keccak_256)(this.toBytes(includeSignature));
|
|
147
|
+
}
|
|
148
|
+
/** Calculates MAXIMUM fee in wei that could be spent. */
|
|
149
|
+
get fee() {
|
|
150
|
+
const { type, raw } = this;
|
|
151
|
+
// Fee calculation is not exact, real fee can be smaller
|
|
152
|
+
let gasFee;
|
|
153
|
+
if (type === 'legacy' || type === 'eip2930') {
|
|
154
|
+
// Because TypeScript is not smart enough to narrow down types here :(
|
|
155
|
+
const r = raw;
|
|
156
|
+
gasFee = r.gasPrice;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
const r = raw;
|
|
160
|
+
// maxFeePerGas is absolute limit, you never pay more than that
|
|
161
|
+
// maxFeePerGas = baseFeePerGas[*2] + maxPriorityFeePerGas
|
|
162
|
+
gasFee = r.maxFeePerGas;
|
|
163
|
+
}
|
|
164
|
+
// TODO: how to calculate 4844 fee?
|
|
165
|
+
return raw.gasLimit * gasFee;
|
|
166
|
+
}
|
|
167
|
+
clone() {
|
|
168
|
+
return new Transaction(this.type, (0, utils_js_2.cloneDeep)(this.raw));
|
|
169
|
+
}
|
|
170
|
+
verifySignature() {
|
|
171
|
+
this.assertIsSigned();
|
|
172
|
+
const { r, s } = this.raw;
|
|
173
|
+
return (0, utils_js_2.verify)(new secp256k1_js_1.secp256k1.Signature(r, s).toBytes(), this.calcHash(false), (0, utils_js_1.hexToBytes)(this.recoverSender().publicKey));
|
|
174
|
+
}
|
|
175
|
+
removeSignature() {
|
|
176
|
+
return new Transaction(this.type, (0, tx_internal_js_1.removeSig)((0, utils_js_2.cloneDeep)(this.raw)));
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Signs transaction with a private key.
|
|
180
|
+
* @param privateKey key in hex or Uint8Array format
|
|
181
|
+
* @param opts extraEntropy will increase security of sig by mixing rfc6979 randomness
|
|
182
|
+
* @returns new "same" transaction, but signed
|
|
183
|
+
*/
|
|
184
|
+
signBy(privateKey, extraEntropy = true) {
|
|
185
|
+
if (this.isSigned)
|
|
186
|
+
throw new Error('expected unsigned transaction');
|
|
187
|
+
const priv = (0, utils_js_2.isBytes)(privateKey) ? privateKey : (0, utils_js_1.hexToBytes)((0, utils_js_2.strip0x)(privateKey));
|
|
188
|
+
const hash = this.calcHash(false);
|
|
189
|
+
const sig = (0, utils_js_2.sign)(hash, priv, extraEntropy);
|
|
190
|
+
const { r, s, recovery } = sig;
|
|
191
|
+
const sraw = Object.assign((0, utils_js_2.cloneDeep)(this.raw), { r, s, yParity: recovery });
|
|
192
|
+
// The copied result is validated in non-strict way, strict is only for user input.
|
|
193
|
+
return new Transaction(this.type, sraw, false);
|
|
194
|
+
}
|
|
195
|
+
/** Calculates public key and address from signed transaction's signature. */
|
|
196
|
+
recoverSender() {
|
|
197
|
+
this.assertIsSigned();
|
|
198
|
+
const { r, s, yParity } = this.raw;
|
|
199
|
+
const sig = (0, utils_js_2.initSig)({ r: r, s: s }, yParity);
|
|
200
|
+
// Will crash on 'chainstart' hardfork
|
|
201
|
+
if (sig.hasHighS())
|
|
202
|
+
throw new Error('invalid s');
|
|
203
|
+
const publicKey = secp256k1_js_1.secp256k1.recoverPublicKey(sig.toBytes('recovered'), this.calcHash(false), {
|
|
204
|
+
prehash: false,
|
|
205
|
+
});
|
|
206
|
+
// const point = sig.recoverPublicKey(this.calcHash(false));
|
|
207
|
+
return { publicKey: (0, utils_js_1.bytesToHex)(publicKey), address: address_js_1.addr.fromPublicKey(publicKey) };
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
exports.Transaction = Transaction;
|
|
211
|
+
//# sourceMappingURL=tx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tx.js","sourceRoot":"","sources":["../../../../../../../../src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.ts"],"names":[],"mappings":";;;AAAA,0EAA0E;AAC1E,4EAA4E;AAC5E,8EAAyF;AAEzF,6CAAoC;AACpC,qDAS0B;AAC1B,kBAAkB;AAClB,sFAAgF;AAChF,0CAUqB;AAErB,iFAAiF;AAEjF,6BAA6B;AAE7B,oEAAoE;AACpE,MAAM,WAAW,GAAG;IAClB,UAAU,EAAE,EAAE,EAAE,iDAAiD;IACjE,iBAAiB,EAAE,EAAE;IACrB,OAAO,EAAE,MAAM,CAAC,CAAC,CAA4B,EAAE,UAAU;IACzD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E,CAAC,CAAC;QAC7E,mFAAmF;QACnF,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IACD,6EAA6E;IAC7E,aAAa;QACX,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QACnC,MAAM,GAAG,GAAG,IAAA,kBAAO,EAAC,EAAE,CAAC,EAAE,CAAE,EAAE,CAAC,EAAE,CAAE,EAAE,EAAE,OAAQ,CAAC,CAAC;QAChD,sCAAsC;QACtC,IAAI,GAAG,CAAC,QAAQ,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;QACjD,MAAM,SAAS,GAAG,wBAAS,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YAC3F,OAAO,EAAE,KAAK;SACf,CAAC,CAAC;QACH,4DAA4D;QAC5D,OAAO,EAAE,SAAS,EAAE,IAAA,qBAAU,EAAC,SAAS,CAAC,EAAE,OAAO,EAAE,iBAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC;IACtF,CAAC;CACF;AAhMD,kCAgMC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type GetType as AbiGetType } from '../advanced/abi-mapper.js';
|
|
2
|
+
export type Hex = string | Uint8Array;
|
|
3
|
+
export interface TypedSigner<T> {
|
|
4
|
+
_getHash: (message: T) => string;
|
|
5
|
+
sign(message: T, privateKey: Hex, extraEntropy?: boolean | Uint8Array): string;
|
|
6
|
+
recoverPublicKey(signature: string, message: T): string;
|
|
7
|
+
verify(signature: string, message: T, address: string): boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const eip191Signer: TypedSigner<string | Uint8Array>;
|
|
10
|
+
export type EIP712Component = {
|
|
11
|
+
name: string;
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
export type EIP712Types = Record<string, readonly EIP712Component[]>;
|
|
15
|
+
type ProcessType<T extends string, Types extends EIP712Types> = T extends `${infer Base}[]${infer Rest}` ? ProcessType<`${Base}${Rest}`, Types>[] : T extends `${infer Base}[${number}]${infer Rest}` ? ProcessType<`${Base}${Rest}`, Types>[] : T extends keyof Types ? GetType<Types, T> | undefined : AbiGetType<T>;
|
|
16
|
+
export type GetType<Types extends EIP712Types, K extends keyof Types & string> = {
|
|
17
|
+
[C in Types[K][number] as C['name']]: ProcessType<C['type'], Types>;
|
|
18
|
+
};
|
|
19
|
+
type Key<T extends EIP712Types> = keyof T & string;
|
|
20
|
+
export declare function encoder<T extends EIP712Types>(types: T, domain: GetType<T, 'EIP712Domain'>): {
|
|
21
|
+
encodeData: <K extends Key<T>>(type: K, message: GetType<T, K>) => string;
|
|
22
|
+
structHash: <K extends Key<T>>(type: K, message: GetType<T, K>) => string;
|
|
23
|
+
_getHash: <K extends Key<T>>(primaryType: K, message: GetType<T, K>) => string;
|
|
24
|
+
sign: <K extends Key<T>>(primaryType: K, message: GetType<T, K>, privateKey: Hex, extraEntropy?: boolean | Uint8Array) => string;
|
|
25
|
+
verify: <K extends Key<T>>(primaryType: K, signature: string, message: GetType<T, K>, address: string) => boolean;
|
|
26
|
+
recoverPublicKey: <K extends Key<T>>(primaryType: K, signature: string, message: GetType<T, K>) => string;
|
|
27
|
+
};
|
|
28
|
+
export declare const EIP712Domain: readonly [{
|
|
29
|
+
readonly name: "name";
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: "version";
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
}, {
|
|
35
|
+
readonly name: "chainId";
|
|
36
|
+
readonly type: "uint256";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "verifyingContract";
|
|
39
|
+
readonly type: "address";
|
|
40
|
+
}, {
|
|
41
|
+
readonly name: "salt";
|
|
42
|
+
readonly type: "bytes32";
|
|
43
|
+
}];
|
|
44
|
+
export type DomainParams = typeof EIP712Domain;
|
|
45
|
+
declare const domainTypes: {
|
|
46
|
+
EIP712Domain: DomainParams;
|
|
47
|
+
};
|
|
48
|
+
export type EIP712Domain = GetType<typeof domainTypes, 'EIP712Domain'>;
|
|
49
|
+
export declare function getDomainType(domain: EIP712Domain): ({
|
|
50
|
+
readonly name: "name";
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
} | {
|
|
53
|
+
readonly name: "version";
|
|
54
|
+
readonly type: "string";
|
|
55
|
+
} | {
|
|
56
|
+
readonly name: "chainId";
|
|
57
|
+
readonly type: "uint256";
|
|
58
|
+
} | {
|
|
59
|
+
readonly name: "verifyingContract";
|
|
60
|
+
readonly type: "address";
|
|
61
|
+
} | {
|
|
62
|
+
readonly name: "salt";
|
|
63
|
+
readonly type: "bytes32";
|
|
64
|
+
})[];
|
|
65
|
+
export type TypedData<T extends EIP712Types, K extends Key<T>> = {
|
|
66
|
+
types: T;
|
|
67
|
+
primaryType: K;
|
|
68
|
+
domain: GetType<T, 'EIP712Domain'>;
|
|
69
|
+
message: GetType<T, K>;
|
|
70
|
+
};
|
|
71
|
+
export declare function encodeData<T extends EIP712Types, K extends Key<T>>(typed: TypedData<T, K>): string;
|
|
72
|
+
export declare function sigHash<T extends EIP712Types, K extends Key<T>>(typed: TypedData<T, K>): string;
|
|
73
|
+
export declare function signTyped<T extends EIP712Types, K extends Key<T>>(typed: TypedData<T, K>, privateKey: Hex, extraEntropy?: boolean | Uint8Array): string;
|
|
74
|
+
export declare function verifyTyped<T extends EIP712Types, K extends Key<T>>(signature: string, typed: TypedData<T, K>, address: string): boolean;
|
|
75
|
+
export declare function recoverPublicKeyTyped<T extends EIP712Types, K extends Key<T>>(signature: string, typed: TypedData<T, K>): string;
|
|
76
|
+
export declare const _TEST: any;
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=typed-data.d.ts.map
|
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