@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.
Files changed (397) hide show
  1. package/esm/_dnt.shims.d.ts +2 -0
  2. package/esm/_dnt.shims.d.ts.map +1 -0
  3. package/esm/_dnt.shims.js +58 -0
  4. package/esm/_dnt.shims.js.map +1 -0
  5. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.d.ts +195 -0
  6. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.d.ts.map +1 -0
  7. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.js +457 -0
  8. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.js.map +1 -0
  9. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.d.ts +90 -0
  10. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.d.ts.map +1 -0
  11. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.js +207 -0
  12. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.js.map +1 -0
  13. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.d.ts +159 -0
  14. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.d.ts.map +1 -0
  15. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.js +555 -0
  16. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.js.map +1 -0
  17. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.d.ts +325 -0
  18. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.d.ts.map +1 -0
  19. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.js +1222 -0
  20. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.js.map +1 -0
  21. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.d.ts +76 -0
  22. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.d.ts.map +1 -0
  23. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.js +283 -0
  24. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.js.map +1 -0
  25. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/utils.d.ts +103 -0
  26. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/utils.d.ts.map +1 -0
  27. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/utils.js +241 -0
  28. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/utils.js.map +1 -0
  29. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_md.d.ts +49 -0
  30. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_md.d.ts.map +1 -0
  31. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_md.js +147 -0
  32. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_md.js.map +1 -0
  33. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.d.ts +55 -0
  34. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.d.ts.map +1 -0
  35. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.js +67 -0
  36. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.js.map +1 -0
  37. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.d.ts +36 -0
  38. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.d.ts.map +1 -0
  39. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.js +90 -0
  40. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.js.map +1 -0
  41. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.d.ts +199 -0
  42. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.d.ts.map +1 -0
  43. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.js +397 -0
  44. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.js.map +1 -0
  45. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.d.ts +58 -0
  46. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.d.ts.map +1 -0
  47. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.js +254 -0
  48. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.js.map +1 -0
  49. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/utils.d.ts +124 -0
  50. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/utils.d.ts.map +1 -0
  51. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/utils.js +243 -0
  52. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/utils.js.map +1 -0
  53. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.d.ts +44 -0
  54. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.d.ts.map +1 -0
  55. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.js +144 -0
  56. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.js.map +1 -0
  57. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.d.ts +38 -0
  58. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.d.ts.map +1 -0
  59. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.js +96 -0
  60. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.js.map +1 -0
  61. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.d.ts +23 -0
  62. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.d.ts.map +1 -0
  63. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.js +98 -0
  64. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.js.map +1 -0
  65. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.d.ts +300 -0
  66. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.d.ts.map +1 -0
  67. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.js +535 -0
  68. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.js.map +1 -0
  69. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.d.ts +98 -0
  70. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.d.ts.map +1 -0
  71. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.js +207 -0
  72. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.js.map +1 -0
  73. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.d.ts +78 -0
  74. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.d.ts.map +1 -0
  75. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.js +298 -0
  76. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.js.map +1 -0
  77. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.d.ts +6 -0
  78. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.d.ts.map +1 -0
  79. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.js +6 -0
  80. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.js.map +1 -0
  81. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.d.ts +66 -0
  82. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.d.ts.map +1 -0
  83. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.js +180 -0
  84. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.js.map +1 -0
  85. package/esm/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.d.ts +877 -0
  86. package/esm/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.d.ts.map +1 -0
  87. package/esm/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.js +2001 -0
  88. package/esm/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.js.map +1 -0
  89. package/esm/deps/jsr.io/@scure/base/2.0.0/index.d.ts +294 -0
  90. package/esm/deps/jsr.io/@scure/base/2.0.0/index.d.ts.map +1 -0
  91. package/esm/deps/jsr.io/@scure/base/2.0.0/index.js +704 -0
  92. package/esm/deps/jsr.io/@scure/base/2.0.0/index.js.map +1 -0
  93. package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts +93 -0
  94. package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts.map +1 -0
  95. package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js +137 -0
  96. package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js.map +1 -0
  97. package/esm/src/api/exchange/_methods/_base/_nonce.d.ts +3 -2
  98. package/esm/src/api/exchange/_methods/_base/_nonce.d.ts.map +1 -1
  99. package/esm/src/api/exchange/_methods/_base/_nonce.js +3 -2
  100. package/esm/src/api/exchange/_methods/_base/_nonce.js.map +1 -1
  101. package/esm/src/api/exchange/_methods/_base/_semaphore.d.ts +7 -6
  102. package/esm/src/api/exchange/_methods/_base/_semaphore.d.ts.map +1 -1
  103. package/esm/src/api/exchange/_methods/_base/_semaphore.js +34 -47
  104. package/esm/src/api/exchange/_methods/_base/_semaphore.js.map +1 -1
  105. package/esm/src/api/exchange/_methods/_base/execute.d.ts +14 -3
  106. package/esm/src/api/exchange/_methods/_base/execute.d.ts.map +1 -1
  107. package/esm/src/api/exchange/_methods/_base/execute.js +44 -10
  108. package/esm/src/api/exchange/_methods/_base/execute.js.map +1 -1
  109. package/esm/src/api/exchange/_methods/batchModify.d.ts +6 -6
  110. package/esm/src/api/exchange/_methods/createVault.d.ts +5 -5
  111. package/esm/src/api/exchange/_methods/modify.d.ts +5 -5
  112. package/esm/src/api/exchange/_methods/order.d.ts +13 -13
  113. package/esm/src/api/exchange/_methods/order.d.ts.map +1 -1
  114. package/esm/src/api/exchange/_methods/order.js +4 -2
  115. package/esm/src/api/exchange/_methods/order.js.map +1 -1
  116. package/esm/src/api/exchange/client.d.ts +1 -1
  117. package/esm/src/api/exchange/client.d.ts.map +1 -1
  118. package/esm/src/api/exchange/client.js.map +1 -1
  119. package/esm/src/api/exchange/mod.d.ts +1 -1
  120. package/esm/src/api/exchange/mod.d.ts.map +1 -1
  121. package/esm/src/api/exchange/mod.js.map +1 -1
  122. package/esm/src/api/info/_methods/_base/commonSchemas.d.ts +8 -8
  123. package/esm/src/api/info/_methods/frontendOpenOrders.d.ts +3 -3
  124. package/esm/src/api/info/_methods/historicalOrders.d.ts +4 -4
  125. package/esm/src/api/info/_methods/l3Orders.d.ts +11 -11
  126. package/esm/src/api/info/_methods/l4Orders.d.ts +6 -6
  127. package/esm/src/api/info/_methods/openOrders.d.ts +3 -3
  128. package/esm/src/api/info/_methods/orderStatus.d.ts +5 -5
  129. package/esm/src/api/info/_methods/recentTrades.d.ts +2 -2
  130. package/esm/src/api/info/_methods/twapHistory.d.ts +4 -4
  131. package/esm/src/api/info/_methods/userFills.d.ts +3 -3
  132. package/esm/src/api/info/_methods/userFillsByTime.d.ts +4 -4
  133. package/esm/src/api/info/_methods/userFunding.d.ts +3 -3
  134. package/esm/src/api/info/_methods/userFunding.js +2 -2
  135. package/esm/src/api/info/_methods/userFunding.js.map +1 -1
  136. package/esm/src/api/info/_methods/userTwapSliceFills.d.ts +4 -4
  137. package/esm/src/api/info/_methods/userTwapSliceFillsByTime.d.ts +5 -5
  138. package/esm/src/api/info/_methods/webData2.d.ts +9 -9
  139. package/esm/src/api/subscription/_methods/assetCtxs.d.ts +2 -0
  140. package/esm/src/api/subscription/_methods/assetCtxs.d.ts.map +1 -1
  141. package/esm/src/api/subscription/_methods/assetCtxs.js.map +1 -1
  142. package/esm/src/api/subscription/_methods/clearinghouseState.d.ts +2 -0
  143. package/esm/src/api/subscription/_methods/clearinghouseState.d.ts.map +1 -1
  144. package/esm/src/api/subscription/_methods/clearinghouseState.js +2 -0
  145. package/esm/src/api/subscription/_methods/clearinghouseState.js.map +1 -1
  146. package/esm/src/api/subscription/_methods/explorerBlock.d.ts +2 -0
  147. package/esm/src/api/subscription/_methods/explorerBlock.d.ts.map +1 -1
  148. package/esm/src/api/subscription/_methods/explorerBlock.js +2 -0
  149. package/esm/src/api/subscription/_methods/explorerBlock.js.map +1 -1
  150. package/esm/src/api/subscription/_methods/explorerTxs.d.ts +2 -0
  151. package/esm/src/api/subscription/_methods/explorerTxs.d.ts.map +1 -1
  152. package/esm/src/api/subscription/_methods/explorerTxs.js +2 -0
  153. package/esm/src/api/subscription/_methods/explorerTxs.js.map +1 -1
  154. package/esm/src/api/subscription/_methods/openOrders.d.ts +5 -5
  155. package/esm/src/api/subscription/_methods/orderUpdates.d.ts +4 -4
  156. package/esm/src/api/subscription/_methods/trades.d.ts +3 -3
  157. package/esm/src/api/subscription/_methods/twapStates.d.ts +9 -4
  158. package/esm/src/api/subscription/_methods/twapStates.d.ts.map +1 -1
  159. package/esm/src/api/subscription/_methods/twapStates.js +6 -1
  160. package/esm/src/api/subscription/_methods/twapStates.js.map +1 -1
  161. package/esm/src/api/subscription/_methods/userEvents.d.ts +17 -17
  162. package/esm/src/api/subscription/_methods/userFills.d.ts +5 -5
  163. package/esm/src/api/subscription/_methods/userHistoricalOrders.d.ts +6 -6
  164. package/esm/src/api/subscription/_methods/userTwapHistory.d.ts +6 -6
  165. package/esm/src/api/subscription/_methods/userTwapSliceFills.d.ts +6 -6
  166. package/esm/src/api/subscription/_methods/webData2.d.ts +11 -11
  167. package/esm/src/signing/_privateKeySigner.js +1 -1
  168. package/esm/src/signing/_privateKeySigner.js.map +1 -1
  169. package/esm/src/signing/mod.js +1 -1
  170. package/esm/src/signing/mod.js.map +1 -1
  171. package/package.json +2 -3
  172. package/script/_dnt.shims.d.ts +2 -0
  173. package/script/_dnt.shims.d.ts.map +1 -0
  174. package/script/_dnt.shims.js +61 -0
  175. package/script/_dnt.shims.js.map +1 -0
  176. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.d.ts +195 -0
  177. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.d.ts.map +1 -0
  178. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.js +468 -0
  179. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.js.map +1 -0
  180. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.d.ts +90 -0
  181. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.d.ts.map +1 -0
  182. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.js +215 -0
  183. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.js.map +1 -0
  184. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.d.ts +159 -0
  185. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.d.ts.map +1 -0
  186. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.js +578 -0
  187. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.js.map +1 -0
  188. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.d.ts +325 -0
  189. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.d.ts.map +1 -0
  190. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.js +1232 -0
  191. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.js.map +1 -0
  192. package/script/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.d.ts +76 -0
  193. package/script/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.d.ts.map +1 -0
  194. package/script/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.js +286 -0
  195. package/script/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.js.map +1 -0
  196. package/script/deps/jsr.io/@noble/curves/2.0.1/src/utils.d.ts +103 -0
  197. package/script/deps/jsr.io/@noble/curves/2.0.1/src/utils.d.ts.map +1 -0
  198. package/script/deps/jsr.io/@noble/curves/2.0.1/src/utils.js +273 -0
  199. package/script/deps/jsr.io/@noble/curves/2.0.1/src/utils.js.map +1 -0
  200. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_md.d.ts +49 -0
  201. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_md.d.ts.map +1 -0
  202. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_md.js +153 -0
  203. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_md.js.map +1 -0
  204. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.d.ts +55 -0
  205. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.d.ts.map +1 -0
  206. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.js +90 -0
  207. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.js.map +1 -0
  208. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.d.ts +36 -0
  209. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.d.ts.map +1 -0
  210. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.js +95 -0
  211. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.js.map +1 -0
  212. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.d.ts +199 -0
  213. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.d.ts.map +1 -0
  214. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.js +439 -0
  215. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.js.map +1 -0
  216. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.d.ts +58 -0
  217. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.d.ts.map +1 -0
  218. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.js +259 -0
  219. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.js.map +1 -0
  220. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/utils.d.ts +124 -0
  221. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/utils.d.ts.map +1 -0
  222. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/utils.js +304 -0
  223. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/utils.js.map +1 -0
  224. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.d.ts +44 -0
  225. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.d.ts.map +1 -0
  226. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.js +182 -0
  227. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.js.map +1 -0
  228. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.d.ts +38 -0
  229. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.d.ts.map +1 -0
  230. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.js +99 -0
  231. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.js.map +1 -0
  232. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.d.ts +23 -0
  233. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.d.ts.map +1 -0
  234. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.js +134 -0
  235. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.js.map +1 -0
  236. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.d.ts +300 -0
  237. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.d.ts.map +1 -0
  238. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.js +576 -0
  239. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.js.map +1 -0
  240. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.d.ts +98 -0
  241. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.d.ts.map +1 -0
  242. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.js +211 -0
  243. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.js.map +1 -0
  244. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.d.ts +78 -0
  245. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.d.ts.map +1 -0
  246. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.js +308 -0
  247. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.js.map +1 -0
  248. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.d.ts +6 -0
  249. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.d.ts.map +1 -0
  250. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.js +21 -0
  251. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.js.map +1 -0
  252. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.d.ts +66 -0
  253. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.d.ts.map +1 -0
  254. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.js +195 -0
  255. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.js.map +1 -0
  256. package/script/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.d.ts +877 -0
  257. package/script/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.d.ts.map +1 -0
  258. package/script/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.js +2032 -0
  259. package/script/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.js.map +1 -0
  260. package/script/deps/jsr.io/@scure/base/2.0.0/index.d.ts +294 -0
  261. package/script/deps/jsr.io/@scure/base/2.0.0/index.d.ts.map +1 -0
  262. package/script/deps/jsr.io/@scure/base/2.0.0/index.js +710 -0
  263. package/script/deps/jsr.io/@scure/base/2.0.0/index.js.map +1 -0
  264. package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts +93 -0
  265. package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts.map +1 -0
  266. package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js +141 -0
  267. package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js.map +1 -0
  268. package/script/src/api/exchange/_methods/_base/_nonce.d.ts +3 -2
  269. package/script/src/api/exchange/_methods/_base/_nonce.d.ts.map +1 -1
  270. package/script/src/api/exchange/_methods/_base/_nonce.js +4 -3
  271. package/script/src/api/exchange/_methods/_base/_nonce.js.map +1 -1
  272. package/script/src/api/exchange/_methods/_base/_semaphore.d.ts +7 -6
  273. package/script/src/api/exchange/_methods/_base/_semaphore.d.ts.map +1 -1
  274. package/script/src/api/exchange/_methods/_base/_semaphore.js +35 -50
  275. package/script/src/api/exchange/_methods/_base/_semaphore.js.map +1 -1
  276. package/script/src/api/exchange/_methods/_base/execute.d.ts +14 -3
  277. package/script/src/api/exchange/_methods/_base/execute.d.ts.map +1 -1
  278. package/script/src/api/exchange/_methods/_base/execute.js +43 -9
  279. package/script/src/api/exchange/_methods/_base/execute.js.map +1 -1
  280. package/script/src/api/exchange/_methods/batchModify.d.ts +6 -6
  281. package/script/src/api/exchange/_methods/createVault.d.ts +5 -5
  282. package/script/src/api/exchange/_methods/modify.d.ts +5 -5
  283. package/script/src/api/exchange/_methods/order.d.ts +13 -13
  284. package/script/src/api/exchange/_methods/order.d.ts.map +1 -1
  285. package/script/src/api/exchange/_methods/order.js +4 -2
  286. package/script/src/api/exchange/_methods/order.js.map +1 -1
  287. package/script/src/api/exchange/client.d.ts +1 -1
  288. package/script/src/api/exchange/client.d.ts.map +1 -1
  289. package/script/src/api/exchange/client.js.map +1 -1
  290. package/script/src/api/exchange/mod.d.ts +1 -1
  291. package/script/src/api/exchange/mod.d.ts.map +1 -1
  292. package/script/src/api/exchange/mod.js.map +1 -1
  293. package/script/src/api/info/_methods/_base/commonSchemas.d.ts +8 -8
  294. package/script/src/api/info/_methods/frontendOpenOrders.d.ts +3 -3
  295. package/script/src/api/info/_methods/historicalOrders.d.ts +4 -4
  296. package/script/src/api/info/_methods/l3Orders.d.ts +11 -11
  297. package/script/src/api/info/_methods/l4Orders.d.ts +6 -6
  298. package/script/src/api/info/_methods/openOrders.d.ts +3 -3
  299. package/script/src/api/info/_methods/orderStatus.d.ts +5 -5
  300. package/script/src/api/info/_methods/recentTrades.d.ts +2 -2
  301. package/script/src/api/info/_methods/twapHistory.d.ts +4 -4
  302. package/script/src/api/info/_methods/userFills.d.ts +3 -3
  303. package/script/src/api/info/_methods/userFillsByTime.d.ts +4 -4
  304. package/script/src/api/info/_methods/userFunding.d.ts +3 -3
  305. package/script/src/api/info/_methods/userFunding.js +2 -2
  306. package/script/src/api/info/_methods/userFunding.js.map +1 -1
  307. package/script/src/api/info/_methods/userTwapSliceFills.d.ts +4 -4
  308. package/script/src/api/info/_methods/userTwapSliceFillsByTime.d.ts +5 -5
  309. package/script/src/api/info/_methods/webData2.d.ts +9 -9
  310. package/script/src/api/subscription/_methods/assetCtxs.d.ts +2 -0
  311. package/script/src/api/subscription/_methods/assetCtxs.d.ts.map +1 -1
  312. package/script/src/api/subscription/_methods/assetCtxs.js.map +1 -1
  313. package/script/src/api/subscription/_methods/clearinghouseState.d.ts +2 -0
  314. package/script/src/api/subscription/_methods/clearinghouseState.d.ts.map +1 -1
  315. package/script/src/api/subscription/_methods/clearinghouseState.js +2 -0
  316. package/script/src/api/subscription/_methods/clearinghouseState.js.map +1 -1
  317. package/script/src/api/subscription/_methods/explorerBlock.d.ts +2 -0
  318. package/script/src/api/subscription/_methods/explorerBlock.d.ts.map +1 -1
  319. package/script/src/api/subscription/_methods/explorerBlock.js +2 -0
  320. package/script/src/api/subscription/_methods/explorerBlock.js.map +1 -1
  321. package/script/src/api/subscription/_methods/explorerTxs.d.ts +2 -0
  322. package/script/src/api/subscription/_methods/explorerTxs.d.ts.map +1 -1
  323. package/script/src/api/subscription/_methods/explorerTxs.js +2 -0
  324. package/script/src/api/subscription/_methods/explorerTxs.js.map +1 -1
  325. package/script/src/api/subscription/_methods/openOrders.d.ts +5 -5
  326. package/script/src/api/subscription/_methods/orderUpdates.d.ts +4 -4
  327. package/script/src/api/subscription/_methods/trades.d.ts +3 -3
  328. package/script/src/api/subscription/_methods/twapStates.d.ts +9 -4
  329. package/script/src/api/subscription/_methods/twapStates.d.ts.map +1 -1
  330. package/script/src/api/subscription/_methods/twapStates.js +6 -1
  331. package/script/src/api/subscription/_methods/twapStates.js.map +1 -1
  332. package/script/src/api/subscription/_methods/userEvents.d.ts +17 -17
  333. package/script/src/api/subscription/_methods/userFills.d.ts +5 -5
  334. package/script/src/api/subscription/_methods/userHistoricalOrders.d.ts +6 -6
  335. package/script/src/api/subscription/_methods/userTwapHistory.d.ts +6 -6
  336. package/script/src/api/subscription/_methods/userTwapSliceFills.d.ts +6 -6
  337. package/script/src/api/subscription/_methods/webData2.d.ts +11 -11
  338. package/script/src/signing/_privateKeySigner.js +3 -3
  339. package/script/src/signing/_privateKeySigner.js.map +1 -1
  340. package/script/src/signing/mod.js +2 -2
  341. package/script/src/signing/mod.js.map +1 -1
  342. package/src/_dnt.shims.ts +60 -0
  343. package/src/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.ts +633 -0
  344. package/src/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.ts +292 -0
  345. package/src/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.ts +621 -0
  346. package/src/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.ts +1562 -0
  347. package/src/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.ts +327 -0
  348. package/src/deps/jsr.io/@noble/curves/2.0.1/src/utils.ts +306 -0
  349. package/src/deps/jsr.io/@noble/hashes/2.0.1/src/_md.ts +156 -0
  350. package/src/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.ts +91 -0
  351. package/src/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.ts +94 -0
  352. package/src/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.ts +469 -0
  353. package/src/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.ts +295 -0
  354. package/src/deps/jsr.io/@noble/hashes/2.0.1/src/utils.ts +340 -0
  355. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.ts +212 -0
  356. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.ts +100 -0
  357. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.ts +104 -0
  358. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.ts +626 -0
  359. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.ts +274 -0
  360. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.ts +391 -0
  361. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.ts +12 -0
  362. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.ts +233 -0
  363. package/src/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.ts +2196 -0
  364. package/src/deps/jsr.io/@scure/base/2.0.0/index.ts +857 -0
  365. package/src/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.ts +146 -0
  366. package/src/src/api/exchange/_methods/_base/_nonce.ts +3 -2
  367. package/src/src/api/exchange/_methods/_base/_semaphore.ts +34 -59
  368. package/src/src/api/exchange/_methods/_base/execute.ts +60 -12
  369. package/src/src/api/exchange/_methods/order.ts +5 -3
  370. package/src/src/api/exchange/client.ts +5 -1
  371. package/src/src/api/exchange/mod.ts +5 -1
  372. package/src/src/api/info/_methods/userFunding.ts +2 -2
  373. package/src/src/api/subscription/_methods/assetCtxs.ts +2 -0
  374. package/src/src/api/subscription/_methods/clearinghouseState.ts +2 -0
  375. package/src/src/api/subscription/_methods/explorerBlock.ts +2 -0
  376. package/src/src/api/subscription/_methods/explorerTxs.ts +2 -0
  377. package/src/src/api/subscription/_methods/twapStates.ts +9 -1
  378. package/src/src/signing/_privateKeySigner.ts +1 -1
  379. package/src/src/signing/mod.ts +1 -1
  380. package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts +0 -21
  381. package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts.map +0 -1
  382. package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.js +0 -292
  383. package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.js.map +0 -1
  384. package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts +0 -44
  385. package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts.map +0 -1
  386. package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.js +0 -46
  387. package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.js.map +0 -1
  388. package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts +0 -21
  389. package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts.map +0 -1
  390. package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.js +0 -295
  391. package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.js.map +0 -1
  392. package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts +0 -44
  393. package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts.map +0 -1
  394. package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.js +0 -62
  395. package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.js.map +0 -1
  396. package/src/deps/jsr.io/@std/msgpack/1.0.3/decode.ts +0 -391
  397. package/src/deps/jsr.io/@std/msgpack/1.0.3/mod.ts +0 -47
@@ -0,0 +1,535 @@
1
+ import { secp256k1 } from '../../../../../@noble/curves/2.0.1/src/secp256k1.js';
2
+ import { keccak_256 } from '../../../../../@noble/hashes/2.0.1/src/sha3.js';
3
+ import { concatBytes } from '../../../../../@noble/hashes/2.0.1/src/utils.js';
4
+ import * as P from '../../../../micro-packed/0.8.0/src/index.js';
5
+ import { amounts, astr, ethHex, initSig, isBytes, isObject, sign } from '../utils.js';
6
+ import { addr } from './address.js';
7
+ import { RLP } from './rlp.js';
8
+ // Transaction parsers
9
+ const _0n = BigInt(0);
10
+ const createTxMap = (versions) => {
11
+ const ent = Object.entries(versions);
12
+ // 'legacy' => {type, ver, coder}
13
+ const typeMap = Object.fromEntries(ent.map(([type, coder], ver) => [type, { type, ver, coder }]));
14
+ // '0' => {type, ver, coder}
15
+ const verMap = Object.fromEntries(ent.map(([type, coder], ver) => [ver, { type, ver, coder }]));
16
+ return P.wrap({
17
+ encodeStream(w, value) {
18
+ const t = value.type;
19
+ if (!typeMap.hasOwnProperty(t))
20
+ throw new Error(`txVersion: wrong type=${t}`);
21
+ const curr = typeMap[t];
22
+ if (t !== 'legacy')
23
+ w.byte(curr.ver);
24
+ curr.coder.encodeStream(w, value.data);
25
+ },
26
+ decodeStream(r) {
27
+ const v = r.byte(true);
28
+ if (v === 0xff)
29
+ throw new Error('reserved version 0xff');
30
+ // TODO: version=0 is legacy, but it is never wrapped in test vectors
31
+ if (v === 0x00)
32
+ throw new Error('version=0 unsupported');
33
+ if (0 <= v && v <= 0x7f) {
34
+ if (!verMap.hasOwnProperty(v.toString()))
35
+ throw new Error(`wrong version=${v}`);
36
+ const curr = verMap[v];
37
+ r.byte(false); // skip first byte
38
+ const d = curr.coder.decodeStream(r);
39
+ return { type: curr.type, data: d };
40
+ }
41
+ return { type: 'legacy', data: typeMap.legacy.coder.decodeStream(r) };
42
+ },
43
+ });
44
+ };
45
+ /**
46
+ * Static struct could have been extracted into micro-packed, but we need a specific behavior:
47
+ * - optional fields maybe either all present or all absent, enforced by type
48
+ * - optional fields change the length of underlying array
49
+ */
50
+ const isOptBig = (a) => a === undefined || typeof a === 'bigint';
51
+ const isNullOr0 = (a) => a === undefined || a === BigInt(0);
52
+ function assertYParityValid(elm) {
53
+ // TODO: is this correct? elm = 0 default?
54
+ if (elm === undefined)
55
+ elm = 0;
56
+ if (elm !== 0 && elm !== 1)
57
+ throw new Error(`yParity wrong value=${elm} (${typeof elm})`);
58
+ }
59
+ // We don't know chainId when specific field coded yet.
60
+ const addrCoder = ethHex;
61
+ // Bytes32: VersionedHash, AccessListKey
62
+ function ensure32(b) {
63
+ if (!isBytes(b) || b.length !== 32)
64
+ throw new Error('expected 32 bytes');
65
+ return b;
66
+ }
67
+ const Bytes32 = {
68
+ encode: (from) => ethHex.encode(ensure32(from)),
69
+ decode: (to) => ensure32(ethHex.decode(to)),
70
+ };
71
+ // Process v as (chainId, yParity) pair. Ethers.js-inspired logic:
72
+ // - v=27/28 -> no chainId (pre eip155)
73
+ // - r & s == 0 -> v = chainId
74
+ // Non-standard, but there is no other way to save chainId for unsignedTx.
75
+ // Case: unsigned tx for cold wallet for different chains, like mainnet & testnet.
76
+ // - otherwise v = yParity + 2*chainId + 35
77
+ // - allows to keep legacy logic here, instead of copying to Transaction
78
+ export const legacySig = {
79
+ encode: (data) => {
80
+ const { v, r, s } = data;
81
+ if (v === undefined)
82
+ return { chainId: undefined };
83
+ // TODO: handle (invalid?) negative v
84
+ if (typeof v !== 'bigint')
85
+ throw new Error(`invalid v type=${typeof v}`);
86
+ if ((r === undefined && s === undefined) || (r === _0n && s === _0n))
87
+ return { chainId: v };
88
+ if (v === BigInt(27))
89
+ return { yParity: 0, chainId: undefined, r, s };
90
+ if (v === BigInt(28))
91
+ return { yParity: 1, chainId: undefined, r, s };
92
+ if (v < BigInt(35))
93
+ throw new Error(`wrong v=${v}`);
94
+ const v2 = v - BigInt(35);
95
+ return { chainId: v2 >> BigInt(1), yParity: Number(v2 & BigInt(1)), r, s };
96
+ },
97
+ decode: (data) => {
98
+ aobj(data);
99
+ const { chainId, yParity, r, s } = data;
100
+ if (!isOptBig(chainId))
101
+ throw new Error(`wrong chainId type=${typeof chainId}`);
102
+ if (!isOptBig(r))
103
+ throw new Error(`wrong r type=${typeof r}`);
104
+ if (!isOptBig(s))
105
+ throw new Error(`wrong s type=${typeof s}`);
106
+ if (yParity !== undefined && typeof yParity !== 'number')
107
+ throw new Error(`wrong yParity type=${typeof chainId}`);
108
+ if (yParity === undefined) {
109
+ if (chainId !== undefined) {
110
+ if ((r !== undefined && r !== _0n) || (s !== undefined && s !== _0n))
111
+ throw new Error(`wrong unsigned legacy r=${r} s=${s}`);
112
+ return { v: chainId, r: _0n, s: _0n };
113
+ }
114
+ // no parity, chainId, but r, s exists
115
+ if ((r !== undefined && r !== _0n) || (s !== undefined && s !== _0n))
116
+ throw new Error(`wrong unsigned legacy r=${r} s=${s}`);
117
+ return {};
118
+ }
119
+ // parity exists, which means r & s should exist too!
120
+ if (isNullOr0(r) || isNullOr0(s))
121
+ throw new Error(`wrong unsigned legacy r=${r} s=${s}`);
122
+ assertYParityValid(yParity);
123
+ const v = chainId !== undefined
124
+ ? BigInt(yParity) + (chainId * BigInt(2) + BigInt(35))
125
+ : BigInt(yParity) + BigInt(27);
126
+ return { v, r, s };
127
+ },
128
+ };
129
+ const U64BE = P.coders.reverse(P.bigint(8, false, false, false));
130
+ const U256BE = P.coders.reverse(P.bigint(32, false, false, false));
131
+ // Small coder utils
132
+ // TODO: seems generic enought for packed? or RLP (seems useful for structured encoding/decoding of RLP stuff)
133
+ // Basic array coder
134
+ const array = (coder) => ({
135
+ encode(from) {
136
+ if (!Array.isArray(from))
137
+ throw new Error('expected array');
138
+ return from.map((i) => coder.encode(i));
139
+ },
140
+ decode(to) {
141
+ if (!Array.isArray(to))
142
+ throw new Error('expected array');
143
+ return to.map((i) => coder.decode(i));
144
+ },
145
+ });
146
+ // tuple -> struct
147
+ const struct = (fields) => ({
148
+ encode(from) {
149
+ if (!Array.isArray(from))
150
+ throw new Error('expected array');
151
+ const fNames = Object.keys(fields);
152
+ if (from.length !== fNames.length)
153
+ throw new Error('wrong array length');
154
+ return Object.fromEntries(fNames.map((f, i) => [f, fields[f].encode(from[i])]));
155
+ },
156
+ decode(to) {
157
+ const fNames = Object.keys(fields);
158
+ if (!isObject(to))
159
+ throw new Error('wrong struct object');
160
+ return fNames.map((i) => fields[i].decode(to[i]));
161
+ },
162
+ });
163
+ // U256BE in geth. But it is either 0 or 1. TODO: is this good enough?
164
+ const yParityCoder = P.coders.reverse(P.validate(P.int(1, false, false, false), (elm) => {
165
+ assertYParityValid(elm);
166
+ return elm;
167
+ }));
168
+ const accessListItem = struct({ address: addrCoder, storageKeys: array(Bytes32) });
169
+ export const authorizationRequest = struct({
170
+ chainId: U256BE,
171
+ address: addrCoder,
172
+ nonce: U64BE,
173
+ });
174
+ // [chain_id, address, nonce, y_parity, r, s]
175
+ const authorizationItem = struct({
176
+ chainId: U256BE,
177
+ address: addrCoder,
178
+ nonce: U64BE,
179
+ yParity: yParityCoder,
180
+ r: U256BE,
181
+ s: U256BE,
182
+ });
183
+ /**
184
+ * Field types, matching geth. Either u64 or u256.
185
+ */
186
+ const coders = {
187
+ chainId: U256BE, // Can fit into u64 (curr max is 0x57a238f93bf), but geth uses bigint
188
+ nonce: U64BE,
189
+ gasPrice: U256BE,
190
+ maxPriorityFeePerGas: U256BE,
191
+ maxFeePerGas: U256BE,
192
+ gasLimit: U64BE,
193
+ to: addrCoder,
194
+ value: U256BE, // "Decimal" coder can be used, but it's harder to work with
195
+ data: ethHex,
196
+ accessList: array(accessListItem),
197
+ maxFeePerBlobGas: U256BE,
198
+ blobVersionedHashes: array(Bytes32),
199
+ yParity: yParityCoder,
200
+ v: U256BE,
201
+ r: U256BE,
202
+ s: U256BE,
203
+ authorizationList: array(authorizationItem),
204
+ };
205
+ const signatureFields = new Set(['v', 'yParity', 'r', 's']);
206
+ // Mutates raw. Make sure to copy it in advance
207
+ export function removeSig(raw) {
208
+ signatureFields.forEach((k) => {
209
+ delete raw[k];
210
+ });
211
+ return raw;
212
+ }
213
+ /**
214
+ * Defines RLP transaction with fields taken from `coders`.
215
+ * @example
216
+ * const tx = txStruct(['nonce', 'gasPrice', 'value'] as const, ['v', 'r', 's'] as const)
217
+ * tx.nonce.decode(...);
218
+ */
219
+ const txStruct = (reqf, optf) => {
220
+ const allFields = reqf.concat(optf);
221
+ // Check that all fields have known coders
222
+ allFields.forEach((f) => {
223
+ if (!coders.hasOwnProperty(f))
224
+ throw new Error(`coder for field ${f} is not defined`);
225
+ });
226
+ const reqS = struct(Object.fromEntries(reqf.map((i) => [i, coders[i]])));
227
+ const allS = struct(Object.fromEntries(allFields.map((i) => [i, coders[i]])));
228
+ // e.g. eip1559 txs have valid lengths of 9 or 12 (unsigned / signed)
229
+ const reql = reqf.length;
230
+ const optl = reql + optf.length;
231
+ const optFieldAt = (i) => reql + i;
232
+ const isEmpty = (item) => item.length === 0;
233
+ // TX is a bunch of fields in specific order. Field like nonce must always be at the same index.
234
+ // We walk through all indexes in proper order.
235
+ const fcoder = P.wrap({
236
+ encodeStream(w, raw) {
237
+ // If at least one optional key is present, we add whole optional block
238
+ const hasOptional = optf.some((f) => raw.hasOwnProperty(f));
239
+ const sCoder = hasOptional ? allS : reqS;
240
+ RLP.encodeStream(w, sCoder.decode(raw));
241
+ },
242
+ decodeStream(r) {
243
+ const decoded = RLP.decodeStream(r);
244
+ if (!Array.isArray(decoded))
245
+ throw new Error('txStruct: expected array from inner coder');
246
+ const length = decoded.length;
247
+ if (length !== reql && length !== optl)
248
+ throw new Error(`txStruct: wrong inner length=${length}`);
249
+ const sCoder = length === optl ? allS : reqS;
250
+ if (length === optl && optf.every((_, i) => isEmpty(decoded[optFieldAt(i)])))
251
+ throw new Error('all optional fields empty');
252
+ // @ts-ignore TODO: fix type (there can be null in RLP)
253
+ return sCoder.encode(decoded);
254
+ },
255
+ });
256
+ fcoder.fields = reqf;
257
+ fcoder.optionalFields = optf;
258
+ fcoder.setOfAllFields = new Set(allFields.concat(['type']));
259
+ return fcoder;
260
+ };
261
+ // prettier-ignore
262
+ const legacyInternal = txStruct([
263
+ 'nonce', 'gasPrice', 'gasLimit', 'to', 'value', 'data'
264
+ ], ['v', 'r', 's']);
265
+ const legacy = (() => {
266
+ const res = P.apply(legacyInternal, {
267
+ decode: (data) => Object.assign({}, data, legacySig.decode(data)),
268
+ encode: (data) => {
269
+ const res = Object.assign({}, data);
270
+ res.chainId = undefined;
271
+ if (data.v) {
272
+ const newV = legacySig.encode(data);
273
+ removeSig(res);
274
+ Object.assign(res, newV);
275
+ }
276
+ return res;
277
+ },
278
+ });
279
+ res.fields = legacyInternal.fields.concat(['chainId']);
280
+ // v, r, s -> yParity, r, s
281
+ // TODO: what about chainId?
282
+ res.optionalFields = ['yParity', 'r', 's'];
283
+ res.setOfAllFields = new Set(res.fields.concat(res.optionalFields, ['type']));
284
+ return res;
285
+ })();
286
+ // prettier-ignore
287
+ const eip2930 = txStruct([
288
+ 'chainId', 'nonce', 'gasPrice', 'gasLimit', 'to', 'value', 'data', 'accessList'
289
+ ], ['yParity', 'r', 's']);
290
+ // prettier-ignore
291
+ const eip1559 = txStruct([
292
+ 'chainId', 'nonce', 'maxPriorityFeePerGas', 'maxFeePerGas', 'gasLimit', 'to', 'value', 'data', 'accessList'
293
+ ], ['yParity', 'r', 's']);
294
+ // prettier-ignore
295
+ const eip4844 = txStruct([
296
+ 'chainId', 'nonce', 'maxPriorityFeePerGas', 'maxFeePerGas', 'gasLimit', 'to', 'value', 'data', 'accessList',
297
+ 'maxFeePerBlobGas', 'blobVersionedHashes'
298
+ ], ['yParity', 'r', 's']);
299
+ // prettier-ignore
300
+ const eip7702 = txStruct([
301
+ 'chainId', 'nonce', 'maxPriorityFeePerGas', 'maxFeePerGas', 'gasLimit', 'to', 'value', 'data', 'accessList',
302
+ 'authorizationList'
303
+ ], ['yParity', 'r', 's']);
304
+ export const TxVersions = {
305
+ legacy, // 0x00 (kinda)
306
+ eip2930, // 0x01
307
+ eip1559, // 0x02
308
+ eip4844, // 0x03
309
+ eip7702, // 0x04
310
+ };
311
+ export const RawTx = P.apply(createTxMap(TxVersions), {
312
+ // NOTE: we apply checksum to addresses here, since chainId is not available inside coders
313
+ // By construction 'to' field is decoded before anything about chainId is known
314
+ encode: (data) => {
315
+ data.data.to = addr.addChecksum(data.data.to, true);
316
+ if (data.type !== 'legacy' && data.data.accessList) {
317
+ for (const item of data.data.accessList) {
318
+ item.address = addr.addChecksum(item.address);
319
+ }
320
+ }
321
+ if (data.type === 'eip7702' && data.data.authorizationList) {
322
+ for (const item of data.data.authorizationList) {
323
+ item.address = addr.addChecksum(item.address);
324
+ }
325
+ }
326
+ return data;
327
+ },
328
+ // Nothing to check here, is validated in validator
329
+ decode: (data) => data,
330
+ });
331
+ /**
332
+ * Unchecked TX for debugging. Returns raw Uint8Array-s.
333
+ * Handles versions - plain RLP will crash on it.
334
+ */
335
+ export const RlpTx = createTxMap(Object.fromEntries(Object.keys(TxVersions).map((k) => [k, RLP])));
336
+ // prettier-ignore
337
+ // Basically all numbers. Can be useful if we decide to do converter from hex here
338
+ // const knownFieldsNoLeading0 = [
339
+ // 'nonce', 'maxPriorityFeePerGas', 'maxFeePerGas', 'gasLimit', 'value', 'yParity', 'r', 's'
340
+ // ] as const;
341
+ function abig(val) {
342
+ if (typeof val !== 'bigint')
343
+ throw new Error('value must be bigint');
344
+ }
345
+ function aobj(val) {
346
+ if (typeof val !== 'object' || val == null)
347
+ throw new Error('object expected');
348
+ }
349
+ function minmax(val, min, max, err) {
350
+ if (!err)
351
+ err = `>= ${min} and <= ${max}`;
352
+ if (Number.isNaN(val) || val < min || val > max)
353
+ throw new Error(`must be ${err}, not ${val}`);
354
+ }
355
+ // NOTE: non-strict validators can be removed (RawTx will handle that), but errors will be less user-friendly.
356
+ // On other hand, we twice per sig because tx is immutable
357
+ // data passed for composite checks (gasLimit * maxFeePerGas overflow and stuff) [not implemented yet]
358
+ const validators = {
359
+ nonce(num, { strict }) {
360
+ abig(num);
361
+ if (strict)
362
+ minmax(num, _0n, amounts.maxNonce);
363
+ else
364
+ minmax(BigInt(num), _0n, BigInt(Number.MAX_SAFE_INTEGER)); // amounts.maxUint64
365
+ },
366
+ maxFeePerGas(num, { strict }) {
367
+ abig(num);
368
+ if (strict)
369
+ minmax(num, BigInt(1), amounts.maxGasPrice, '>= 1 wei and < 10000 gwei');
370
+ else
371
+ minmax(num, _0n, amounts.maxUint64);
372
+ },
373
+ maxPriorityFeePerGas(num, { strict, data }) {
374
+ abig(num);
375
+ if (strict)
376
+ minmax(num, _0n, amounts.maxGasPrice, '>= 1 wei and < 10000 gwei');
377
+ else
378
+ minmax(num, _0n, amounts.maxUint64, '>= 1 wei and < 10000 gwei');
379
+ if (strict && data && typeof data.maxFeePerGas === 'bigint' && data.maxFeePerGas < num) {
380
+ throw new Error(`cannot be bigger than maxFeePerGas=${data.maxFeePerGas}`);
381
+ }
382
+ },
383
+ gasLimit(num, { strict }) {
384
+ abig(num);
385
+ if (strict)
386
+ minmax(num, amounts.minGasLimit, amounts.maxGasLimit);
387
+ else
388
+ minmax(num, _0n, amounts.maxUint64);
389
+ },
390
+ to(address, { strict, data }) {
391
+ if (!addr.isValid(address, true))
392
+ throw new Error('address checksum does not match');
393
+ if (strict && address === '0x' && !data.data)
394
+ throw new Error('Empty address (0x) without contract deployment code');
395
+ },
396
+ value(num, { strict }) {
397
+ abig(num);
398
+ if (strict)
399
+ minmax(num, _0n, amounts.maxAmount, '>= 0 and < 1M eth');
400
+ },
401
+ data(val, { strict, data }) {
402
+ if (typeof val !== 'string')
403
+ throw new Error('data must be string');
404
+ if (strict) {
405
+ if (val.length > amounts.maxDataSize)
406
+ throw new Error('data is too big: ' + val.length);
407
+ }
408
+ // NOTE: data is hex here
409
+ if (data.to === '0x' && val.length > 2 * amounts.maxInitDataSize)
410
+ throw new Error(`initcode is too big: ${val.length}`);
411
+ },
412
+ chainId(num, { strict, type }) {
413
+ // chainId is optional for legacy transactions
414
+ if (type === 'legacy' && num === undefined)
415
+ return;
416
+ abig(num);
417
+ if (strict)
418
+ minmax(num, BigInt(1), amounts.maxChainId, '>= 1 and <= 2**32-1');
419
+ },
420
+ accessList(list) {
421
+ // NOTE: we cannot handle this validation in coder, since it requires chainId to calculate correct checksum
422
+ for (const { address } of list) {
423
+ if (!addr.isValid(address))
424
+ throw new Error('address checksum does not match');
425
+ }
426
+ },
427
+ authorizationList(list, opts) {
428
+ for (const { address, nonce, chainId } of list) {
429
+ if (!addr.isValid(address))
430
+ throw new Error('address checksum does not match');
431
+ // chainId in authorization list can be zero (==allow any chain)
432
+ abig(chainId);
433
+ if (opts.strict)
434
+ minmax(chainId, _0n, amounts.maxChainId, '>= 0 and <= 2**32-1');
435
+ this.nonce(nonce, opts);
436
+ }
437
+ },
438
+ };
439
+ export class AggregatedError extends Error {
440
+ message;
441
+ errors;
442
+ constructor(message, errors) {
443
+ super();
444
+ this.message = message;
445
+ this.errors = errors;
446
+ }
447
+ }
448
+ export function validateFields(type, data, strict = true, allowSignatureFields = true) {
449
+ aobj(data);
450
+ if (!TxVersions.hasOwnProperty(type))
451
+ throw new Error(`unknown tx type=${type}`);
452
+ const txType = TxVersions[type];
453
+ const dataFields = new Set(Object.keys(data));
454
+ const dataHas = (field) => dataFields.has(field);
455
+ function checkField(field) {
456
+ if (!dataHas(field))
457
+ return { field, error: `field "${field}" must be present for tx type=${type}` };
458
+ const val = data[field];
459
+ try {
460
+ if (validators.hasOwnProperty(field))
461
+ validators[field](val, { data, strict, type });
462
+ if (field === 'chainId')
463
+ return; // chainId is validated, but can't be decoded
464
+ coders[field].decode(val); // decoding may throw an error
465
+ }
466
+ catch (error) {
467
+ // No early-return: when multiple fields have error, we should show them all.
468
+ return { field, error: error.message };
469
+ }
470
+ return undefined;
471
+ }
472
+ // All fields are required.
473
+ const reqErrs = txType.fields.map(checkField);
474
+ // Signature fields should be all present or all missing
475
+ const optErrs = txType.optionalFields.some(dataHas) ? txType.optionalFields.map(checkField) : [];
476
+ // Check if user data has unexpected fields
477
+ const unexpErrs = Object.keys(data).map((field) => {
478
+ if (!txType.setOfAllFields.has(field))
479
+ return { field, error: `unknown field "${field}" for tx type=${type}` };
480
+ if (!allowSignatureFields && signatureFields.has(field))
481
+ return {
482
+ field,
483
+ error: `field "${field}" is sig-related and must not be user-specified`,
484
+ };
485
+ return;
486
+ });
487
+ const errors = reqErrs
488
+ .concat(optErrs, unexpErrs)
489
+ .filter((val) => val !== undefined);
490
+ if (errors.length > 0)
491
+ throw new AggregatedError('fields had validation errors', errors);
492
+ }
493
+ // prettier-ignore
494
+ const sortedFieldOrder = [
495
+ 'to', 'value', 'nonce',
496
+ 'maxFeePerGas', 'maxFeePerBlobGas', 'maxPriorityFeePerGas', 'gasPrice', 'gasLimit',
497
+ 'accessList', 'authorizationList', 'blobVersionedHashes', 'chainId', 'data', 'type',
498
+ 'r', 's', 'yParity', 'v'
499
+ ];
500
+ // TODO: remove any
501
+ export function sortRawData(raw) {
502
+ const sortedRaw = {};
503
+ sortedFieldOrder
504
+ .filter((field) => raw.hasOwnProperty(field))
505
+ .forEach((field) => {
506
+ sortedRaw[field] = raw[field];
507
+ });
508
+ return sortedRaw;
509
+ }
510
+ export function decodeLegacyV(raw) {
511
+ return legacySig.decode(raw).v;
512
+ }
513
+ /** EIP-7702 Authorizations. */
514
+ export const authorization = {
515
+ _getHash(req) {
516
+ const msg = RLP.encode(authorizationRequest.decode(req));
517
+ return keccak_256(concatBytes(new Uint8Array([0x05]), msg));
518
+ },
519
+ sign(req, privateKey) {
520
+ astr(privateKey);
521
+ const sig = sign(this._getHash(req), ethHex.decode(privateKey));
522
+ return { ...req, r: sig.r, s: sig.s, yParity: sig.recovery };
523
+ },
524
+ getAuthority(item) {
525
+ const { r, s, yParity, ...req } = item;
526
+ const hash = this._getHash(req);
527
+ const sig = initSig({ r, s }, yParity);
528
+ // const point = sig.recoverPublicKey(hash);
529
+ const bytes = secp256k1.recoverPublicKey(sig.toBytes('recovered'), hash, { prehash: false });
530
+ return addr.fromPublicKey(bytes);
531
+ },
532
+ };
533
+ // NOTE: for tests only, don't use
534
+ export const __tests = { legacySig, TxVersions };
535
+ //# sourceMappingURL=tx-internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx-internal.js","sourceRoot":"","sources":["../../../../../../../../src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qDAAqD,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,KAAK,CAAC,MAAM,6CAA6C,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAc,MAAM,aAAa,CAAC;AAClG,OAAO,EAAE,I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CAAC,CAAC,CAAC;QACzD,OAAO,UAAU,CAAC,WAAW,CAAC,IAAI,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAC9D,CAAC;IACD,IAAI,CAAC,GAAyB,EAAE,UAAkB;QAChD,IAAI,CAAC,UAAU,CAAC,CAAC;QACjB,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;QAChE,OAAO,EAAE,GAAG,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,QAAS,EAAE,CAAC;IAChE,CAAC;IACD,YAAY,CAAC,IAAuB;QAClC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAChC,MAAM,GAAG,GAAG,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACvC,4CAA4C;QAC5C,MAAM,KAAK,GAAG,SAAS,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;QAC7F,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF,CAAC;AAEF,kCAAkC;AAClC,MAAM,CAAC,MAAM,OAAO,GAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC"}
@@ -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