tenjin-cli 0.1.0-alpha.0 → 0.1.0-alpha.10

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 (191) hide show
  1. package/NOTICE.md +33 -0
  2. package/README.md +575 -50
  3. package/dist/{_esm-ZH2J4QEH.js → _esm-C5CRWCYU.js} +2 -2
  4. package/dist/_esm-N4KAVXQR.js +881 -0
  5. package/dist/buy-FMDBZ4NY.js +44 -0
  6. package/dist/candidate-7LAELUQD.js +23 -0
  7. package/dist/ccip-RPPPKTJR.js +19 -0
  8. package/dist/{ccip-FXWZDDF5.js → ccip-ZGGWQN4X.js} +6 -5
  9. package/dist/chunk-2GSRYTZS.js +127 -0
  10. package/dist/chunk-2GSRYTZS.js.map +1 -0
  11. package/dist/chunk-2I4QTOLB.js +11 -0
  12. package/dist/chunk-2I4QTOLB.js.map +1 -0
  13. package/dist/chunk-36X2CA3N.js +311 -0
  14. package/dist/chunk-36X2CA3N.js.map +1 -0
  15. package/dist/{chunk-F5DZJLU3.js → chunk-47PP7TAG.js} +1441 -634
  16. package/dist/chunk-47PP7TAG.js.map +1 -0
  17. package/dist/chunk-5JMKIDMM.js +316 -0
  18. package/dist/chunk-5JMKIDMM.js.map +1 -0
  19. package/dist/chunk-5JXAZP7H.js +206 -0
  20. package/dist/chunk-5JXAZP7H.js.map +1 -0
  21. package/dist/chunk-5SE6BJRP.js +135 -0
  22. package/dist/chunk-5SE6BJRP.js.map +1 -0
  23. package/dist/chunk-6BZLSRNU.js +149 -0
  24. package/dist/chunk-6BZLSRNU.js.map +1 -0
  25. package/dist/{chunk-PAAL45FJ.js → chunk-7FK2UN2T.js} +3410 -412
  26. package/dist/chunk-7FK2UN2T.js.map +1 -0
  27. package/dist/chunk-7WDY4AXV.js +14620 -0
  28. package/dist/chunk-7WDY4AXV.js.map +1 -0
  29. package/dist/chunk-A6KCZPNQ.js +83 -0
  30. package/dist/chunk-A6KCZPNQ.js.map +1 -0
  31. package/dist/chunk-AWQ6A4CI.js +341 -0
  32. package/dist/chunk-AWQ6A4CI.js.map +1 -0
  33. package/dist/chunk-BJJ5BQO6.js +162 -0
  34. package/dist/chunk-BJJ5BQO6.js.map +1 -0
  35. package/dist/chunk-BUDHTDKL.js +612 -0
  36. package/dist/chunk-BUDHTDKL.js.map +1 -0
  37. package/dist/chunk-DKQMJTG7.js +188 -0
  38. package/dist/chunk-DKQMJTG7.js.map +1 -0
  39. package/dist/chunk-FKSAUOJU.js +137 -0
  40. package/dist/chunk-FKSAUOJU.js.map +1 -0
  41. package/dist/chunk-GECSWJ7O.js +1645 -0
  42. package/dist/chunk-GECSWJ7O.js.map +1 -0
  43. package/dist/chunk-GSDZRCGF.js +105 -0
  44. package/dist/chunk-GSDZRCGF.js.map +1 -0
  45. package/dist/chunk-JSSIMGQT.js +174 -0
  46. package/dist/chunk-JSSIMGQT.js.map +1 -0
  47. package/dist/chunk-KYH4KPE5.js +1357 -0
  48. package/dist/chunk-KYH4KPE5.js.map +1 -0
  49. package/dist/chunk-KYQVEKP5.js +209 -0
  50. package/dist/chunk-KYQVEKP5.js.map +1 -0
  51. package/dist/chunk-KZAAWQNP.js +6199 -0
  52. package/dist/chunk-KZAAWQNP.js.map +1 -0
  53. package/dist/{chunk-SXQQ2ZSR.js → chunk-M2O56UK7.js} +243 -75
  54. package/dist/chunk-M2O56UK7.js.map +1 -0
  55. package/dist/chunk-MD7WGYYI.js +125 -0
  56. package/dist/chunk-MD7WGYYI.js.map +1 -0
  57. package/dist/chunk-MJZZTKCC.js +323 -0
  58. package/dist/chunk-MJZZTKCC.js.map +1 -0
  59. package/dist/chunk-O6CAUZGY.js +317 -0
  60. package/dist/chunk-O6CAUZGY.js.map +1 -0
  61. package/dist/chunk-P74I3WH4.js +204 -0
  62. package/dist/chunk-P74I3WH4.js.map +1 -0
  63. package/dist/chunk-POF7HPRV.js +145 -0
  64. package/dist/chunk-POF7HPRV.js.map +1 -0
  65. package/dist/chunk-POJRB2AE.js +83 -0
  66. package/dist/chunk-POJRB2AE.js.map +1 -0
  67. package/dist/{chunk-FIYZLITH.js → chunk-PZRAAAY2.js} +107 -18
  68. package/dist/chunk-PZRAAAY2.js.map +1 -0
  69. package/dist/chunk-PZSUWDF2.js +35 -0
  70. package/dist/chunk-PZSUWDF2.js.map +1 -0
  71. package/dist/chunk-QW2Q2KAH.js +27 -0
  72. package/dist/chunk-QW2Q2KAH.js.map +1 -0
  73. package/dist/chunk-R2VLGNFD.js +181 -0
  74. package/dist/chunk-R2VLGNFD.js.map +1 -0
  75. package/dist/{chunk-CPUZRZ2A.js → chunk-RBJPAZFI.js} +25 -170
  76. package/dist/chunk-RBJPAZFI.js.map +1 -0
  77. package/dist/chunk-S5RYMCV6.js +70 -0
  78. package/dist/chunk-S5RYMCV6.js.map +1 -0
  79. package/dist/chunk-SGK2B724.js +67 -0
  80. package/dist/chunk-SGK2B724.js.map +1 -0
  81. package/dist/chunk-STND72DS.js +242 -0
  82. package/dist/chunk-STND72DS.js.map +1 -0
  83. package/dist/chunk-TEL27PR5.js +124 -0
  84. package/dist/chunk-TEL27PR5.js.map +1 -0
  85. package/dist/chunk-TWRYSGAW.js +134 -0
  86. package/dist/chunk-TWRYSGAW.js.map +1 -0
  87. package/dist/{chunk-WOHCAMDQ.js → chunk-U5S527PP.js} +1887 -1029
  88. package/dist/chunk-U5S527PP.js.map +1 -0
  89. package/dist/chunk-UHTVXQ2O.js +140 -0
  90. package/dist/chunk-UHTVXQ2O.js.map +1 -0
  91. package/dist/chunk-UOJRKQTZ.js +213 -0
  92. package/dist/chunk-UOJRKQTZ.js.map +1 -0
  93. package/dist/chunk-V4WWTZHZ.js +233 -0
  94. package/dist/chunk-V4WWTZHZ.js.map +1 -0
  95. package/dist/chunk-VRRLTZ2Q.js +651 -0
  96. package/dist/chunk-VRRLTZ2Q.js.map +1 -0
  97. package/dist/{chunk-TX5T3LKJ.js → chunk-W6R3HAAG.js} +21 -17
  98. package/dist/{chunk-TX5T3LKJ.js.map → chunk-W6R3HAAG.js.map} +1 -1
  99. package/dist/chunk-X3OOVSPX.js +154 -0
  100. package/dist/chunk-X3OOVSPX.js.map +1 -0
  101. package/dist/chunk-XJN5WUKL.js +204 -0
  102. package/dist/chunk-XJN5WUKL.js.map +1 -0
  103. package/dist/chunk-Y7ERTA7D.js +146 -0
  104. package/dist/chunk-Y7ERTA7D.js.map +1 -0
  105. package/dist/chunk-YLYINX2H.js +7806 -0
  106. package/dist/chunk-YLYINX2H.js.map +1 -0
  107. package/dist/chunk-ZQIQ55KK.js +51 -0
  108. package/dist/chunk-ZQIQ55KK.js.map +1 -0
  109. package/dist/chunk-ZUAQRIVP.js +1369 -0
  110. package/dist/chunk-ZUAQRIVP.js.map +1 -0
  111. package/dist/{chunk-3IMLRUZE.js → chunk-ZXTAQYNA.js} +6 -2
  112. package/dist/chunk-ZXTAQYNA.js.map +1 -0
  113. package/dist/{cli-LMHGCZ5S.js → cli-HK2XAWNW.js} +438 -177
  114. package/dist/cli-HK2XAWNW.js.map +1 -0
  115. package/dist/config-LYCHHNAJ.js +26 -0
  116. package/dist/config-LYCHHNAJ.js.map +1 -0
  117. package/dist/dist-U4M6QCKE.js +2842 -0
  118. package/dist/dist-U4M6QCKE.js.map +1 -0
  119. package/dist/doctor-2KPUQURC.js +27 -0
  120. package/dist/doctor-2KPUQURC.js.map +1 -0
  121. package/dist/edit-TST3OCKQ.js +38 -0
  122. package/dist/edit-TST3OCKQ.js.map +1 -0
  123. package/dist/ethersCompat-Df4a6QIZ-WHYKB6HA.js +18 -0
  124. package/dist/ethersCompat-Df4a6QIZ-WHYKB6HA.js.map +1 -0
  125. package/dist/index.js +1 -1
  126. package/dist/inspect-TPTHVPBB.js +35 -0
  127. package/dist/inspect-TPTHVPBB.js.map +1 -0
  128. package/dist/install-PT3XEDJ6.js +1869 -0
  129. package/dist/install-PT3XEDJ6.js.map +1 -0
  130. package/dist/{mine.wasm-GQECMSGN.js → mine.wasm-6PIT3DK6.js} +2 -2
  131. package/dist/outcome-NPNSF2Q7.js +22 -0
  132. package/dist/outcome-NPNSF2Q7.js.map +1 -0
  133. package/dist/publish-XP5SEWST.js +41 -0
  134. package/dist/publish-XP5SEWST.js.map +1 -0
  135. package/dist/read-D4VXRWOG.js +158 -0
  136. package/dist/read-D4VXRWOG.js.map +1 -0
  137. package/dist/run-3IPGEXW7.js +16902 -0
  138. package/dist/run-3IPGEXW7.js.map +1 -0
  139. package/dist/search-YOBD6VDI.js +24 -0
  140. package/dist/search-YOBD6VDI.js.map +1 -0
  141. package/dist/{secp256k1-35YNNB6F.js → secp256k1-XRPVBC6V.js} +5 -4
  142. package/dist/secp256k1-XRPVBC6V.js.map +1 -0
  143. package/dist/send-BWNP6WN4.js +223 -0
  144. package/dist/send-BWNP6WN4.js.map +1 -0
  145. package/dist/session-GZEZBOMI.js +88 -0
  146. package/dist/session-GZEZBOMI.js.map +1 -0
  147. package/dist/skill-heal-OK6YALW6.js +85 -0
  148. package/dist/skill-heal-OK6YALW6.js.map +1 -0
  149. package/dist/usdc-4VCDHFWX.js +38 -0
  150. package/dist/usdc-4VCDHFWX.js.map +1 -0
  151. package/dist/viemAdapter-By13KInL-TUQJBMHM.js +14 -0
  152. package/dist/viemAdapter-By13KInL-TUQJBMHM.js.map +1 -0
  153. package/dist/wallet-5RHDFPN2.js +32 -0
  154. package/dist/wallet-5RHDFPN2.js.map +1 -0
  155. package/dist/wallet-YEGQBWWL.js +42 -0
  156. package/dist/wallet-YEGQBWWL.js.map +1 -0
  157. package/docs/agent-permissions.md +281 -0
  158. package/package.json +26 -17
  159. package/skills/tenjin/SKILL.md +364 -0
  160. package/skills/tenjin-publish/SKILL.md +219 -0
  161. package/skills/tenjin-search/SKILL.md +335 -0
  162. package/dist/chunk-376LHMK2.js +0 -100
  163. package/dist/chunk-376LHMK2.js.map +0 -1
  164. package/dist/chunk-CPUZRZ2A.js.map +0 -1
  165. package/dist/chunk-F5DZJLU3.js.map +0 -1
  166. package/dist/chunk-FIYZLITH.js.map +0 -1
  167. package/dist/chunk-LTTRND4A.js +0 -135
  168. package/dist/chunk-LTTRND4A.js.map +0 -1
  169. package/dist/chunk-PAAL45FJ.js.map +0 -1
  170. package/dist/chunk-QHIEYBLV.js +0 -320
  171. package/dist/chunk-QHIEYBLV.js.map +0 -1
  172. package/dist/chunk-SXQQ2ZSR.js.map +0 -1
  173. package/dist/chunk-WOHCAMDQ.js.map +0 -1
  174. package/dist/chunk-ZPZFPVDN.js +0 -67
  175. package/dist/chunk-ZPZFPVDN.js.map +0 -1
  176. package/dist/cli-LMHGCZ5S.js.map +0 -1
  177. package/dist/config-XVXZ3V2Q.js +0 -206
  178. package/dist/config-XVXZ3V2Q.js.map +0 -1
  179. package/dist/doctor-MVLZRVPU.js +0 -338
  180. package/dist/doctor-MVLZRVPU.js.map +0 -1
  181. package/dist/usdc-OQUOFF6R.js +0 -18
  182. package/dist/wallet-NRKWLKHX.js +0 -153
  183. package/dist/wallet-NRKWLKHX.js.map +0 -1
  184. package/dist/wallet-QUWK2PA4.js +0 -22
  185. /package/dist/{_esm-ZH2J4QEH.js.map → _esm-C5CRWCYU.js.map} +0 -0
  186. /package/dist/{ccip-FXWZDDF5.js.map → _esm-N4KAVXQR.js.map} +0 -0
  187. /package/dist/{chunk-3IMLRUZE.js.map → buy-FMDBZ4NY.js.map} +0 -0
  188. /package/dist/{secp256k1-35YNNB6F.js.map → candidate-7LAELUQD.js.map} +0 -0
  189. /package/dist/{usdc-OQUOFF6R.js.map → ccip-RPPPKTJR.js.map} +0 -0
  190. /package/dist/{wallet-QUWK2PA4.js.map → ccip-ZGGWQN4X.js.map} +0 -0
  191. /package/dist/{mine.wasm-GQECMSGN.js.map → mine.wasm-6PIT3DK6.js.map} +0 -0
@@ -1,25 +1,38 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
2
  import {
3
+ assertTransactionEIP1559,
4
+ assertTransactionEIP2930,
5
+ assertTransactionEIP4844,
6
+ assertTransactionEIP7702,
7
+ assertTransactionLegacy,
3
8
  blobsToCommitments,
4
9
  blobsToProofs,
10
+ commitmentToVersionedHash,
5
11
  commitmentsToVersionedHashes,
12
+ getTransactionCount,
6
13
  getTransactionType,
14
+ getTypesForEIP712Domain,
7
15
  hashAuthorization,
8
16
  hashMessage,
9
17
  hashTypedData,
18
+ keccak256 as keccak2562,
10
19
  publicKeyToAddress,
11
20
  serializeSignature,
12
21
  serializeTransaction,
22
+ serializeTypedData,
13
23
  toBlobSidecars,
14
- toRlp
15
- } from "./chunk-SXQQ2ZSR.js";
24
+ toRlp,
25
+ validateTypedData
26
+ } from "./chunk-M2O56UK7.js";
27
+ import {
28
+ ripemd160
29
+ } from "./chunk-UHTVXQ2O.js";
16
30
  import {
17
31
  secp256k1
18
- } from "./chunk-TX5T3LKJ.js";
32
+ } from "./chunk-W6R3HAAG.js";
19
33
  import {
20
34
  AtomicReadyWalletRejectedUpgradeError,
21
35
  AtomicityNotSupportedError,
22
- BaseError as BaseError2,
23
36
  BundleTooLargeError,
24
37
  CallExecutionError,
25
38
  ChainDisconnectedError,
@@ -28,7 +41,6 @@ import {
28
41
  ContractFunctionZeroDataError,
29
42
  DuplicateIdError,
30
43
  HttpRequestError,
31
- IntegerOutOfRangeError,
32
44
  InternalRpcError,
33
45
  InvalidInputRpcError,
34
46
  InvalidParamsRpcError,
@@ -44,6 +56,7 @@ import {
44
56
  ResourceUnavailableRpcError,
45
57
  ResponseBodyTooLargeError,
46
58
  RpcRequestError,
59
+ SocketClosedError,
47
60
  SwitchChainError,
48
61
  TimeoutError,
49
62
  TransactionRejectedRpcError,
@@ -55,12 +68,15 @@ import {
55
68
  UnsupportedProviderMethodError,
56
69
  UserRejectedRequestError,
57
70
  WalletConnectSessionSettlementError,
71
+ WebSocketRequestError,
58
72
  addressResolverAbi,
59
73
  assertRequest,
74
+ batchGatewayAbi,
60
75
  call,
61
- concat as concat2,
76
+ ccipRequest,
62
77
  createBatchScheduler,
63
78
  decodeAbiParameters,
79
+ decodeErrorResult,
64
80
  decodeFunctionResult,
65
81
  defineFormatter,
66
82
  deploylessCallViaBytecodeBytecode,
@@ -71,18 +87,9 @@ import {
71
87
  erc6492SignatureValidatorAbi,
72
88
  erc6492SignatureValidatorByteCode,
73
89
  extract,
74
- formatAbiItem as formatAbiItem2,
90
+ formatAbiItem,
75
91
  formatAbiParameters,
76
- formatBlockParameter,
77
92
  formatTransactionRequest,
78
- from,
79
- from2,
80
- fromBoolean,
81
- fromBytes,
82
- fromHex,
83
- fromNumber,
84
- fromString,
85
- fromString2,
86
93
  getAbiItem,
87
94
  getAbortError,
88
95
  getCallError,
@@ -93,80 +100,120 @@ import {
93
100
  localBatchGatewayUrl,
94
101
  multicall3Abi,
95
102
  multicall3Bytecode,
96
- padLeft,
97
- padRight,
98
103
  parseAbiItem,
99
104
  parseAbiParameters,
100
105
  serializeStateOverride,
101
- size as size2,
102
- size2 as size3,
103
- slice as slice2,
104
- slice2 as slice3,
105
- stringify as stringify2,
106
+ solidityError,
106
107
  textResolverAbi,
107
- toBigInt,
108
- toBoolean,
109
108
  toEventSelector,
110
- toNumber,
111
- toNumber2,
112
109
  toRpc,
113
- toString,
114
- trimLeft,
115
- trimLeft2,
116
110
  universalResolverResolveAbi,
117
111
  universalResolverReverseAbi,
118
- validate,
119
- validate2,
120
112
  withResolvers
121
- } from "./chunk-WOHCAMDQ.js";
113
+ } from "./chunk-U5S527PP.js";
122
114
  import {
115
+ AbiConstructorNotFoundError,
116
+ AbiConstructorParamsNotFoundError,
123
117
  AbiDecodingDataSizeTooSmallError,
124
118
  AbiDecodingZeroDataError,
119
+ AbiEncodingLengthMismatchError,
125
120
  AbiEventNotFoundError,
126
121
  AbiEventSignatureEmptyTopicsError,
127
122
  AbiEventSignatureNotFoundError,
128
123
  BaseError,
124
+ BaseError2,
125
+ BytesSizeMismatchError,
126
+ ChainMismatchError,
127
+ ChainNotFoundError,
129
128
  DecodeLogDataMismatch,
130
129
  DecodeLogTopicsMismatch,
130
+ ExecutionRevertedError,
131
+ IntegerOutOfRangeError2 as IntegerOutOfRangeError,
131
132
  InvalidAddressError,
133
+ InvalidHexValueError,
134
+ InvalidLegacyVError,
135
+ InvalidSerializedTransactionError,
136
+ InvalidSerializedTransactionTypeError,
137
+ InvalidYParityError,
132
138
  LruMap,
133
139
  PositionOutOfBoundsError,
140
+ RlpDepthLimitExceededError,
141
+ RlpListBoundaryExceededError,
142
+ RlpTrailingBytesError,
134
143
  TransactionExecutionError,
135
144
  TransactionNotFoundError,
136
145
  TransactionReceiptNotFoundError,
137
146
  TransactionReceiptRevertedError,
138
147
  UnknownNodeError,
148
+ UnsupportedPackedAbiType,
139
149
  WaitForTransactionReceiptTimeoutError,
150
+ arrayRegex,
151
+ boolToHex,
152
+ bytesRegex,
140
153
  bytesToHex,
154
+ checksumAddress,
141
155
  concat,
156
+ concat3 as concat2,
142
157
  concatHex,
158
+ createCursor,
143
159
  encodeAbiParameters,
144
- formatAbiItem,
160
+ etherUnits,
161
+ formatAbiItem as formatAbiItem2,
162
+ formatBlockParameter,
145
163
  formatEther,
146
164
  formatGwei,
147
165
  formatUnits,
166
+ from2 as from,
167
+ fromBoolean,
168
+ fromBytes,
169
+ fromHex2 as fromHex,
170
+ fromNumber,
171
+ fromString,
172
+ fromString2,
148
173
  getAddress,
174
+ gweiUnits,
149
175
  hexToBigInt,
150
176
  hexToBool,
177
+ hexToBytes,
151
178
  hexToNumber,
179
+ integerRegex,
152
180
  isAddress,
153
181
  isHex,
154
182
  keccak256,
155
- keccak_256,
156
183
  numberToHex,
184
+ pad,
185
+ padHex,
186
+ padLeft,
187
+ padRight,
157
188
  parseAccount,
158
189
  prettyPrint,
159
190
  size,
191
+ size2,
192
+ size3,
160
193
  slice,
194
+ slice2,
195
+ slice3,
196
+ sliceHex,
161
197
  stringToBytes,
198
+ stringToHex,
162
199
  stringify,
200
+ stringify2,
201
+ toBigInt,
202
+ toBoolean,
163
203
  toBytes,
164
204
  toHex,
165
- trim
166
- } from "./chunk-F5DZJLU3.js";
205
+ toNumber,
206
+ toNumber2,
207
+ toString,
208
+ trim,
209
+ trimLeft,
210
+ trimLeft2,
211
+ validate,
212
+ validate2
213
+ } from "./chunk-47PP7TAG.js";
167
214
  import {
168
215
  __export
169
- } from "./chunk-3IMLRUZE.js";
216
+ } from "./chunk-ZXTAQYNA.js";
170
217
 
171
218
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/getAction.js
172
219
  function getAction(client, actionFn, name) {
@@ -215,7 +262,7 @@ function encodeEventTopics(parameters) {
215
262
  }
216
263
  if (abiItem.anonymous)
217
264
  return topics;
218
- const definition = formatAbiItem(abiItem);
265
+ const definition = formatAbiItem2(abiItem);
219
266
  const signature = toEventSelector(definition);
220
267
  return [signature, ...topics];
221
268
  }
@@ -273,7 +320,7 @@ async function createContractEventFilter(client, parameters) {
273
320
 
274
321
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/errors/getContractError.js
275
322
  var EXECUTION_REVERTED_ERROR_CODE = 3;
276
- function getContractError(err, { abi: abi2, address, args, docsPath: docsPath3, functionName, sender }) {
323
+ function getContractError(err, { abi: abi2, address, args, docsPath: docsPath4, functionName, sender }) {
277
324
  const error = err instanceof RawContractError ? err : err instanceof BaseError ? err.walk((err2) => "data" in err2) || err.walk() : {};
278
325
  const { code, data, details, message, shortMessage } = error;
279
326
  const cause = (() => {
@@ -294,7 +341,7 @@ function getContractError(err, { abi: abi2, address, args, docsPath: docsPath3,
294
341
  abi: abi2,
295
342
  args,
296
343
  contractAddress: address,
297
- docsPath: docsPath3,
344
+ docsPath: docsPath4,
298
345
  functionName,
299
346
  sender
300
347
  });
@@ -303,7 +350,7 @@ function getContractError(err, { abi: abi2, address, args, docsPath: docsPath3,
303
350
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/recoverPublicKey.js
304
351
  async function recoverPublicKey({ hash: hash2, signature }) {
305
352
  const hashHex = isHex(hash2) ? hash2 : toHex(hash2);
306
- const { secp256k1: secp256k12 } = await import("./secp256k1-35YNNB6F.js");
353
+ const { secp256k1: secp256k12 } = await import("./secp256k1-XRPVBC6V.js");
307
354
  const signature_ = (() => {
308
355
  if (typeof signature === "object" && "r" in signature && "s" in signature) {
309
356
  const { r, s, v, yParity } = signature;
@@ -347,7 +394,7 @@ async function recoverAuthorizationAddress(parameters) {
347
394
 
348
395
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/estimateGas.js
349
396
  var EstimateGasExecutionError = class extends BaseError {
350
- constructor(cause, { account, docsPath: docsPath3, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value }) {
397
+ constructor(cause, { account, docsPath: docsPath4, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value }) {
351
398
  const prettyArgs = prettyPrint({
352
399
  from: account?.address,
353
400
  to,
@@ -361,7 +408,7 @@ var EstimateGasExecutionError = class extends BaseError {
361
408
  });
362
409
  super(cause.shortMessage, {
363
410
  cause,
364
- docsPath: docsPath3,
411
+ docsPath: docsPath4,
365
412
  metaMessages: [
366
413
  ...cause.metaMessages ? [...cause.metaMessages, " "] : [],
367
414
  "Estimate Gas Arguments:",
@@ -380,7 +427,7 @@ var EstimateGasExecutionError = class extends BaseError {
380
427
  };
381
428
 
382
429
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/errors/getEstimateGasError.js
383
- function getEstimateGasError(err, { docsPath: docsPath3, ...args }) {
430
+ function getEstimateGasError(err, { docsPath: docsPath4, ...args }) {
384
431
  const cause = (() => {
385
432
  const cause2 = getNodeError(err, args);
386
433
  if (cause2 instanceof UnknownNodeError)
@@ -388,7 +435,7 @@ function getEstimateGasError(err, { docsPath: docsPath3, ...args }) {
388
435
  return cause2;
389
436
  })();
390
437
  return new EstimateGasExecutionError(cause, {
391
- docsPath: docsPath3,
438
+ docsPath: docsPath4,
392
439
  ...args
393
440
  });
394
441
  }
@@ -614,7 +661,7 @@ async function internal_estimateFeesPerGas(client, args) {
614
661
  throw new BaseFeeScalarError();
615
662
  const decimals = baseFeeMultiplier.toString().split(".")[1]?.length ?? 0;
616
663
  const denominator = 10 ** decimals;
617
- const multiply = (base2) => base2 * BigInt(Math.ceil(baseFeeMultiplier * denominator)) / BigInt(denominator);
664
+ const multiply = (base) => base * BigInt(Math.ceil(baseFeeMultiplier * denominator)) / BigInt(denominator);
618
665
  const block = block_ ? block_ : await getAction(client, getBlock, "getBlock")({});
619
666
  if (typeof chain?.fees?.estimateFeesPerGas === "function") {
620
667
  const fees = await chain.fees.estimateFeesPerGas({
@@ -648,25 +695,8 @@ async function internal_estimateFeesPerGas(client, args) {
648
695
  };
649
696
  }
650
697
 
651
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/getTransactionCount.js
652
- async function getTransactionCount(client, { address, blockHash, blockNumber, blockTag = "latest", requireCanonical }) {
653
- const block = formatBlockParameter({
654
- blockHash,
655
- blockNumber,
656
- blockTag,
657
- requireCanonical
658
- });
659
- const count = await client.request({
660
- method: "eth_getTransactionCount",
661
- params: [address, block]
662
- }, {
663
- dedupe: typeof blockNumber === "bigint" || blockHash !== void 0
664
- });
665
- return hexToNumber(count);
666
- }
667
-
668
698
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/errors/getTransactionError.js
669
- function getTransactionError(err, { docsPath: docsPath3, ...args }) {
699
+ function getTransactionError(err, { docsPath: docsPath4, ...args }) {
670
700
  const cause = (() => {
671
701
  const cause2 = getNodeError(err, args);
672
702
  if (cause2 instanceof UnknownNodeError)
@@ -674,7 +704,7 @@ function getTransactionError(err, { docsPath: docsPath3, ...args }) {
674
704
  return cause2;
675
705
  })();
676
706
  return new TransactionExecutionError(cause, {
677
- docsPath: docsPath3,
707
+ docsPath: docsPath4,
678
708
  ...args
679
709
  });
680
710
  }
@@ -689,17 +719,17 @@ async function getChainId(client) {
689
719
 
690
720
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/fillTransaction.js
691
721
  async function fillTransaction(client, parameters) {
692
- const { account = client.account, accessList, authorizationList, chain = client.chain, blobVersionedHashes, blobs, data, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce: nonce_, nonceManager, to, type, value, ...rest } = parameters;
722
+ const { account = client.account, accessList, authorizationList, chain = client.chain, blobVersionedHashes, blobs, data, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce: nonce_, nonceManager: nonceManager2, to, type, value, ...rest } = parameters;
693
723
  const nonce = await (async () => {
694
724
  if (!account)
695
725
  return nonce_;
696
- if (!nonceManager)
726
+ if (!nonceManager2)
697
727
  return nonce_;
698
728
  if (typeof nonce_ !== "undefined")
699
729
  return nonce_;
700
730
  const account_ = parseAccount(account);
701
731
  const chainId = chain ? chain.id : await getAction(client, getChainId, "getChainId")({});
702
- return await nonceManager.consume({
732
+ return await nonceManager2.consume({
703
733
  address: account_.address,
704
734
  chainId,
705
735
  client
@@ -769,7 +799,7 @@ async function fillTransaction(client, parameters) {
769
799
  throw new BaseFeeScalarError();
770
800
  const decimals = feeMultiplier.toString().split(".")[1]?.length ?? 0;
771
801
  const denominator = 10 ** decimals;
772
- const multiplyFee = (base2) => base2 * BigInt(Math.ceil(feeMultiplier * denominator)) / BigInt(denominator);
802
+ const multiplyFee = (base) => base * BigInt(Math.ceil(feeMultiplier * denominator)) / BigInt(denominator);
773
803
  if (!transaction.feePayerSignature) {
774
804
  if (transaction.maxFeePerGas && !parameters.maxFeePerGas)
775
805
  transaction.maxFeePerGas = multiplyFee(transaction.maxFeePerGas);
@@ -807,7 +837,7 @@ async function prepareTransactionRequest(client, args) {
807
837
  let request = args;
808
838
  request.account ??= client.account;
809
839
  request.parameters ??= defaultParameters;
810
- const { account: account_, chain = client.chain, nonceManager, parameters } = request;
840
+ const { account: account_, chain = client.chain, nonceManager: nonceManager2, parameters } = request;
811
841
  const prepareTransactionRequest2 = (() => {
812
842
  if (typeof chain?.prepareTransactionRequest === "function")
813
843
  return {
@@ -835,9 +865,9 @@ async function prepareTransactionRequest(client, args) {
835
865
  }
836
866
  const account = account_ ? parseAccount(account_) : account_;
837
867
  let nonce = request.nonce;
838
- if (parameters.includes("nonce") && typeof nonce === "undefined" && account && nonceManager) {
868
+ if (parameters.includes("nonce") && typeof nonce === "undefined" && account && nonceManager2) {
839
869
  const chainId2 = await getChainId2();
840
- nonce = await nonceManager.consume({
870
+ nonce = await nonceManager2.consume({
841
871
  address: account.address,
842
872
  chainId: chainId2,
843
873
  client
@@ -869,14 +899,14 @@ async function prepareTransactionRequest(client, args) {
869
899
  return false;
870
900
  })();
871
901
  const fillResult = attemptFill ? await getAction(client, fillTransaction, "fillTransaction")({ ...request, nonce }).then((result) => {
872
- const { chainId: chainId2, from: from14, gas: gas2, gasPrice, nonce: nonce2, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, type: type2, ...rest } = result.transaction;
902
+ const { chainId: chainId2, from: from13, gas: gas2, gasPrice, nonce: nonce2, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, type: type2, ...rest } = result.transaction;
873
903
  const feeToken = "feeToken" in rest ? rest.feeToken : void 0;
874
904
  const hasFilledFeePayerSignature = "feePayerSignature" in rest && rest.feePayerSignature !== null && typeof rest.feePayerSignature !== "undefined";
875
905
  const shouldUseFilledFeeToken = typeof feeToken !== "undefined" && feeToken !== null && (!("feeToken" in request) || hasFilledFeePayerSignature);
876
906
  supportsFillTransaction.set(client.uid, true);
877
907
  return {
878
908
  ...request,
879
- ...from14 ? { from: from14 } : {},
909
+ ...from13 ? { from: from13 } : {},
880
910
  ...type2 && !request.type ? { type: type2 } : {},
881
911
  ...typeof chainId2 !== "undefined" ? { chainId: chainId2 } : {},
882
912
  ...typeof gas2 !== "undefined" ? { gas: gas2 } : {},
@@ -929,7 +959,7 @@ async function prepareTransactionRequest(client, args) {
929
959
  block = await getAction(client, getBlock, "getBlock")({ blockTag: "latest" });
930
960
  return block;
931
961
  }
932
- if (parameters.includes("nonce") && typeof nonce === "undefined" && account && !nonceManager)
962
+ if (parameters.includes("nonce") && typeof nonce === "undefined" && account && !nonceManager2)
933
963
  request.nonce = await getAction(client, getTransactionCount, "getTransactionCount")({
934
964
  address: account.address,
935
965
  blockTag: "pending"
@@ -1136,7 +1166,7 @@ function decodeEventLog(parameters) {
1136
1166
  const [signature, ...argTopics] = topics;
1137
1167
  if (!signature)
1138
1168
  throw new AbiEventSignatureEmptyTopicsError({ docsPath: docsPath2 });
1139
- const abiItem = abi2.find((x) => x.type === "event" && signature === toEventSelector(formatAbiItem(x)));
1169
+ const abiItem = abi2.find((x) => x.type === "event" && signature === toEventSelector(formatAbiItem2(x)));
1140
1170
  if (!(abiItem && "name" in abiItem) || abiItem.type !== "event")
1141
1171
  throw new AbiEventSignatureNotFoundError(signature, { docsPath: docsPath2 });
1142
1172
  const { name, inputs } = abiItem;
@@ -1810,17 +1840,34 @@ function watchContractEvent(client, parameters) {
1810
1840
 
1811
1841
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/account.js
1812
1842
  var AccountNotFoundError = class extends BaseError {
1813
- constructor({ docsPath: docsPath3 } = {}) {
1843
+ constructor({ docsPath: docsPath4 } = {}) {
1814
1844
  super([
1815
1845
  "Could not find an Account to execute with this Action.",
1816
1846
  "Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."
1817
1847
  ].join("\n"), {
1818
- docsPath: docsPath3,
1848
+ docsPath: docsPath4,
1819
1849
  docsSlug: "account",
1820
1850
  name: "AccountNotFoundError"
1821
1851
  });
1822
1852
  }
1823
1853
  };
1854
+ var AccountTypeNotSupportedError = class extends BaseError {
1855
+ constructor({ docsPath: docsPath4, metaMessages, type }) {
1856
+ super(`Account type "${type}" is not supported.`, {
1857
+ docsPath: docsPath4,
1858
+ metaMessages,
1859
+ name: "AccountTypeNotSupportedError"
1860
+ });
1861
+ }
1862
+ };
1863
+
1864
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/chain/assertCurrentChain.js
1865
+ function assertCurrentChain({ chain, currentChainId }) {
1866
+ if (!chain)
1867
+ throw new ChainNotFoundError();
1868
+ if (currentChainId !== chain.id)
1869
+ throw new ChainMismatchError({ chain, currentChainId });
1870
+ }
1824
1871
 
1825
1872
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/sendRawTransaction.js
1826
1873
  async function sendRawTransaction(client, { serializedTransaction }) {
@@ -1830,6 +1877,381 @@ async function sendRawTransaction(client, { serializedTransaction }) {
1830
1877
  }, { retryCount: 0 });
1831
1878
  }
1832
1879
 
1880
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/sendTransaction.js
1881
+ var supportsWalletNamespace = new LruMap(128);
1882
+ async function sendTransaction(client, parameters) {
1883
+ const { account: account_ = client.account, assertChainId = true, chain = client.chain, accessList, authorizationList, blobs, data, dataSuffix = typeof client.dataSuffix === "string" ? client.dataSuffix : client.dataSuffix?.value, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, type, value, ...rest } = parameters;
1884
+ if (typeof account_ === "undefined")
1885
+ throw new AccountNotFoundError({
1886
+ docsPath: "/docs/actions/wallet/sendTransaction"
1887
+ });
1888
+ const account = account_ ? parseAccount(account_) : null;
1889
+ let nonceManagerParameters;
1890
+ try {
1891
+ assertRequest(parameters);
1892
+ const to = await (async () => {
1893
+ if (parameters.to)
1894
+ return parameters.to;
1895
+ if (parameters.to === null)
1896
+ return void 0;
1897
+ if (authorizationList && authorizationList.length > 0)
1898
+ return await recoverAuthorizationAddress({
1899
+ authorization: authorizationList[0]
1900
+ }).catch(() => {
1901
+ throw new BaseError("`to` is required. Could not infer from `authorizationList`.");
1902
+ });
1903
+ return void 0;
1904
+ })();
1905
+ if (account?.type === "json-rpc" || account === null) {
1906
+ let chainId;
1907
+ if (chain !== null) {
1908
+ chainId = await getAction(client, getChainId, "getChainId")({});
1909
+ if (assertChainId)
1910
+ assertCurrentChain({
1911
+ currentChainId: chainId,
1912
+ chain
1913
+ });
1914
+ }
1915
+ const chainFormat = client.chain?.formatters?.transactionRequest?.format;
1916
+ const format = chainFormat || formatTransactionRequest;
1917
+ const request = format({
1918
+ // Pick out extra data that might exist on the chain's transaction request type.
1919
+ ...extract(rest, { format: chainFormat }),
1920
+ accessList,
1921
+ account,
1922
+ authorizationList,
1923
+ blobs,
1924
+ chainId,
1925
+ data: dataSuffix ? concat([data ?? "0x", dataSuffix]) : data,
1926
+ gas,
1927
+ gasPrice,
1928
+ maxFeePerBlobGas,
1929
+ maxFeePerGas,
1930
+ maxPriorityFeePerGas,
1931
+ nonce,
1932
+ to,
1933
+ type,
1934
+ value
1935
+ }, "sendTransaction");
1936
+ const isWalletNamespaceSupported = supportsWalletNamespace.get(client.uid);
1937
+ const method = isWalletNamespaceSupported ? "wallet_sendTransaction" : "eth_sendTransaction";
1938
+ try {
1939
+ return await client.request({
1940
+ method,
1941
+ params: [request]
1942
+ }, { retryCount: 0 });
1943
+ } catch (e) {
1944
+ if (isWalletNamespaceSupported === false)
1945
+ throw e;
1946
+ const error = e;
1947
+ if (error.name === "InvalidInputRpcError" || error.name === "InvalidParamsRpcError" || error.name === "MethodNotFoundRpcError" || error.name === "MethodNotSupportedRpcError") {
1948
+ return await client.request({
1949
+ method: "wallet_sendTransaction",
1950
+ params: [request]
1951
+ }, { retryCount: 0 }).then((hash2) => {
1952
+ supportsWalletNamespace.set(client.uid, true);
1953
+ return hash2;
1954
+ }).catch((e2) => {
1955
+ const walletNamespaceError = e2;
1956
+ if (walletNamespaceError.name === "MethodNotFoundRpcError" || walletNamespaceError.name === "MethodNotSupportedRpcError") {
1957
+ supportsWalletNamespace.set(client.uid, false);
1958
+ throw error;
1959
+ }
1960
+ throw walletNamespaceError;
1961
+ });
1962
+ }
1963
+ throw error;
1964
+ }
1965
+ }
1966
+ if (account?.type === "local") {
1967
+ if (account.nonceManager && typeof nonce === "undefined") {
1968
+ const requestChainId = rest.chainId;
1969
+ const chainId = await (async () => {
1970
+ if (typeof requestChainId === "number")
1971
+ return requestChainId;
1972
+ if (chain)
1973
+ return chain.id;
1974
+ return getAction(client, getChainId, "getChainId")({});
1975
+ })();
1976
+ nonceManagerParameters = { address: account.address, chainId };
1977
+ }
1978
+ const request = await getAction(client, prepareTransactionRequest, "prepareTransactionRequest")({
1979
+ account,
1980
+ accessList,
1981
+ authorizationList,
1982
+ blobs,
1983
+ chain,
1984
+ data: dataSuffix ? concat([data ?? "0x", dataSuffix]) : data,
1985
+ gas,
1986
+ gasPrice,
1987
+ maxFeePerBlobGas,
1988
+ maxFeePerGas,
1989
+ maxPriorityFeePerGas,
1990
+ nonce,
1991
+ nonceManager: account.nonceManager,
1992
+ parameters: [...defaultParameters, "sidecars"],
1993
+ type,
1994
+ value,
1995
+ ...rest,
1996
+ to
1997
+ });
1998
+ const serializer = chain?.serializers?.transaction;
1999
+ const serializedTransaction = await account.signTransaction(request, {
2000
+ serializer
2001
+ });
2002
+ return await getAction(client, sendRawTransaction, "sendRawTransaction")({
2003
+ serializedTransaction
2004
+ });
2005
+ }
2006
+ if (account?.type === "smart")
2007
+ throw new AccountTypeNotSupportedError({
2008
+ metaMessages: [
2009
+ "Consider using the `sendUserOperation` Action instead."
2010
+ ],
2011
+ docsPath: "/docs/actions/bundler/sendUserOperation",
2012
+ type: "smart"
2013
+ });
2014
+ throw new AccountTypeNotSupportedError({
2015
+ docsPath: "/docs/actions/wallet/sendTransaction",
2016
+ type: account?.type
2017
+ });
2018
+ } catch (err) {
2019
+ if (err instanceof AccountTypeNotSupportedError)
2020
+ throw err;
2021
+ if (nonceManagerParameters)
2022
+ account?.nonceManager?.reset(nonceManagerParameters);
2023
+ throw getTransactionError(err, {
2024
+ ...parameters,
2025
+ account,
2026
+ chain: parameters.chain || void 0
2027
+ });
2028
+ }
2029
+ }
2030
+
2031
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/writeContract.js
2032
+ async function writeContract(client, parameters) {
2033
+ return writeContract.internal(client, sendTransaction, "sendTransaction", parameters);
2034
+ }
2035
+ (function(writeContract2) {
2036
+ async function internal(client, actionFn, name, parameters) {
2037
+ const { abi: abi2, account: account_ = client.account, address, args, functionName, ...request } = parameters;
2038
+ if (typeof account_ === "undefined")
2039
+ throw new AccountNotFoundError({
2040
+ docsPath: "/docs/contract/writeContract"
2041
+ });
2042
+ const account = account_ ? parseAccount(account_) : null;
2043
+ const data = encodeFunctionData({
2044
+ abi: abi2,
2045
+ args,
2046
+ functionName
2047
+ });
2048
+ try {
2049
+ return await getAction(client, actionFn, name)({
2050
+ data,
2051
+ to: address,
2052
+ account,
2053
+ ...request
2054
+ });
2055
+ } catch (error) {
2056
+ throw getContractError(error, {
2057
+ abi: abi2,
2058
+ address,
2059
+ args,
2060
+ docsPath: "/docs/contract/writeContract",
2061
+ functionName,
2062
+ sender: account?.address
2063
+ });
2064
+ }
2065
+ }
2066
+ writeContract2.internal = internal;
2067
+ })(writeContract || (writeContract = {}));
2068
+
2069
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/getContract.js
2070
+ function getContract({ abi: abi2, address, client: client_ }) {
2071
+ const client = client_;
2072
+ const [publicClient, walletClient] = (() => {
2073
+ if (!client)
2074
+ return [void 0, void 0];
2075
+ if ("public" in client && "wallet" in client)
2076
+ return [client.public, client.wallet];
2077
+ if ("public" in client)
2078
+ return [client.public, void 0];
2079
+ if ("wallet" in client)
2080
+ return [void 0, client.wallet];
2081
+ return [client, client];
2082
+ })();
2083
+ const hasPublicClient = publicClient !== void 0 && publicClient !== null;
2084
+ const hasWalletClient = walletClient !== void 0 && walletClient !== null;
2085
+ const contract = {};
2086
+ let hasReadFunction = false;
2087
+ let hasWriteFunction = false;
2088
+ let hasEvent = false;
2089
+ for (const item of abi2) {
2090
+ if (item.type === "function")
2091
+ if (item.stateMutability === "view" || item.stateMutability === "pure")
2092
+ hasReadFunction = true;
2093
+ else
2094
+ hasWriteFunction = true;
2095
+ else if (item.type === "event")
2096
+ hasEvent = true;
2097
+ if (hasReadFunction && hasWriteFunction && hasEvent)
2098
+ break;
2099
+ }
2100
+ if (hasPublicClient) {
2101
+ if (hasReadFunction)
2102
+ contract.read = new Proxy({}, {
2103
+ get(_, functionName) {
2104
+ return (...parameters) => {
2105
+ const { args, options } = getFunctionParameters(parameters);
2106
+ return getAction(publicClient, readContract, "readContract")({
2107
+ abi: abi2,
2108
+ address,
2109
+ functionName,
2110
+ args,
2111
+ ...options
2112
+ });
2113
+ };
2114
+ }
2115
+ });
2116
+ if (hasWriteFunction)
2117
+ contract.simulate = new Proxy({}, {
2118
+ get(_, functionName) {
2119
+ return (...parameters) => {
2120
+ const { args, options } = getFunctionParameters(parameters);
2121
+ return getAction(publicClient, simulateContract, "simulateContract")({
2122
+ abi: abi2,
2123
+ address,
2124
+ functionName,
2125
+ args,
2126
+ ...options
2127
+ });
2128
+ };
2129
+ }
2130
+ });
2131
+ if (hasEvent) {
2132
+ contract.createEventFilter = new Proxy({}, {
2133
+ get(_, eventName) {
2134
+ return (...parameters) => {
2135
+ const abiEvent = abi2.find((x) => x.type === "event" && x.name === eventName);
2136
+ const { args, options } = getEventParameters(parameters, abiEvent);
2137
+ return getAction(publicClient, createContractEventFilter, "createContractEventFilter")({
2138
+ abi: abi2,
2139
+ address,
2140
+ eventName,
2141
+ args,
2142
+ ...options
2143
+ });
2144
+ };
2145
+ }
2146
+ });
2147
+ contract.getEvents = new Proxy({}, {
2148
+ get(_, eventName) {
2149
+ return (...parameters) => {
2150
+ const abiEvent = abi2.find((x) => x.type === "event" && x.name === eventName);
2151
+ const { args, options } = getEventParameters(parameters, abiEvent);
2152
+ return getAction(publicClient, getContractEvents, "getContractEvents")({
2153
+ abi: abi2,
2154
+ address,
2155
+ eventName,
2156
+ args,
2157
+ ...options
2158
+ });
2159
+ };
2160
+ }
2161
+ });
2162
+ contract.watchEvent = new Proxy({}, {
2163
+ get(_, eventName) {
2164
+ return (...parameters) => {
2165
+ const abiEvent = abi2.find((x) => x.type === "event" && x.name === eventName);
2166
+ const { args, options } = getEventParameters(parameters, abiEvent);
2167
+ return getAction(publicClient, watchContractEvent, "watchContractEvent")({
2168
+ abi: abi2,
2169
+ address,
2170
+ eventName,
2171
+ args,
2172
+ ...options
2173
+ });
2174
+ };
2175
+ }
2176
+ });
2177
+ }
2178
+ }
2179
+ if (hasWalletClient) {
2180
+ if (hasWriteFunction)
2181
+ contract.write = new Proxy({}, {
2182
+ get(_, functionName) {
2183
+ return (...parameters) => {
2184
+ const { args, options } = getFunctionParameters(parameters);
2185
+ return getAction(walletClient, writeContract, "writeContract")({
2186
+ abi: abi2,
2187
+ address,
2188
+ functionName,
2189
+ args,
2190
+ ...options
2191
+ });
2192
+ };
2193
+ }
2194
+ });
2195
+ }
2196
+ if (hasPublicClient || hasWalletClient) {
2197
+ if (hasWriteFunction)
2198
+ contract.estimateGas = new Proxy({}, {
2199
+ get(_, functionName) {
2200
+ return (...parameters) => {
2201
+ const { args, options } = getFunctionParameters(parameters);
2202
+ const client2 = publicClient ?? walletClient;
2203
+ return getAction(client2, estimateContractGas, "estimateContractGas")({
2204
+ abi: abi2,
2205
+ address,
2206
+ functionName,
2207
+ args,
2208
+ ...options,
2209
+ account: options.account ?? walletClient.account
2210
+ });
2211
+ };
2212
+ }
2213
+ });
2214
+ }
2215
+ contract.address = address;
2216
+ contract.abi = abi2;
2217
+ return contract;
2218
+ }
2219
+ function getFunctionParameters(values) {
2220
+ const hasArgs = values.length && Array.isArray(values[0]);
2221
+ const args = hasArgs ? values[0] : [];
2222
+ const options = (hasArgs ? values[1] : values[0]) ?? {};
2223
+ return { args, options };
2224
+ }
2225
+ function getEventParameters(values, abiEvent) {
2226
+ let hasArgs = false;
2227
+ if (Array.isArray(values[0]))
2228
+ hasArgs = true;
2229
+ else if (values.length === 1) {
2230
+ hasArgs = abiEvent.inputs.some((x) => x.indexed);
2231
+ } else if (values.length === 2) {
2232
+ hasArgs = true;
2233
+ }
2234
+ const args = hasArgs ? values[0] : void 0;
2235
+ const options = (hasArgs ? values[1] : values[0]) ?? {};
2236
+ return { args, options };
2237
+ }
2238
+
2239
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/calls.js
2240
+ var BundleFailedError = class extends BaseError {
2241
+ constructor(result) {
2242
+ super(`Call bundle failed with status: ${result.statusCode}`, {
2243
+ name: "BundleFailedError"
2244
+ });
2245
+ Object.defineProperty(this, "result", {
2246
+ enumerable: true,
2247
+ configurable: true,
2248
+ writable: true,
2249
+ value: void 0
2250
+ });
2251
+ this.result = result;
2252
+ }
2253
+ };
2254
+
1833
2255
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/promise/withRetry.js
1834
2256
  function withRetry(fn, { delay: delay_ = 100, retryCount = 2, shouldRetry: shouldRetry2 = () => true, signal } = {}) {
1835
2257
  return new Promise((resolve, reject) => {
@@ -1898,6 +2320,244 @@ function formatTransactionReceipt(transactionReceipt, _) {
1898
2320
  }
1899
2321
  var defineTransactionReceipt = /* @__PURE__ */ defineFormatter("transactionReceipt", formatTransactionReceipt);
1900
2322
 
2323
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/sendCalls.js
2324
+ var fallbackMagicIdentifier = "0x5792579257925792579257925792579257925792579257925792579257925792";
2325
+ var fallbackTransactionErrorMagicIdentifier = numberToHex(0, {
2326
+ size: 32
2327
+ });
2328
+ async function sendCalls(client, parameters) {
2329
+ const { account: account_ = client.account, chain = client.chain, experimental_fallback, experimental_fallbackDelay = 32, forceAtomic = false, id, version = "2.0.0" } = parameters;
2330
+ const account = account_ ? parseAccount(account_) : null;
2331
+ let capabilities = parameters.capabilities;
2332
+ if (client.dataSuffix && !parameters.capabilities?.dataSuffix) {
2333
+ if (typeof client.dataSuffix === "string")
2334
+ capabilities = {
2335
+ ...parameters.capabilities,
2336
+ dataSuffix: { value: client.dataSuffix, optional: true }
2337
+ };
2338
+ else
2339
+ capabilities = {
2340
+ ...parameters.capabilities,
2341
+ dataSuffix: {
2342
+ value: client.dataSuffix.value,
2343
+ ...client.dataSuffix.required ? {} : { optional: true }
2344
+ }
2345
+ };
2346
+ }
2347
+ const calls = parameters.calls.map((call_) => {
2348
+ const call2 = call_;
2349
+ const data = call2.abi ? encodeFunctionData({
2350
+ abi: call2.abi,
2351
+ functionName: call2.functionName,
2352
+ args: call2.args
2353
+ }) : call2.data;
2354
+ return {
2355
+ data: call2.dataSuffix && data ? concat([data, call2.dataSuffix]) : data,
2356
+ to: call2.to,
2357
+ value: call2.value ? numberToHex(call2.value) : void 0
2358
+ };
2359
+ });
2360
+ try {
2361
+ const response = await client.request({
2362
+ method: "wallet_sendCalls",
2363
+ params: [
2364
+ {
2365
+ atomicRequired: forceAtomic,
2366
+ calls,
2367
+ capabilities,
2368
+ chainId: numberToHex(chain.id),
2369
+ from: account?.address,
2370
+ id,
2371
+ version
2372
+ }
2373
+ ]
2374
+ }, { retryCount: 0 });
2375
+ if (typeof response === "string")
2376
+ return { id: response };
2377
+ return response;
2378
+ } catch (err) {
2379
+ const error = err;
2380
+ if (experimental_fallback && (error.name === "MethodNotFoundRpcError" || error.name === "MethodNotSupportedRpcError" || error.name === "UnknownRpcError" || error.details.toLowerCase().includes("does not exist / is not available") || error.details.toLowerCase().includes("missing or invalid. request()") || error.details.toLowerCase().includes("did not match any variant of untagged enum") || error.details.toLowerCase().includes("account upgraded to unsupported contract") || error.details.toLowerCase().includes("eip-7702 not supported") || error.details.toLowerCase().includes("unsupported wc_ method") || // magic.link
2381
+ error.details.toLowerCase().includes("feature toggled misconfigured") || // Trust Wallet
2382
+ error.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))) {
2383
+ if (capabilities) {
2384
+ const hasNonOptionalCapability = Object.values(capabilities).some((capability) => !capability.optional);
2385
+ if (hasNonOptionalCapability) {
2386
+ const message = "non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";
2387
+ throw new UnsupportedNonOptionalCapabilityError(new BaseError(message, {
2388
+ details: message
2389
+ }));
2390
+ }
2391
+ }
2392
+ if (forceAtomic && calls.length > 1) {
2393
+ const message = "`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";
2394
+ throw new AtomicityNotSupportedError(new BaseError(message, {
2395
+ details: message
2396
+ }));
2397
+ }
2398
+ const results = [];
2399
+ for (const call2 of calls) {
2400
+ try {
2401
+ const value = await sendTransaction(client, {
2402
+ account,
2403
+ chain,
2404
+ data: call2.data,
2405
+ to: call2.to,
2406
+ value: call2.value ? hexToBigInt(call2.value) : void 0
2407
+ });
2408
+ results.push({ status: "fulfilled", value });
2409
+ } catch (reason) {
2410
+ results.push({ reason, status: "rejected" });
2411
+ }
2412
+ if (experimental_fallbackDelay > 0)
2413
+ await new Promise((resolve) => setTimeout(resolve, experimental_fallbackDelay));
2414
+ }
2415
+ if (results.every((r) => r.status === "rejected"))
2416
+ throw results[0].reason;
2417
+ const hashes = results.map((result) => {
2418
+ if (result.status === "fulfilled")
2419
+ return result.value;
2420
+ return fallbackTransactionErrorMagicIdentifier;
2421
+ });
2422
+ return {
2423
+ id: concat([
2424
+ ...hashes,
2425
+ numberToHex(chain.id, { size: 32 }),
2426
+ fallbackMagicIdentifier
2427
+ ])
2428
+ };
2429
+ }
2430
+ throw getTransactionError(err, {
2431
+ ...parameters,
2432
+ account,
2433
+ chain: parameters.chain
2434
+ });
2435
+ }
2436
+ }
2437
+
2438
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/getCallsStatus.js
2439
+ async function getCallsStatus(client, parameters) {
2440
+ async function getStatus(id) {
2441
+ const isTransactions = id.endsWith(fallbackMagicIdentifier.slice(2));
2442
+ if (isTransactions) {
2443
+ const chainId2 = trim(sliceHex(id, -64, -32));
2444
+ const hashes = sliceHex(id, 0, -64).slice(2).match(/.{1,64}/g);
2445
+ const receipts2 = await Promise.all(hashes.map((hash2) => fallbackTransactionErrorMagicIdentifier.slice(2) !== hash2 ? client.request({
2446
+ method: "eth_getTransactionReceipt",
2447
+ params: [`0x${hash2}`]
2448
+ }, { dedupe: true }) : void 0));
2449
+ const status2 = (() => {
2450
+ if (receipts2.some((r) => r === null))
2451
+ return 100;
2452
+ if (receipts2.every((r) => r?.status === "0x1"))
2453
+ return 200;
2454
+ if (receipts2.every((r) => r?.status === "0x0"))
2455
+ return 500;
2456
+ return 600;
2457
+ })();
2458
+ return {
2459
+ atomic: false,
2460
+ chainId: hexToNumber(chainId2),
2461
+ receipts: receipts2.filter(Boolean),
2462
+ status: status2,
2463
+ version: "2.0.0"
2464
+ };
2465
+ }
2466
+ return client.request({
2467
+ method: "wallet_getCallsStatus",
2468
+ params: [id]
2469
+ });
2470
+ }
2471
+ const { atomic = false, chainId, receipts, version = "2.0.0", ...response } = await getStatus(parameters.id);
2472
+ const [status, statusCode] = (() => {
2473
+ const statusCode2 = response.status;
2474
+ if (statusCode2 >= 100 && statusCode2 < 200)
2475
+ return ["pending", statusCode2];
2476
+ if (statusCode2 >= 200 && statusCode2 < 300)
2477
+ return ["success", statusCode2];
2478
+ if (statusCode2 >= 300 && statusCode2 < 700)
2479
+ return ["failure", statusCode2];
2480
+ if (statusCode2 === "CONFIRMED")
2481
+ return ["success", 200];
2482
+ if (statusCode2 === "PENDING")
2483
+ return ["pending", 100];
2484
+ return [void 0, statusCode2];
2485
+ })();
2486
+ return {
2487
+ ...response,
2488
+ atomic,
2489
+ // @ts-expect-error: for backwards compatibility
2490
+ chainId: chainId ? hexToNumber(chainId) : void 0,
2491
+ receipts: receipts?.map((receipt) => ({
2492
+ ...receipt,
2493
+ blockNumber: hexToBigInt(receipt.blockNumber),
2494
+ gasUsed: hexToBigInt(receipt.gasUsed),
2495
+ status: receiptStatuses[receipt.status]
2496
+ })) ?? [],
2497
+ statusCode,
2498
+ status,
2499
+ version
2500
+ };
2501
+ }
2502
+
2503
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/waitForCallsStatus.js
2504
+ async function waitForCallsStatus(client, parameters) {
2505
+ const {
2506
+ id,
2507
+ pollingInterval = client.pollingInterval,
2508
+ status = ({ statusCode }) => statusCode === 200 || statusCode >= 300,
2509
+ retryCount = 4,
2510
+ retryDelay = ({ count }) => ~~(1 << count) * 200,
2511
+ // exponential backoff
2512
+ timeout = 6e4,
2513
+ throwOnFailure = false
2514
+ } = parameters;
2515
+ const observerId = stringify(["waitForCallsStatus", client.uid, id]);
2516
+ const { promise, resolve, reject } = withResolvers();
2517
+ let timer;
2518
+ const unobserve = observe(observerId, { resolve, reject }, (emit) => {
2519
+ const unpoll = poll(async () => {
2520
+ const done = (fn) => {
2521
+ clearTimeout(timer);
2522
+ unpoll();
2523
+ fn();
2524
+ unobserve();
2525
+ };
2526
+ try {
2527
+ const result = await withRetry(async () => {
2528
+ const result2 = await getAction(client, getCallsStatus, "getCallsStatus")({ id });
2529
+ if (throwOnFailure && result2.status === "failure")
2530
+ throw new BundleFailedError(result2);
2531
+ return result2;
2532
+ }, {
2533
+ retryCount,
2534
+ delay: retryDelay
2535
+ });
2536
+ if (!status(result))
2537
+ return;
2538
+ done(() => emit.resolve(result));
2539
+ } catch (error) {
2540
+ done(() => emit.reject(error));
2541
+ }
2542
+ }, {
2543
+ interval: pollingInterval,
2544
+ emitOnBegin: true
2545
+ });
2546
+ return unpoll;
2547
+ });
2548
+ timer = timeout ? setTimeout(() => {
2549
+ unobserve();
2550
+ clearTimeout(timer);
2551
+ reject(new WaitForCallsStatusTimeoutError({ id }));
2552
+ }, timeout) : void 0;
2553
+ return await promise;
2554
+ }
2555
+ var WaitForCallsStatusTimeoutError = class extends BaseError {
2556
+ constructor({ id }) {
2557
+ super(`Timed out while waiting for call bundle with id "${id}" to be confirmed.`, { name: "WaitForCallsStatusTimeoutError" });
2558
+ }
2559
+ };
2560
+
1901
2561
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/uid.js
1902
2562
  var size4 = 256;
1903
2563
  var index = size4;
@@ -1945,14 +2605,14 @@ function createClient(parameters) {
1945
2605
  uid: uid(),
1946
2606
  ...experimental_blockTag ? { experimental_blockTag } : {}
1947
2607
  };
1948
- function extend(base2) {
2608
+ function extend(base) {
1949
2609
  return (extendFn) => {
1950
- const extended = extendFn(base2);
2610
+ const extended = extendFn(base);
1951
2611
  for (const key2 in client)
1952
2612
  delete extended[key2];
1953
- const combined = { ...base2, ...extended };
2613
+ const combined = { ...base, ...extended };
1954
2614
  for (const key2 in extended) {
1955
- const a = base2[key2];
2615
+ const a = base[key2];
1956
2616
  const b = extended[key2];
1957
2617
  if (isPlainObject(a) && isPlainObject(b))
1958
2618
  combined[key2] = { ...a, ...b };
@@ -1992,6 +2652,9 @@ function bindActionDecorators(client, action) {
1992
2652
  wrapped[key] = action[key];
1993
2653
  return wrapped;
1994
2654
  }
2655
+ function rpcSchema() {
2656
+ return null;
2657
+ }
1995
2658
 
1996
2659
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/ens/errors.js
1997
2660
  function isNullUniversalResolverError(err) {
@@ -2184,6 +2847,13 @@ var EnsAvatarUnsupportedNamespaceError = class extends BaseError {
2184
2847
  super(`ENS NFT avatar namespace "${namespace}" is not supported. Must be "erc721" or "erc1155".`, { name: "EnsAvatarUnsupportedNamespaceError" });
2185
2848
  }
2186
2849
  };
2850
+ var EnsInvalidChainIdError = class extends BaseError {
2851
+ constructor({ chainId }) {
2852
+ super(`Invalid ENSIP-11 chainId: ${chainId}. Must be between 0 and 0x7fffffff, or 1.`, {
2853
+ name: "EnsInvalidChainIdError"
2854
+ });
2855
+ }
2856
+ };
2187
2857
 
2188
2858
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/ens/avatar/utils.js
2189
2859
  var networkRegex = /(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/;
@@ -2216,12 +2886,12 @@ async function isImageUri(uri) {
2216
2886
  });
2217
2887
  }
2218
2888
  }
2219
- function getGateway(custom, defaultGateway) {
2220
- if (!custom)
2889
+ function getGateway(custom2, defaultGateway) {
2890
+ if (!custom2)
2221
2891
  return defaultGateway;
2222
- if (custom.endsWith("/"))
2223
- return custom.slice(0, -1);
2224
- return custom;
2892
+ if (custom2.endsWith("/"))
2893
+ return custom2.slice(0, -1);
2894
+ return custom2;
2225
2895
  }
2226
2896
  function resolveAvatarUri({ uri, gatewayUrls }) {
2227
2897
  const isEncoded = base64Regex.test(uri);
@@ -2860,16 +3530,119 @@ async function getFilterLogs(_client, { filter }) {
2860
3530
  });
2861
3531
  }
2862
3532
 
2863
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/authorization/verifyAuthorization.js
2864
- async function verifyAuthorization({ address, authorization, signature }) {
2865
- return isAddressEqual(getAddress(address), await recoverAuthorizationAddress({
2866
- authorization,
2867
- signature
2868
- }));
3533
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/encodePacked.js
3534
+ function encodePacked(types, values) {
3535
+ if (types.length !== values.length)
3536
+ throw new AbiEncodingLengthMismatchError({
3537
+ expectedLength: types.length,
3538
+ givenLength: values.length
3539
+ });
3540
+ const data = [];
3541
+ for (let i = 0; i < types.length; i++) {
3542
+ const type = types[i];
3543
+ const value = values[i];
3544
+ data.push(encode(type, value));
3545
+ }
3546
+ return concatHex(data);
2869
3547
  }
2870
-
2871
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/promise/withDedupe.js
2872
- var promiseCache2 = /* @__PURE__ */ new LruMap(8192);
3548
+ function encode(type, value, isArray = false) {
3549
+ if (type === "address") {
3550
+ const address = value;
3551
+ if (!isAddress(address))
3552
+ throw new InvalidAddressError({ address });
3553
+ return pad(address.toLowerCase(), {
3554
+ size: isArray ? 32 : null
3555
+ });
3556
+ }
3557
+ if (type === "string")
3558
+ return stringToHex(value);
3559
+ if (type === "bytes")
3560
+ return value;
3561
+ if (type === "bool")
3562
+ return pad(boolToHex(value), { size: isArray ? 32 : 1 });
3563
+ const intMatch = type.match(integerRegex);
3564
+ if (intMatch) {
3565
+ const [_type, baseType, bits = "256"] = intMatch;
3566
+ const size5 = Number.parseInt(bits, 10) / 8;
3567
+ return numberToHex(value, {
3568
+ size: isArray ? 32 : size5,
3569
+ signed: baseType === "int"
3570
+ });
3571
+ }
3572
+ const bytesMatch = type.match(bytesRegex);
3573
+ if (bytesMatch) {
3574
+ const [_type, size5] = bytesMatch;
3575
+ if (Number.parseInt(size5, 10) !== (value.length - 2) / 2)
3576
+ throw new BytesSizeMismatchError({
3577
+ expectedSize: Number.parseInt(size5, 10),
3578
+ givenSize: (value.length - 2) / 2
3579
+ });
3580
+ return pad(value, { dir: "right", size: isArray ? 32 : null });
3581
+ }
3582
+ const arrayMatch = type.match(arrayRegex);
3583
+ if (arrayMatch && Array.isArray(value)) {
3584
+ const [_type, childType] = arrayMatch;
3585
+ const data = [];
3586
+ for (let i = 0; i < value.length; i++) {
3587
+ data.push(encode(childType, value[i], true));
3588
+ }
3589
+ if (data.length === 0)
3590
+ return "0x";
3591
+ return concatHex(data);
3592
+ }
3593
+ throw new UnsupportedPackedAbiType(type);
3594
+ }
3595
+
3596
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/isBytes.js
3597
+ function isBytes(value) {
3598
+ if (!value)
3599
+ return false;
3600
+ if (typeof value !== "object")
3601
+ return false;
3602
+ if (!("BYTES_PER_ELEMENT" in value))
3603
+ return false;
3604
+ return value.BYTES_PER_ELEMENT === 1 && value.constructor.name === "Uint8Array";
3605
+ }
3606
+
3607
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/address/getContractAddress.js
3608
+ function getContractAddress(opts) {
3609
+ if (opts.opcode === "CREATE2")
3610
+ return getCreate2Address(opts);
3611
+ return getCreateAddress(opts);
3612
+ }
3613
+ function getCreateAddress(opts) {
3614
+ const from13 = toBytes(getAddress(opts.from));
3615
+ let nonce = toBytes(opts.nonce);
3616
+ if (nonce[0] === 0)
3617
+ nonce = new Uint8Array([]);
3618
+ return getAddress(`0x${keccak256(toRlp([from13, nonce], "bytes")).slice(26)}`);
3619
+ }
3620
+ function getCreate2Address(opts) {
3621
+ const from13 = toBytes(getAddress(opts.from));
3622
+ const salt = pad(isBytes(opts.salt) ? opts.salt : toBytes(opts.salt), {
3623
+ size: 32
3624
+ });
3625
+ const bytecodeHash = (() => {
3626
+ if ("bytecodeHash" in opts) {
3627
+ if (isBytes(opts.bytecodeHash))
3628
+ return opts.bytecodeHash;
3629
+ return toBytes(opts.bytecodeHash);
3630
+ }
3631
+ return keccak256(opts.bytecode, "bytes");
3632
+ })();
3633
+ return getAddress(slice(keccak256(concat([toBytes("0xff"), from13, salt, bytecodeHash])), 12));
3634
+ }
3635
+
3636
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/authorization/verifyAuthorization.js
3637
+ async function verifyAuthorization({ address, authorization, signature }) {
3638
+ return isAddressEqual(getAddress(address), await recoverAuthorizationAddress({
3639
+ authorization,
3640
+ signature
3641
+ }));
3642
+ }
3643
+
3644
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/promise/withDedupe.js
3645
+ var promiseCache2 = /* @__PURE__ */ new LruMap(8192);
2873
3646
  function withDedupe(fn, { enabled = true, id }) {
2874
3647
  if (!enabled || !id)
2875
3648
  return fn();
@@ -3065,6 +3838,59 @@ function hashString(str, seed = 0) {
3065
3838
  return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(36);
3066
3839
  }
3067
3840
 
3841
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/ccipTunnel.js
3842
+ function ccipReadTunnel({ batchGateways, ccipRequest: ccipRequest2 = ccipRequest }) {
3843
+ return {
3844
+ async request({ data, sender, urls }) {
3845
+ if (urls.includes(localBatchGatewayUrl)) {
3846
+ return ccipRequest2({
3847
+ data,
3848
+ sender,
3849
+ urls: batchGateways
3850
+ });
3851
+ } else {
3852
+ const [failures, responses] = decodeFunctionResult({
3853
+ abi: batchGatewayAbi,
3854
+ functionName: "query",
3855
+ data: await ccipRequest2({
3856
+ data: encodeFunctionData({
3857
+ abi: batchGatewayAbi,
3858
+ functionName: "query",
3859
+ args: [[{ sender, data, urls }]]
3860
+ }),
3861
+ sender,
3862
+ urls: batchGateways
3863
+ })
3864
+ });
3865
+ if (failures[0]) {
3866
+ let error;
3867
+ try {
3868
+ const res = decodeErrorResult({
3869
+ abi: [...batchGatewayAbi, solidityError],
3870
+ data: responses[0]
3871
+ });
3872
+ if (res.errorName === "HttpError") {
3873
+ error = new HttpRequestError({
3874
+ body: { message: res.args[1] },
3875
+ status: res.args[0],
3876
+ url: urls.join(" | ")
3877
+ });
3878
+ } else {
3879
+ const message = res.args[0];
3880
+ if (message) {
3881
+ error = new Error(message);
3882
+ }
3883
+ }
3884
+ } catch {
3885
+ }
3886
+ throw error ?? new Error("An unknown error occurred.");
3887
+ }
3888
+ return responses[0];
3889
+ }
3890
+ }
3891
+ };
3892
+ }
3893
+
3068
3894
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/chain/defineChain.js
3069
3895
  function defineChain(chain) {
3070
3896
  const chainInstance = {
@@ -3073,10 +3899,10 @@ function defineChain(chain) {
3073
3899
  serializers: void 0,
3074
3900
  ...chain
3075
3901
  };
3076
- function extend(base2) {
3902
+ function extend(base) {
3077
3903
  return (fnOrExtended) => {
3078
- const properties = typeof fnOrExtended === "function" ? fnOrExtended(base2) : fnOrExtended;
3079
- const combined = { ...base2, ...properties };
3904
+ const properties = typeof fnOrExtended === "function" ? fnOrExtended(base) : fnOrExtended;
3905
+ const combined = { ...base, ...properties };
3080
3906
  return Object.assign(combined, { extend: extend(combined) });
3081
3907
  };
3082
3908
  }
@@ -3084,6 +3910,93 @@ function defineChain(chain) {
3084
3910
  extend: extend(chainInstance)
3085
3911
  });
3086
3912
  }
3913
+ function extendSchema() {
3914
+ return {};
3915
+ }
3916
+
3917
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/chain/extractChain.js
3918
+ function extractChain({ chains, id }) {
3919
+ return chains.find((chain) => chain.id === id);
3920
+ }
3921
+
3922
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/fromRlp.js
3923
+ var rlpDepthLimit = 1024;
3924
+ function fromRlp(value, to = "hex") {
3925
+ const bytes = (() => {
3926
+ if (typeof value === "string") {
3927
+ if (value.length > 3 && value.length % 2 !== 0)
3928
+ throw new InvalidHexValueError(value);
3929
+ return hexToBytes(value);
3930
+ }
3931
+ return value;
3932
+ })();
3933
+ const cursor = createCursor(bytes, {
3934
+ recursiveReadLimit: Number.POSITIVE_INFINITY
3935
+ });
3936
+ const result = fromRlpCursor(cursor, to);
3937
+ if (cursor.position < cursor.bytes.length)
3938
+ throw new RlpTrailingBytesError({
3939
+ count: cursor.bytes.length - cursor.position
3940
+ });
3941
+ return result;
3942
+ }
3943
+ function fromRlpCursor(cursor, to = "hex", recursiveDepth = 0) {
3944
+ if (recursiveDepth >= rlpDepthLimit)
3945
+ throw new RlpDepthLimitExceededError({ limit: rlpDepthLimit });
3946
+ if (cursor.bytes.length === 0)
3947
+ return to === "hex" ? bytesToHex(cursor.bytes) : cursor.bytes;
3948
+ const prefix = cursor.readByte();
3949
+ if (prefix < 128)
3950
+ cursor.decrementPosition(1);
3951
+ if (prefix < 192) {
3952
+ const length2 = readLength(cursor, prefix, 128);
3953
+ const bytes = cursor.readBytes(length2);
3954
+ return to === "hex" ? bytesToHex(bytes) : bytes;
3955
+ }
3956
+ const length = readLength(cursor, prefix, 192);
3957
+ return readList(cursor, length, to, recursiveDepth + 1);
3958
+ }
3959
+ function readLength(cursor, prefix, offset) {
3960
+ if (offset === 128 && prefix < 128)
3961
+ return 1;
3962
+ if (prefix <= offset + 55)
3963
+ return prefix - offset;
3964
+ if (prefix === offset + 55 + 1)
3965
+ return cursor.readUint8();
3966
+ if (prefix === offset + 55 + 2)
3967
+ return cursor.readUint16();
3968
+ if (prefix === offset + 55 + 3)
3969
+ return cursor.readUint24();
3970
+ if (prefix === offset + 55 + 4)
3971
+ return cursor.readUint32();
3972
+ throw new BaseError("Invalid RLP prefix");
3973
+ }
3974
+ function readList(cursor, length, to, recursiveDepth) {
3975
+ const position = cursor.position;
3976
+ const value = [];
3977
+ while (cursor.position - position < length)
3978
+ value.push(fromRlpCursor(cursor, to, recursiveDepth));
3979
+ if (cursor.position - position !== length)
3980
+ throw new RlpListBoundaryExceededError({
3981
+ consumed: cursor.position - position,
3982
+ declared: length
3983
+ });
3984
+ return value;
3985
+ }
3986
+
3987
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/hash/isHash.js
3988
+ function isHash(hash2) {
3989
+ return isHex(hash2) && size(hash2) === 32;
3990
+ }
3991
+
3992
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/hash/ripemd160.js
3993
+ function ripemd1602(value, to_) {
3994
+ const to = to_ || "hex";
3995
+ const bytes = ripemd160(isHex(value, { strict: false }) ? toBytes(value) : value);
3996
+ if (to === "bytes")
3997
+ return bytes;
3998
+ return toHex(bytes);
3999
+ }
3087
4000
 
3088
4001
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/promise/withTimeout.js
3089
4002
  function withTimeout(fn, { errorInstance = new Error("timed out"), timeout, signal }) {
@@ -3290,12 +4203,272 @@ function parseUrl(url_) {
3290
4203
  }
3291
4204
  }
3292
4205
 
4206
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/rpc/socket.js
4207
+ var socketClientCache = /* @__PURE__ */ new Map();
4208
+ async function getSocketRpcClient(parameters) {
4209
+ const { getSocket: getSocket2, keepAlive = true, key = "socket", reconnect = true, url } = parameters;
4210
+ const { interval: keepAliveInterval = 3e4 } = typeof keepAlive === "object" ? keepAlive : {};
4211
+ const { attempts = 5, delay = 2e3 } = typeof reconnect === "object" ? reconnect : {};
4212
+ const id = JSON.stringify({ keepAlive, key, url, reconnect });
4213
+ let socketClient = socketClientCache.get(id);
4214
+ if (socketClient)
4215
+ return socketClient;
4216
+ let reconnectCount = 0;
4217
+ const { schedule } = createBatchScheduler({
4218
+ id,
4219
+ fn: async () => {
4220
+ const requests = /* @__PURE__ */ new Map();
4221
+ const subscriptions = /* @__PURE__ */ new Map();
4222
+ let error;
4223
+ let socket;
4224
+ let keepAliveTimer;
4225
+ let reconnectTimer;
4226
+ let reconnectInProgress = false;
4227
+ let intentionallyClosed = false;
4228
+ function attemptReconnect() {
4229
+ if (reconnect && !intentionallyClosed && reconnectCount < attempts) {
4230
+ if (reconnectInProgress)
4231
+ return;
4232
+ reconnectInProgress = true;
4233
+ reconnectCount++;
4234
+ socket?.close();
4235
+ reconnectTimer = setTimeout(async () => {
4236
+ reconnectTimer = void 0;
4237
+ if (intentionallyClosed) {
4238
+ reconnectInProgress = false;
4239
+ return;
4240
+ }
4241
+ await setup().catch(console.error);
4242
+ reconnectInProgress = false;
4243
+ }, delay);
4244
+ } else {
4245
+ requests.clear();
4246
+ subscriptions.clear();
4247
+ }
4248
+ }
4249
+ async function setup() {
4250
+ const result = await getSocket2({
4251
+ onClose() {
4252
+ for (const request of requests.values())
4253
+ request.onError?.(new SocketClosedError({ url }));
4254
+ for (const subscription of subscriptions.values())
4255
+ subscription.onError?.(new SocketClosedError({ url }));
4256
+ attemptReconnect();
4257
+ },
4258
+ onError(error_) {
4259
+ error = error_;
4260
+ for (const request of requests.values())
4261
+ request.onError?.(error);
4262
+ for (const subscription of subscriptions.values())
4263
+ subscription.onError?.(error);
4264
+ attemptReconnect();
4265
+ },
4266
+ onOpen() {
4267
+ error = void 0;
4268
+ reconnectCount = 0;
4269
+ },
4270
+ onResponse(data) {
4271
+ const isSubscription = data.method === "eth_subscription";
4272
+ const id2 = isSubscription ? data.params.subscription : data.id;
4273
+ const cache = isSubscription ? subscriptions : requests;
4274
+ const callback = cache.get(id2);
4275
+ if (callback)
4276
+ callback.onResponse(data);
4277
+ if (!isSubscription)
4278
+ cache.delete(id2);
4279
+ }
4280
+ });
4281
+ if (intentionallyClosed) {
4282
+ result.close();
4283
+ return result;
4284
+ }
4285
+ socket = result;
4286
+ if (keepAlive) {
4287
+ if (keepAliveTimer)
4288
+ clearInterval(keepAliveTimer);
4289
+ keepAliveTimer = setInterval(() => socket.ping?.(), keepAliveInterval);
4290
+ }
4291
+ if (reconnect && subscriptions.size > 0) {
4292
+ const subscriptionEntries = subscriptions.entries();
4293
+ for (const [key2, { onResponse, body, onError }] of subscriptionEntries) {
4294
+ if (!body)
4295
+ continue;
4296
+ subscriptions.delete(key2);
4297
+ socketClient?.request({ body, onResponse, onError });
4298
+ }
4299
+ }
4300
+ return result;
4301
+ }
4302
+ await setup();
4303
+ error = void 0;
4304
+ socketClient = {
4305
+ close() {
4306
+ intentionallyClosed = true;
4307
+ keepAliveTimer && clearInterval(keepAliveTimer);
4308
+ if (reconnectTimer) {
4309
+ clearTimeout(reconnectTimer);
4310
+ reconnectTimer = void 0;
4311
+ reconnectInProgress = false;
4312
+ }
4313
+ socket.close();
4314
+ socketClientCache.delete(id);
4315
+ },
4316
+ get socket() {
4317
+ return socket;
4318
+ },
4319
+ request({ body, onError, onResponse }) {
4320
+ if (error && onError)
4321
+ onError(error);
4322
+ const id2 = body.id ?? idCache.take();
4323
+ const callback = (response) => {
4324
+ if (typeof response.id === "number" && id2 !== response.id)
4325
+ return;
4326
+ if (body.method === "eth_subscribe" && typeof response.result === "string")
4327
+ subscriptions.set(response.result, {
4328
+ onResponse: callback,
4329
+ onError,
4330
+ body
4331
+ });
4332
+ onResponse(response);
4333
+ };
4334
+ if (body.method === "eth_unsubscribe")
4335
+ subscriptions.delete(body.params?.[0]);
4336
+ requests.set(id2, { onResponse: callback, onError });
4337
+ try {
4338
+ socket.request({
4339
+ body: {
4340
+ jsonrpc: "2.0",
4341
+ id: id2,
4342
+ ...body
4343
+ }
4344
+ });
4345
+ } catch (error2) {
4346
+ onError?.(error2);
4347
+ }
4348
+ },
4349
+ requestAsync({ body, timeout = 1e4 }) {
4350
+ return withTimeout(() => new Promise((onResponse, onError) => this.request({
4351
+ body,
4352
+ onError,
4353
+ onResponse
4354
+ })), {
4355
+ errorInstance: new TimeoutError({ body, url }),
4356
+ timeout
4357
+ });
4358
+ },
4359
+ requests,
4360
+ subscriptions,
4361
+ url
4362
+ };
4363
+ socketClientCache.set(id, socketClient);
4364
+ return [socketClient];
4365
+ }
4366
+ });
4367
+ const [_, [socketClient_]] = await schedule();
4368
+ return socketClient_;
4369
+ }
4370
+
4371
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/rpc/webSocket.js
4372
+ async function getWebSocketRpcClient(url, options = {}) {
4373
+ const { keepAlive, reconnect } = options;
4374
+ return getSocketRpcClient({
4375
+ async getSocket({ onClose, onError, onOpen, onResponse }) {
4376
+ const WebSocket = await import("./_esm-C5CRWCYU.js").then((module) => module.WebSocket);
4377
+ const socket = new WebSocket(url);
4378
+ function onClose_() {
4379
+ socket.removeEventListener("close", onClose_);
4380
+ socket.removeEventListener("message", onMessage);
4381
+ socket.removeEventListener("error", onError);
4382
+ socket.removeEventListener("open", onOpen);
4383
+ onClose();
4384
+ }
4385
+ function onMessage({ data }) {
4386
+ if (typeof data === "string" && data.trim().length === 0)
4387
+ return;
4388
+ try {
4389
+ const _data = JSON.parse(data);
4390
+ onResponse(_data);
4391
+ } catch (error) {
4392
+ onError(error);
4393
+ }
4394
+ }
4395
+ socket.addEventListener("close", onClose_);
4396
+ socket.addEventListener("message", onMessage);
4397
+ socket.addEventListener("error", onError);
4398
+ socket.addEventListener("open", onOpen);
4399
+ if (socket.readyState === WebSocket.CONNECTING) {
4400
+ await new Promise((resolve, reject) => {
4401
+ if (!socket)
4402
+ return;
4403
+ socket.onopen = resolve;
4404
+ socket.onerror = reject;
4405
+ });
4406
+ }
4407
+ const { close: close_ } = socket;
4408
+ return Object.assign(socket, {
4409
+ close() {
4410
+ close_.bind(socket)();
4411
+ onClose_();
4412
+ },
4413
+ ping() {
4414
+ try {
4415
+ if (socket.readyState === socket.CLOSED || socket.readyState === socket.CLOSING)
4416
+ throw new WebSocketRequestError({
4417
+ url: socket.url,
4418
+ cause: new SocketClosedError({ url: socket.url })
4419
+ });
4420
+ const body = {
4421
+ jsonrpc: "2.0",
4422
+ id: null,
4423
+ method: "net_version",
4424
+ params: []
4425
+ };
4426
+ socket.send(JSON.stringify(body));
4427
+ } catch (error) {
4428
+ onError(error);
4429
+ }
4430
+ },
4431
+ request({ body }) {
4432
+ if (socket.readyState === socket.CLOSED || socket.readyState === socket.CLOSING)
4433
+ throw new WebSocketRequestError({
4434
+ body,
4435
+ url: socket.url,
4436
+ cause: new SocketClosedError({ url: socket.url })
4437
+ });
4438
+ return socket.send(JSON.stringify(body));
4439
+ }
4440
+ });
4441
+ },
4442
+ keepAlive,
4443
+ reconnect,
4444
+ url
4445
+ });
4446
+ }
4447
+
4448
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/rpc/compat.js
4449
+ async function getSocket(url) {
4450
+ const client = await getWebSocketRpcClient(url);
4451
+ return Object.assign(client.socket, {
4452
+ requests: client.requests,
4453
+ subscriptions: client.subscriptions
4454
+ });
4455
+ }
4456
+
4457
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/bytes.js
4458
+ var erc6492MagicBytes = "0x6492649264926492649264926492649264926492649264926492649264926492";
4459
+ var zeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000";
4460
+
4461
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/isErc6492Signature.js
4462
+ function isErc6492Signature(signature) {
4463
+ return sliceHex(signature, -32) === erc6492MagicBytes;
4464
+ }
4465
+
3293
4466
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/erc8010/SignatureErc8010.js
3294
4467
  var SignatureErc8010_exports = {};
3295
4468
  __export(SignatureErc8010_exports, {
3296
4469
  InvalidWrappedSignatureError: () => InvalidWrappedSignatureError,
3297
4470
  assert: () => assert4,
3298
- from: () => from9,
4471
+ from: () => from8,
3299
4472
  magicBytes: () => magicBytes,
3300
4473
  suffixParameters: () => suffixParameters,
3301
4474
  unwrap: () => unwrap,
@@ -3340,15 +4513,6 @@ var caches = {
3340
4513
  };
3341
4514
  var checksum = caches.checksum;
3342
4515
 
3343
- // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Hash.js
3344
- function keccak2562(value, options = {}) {
3345
- const { as = typeof value === "string" ? "Hex" : "Bytes" } = options;
3346
- const bytes = keccak_256(from(value));
3347
- if (as === "Bytes")
3348
- return bytes;
3349
- return fromBytes(bytes);
3350
- }
3351
-
3352
4516
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/PublicKey.js
3353
4517
  function assert(publicKey, options = {}) {
3354
4518
  const { compressed } = options;
@@ -3371,7 +4535,7 @@ function assert(publicKey, options = {}) {
3371
4535
  }
3372
4536
  throw new InvalidError({ publicKey });
3373
4537
  }
3374
- function from3(value) {
4538
+ function from2(value) {
3375
4539
  const publicKey = (() => {
3376
4540
  if (validate2(value))
3377
4541
  return fromHex2(value);
@@ -3486,7 +4650,7 @@ var InvalidSerializedSizeError = class extends BaseError2 {
3486
4650
  super(`Value \`${publicKey}\` is an invalid public key size.`, {
3487
4651
  metaMessages: [
3488
4652
  "Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",
3489
- `Received ${size3(from2(publicKey))} bytes.`
4653
+ `Received ${size3(from(publicKey))} bytes.`
3490
4654
  ]
3491
4655
  });
3492
4656
  Object.defineProperty(this, "name", {
@@ -3536,7 +4700,7 @@ function checksum2(address) {
3536
4700
  checksum.set(address, result);
3537
4701
  return result;
3538
4702
  }
3539
- function from4(address, options = {}) {
4703
+ function from3(address, options = {}) {
3540
4704
  const { checksum: checksumVal = false } = options;
3541
4705
  assert2(address);
3542
4706
  if (checksumVal)
@@ -3545,7 +4709,7 @@ function from4(address, options = {}) {
3545
4709
  }
3546
4710
  function fromPublicKey(publicKey, options = {}) {
3547
4711
  const address = keccak2562(`0x${toHex2(publicKey).slice(4)}`).substring(26);
3548
- return from4(`0x${address}`, options);
4712
+ return from3(`0x${address}`, options);
3549
4713
  }
3550
4714
  function validate3(address, options = {}) {
3551
4715
  const { strict = true } = options ?? {};
@@ -3593,9 +4757,9 @@ var InvalidChecksumError = class extends BaseError2 {
3593
4757
  };
3594
4758
 
3595
4759
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Solidity.js
3596
- var arrayRegex = /^(.*)\[([0-9]*)\]$/;
3597
- var bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
3598
- var integerRegex = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
4760
+ var arrayRegex2 = /^(.*)\[([0-9]*)\]$/;
4761
+ var bytesRegex2 = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
4762
+ var integerRegex2 = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
3599
4763
  var maxInt8 = 2n ** (8n - 1n) - 1n;
3600
4764
  var maxInt16 = 2n ** (16n - 1n) - 1n;
3601
4765
  var maxInt24 = 2n ** (24n - 1n) - 1n;
@@ -3695,19 +4859,19 @@ var maxUint256 = 2n ** 256n - 1n;
3695
4859
 
3696
4860
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/internal/abiParameters.js
3697
4861
  function decodeParameter(cursor, param, options) {
3698
- const { checksumAddress, staticPosition } = options;
4862
+ const { checksumAddress: checksumAddress2, staticPosition } = options;
3699
4863
  const arrayComponents = getArrayComponents(param.type);
3700
4864
  if (arrayComponents) {
3701
4865
  const [length, type] = arrayComponents;
3702
- return decodeArray(cursor, { ...param, type }, { checksumAddress, length, staticPosition });
4866
+ return decodeArray(cursor, { ...param, type }, { checksumAddress: checksumAddress2, length, staticPosition });
3703
4867
  }
3704
4868
  if (param.type === "tuple")
3705
4869
  return decodeTuple(cursor, param, {
3706
- checksumAddress,
4870
+ checksumAddress: checksumAddress2,
3707
4871
  staticPosition
3708
4872
  });
3709
4873
  if (param.type === "address")
3710
- return decodeAddress2(cursor, { checksum: checksumAddress });
4874
+ return decodeAddress2(cursor, { checksum: checksumAddress2 });
3711
4875
  if (param.type === "bool")
3712
4876
  return decodeBool(cursor);
3713
4877
  if (param.type.startsWith("bytes"))
@@ -3727,7 +4891,7 @@ function decodeAddress2(cursor, options = {}) {
3727
4891
  return [wrap3(fromBytes(slice2(value, -20))), 32];
3728
4892
  }
3729
4893
  function decodeArray(cursor, param, options) {
3730
- const { checksumAddress, length, staticPosition } = options;
4894
+ const { checksumAddress: checksumAddress2, length, staticPosition } = options;
3731
4895
  if (!length) {
3732
4896
  const offset = toNumber(cursor.readBytes(sizeOfOffset));
3733
4897
  const start = staticPosition + offset;
@@ -3740,7 +4904,7 @@ function decodeArray(cursor, param, options) {
3740
4904
  for (let i = 0; i < length2; ++i) {
3741
4905
  cursor.setPosition(startOfData + (dynamicChild ? i * 32 : consumed2));
3742
4906
  const [data, consumed_] = decodeParameter(cursor, param, {
3743
- checksumAddress,
4907
+ checksumAddress: checksumAddress2,
3744
4908
  staticPosition: startOfData
3745
4909
  });
3746
4910
  consumed2 += consumed_;
@@ -3756,7 +4920,7 @@ function decodeArray(cursor, param, options) {
3756
4920
  for (let i = 0; i < length; ++i) {
3757
4921
  cursor.setPosition(start + i * 32);
3758
4922
  const [data] = decodeParameter(cursor, param, {
3759
- checksumAddress,
4923
+ checksumAddress: checksumAddress2,
3760
4924
  staticPosition: start
3761
4925
  });
3762
4926
  value2.push(data);
@@ -3768,7 +4932,7 @@ function decodeArray(cursor, param, options) {
3768
4932
  const value = [];
3769
4933
  for (let i = 0; i < length; ++i) {
3770
4934
  const [data, consumed_] = decodeParameter(cursor, param, {
3771
- checksumAddress,
4935
+ checksumAddress: checksumAddress2,
3772
4936
  staticPosition: staticPosition + consumed
3773
4937
  });
3774
4938
  consumed += consumed_;
@@ -3806,7 +4970,7 @@ function decodeNumber(cursor, param) {
3806
4970
  ];
3807
4971
  }
3808
4972
  function decodeTuple(cursor, param, options) {
3809
- const { checksumAddress, staticPosition } = options;
4973
+ const { checksumAddress: checksumAddress2, staticPosition } = options;
3810
4974
  const hasUnnamedChild = param.components.length === 0 || param.components.some(({ name }) => !name);
3811
4975
  const value = hasUnnamedChild ? [] : {};
3812
4976
  let consumed = 0;
@@ -3817,7 +4981,7 @@ function decodeTuple(cursor, param, options) {
3817
4981
  const component = param.components[i];
3818
4982
  cursor.setPosition(start + consumed);
3819
4983
  const [data, consumed_] = decodeParameter(cursor, component, {
3820
- checksumAddress,
4984
+ checksumAddress: checksumAddress2,
3821
4985
  staticPosition: start
3822
4986
  });
3823
4987
  consumed += consumed_;
@@ -3829,7 +4993,7 @@ function decodeTuple(cursor, param, options) {
3829
4993
  for (let i = 0; i < param.components.length; ++i) {
3830
4994
  const component = param.components[i];
3831
4995
  const [data, consumed_] = decodeParameter(cursor, component, {
3832
- checksumAddress,
4996
+ checksumAddress: checksumAddress2,
3833
4997
  staticPosition
3834
4998
  });
3835
4999
  value[hasUnnamedChild ? i : component?.name] = data;
@@ -3851,24 +5015,24 @@ function decodeString(cursor, { staticPosition }) {
3851
5015
  cursor.setPosition(staticPosition + 32);
3852
5016
  return [value, 32];
3853
5017
  }
3854
- function prepareParameters({ checksumAddress, parameters, values }) {
5018
+ function prepareParameters({ checksumAddress: checksumAddress2, parameters, values }) {
3855
5019
  const preparedParameters = [];
3856
5020
  for (let i = 0; i < parameters.length; i++) {
3857
5021
  preparedParameters.push(prepareParameter({
3858
- checksumAddress,
5022
+ checksumAddress: checksumAddress2,
3859
5023
  parameter: parameters[i],
3860
5024
  value: values[i]
3861
5025
  }));
3862
5026
  }
3863
5027
  return preparedParameters;
3864
5028
  }
3865
- function prepareParameter({ checksumAddress = false, parameter: parameter_, value }) {
5029
+ function prepareParameter({ checksumAddress: checksumAddress2 = false, parameter: parameter_, value }) {
3866
5030
  const parameter = parameter_;
3867
5031
  const arrayComponents = getArrayComponents(parameter.type);
3868
5032
  if (arrayComponents) {
3869
5033
  const [length, type] = arrayComponents;
3870
5034
  return encodeArray(value, {
3871
- checksumAddress,
5035
+ checksumAddress: checksumAddress2,
3872
5036
  length,
3873
5037
  parameter: {
3874
5038
  ...parameter,
@@ -3878,13 +5042,13 @@ function prepareParameter({ checksumAddress = false, parameter: parameter_, valu
3878
5042
  }
3879
5043
  if (parameter.type === "tuple") {
3880
5044
  return encodeTuple(value, {
3881
- checksumAddress,
5045
+ checksumAddress: checksumAddress2,
3882
5046
  parameter
3883
5047
  });
3884
5048
  }
3885
5049
  if (parameter.type === "address") {
3886
5050
  return encodeAddress(value, {
3887
- checksum: checksumAddress
5051
+ checksum: checksumAddress2
3888
5052
  });
3889
5053
  }
3890
5054
  if (parameter.type === "bool") {
@@ -3892,7 +5056,7 @@ function prepareParameter({ checksumAddress = false, parameter: parameter_, valu
3892
5056
  }
3893
5057
  if (parameter.type.startsWith("uint") || parameter.type.startsWith("int")) {
3894
5058
  const signed = parameter.type.startsWith("int");
3895
- const [, , size5 = "256"] = integerRegex.exec(parameter.type) ?? [];
5059
+ const [, , size5 = "256"] = integerRegex2.exec(parameter.type) ?? [];
3896
5060
  return encodeNumber(value, {
3897
5061
  signed,
3898
5062
  size: Number(size5)
@@ -3906,7 +5070,7 @@ function prepareParameter({ checksumAddress = false, parameter: parameter_, valu
3906
5070
  }
3907
5071
  throw new InvalidTypeError(parameter.type);
3908
5072
  }
3909
- function encode(preparedParameters) {
5073
+ function encode2(preparedParameters) {
3910
5074
  let staticSize = 0;
3911
5075
  for (let i = 0; i < preparedParameters.length; i++) {
3912
5076
  const { dynamic, encoded } = preparedParameters[i];
@@ -3939,7 +5103,7 @@ function encodeAddress(value, options) {
3939
5103
  };
3940
5104
  }
3941
5105
  function encodeArray(value, options) {
3942
- const { checksumAddress, length, parameter } = options;
5106
+ const { checksumAddress: checksumAddress2, length, parameter } = options;
3943
5107
  const dynamic = length === null;
3944
5108
  if (!Array.isArray(value))
3945
5109
  throw new InvalidArrayError(value);
@@ -3953,7 +5117,7 @@ function encodeArray(value, options) {
3953
5117
  const preparedParameters = [];
3954
5118
  for (let i = 0; i < value.length; i++) {
3955
5119
  const preparedParam = prepareParameter({
3956
- checksumAddress,
5120
+ checksumAddress: checksumAddress2,
3957
5121
  parameter,
3958
5122
  value: value[i]
3959
5123
  });
@@ -3962,7 +5126,7 @@ function encodeArray(value, options) {
3962
5126
  preparedParameters.push(preparedParam);
3963
5127
  }
3964
5128
  if (dynamic || dynamicChild) {
3965
- const data = encode(preparedParameters);
5129
+ const data = encode2(preparedParameters);
3966
5130
  if (dynamic) {
3967
5131
  const length2 = fromNumber(preparedParameters.length, { size: 32 });
3968
5132
  return {
@@ -3991,7 +5155,7 @@ function encodeBytes(value, { type }) {
3991
5155
  };
3992
5156
  }
3993
5157
  if (bytesSize !== Number.parseInt(parametersize, 10))
3994
- throw new BytesSizeMismatchError({
5158
+ throw new BytesSizeMismatchError2({
3995
5159
  expectedSize: Number.parseInt(parametersize, 10),
3996
5160
  value
3997
5161
  });
@@ -4036,14 +5200,14 @@ function encodeString(value) {
4036
5200
  };
4037
5201
  }
4038
5202
  function encodeTuple(value, options) {
4039
- const { checksumAddress, parameter } = options;
5203
+ const { checksumAddress: checksumAddress2, parameter } = options;
4040
5204
  let dynamic = false;
4041
5205
  const preparedParameters = [];
4042
5206
  for (let i = 0; i < parameter.components.length; i++) {
4043
5207
  const param_ = parameter.components[i];
4044
5208
  const index2 = Array.isArray(value) ? i : param_.name;
4045
5209
  const preparedParam = prepareParameter({
4046
- checksumAddress,
5210
+ checksumAddress: checksumAddress2,
4047
5211
  parameter: param_,
4048
5212
  value: value[index2]
4049
5213
  });
@@ -4053,7 +5217,7 @@ function encodeTuple(value, options) {
4053
5217
  }
4054
5218
  return {
4055
5219
  dynamic,
4056
- encoded: dynamic ? encode(preparedParameters) : concat2(...preparedParameters.map(({ encoded }) => encoded))
5220
+ encoded: dynamic ? encode2(preparedParameters) : concat2(...preparedParameters.map(({ encoded }) => encoded))
4057
5221
  };
4058
5222
  }
4059
5223
  function getArrayComponents(type) {
@@ -4286,7 +5450,7 @@ var RecursiveReadLimitExceededError = class extends BaseError2 {
4286
5450
 
4287
5451
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/AbiParameters.js
4288
5452
  function decode(parameters, data, options = {}) {
4289
- const { as = "Array", checksumAddress = false } = options;
5453
+ const { as = "Array", checksumAddress: checksumAddress2 = false } = options;
4290
5454
  const bytes = typeof data === "string" ? fromHex(data) : data;
4291
5455
  const cursor = create(bytes);
4292
5456
  if (size2(bytes) === 0 && parameters.length > 0)
@@ -4303,7 +5467,7 @@ function decode(parameters, data, options = {}) {
4303
5467
  const param = parameters[i];
4304
5468
  cursor.setPosition(consumed);
4305
5469
  const [data2, consumed_] = decodeParameter(cursor, param, {
4306
- checksumAddress,
5470
+ checksumAddress: checksumAddress2,
4307
5471
  staticPosition: 0
4308
5472
  });
4309
5473
  consumed += consumed_;
@@ -4314,24 +5478,24 @@ function decode(parameters, data, options = {}) {
4314
5478
  }
4315
5479
  return values;
4316
5480
  }
4317
- function encode2(parameters, values, options) {
4318
- const { checksumAddress = false } = options ?? {};
5481
+ function encode3(parameters, values, options) {
5482
+ const { checksumAddress: checksumAddress2 = false } = options ?? {};
4319
5483
  if (parameters.length !== values.length)
4320
5484
  throw new LengthMismatchError({
4321
5485
  expectedLength: parameters.length,
4322
5486
  givenLength: values.length
4323
5487
  });
4324
5488
  const preparedParameters = prepareParameters({
4325
- checksumAddress,
5489
+ checksumAddress: checksumAddress2,
4326
5490
  parameters,
4327
5491
  values
4328
5492
  });
4329
- const data = encode(preparedParameters);
5493
+ const data = encode2(preparedParameters);
4330
5494
  if (data.length === 0)
4331
5495
  return "0x";
4332
5496
  return data;
4333
5497
  }
4334
- function encodePacked(types, values) {
5498
+ function encodePacked2(types, values) {
4335
5499
  if (types.length !== values.length)
4336
5500
  throw new LengthMismatchError({
4337
5501
  expectedLength: types.length,
@@ -4341,12 +5505,12 @@ function encodePacked(types, values) {
4341
5505
  for (let i = 0; i < types.length; i++) {
4342
5506
  const type = types[i];
4343
5507
  const value = values[i];
4344
- data.push(encodePacked.encode(type, value));
5508
+ data.push(encodePacked2.encode(type, value));
4345
5509
  }
4346
5510
  return concat2(...data);
4347
5511
  }
4348
- (function(encodePacked2) {
4349
- function encode4(type, value, isArray = false) {
5512
+ (function(encodePacked3) {
5513
+ function encode5(type, value, isArray = false) {
4350
5514
  if (type === "address") {
4351
5515
  const address = value;
4352
5516
  assert2(address);
@@ -4358,7 +5522,7 @@ function encodePacked(types, values) {
4358
5522
  return value;
4359
5523
  if (type === "bool")
4360
5524
  return padLeft(fromBoolean(value), isArray ? 32 : 1);
4361
- const intMatch = type.match(integerRegex);
5525
+ const intMatch = type.match(integerRegex2);
4362
5526
  if (intMatch) {
4363
5527
  const [_type, baseType, bits = "256"] = intMatch;
4364
5528
  const size5 = Number.parseInt(bits, 10) / 8;
@@ -4367,22 +5531,22 @@ function encodePacked(types, values) {
4367
5531
  signed: baseType === "int"
4368
5532
  });
4369
5533
  }
4370
- const bytesMatch = type.match(bytesRegex);
5534
+ const bytesMatch = type.match(bytesRegex2);
4371
5535
  if (bytesMatch) {
4372
5536
  const [_type, size5] = bytesMatch;
4373
5537
  if (Number.parseInt(size5, 10) !== (value.length - 2) / 2)
4374
- throw new BytesSizeMismatchError({
5538
+ throw new BytesSizeMismatchError2({
4375
5539
  expectedSize: Number.parseInt(size5, 10),
4376
5540
  value
4377
5541
  });
4378
5542
  return padRight(value, isArray ? 32 : 0);
4379
5543
  }
4380
- const arrayMatch = type.match(arrayRegex);
5544
+ const arrayMatch = type.match(arrayRegex2);
4381
5545
  if (arrayMatch && Array.isArray(value)) {
4382
5546
  const [_type, childType] = arrayMatch;
4383
5547
  const data = [];
4384
5548
  for (let i = 0; i < value.length; i++) {
4385
- data.push(encode4(childType, value[i], true));
5549
+ data.push(encode5(childType, value[i], true));
4386
5550
  }
4387
5551
  if (data.length === 0)
4388
5552
  return "0x";
@@ -4390,9 +5554,9 @@ function encodePacked(types, values) {
4390
5554
  }
4391
5555
  throw new InvalidTypeError(type);
4392
5556
  }
4393
- encodePacked2.encode = encode4;
4394
- })(encodePacked || (encodePacked = {}));
4395
- function from5(parameters) {
5557
+ encodePacked3.encode = encode5;
5558
+ })(encodePacked2 || (encodePacked2 = {}));
5559
+ function from4(parameters) {
4396
5560
  if (Array.isArray(parameters) && typeof parameters[0] === "string")
4397
5561
  return parseAbiParameters(parameters);
4398
5562
  if (typeof parameters === "string")
@@ -4437,7 +5601,7 @@ var ArrayLengthMismatchError = class extends BaseError2 {
4437
5601
  });
4438
5602
  }
4439
5603
  };
4440
- var BytesSizeMismatchError = class extends BaseError2 {
5604
+ var BytesSizeMismatchError2 = class extends BaseError2 {
4441
5605
  constructor({ expectedSize, value }) {
4442
5606
  super(`Size of bytes "${value}" (bytes${size3(value)}) does not match expected size (bytes${expectedSize}).`);
4443
5607
  Object.defineProperty(this, "name", {
@@ -4487,7 +5651,7 @@ var InvalidTypeError = class extends BaseError2 {
4487
5651
  };
4488
5652
 
4489
5653
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Rlp.js
4490
- function from6(value, options) {
5654
+ function from5(value, options) {
4491
5655
  const { as } = options;
4492
5656
  const encodable = getEncodable(value);
4493
5657
  const cursor = create(new Uint8Array(encodable.length));
@@ -4498,7 +5662,7 @@ function from6(value, options) {
4498
5662
  }
4499
5663
  function fromHex3(hex, options = {}) {
4500
5664
  const { as = "Hex" } = options;
4501
- return from6(hex, { as });
5665
+ return from5(hex, { as });
4502
5666
  }
4503
5667
  function getEncodable(bytes) {
4504
5668
  if (Array.isArray(bytes))
@@ -4529,8 +5693,8 @@ function getEncodableList(list) {
4529
5693
  else
4530
5694
  cursor.pushUint32(bodyLength);
4531
5695
  }
4532
- for (const { encode: encode4 } of list) {
4533
- encode4(cursor);
5696
+ for (const { encode: encode5 } of list) {
5697
+ encode5(cursor);
4534
5698
  }
4535
5699
  }
4536
5700
  };
@@ -4594,7 +5758,7 @@ function assert3(signature, options = {}) {
4594
5758
  if (signature.s < 0n || signature.s > maxUint256)
4595
5759
  throw new InvalidSError({ value: signature.s });
4596
5760
  if (typeof signature.yParity === "number" && signature.yParity !== 0 && signature.yParity !== 1)
4597
- throw new InvalidYParityError({ value: signature.yParity });
5761
+ throw new InvalidYParityError2({ value: signature.yParity });
4598
5762
  }
4599
5763
  function fromBytes3(signature) {
4600
5764
  return fromHex4(fromBytes(signature));
@@ -4611,7 +5775,7 @@ function fromHex4(signature) {
4611
5775
  try {
4612
5776
  return vToYParity(yParity2);
4613
5777
  } catch {
4614
- throw new InvalidYParityError({ value: yParity2 });
5778
+ throw new InvalidYParityError2({ value: yParity2 });
4615
5779
  }
4616
5780
  })();
4617
5781
  if (typeof yParity === "undefined")
@@ -4630,9 +5794,9 @@ function extract2(value) {
4630
5794
  return void 0;
4631
5795
  if (typeof value.s === "undefined")
4632
5796
  return void 0;
4633
- return from7(value);
5797
+ return from6(value);
4634
5798
  }
4635
- function from7(signature) {
5799
+ function from6(signature) {
4636
5800
  const signature_ = (() => {
4637
5801
  if (typeof signature === "string")
4638
5802
  return fromHex4(signature);
@@ -4665,7 +5829,7 @@ function fromRpc(signature) {
4665
5829
  if (typeof v === "number" && typeof yParity2 !== "number")
4666
5830
  yParity2 = vToYParity(v);
4667
5831
  if (typeof yParity2 !== "number")
4668
- throw new InvalidYParityError({ value: signature.yParity });
5832
+ throw new InvalidYParityError2({ value: signature.yParity });
4669
5833
  return yParity2;
4670
5834
  })();
4671
5835
  return {
@@ -4696,7 +5860,7 @@ var InvalidSerializedSizeError2 = class extends BaseError2 {
4696
5860
  super(`Value \`${signature}\` is an invalid signature size.`, {
4697
5861
  metaMessages: [
4698
5862
  "Expected: 64 bytes or 65 bytes.",
4699
- `Received ${size3(from2(signature))} bytes.`
5863
+ `Received ${size3(from(signature))} bytes.`
4700
5864
  ]
4701
5865
  });
4702
5866
  Object.defineProperty(this, "name", {
@@ -4740,7 +5904,7 @@ var InvalidSError = class extends BaseError2 {
4740
5904
  });
4741
5905
  }
4742
5906
  };
4743
- var InvalidYParityError = class extends BaseError2 {
5907
+ var InvalidYParityError2 = class extends BaseError2 {
4744
5908
  constructor({ value }) {
4745
5909
  super(`Value \`${value}\` is an invalid y-parity value. Y-parity must be 0 or 1.`);
4746
5910
  Object.defineProperty(this, "name", {
@@ -4764,7 +5928,7 @@ var InvalidVError = class extends BaseError2 {
4764
5928
  };
4765
5929
 
4766
5930
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Authorization.js
4767
- function from8(authorization, options = {}) {
5931
+ function from7(authorization, options = {}) {
4768
5932
  if (typeof authorization.chainId === "string")
4769
5933
  return fromRpc2(authorization);
4770
5934
  return { ...authorization, ...options.signature };
@@ -4809,13 +5973,13 @@ function recoverPublicKey2(options) {
4809
5973
  const { payload, signature } = options;
4810
5974
  const { r, s, yParity } = signature;
4811
5975
  const signature_ = new secp256k1.Signature(BigInt(r), BigInt(s)).addRecoveryBit(yParity);
4812
- const point = signature_.recoverPublicKey(from2(payload).substring(2));
4813
- return from3(point);
5976
+ const point = signature_.recoverPublicKey(from(payload).substring(2));
5977
+ return from2(point);
4814
5978
  }
4815
5979
 
4816
5980
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/erc8010/SignatureErc8010.js
4817
5981
  var magicBytes = "0x8010801080108010801080108010801080108010801080108010801080108010";
4818
- var suffixParameters = from5("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");
5982
+ var suffixParameters = from4("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");
4819
5983
  function assert4(value) {
4820
5984
  if (typeof value === "string") {
4821
5985
  if (slice3(value, -32) !== magicBytes)
@@ -4823,7 +5987,7 @@ function assert4(value) {
4823
5987
  } else
4824
5988
  assert3(value.authorization);
4825
5989
  }
4826
- function from9(value) {
5990
+ function from8(value) {
4827
5991
  if (typeof value === "string")
4828
5992
  return unwrap(value);
4829
5993
  return value;
@@ -4834,7 +5998,7 @@ function unwrap(wrapped) {
4834
5998
  const suffix = slice3(wrapped, -suffixLength - 64, -64);
4835
5999
  const signature = slice3(wrapped, 0, -suffixLength - 64);
4836
6000
  const [auth, to, data] = decode(suffixParameters, suffix);
4837
- const authorization = from8({
6001
+ const authorization = from7({
4838
6002
  address: auth.delegation,
4839
6003
  chainId: Number(auth.chainId),
4840
6004
  nonce: auth.nonce,
@@ -4853,9 +6017,9 @@ function wrap(value) {
4853
6017
  assert4(value);
4854
6018
  const self = recoverAddress2({
4855
6019
  payload: getSignPayload(value.authorization),
4856
- signature: from7(value.authorization)
6020
+ signature: from6(value.authorization)
4857
6021
  });
4858
- const suffix = encode2(suffixParameters, [
6022
+ const suffix = encode3(suffixParameters, [
4859
6023
  {
4860
6024
  ...value.authorization,
4861
6025
  delegation: value.authorization.address,
@@ -4887,6 +6051,499 @@ var InvalidWrappedSignatureError = class extends BaseError2 {
4887
6051
  }
4888
6052
  };
4889
6053
 
6054
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/isErc8010Signature.js
6055
+ function isErc8010Signature(signature) {
6056
+ return SignatureErc8010_exports.validate(signature);
6057
+ }
6058
+
6059
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/parseErc6492Signature.js
6060
+ function parseErc6492Signature(signature) {
6061
+ if (!isErc6492Signature(signature))
6062
+ return { signature };
6063
+ const [address, data, signature_] = decodeAbiParameters([{ type: "address" }, { type: "bytes" }, { type: "bytes" }], signature);
6064
+ return { address, data, signature: signature_ };
6065
+ }
6066
+
6067
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/parseErc8010Signature.js
6068
+ function parseErc8010Signature(signature) {
6069
+ if (!isErc8010Signature(signature))
6070
+ return { signature };
6071
+ const { authorization: authorization_ox, to, ...rest } = SignatureErc8010_exports.unwrap(signature);
6072
+ return {
6073
+ authorization: {
6074
+ address: authorization_ox.address,
6075
+ chainId: authorization_ox.chainId,
6076
+ nonce: Number(authorization_ox.nonce),
6077
+ r: numberToHex(authorization_ox.r, { size: 32 }),
6078
+ s: numberToHex(authorization_ox.s, { size: 32 }),
6079
+ yParity: authorization_ox.yParity
6080
+ },
6081
+ ...to ? { address: to } : {},
6082
+ ...rest
6083
+ };
6084
+ }
6085
+
6086
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/recoverMessageAddress.js
6087
+ async function recoverMessageAddress({ message, signature }) {
6088
+ return recoverAddress({ hash: hashMessage(message), signature });
6089
+ }
6090
+
6091
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/recoverTypedDataAddress.js
6092
+ async function recoverTypedDataAddress(parameters) {
6093
+ const { domain, message, primaryType, signature, types } = parameters;
6094
+ return recoverAddress({
6095
+ hash: hashTypedData({
6096
+ domain,
6097
+ message,
6098
+ primaryType,
6099
+ types
6100
+ }),
6101
+ signature
6102
+ });
6103
+ }
6104
+
6105
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/serializeErc6492Signature.js
6106
+ function serializeErc6492Signature(parameters) {
6107
+ const { address, data, signature, to = "hex" } = parameters;
6108
+ const signature_ = concatHex([
6109
+ encodeAbiParameters([{ type: "address" }, { type: "bytes" }, { type: "bytes" }], [address, data, signature]),
6110
+ erc6492MagicBytes
6111
+ ]);
6112
+ if (to === "hex")
6113
+ return signature_;
6114
+ return hexToBytes(signature_);
6115
+ }
6116
+
6117
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/serializeErc8010Signature.js
6118
+ function serializeErc8010Signature(parameters) {
6119
+ const { address, data, signature, to = "hex" } = parameters;
6120
+ const signature_ = SignatureErc8010_exports.wrap({
6121
+ authorization: {
6122
+ address: parameters.authorization.address,
6123
+ chainId: parameters.authorization.chainId,
6124
+ nonce: BigInt(parameters.authorization.nonce),
6125
+ r: BigInt(parameters.authorization.r),
6126
+ s: BigInt(parameters.authorization.s),
6127
+ yParity: parameters.authorization.yParity
6128
+ },
6129
+ data,
6130
+ signature,
6131
+ to: address
6132
+ });
6133
+ if (to === "hex")
6134
+ return signature_;
6135
+ return hexToBytes(signature_);
6136
+ }
6137
+
6138
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/verifyHash.js
6139
+ async function verifyHash({ address, hash: hash2, signature }) {
6140
+ return isAddressEqual(getAddress(address), await recoverAddress({ hash: hash2, signature }));
6141
+ }
6142
+
6143
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/verifyMessage.js
6144
+ async function verifyMessage({ address, message, signature }) {
6145
+ return isAddressEqual(getAddress(address), await recoverMessageAddress({ message, signature }));
6146
+ }
6147
+
6148
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/verifyTypedData.js
6149
+ async function verifyTypedData(parameters) {
6150
+ const { address, domain, message, primaryType, signature, types } = parameters;
6151
+ return isAddressEqual(getAddress(address), await recoverTypedDataAddress({
6152
+ domain,
6153
+ message,
6154
+ primaryType,
6155
+ signature,
6156
+ types
6157
+ }));
6158
+ }
6159
+
6160
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/getSerializedTransactionType.js
6161
+ function getSerializedTransactionType(serializedTransaction) {
6162
+ const serializedType = sliceHex(serializedTransaction, 0, 1);
6163
+ if (serializedType === "0x04")
6164
+ return "eip7702";
6165
+ if (serializedType === "0x03")
6166
+ return "eip4844";
6167
+ if (serializedType === "0x02")
6168
+ return "eip1559";
6169
+ if (serializedType === "0x01")
6170
+ return "eip2930";
6171
+ if (serializedType !== "0x" && hexToNumber(serializedType) >= 192)
6172
+ return "legacy";
6173
+ throw new InvalidSerializedTransactionTypeError({ serializedType });
6174
+ }
6175
+
6176
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/parseTransaction.js
6177
+ function parseTransaction(serializedTransaction) {
6178
+ const type = getSerializedTransactionType(serializedTransaction);
6179
+ if (type === "eip1559")
6180
+ return parseTransactionEIP1559(serializedTransaction);
6181
+ if (type === "eip2930")
6182
+ return parseTransactionEIP2930(serializedTransaction);
6183
+ if (type === "eip4844")
6184
+ return parseTransactionEIP4844(serializedTransaction);
6185
+ if (type === "eip7702")
6186
+ return parseTransactionEIP7702(serializedTransaction);
6187
+ return parseTransactionLegacy(serializedTransaction);
6188
+ }
6189
+ function parseTransactionEIP7702(serializedTransaction) {
6190
+ const transactionArray = toTransactionArray(serializedTransaction);
6191
+ const [chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gas, to, value, data, accessList, authorizationList, v, r, s] = transactionArray;
6192
+ if (transactionArray.length !== 10 && transactionArray.length !== 13)
6193
+ throw new InvalidSerializedTransactionError({
6194
+ attributes: {
6195
+ chainId,
6196
+ nonce,
6197
+ maxPriorityFeePerGas,
6198
+ maxFeePerGas,
6199
+ gas,
6200
+ to,
6201
+ value,
6202
+ data,
6203
+ accessList,
6204
+ authorizationList,
6205
+ ...transactionArray.length > 9 ? {
6206
+ v,
6207
+ r,
6208
+ s
6209
+ } : {}
6210
+ },
6211
+ serializedTransaction,
6212
+ type: "eip7702"
6213
+ });
6214
+ const transaction = {
6215
+ chainId: hexToNumber(chainId),
6216
+ type: "eip7702"
6217
+ };
6218
+ if (isHex(to) && to !== "0x")
6219
+ transaction.to = to;
6220
+ if (isHex(gas) && gas !== "0x")
6221
+ transaction.gas = hexToBigInt(gas);
6222
+ if (isHex(data) && data !== "0x")
6223
+ transaction.data = data;
6224
+ if (isHex(nonce))
6225
+ transaction.nonce = nonce === "0x" ? 0 : hexToNumber(nonce);
6226
+ if (isHex(value) && value !== "0x")
6227
+ transaction.value = hexToBigInt(value);
6228
+ if (isHex(maxFeePerGas) && maxFeePerGas !== "0x")
6229
+ transaction.maxFeePerGas = hexToBigInt(maxFeePerGas);
6230
+ if (isHex(maxPriorityFeePerGas) && maxPriorityFeePerGas !== "0x")
6231
+ transaction.maxPriorityFeePerGas = hexToBigInt(maxPriorityFeePerGas);
6232
+ if (accessList.length !== 0 && accessList !== "0x")
6233
+ transaction.accessList = parseAccessList(accessList);
6234
+ if (authorizationList.length !== 0 && authorizationList !== "0x")
6235
+ transaction.authorizationList = parseAuthorizationList(authorizationList);
6236
+ assertTransactionEIP7702(transaction);
6237
+ const signature = transactionArray.length === 13 ? parseEIP155Signature(transactionArray) : void 0;
6238
+ return { ...signature, ...transaction };
6239
+ }
6240
+ function parseTransactionEIP4844(serializedTransaction) {
6241
+ const transactionOrWrapperArray = toTransactionArray(serializedTransaction);
6242
+ const hasNetworkWrapper = transactionOrWrapperArray.length === 4;
6243
+ const transactionArray = hasNetworkWrapper ? transactionOrWrapperArray[0] : transactionOrWrapperArray;
6244
+ const wrapperArray = hasNetworkWrapper ? transactionOrWrapperArray.slice(1) : [];
6245
+ const [chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gas, to, value, data, accessList, maxFeePerBlobGas, blobVersionedHashes, v, r, s] = transactionArray;
6246
+ const [blobs, commitments, proofs] = wrapperArray;
6247
+ if (!(transactionArray.length === 11 || transactionArray.length === 14))
6248
+ throw new InvalidSerializedTransactionError({
6249
+ attributes: {
6250
+ chainId,
6251
+ nonce,
6252
+ maxPriorityFeePerGas,
6253
+ maxFeePerGas,
6254
+ gas,
6255
+ to,
6256
+ value,
6257
+ data,
6258
+ accessList,
6259
+ ...transactionArray.length > 9 ? {
6260
+ v,
6261
+ r,
6262
+ s
6263
+ } : {}
6264
+ },
6265
+ serializedTransaction,
6266
+ type: "eip4844"
6267
+ });
6268
+ const transaction = {
6269
+ blobVersionedHashes,
6270
+ chainId: hexToNumber(chainId),
6271
+ to,
6272
+ type: "eip4844"
6273
+ };
6274
+ if (isHex(gas) && gas !== "0x")
6275
+ transaction.gas = hexToBigInt(gas);
6276
+ if (isHex(data) && data !== "0x")
6277
+ transaction.data = data;
6278
+ if (isHex(nonce))
6279
+ transaction.nonce = nonce === "0x" ? 0 : hexToNumber(nonce);
6280
+ if (isHex(value) && value !== "0x")
6281
+ transaction.value = hexToBigInt(value);
6282
+ if (isHex(maxFeePerBlobGas) && maxFeePerBlobGas !== "0x")
6283
+ transaction.maxFeePerBlobGas = hexToBigInt(maxFeePerBlobGas);
6284
+ if (isHex(maxFeePerGas) && maxFeePerGas !== "0x")
6285
+ transaction.maxFeePerGas = hexToBigInt(maxFeePerGas);
6286
+ if (isHex(maxPriorityFeePerGas) && maxPriorityFeePerGas !== "0x")
6287
+ transaction.maxPriorityFeePerGas = hexToBigInt(maxPriorityFeePerGas);
6288
+ if (accessList.length !== 0 && accessList !== "0x")
6289
+ transaction.accessList = parseAccessList(accessList);
6290
+ if (blobs && commitments && proofs)
6291
+ transaction.sidecars = toBlobSidecars({
6292
+ blobs,
6293
+ commitments,
6294
+ proofs
6295
+ });
6296
+ assertTransactionEIP4844(transaction);
6297
+ const signature = transactionArray.length === 14 ? parseEIP155Signature(transactionArray) : void 0;
6298
+ return { ...signature, ...transaction };
6299
+ }
6300
+ function parseTransactionEIP1559(serializedTransaction) {
6301
+ const transactionArray = toTransactionArray(serializedTransaction);
6302
+ const [chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gas, to, value, data, accessList, v, r, s] = transactionArray;
6303
+ if (!(transactionArray.length === 9 || transactionArray.length === 12))
6304
+ throw new InvalidSerializedTransactionError({
6305
+ attributes: {
6306
+ chainId,
6307
+ nonce,
6308
+ maxPriorityFeePerGas,
6309
+ maxFeePerGas,
6310
+ gas,
6311
+ to,
6312
+ value,
6313
+ data,
6314
+ accessList,
6315
+ ...transactionArray.length > 9 ? {
6316
+ v,
6317
+ r,
6318
+ s
6319
+ } : {}
6320
+ },
6321
+ serializedTransaction,
6322
+ type: "eip1559"
6323
+ });
6324
+ const transaction = {
6325
+ chainId: hexToNumber(chainId),
6326
+ type: "eip1559"
6327
+ };
6328
+ if (isHex(to) && to !== "0x")
6329
+ transaction.to = to;
6330
+ if (isHex(gas) && gas !== "0x")
6331
+ transaction.gas = hexToBigInt(gas);
6332
+ if (isHex(data) && data !== "0x")
6333
+ transaction.data = data;
6334
+ if (isHex(nonce))
6335
+ transaction.nonce = nonce === "0x" ? 0 : hexToNumber(nonce);
6336
+ if (isHex(value) && value !== "0x")
6337
+ transaction.value = hexToBigInt(value);
6338
+ if (isHex(maxFeePerGas) && maxFeePerGas !== "0x")
6339
+ transaction.maxFeePerGas = hexToBigInt(maxFeePerGas);
6340
+ if (isHex(maxPriorityFeePerGas) && maxPriorityFeePerGas !== "0x")
6341
+ transaction.maxPriorityFeePerGas = hexToBigInt(maxPriorityFeePerGas);
6342
+ if (accessList.length !== 0 && accessList !== "0x")
6343
+ transaction.accessList = parseAccessList(accessList);
6344
+ assertTransactionEIP1559(transaction);
6345
+ const signature = transactionArray.length === 12 ? parseEIP155Signature(transactionArray) : void 0;
6346
+ return { ...signature, ...transaction };
6347
+ }
6348
+ function parseTransactionEIP2930(serializedTransaction) {
6349
+ const transactionArray = toTransactionArray(serializedTransaction);
6350
+ const [chainId, nonce, gasPrice, gas, to, value, data, accessList, v, r, s] = transactionArray;
6351
+ if (!(transactionArray.length === 8 || transactionArray.length === 11))
6352
+ throw new InvalidSerializedTransactionError({
6353
+ attributes: {
6354
+ chainId,
6355
+ nonce,
6356
+ gasPrice,
6357
+ gas,
6358
+ to,
6359
+ value,
6360
+ data,
6361
+ accessList,
6362
+ ...transactionArray.length > 8 ? {
6363
+ v,
6364
+ r,
6365
+ s
6366
+ } : {}
6367
+ },
6368
+ serializedTransaction,
6369
+ type: "eip2930"
6370
+ });
6371
+ const transaction = {
6372
+ chainId: hexToNumber(chainId),
6373
+ type: "eip2930"
6374
+ };
6375
+ if (isHex(to) && to !== "0x")
6376
+ transaction.to = to;
6377
+ if (isHex(gas) && gas !== "0x")
6378
+ transaction.gas = hexToBigInt(gas);
6379
+ if (isHex(data) && data !== "0x")
6380
+ transaction.data = data;
6381
+ if (isHex(nonce))
6382
+ transaction.nonce = nonce === "0x" ? 0 : hexToNumber(nonce);
6383
+ if (isHex(value) && value !== "0x")
6384
+ transaction.value = hexToBigInt(value);
6385
+ if (isHex(gasPrice) && gasPrice !== "0x")
6386
+ transaction.gasPrice = hexToBigInt(gasPrice);
6387
+ if (accessList.length !== 0 && accessList !== "0x")
6388
+ transaction.accessList = parseAccessList(accessList);
6389
+ assertTransactionEIP2930(transaction);
6390
+ const signature = transactionArray.length === 11 ? parseEIP155Signature(transactionArray) : void 0;
6391
+ return { ...signature, ...transaction };
6392
+ }
6393
+ function parseTransactionLegacy(serializedTransaction) {
6394
+ const transactionArray = fromRlp(serializedTransaction, "hex");
6395
+ const [nonce, gasPrice, gas, to, value, data, chainIdOrV_, r, s] = transactionArray;
6396
+ if (!(transactionArray.length === 6 || transactionArray.length === 9))
6397
+ throw new InvalidSerializedTransactionError({
6398
+ attributes: {
6399
+ nonce,
6400
+ gasPrice,
6401
+ gas,
6402
+ to,
6403
+ value,
6404
+ data,
6405
+ ...transactionArray.length > 6 ? {
6406
+ v: chainIdOrV_,
6407
+ r,
6408
+ s
6409
+ } : {}
6410
+ },
6411
+ serializedTransaction,
6412
+ type: "legacy"
6413
+ });
6414
+ const transaction = {
6415
+ type: "legacy"
6416
+ };
6417
+ if (isHex(to) && to !== "0x")
6418
+ transaction.to = to;
6419
+ if (isHex(gas) && gas !== "0x")
6420
+ transaction.gas = hexToBigInt(gas);
6421
+ if (isHex(data) && data !== "0x")
6422
+ transaction.data = data;
6423
+ if (isHex(nonce))
6424
+ transaction.nonce = nonce === "0x" ? 0 : hexToNumber(nonce);
6425
+ if (isHex(value) && value !== "0x")
6426
+ transaction.value = hexToBigInt(value);
6427
+ if (isHex(gasPrice) && gasPrice !== "0x")
6428
+ transaction.gasPrice = hexToBigInt(gasPrice);
6429
+ assertTransactionLegacy(transaction);
6430
+ if (transactionArray.length === 6)
6431
+ return transaction;
6432
+ const chainIdOrV = isHex(chainIdOrV_) && chainIdOrV_ !== "0x" ? hexToBigInt(chainIdOrV_) : 0n;
6433
+ if (s === "0x" && r === "0x") {
6434
+ if (chainIdOrV > 0)
6435
+ transaction.chainId = Number(chainIdOrV);
6436
+ return transaction;
6437
+ }
6438
+ const v = chainIdOrV;
6439
+ const chainId = Number((v - 35n) / 2n);
6440
+ if (chainId > 0)
6441
+ transaction.chainId = chainId;
6442
+ else if (v !== 27n && v !== 28n)
6443
+ throw new InvalidLegacyVError({ v });
6444
+ transaction.v = v;
6445
+ transaction.s = s;
6446
+ transaction.r = r;
6447
+ transaction.yParity = v % 2n === 0n ? 1 : 0;
6448
+ return transaction;
6449
+ }
6450
+ function toTransactionArray(serializedTransaction) {
6451
+ return fromRlp(`0x${serializedTransaction.slice(4)}`, "hex");
6452
+ }
6453
+ function parseAccessList(accessList_) {
6454
+ const accessList = [];
6455
+ for (let i = 0; i < accessList_.length; i++) {
6456
+ const [address, storageKeys] = accessList_[i];
6457
+ if (!isAddress(address, { strict: false }))
6458
+ throw new InvalidAddressError({ address });
6459
+ accessList.push({
6460
+ address,
6461
+ storageKeys: storageKeys.map((key) => isHash(key) ? key : trim(key))
6462
+ });
6463
+ }
6464
+ return accessList;
6465
+ }
6466
+ function parseAuthorizationList(serializedAuthorizationList) {
6467
+ const authorizationList = [];
6468
+ for (let i = 0; i < serializedAuthorizationList.length; i++) {
6469
+ const [chainId, address, nonce, yParity, r, s] = serializedAuthorizationList[i];
6470
+ authorizationList.push({
6471
+ address,
6472
+ chainId: chainId === "0x" ? 0 : hexToNumber(chainId),
6473
+ nonce: nonce === "0x" ? 0 : hexToNumber(nonce),
6474
+ ...parseEIP155Signature([yParity, r, s])
6475
+ });
6476
+ }
6477
+ return authorizationList;
6478
+ }
6479
+ function parseEIP155Signature(transactionArray) {
6480
+ const signature = transactionArray.slice(-3);
6481
+ const yParity = signature[0] === "0x" ? 0n : hexToBigInt(signature[0]);
6482
+ if (yParity !== 0n && yParity !== 1n)
6483
+ throw new InvalidYParityError({ yParity });
6484
+ const v = yParity === 0n ? 27n : 28n;
6485
+ return {
6486
+ r: padHex(signature[1], { size: 32 }),
6487
+ s: padHex(signature[2], { size: 32 }),
6488
+ v,
6489
+ yParity: v === 27n ? 0 : 1
6490
+ };
6491
+ }
6492
+
6493
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/unit.js
6494
+ var InvalidDecimalNumberError = class extends BaseError {
6495
+ constructor({ value }) {
6496
+ super(`Number \`${value}\` is not a valid decimal number.`, {
6497
+ name: "InvalidDecimalNumberError"
6498
+ });
6499
+ }
6500
+ };
6501
+
6502
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/parseUnits.js
6503
+ function parseUnits(value, decimals) {
6504
+ if (!/^(-?)([0-9]*)\.?([0-9]*)$/.test(value))
6505
+ throw new InvalidDecimalNumberError({ value });
6506
+ let [integer, fraction = "0"] = value.split(".");
6507
+ const negative = integer.startsWith("-");
6508
+ if (negative)
6509
+ integer = integer.slice(1);
6510
+ fraction = fraction.replace(/(0+)$/, "");
6511
+ if (decimals === 0) {
6512
+ if (Math.round(Number(`.${fraction}`)) === 1)
6513
+ integer = `${BigInt(integer) + 1n}`;
6514
+ fraction = "";
6515
+ } else if (fraction.length > decimals) {
6516
+ const [left, unit, right] = [
6517
+ fraction.slice(0, decimals - 1),
6518
+ fraction.slice(decimals - 1, decimals),
6519
+ fraction.slice(decimals)
6520
+ ];
6521
+ const rounded = Math.round(Number(`${unit}.${right}`));
6522
+ if (rounded > 9)
6523
+ fraction = `${BigInt(left) + BigInt(1)}0`.padStart(left.length + 1, "0");
6524
+ else
6525
+ fraction = `${left}${rounded}`;
6526
+ if (fraction.length > decimals) {
6527
+ fraction = fraction.slice(1);
6528
+ integer = `${BigInt(integer) + 1n}`;
6529
+ }
6530
+ fraction = fraction.slice(0, decimals);
6531
+ } else {
6532
+ fraction = fraction.padEnd(decimals, "0");
6533
+ }
6534
+ return BigInt(`${negative ? "-" : ""}${integer}${fraction}`);
6535
+ }
6536
+
6537
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/parseEther.js
6538
+ function parseEther(ether, unit = "wei") {
6539
+ return parseUnits(ether, etherUnits[unit]);
6540
+ }
6541
+
6542
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/parseGwei.js
6543
+ function parseGwei(ether, unit = "wei") {
6544
+ return parseUnits(ether, gweiUnits[unit]);
6545
+ }
6546
+
4890
6547
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/formatters/proof.js
4891
6548
  function formatStorageProof(storageProof) {
4892
6549
  return storageProof.map((proof) => ({
@@ -5009,7 +6666,7 @@ async function getTransactionReceipt(client, { hash: hash2 }) {
5009
6666
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/multicall.js
5010
6667
  async function multicall(client, parameters) {
5011
6668
  const { account, authorizationList, allowFailure = true, blockHash, blockNumber, blockOverrides, blockTag, requireCanonical, stateOverride } = parameters;
5012
- const contracts2 = parameters.contracts;
6669
+ const contracts = parameters.contracts;
5013
6670
  const batch = typeof client.batch?.multicall === "object" ? client.batch.multicall : {};
5014
6671
  const batchSize = parameters.batchSize ?? batch.batchSize ?? 1024;
5015
6672
  const deployless = parameters.deployless ?? batch.deployless ?? false;
@@ -5030,8 +6687,8 @@ async function multicall(client, parameters) {
5030
6687
  const chunkedCalls = [[]];
5031
6688
  let currentChunk = 0;
5032
6689
  let currentChunkSize = 0;
5033
- for (let i = 0; i < contracts2.length; i++) {
5034
- const { abi: abi2, address, args, functionName } = contracts2[i];
6690
+ for (let i = 0; i < contracts.length; i++) {
6691
+ const { abi: abi2, address, args, functionName } = contracts[i];
5035
6692
  try {
5036
6693
  const callData = encodeFunctionData({ abi: abi2, args, functionName });
5037
6694
  currentChunkSize += (callData.length - 2) / 2;
@@ -5107,7 +6764,7 @@ async function multicall(client, parameters) {
5107
6764
  for (let j = 0; j < aggregate3Result.length; j++) {
5108
6765
  const { returnData, success } = aggregate3Result[j];
5109
6766
  const { callData } = chunkedCalls[i][j];
5110
- const { abi: abi2, address, functionName, args } = contracts2[results.length];
6767
+ const { abi: abi2, address, functionName, args } = contracts[results.length];
5111
6768
  try {
5112
6769
  if (callData === "0x")
5113
6770
  throw new AbiDecodingZeroDataError();
@@ -5134,7 +6791,7 @@ async function multicall(client, parameters) {
5134
6791
  }
5135
6792
  }
5136
6793
  }
5137
- if (results.length !== contracts2.length)
6794
+ if (results.length !== contracts.length)
5138
6795
  throw new BaseError("multicall results mismatch");
5139
6796
  return results;
5140
6797
  }
@@ -5329,7 +6986,7 @@ function getAmbiguousTypes(sourceParameters, targetParameters, args) {
5329
6986
  }
5330
6987
 
5331
6988
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/AbiItem.js
5332
- function from10(abiItem, options = {}) {
6989
+ function from9(abiItem, options = {}) {
5333
6990
  const { prepare = true } = options;
5334
6991
  const item = (() => {
5335
6992
  if (Array.isArray(abiItem))
@@ -5436,7 +7093,7 @@ function getSignature(...parameters) {
5436
7093
  const signature = (() => {
5437
7094
  if (typeof abiItem === "string")
5438
7095
  return abiItem;
5439
- return formatAbiItem2(abiItem);
7096
+ return formatAbiItem(abiItem);
5440
7097
  })();
5441
7098
  return normalizeSignature(signature);
5442
7099
  }
@@ -5457,8 +7114,8 @@ var AmbiguityError = class extends BaseError2 {
5457
7114
  super("Found ambiguous types in overloaded ABI Items.", {
5458
7115
  metaMessages: [
5459
7116
  // TODO: abitype to add support for signature-formatted ABI items.
5460
- `\`${x.type}\` in \`${normalizeSignature(formatAbiItem2(x.abiItem))}\`, and`,
5461
- `\`${y.type}\` in \`${normalizeSignature(formatAbiItem2(y.abiItem))}\``,
7117
+ `\`${x.type}\` in \`${normalizeSignature(formatAbiItem(x.abiItem))}\`, and`,
7118
+ `\`${y.type}\` in \`${normalizeSignature(formatAbiItem(y.abiItem))}\``,
5462
7119
  "",
5463
7120
  "These types encode differently and cannot be distinguished at runtime.",
5464
7121
  "Remove one of the ambiguous items in the ABI."
@@ -5492,7 +7149,7 @@ var NotFoundError = class extends BaseError2 {
5492
7149
  };
5493
7150
 
5494
7151
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/AbiConstructor.js
5495
- function encode3(...parameters) {
7152
+ function encode4(...parameters) {
5496
7153
  const [abiConstructor, options] = (() => {
5497
7154
  if (Array.isArray(parameters[0])) {
5498
7155
  const [abi2, options2] = parameters;
@@ -5501,10 +7158,10 @@ function encode3(...parameters) {
5501
7158
  return parameters;
5502
7159
  })();
5503
7160
  const { bytecode, args } = options;
5504
- return concat2(bytecode, abiConstructor.inputs?.length && args?.length ? encode2(abiConstructor.inputs, args) : "0x");
7161
+ return concat2(bytecode, abiConstructor.inputs?.length && args?.length ? encode3(abiConstructor.inputs, args) : "0x");
5505
7162
  }
5506
- function from11(abiConstructor) {
5507
- return from10(abiConstructor);
7163
+ function from10(abiConstructor) {
7164
+ return from9(abiConstructor);
5508
7165
  }
5509
7166
  function fromAbi2(abi2) {
5510
7167
  const item = abi2.find((item2) => item2.type === "constructor");
@@ -5528,11 +7185,11 @@ function encodeData(...parameters) {
5528
7185
  args
5529
7186
  }) : abiFunction;
5530
7187
  const selector = getSelector2(item);
5531
- const data = args.length > 0 ? encode2(item.inputs, args) : void 0;
7188
+ const data = args.length > 0 ? encode3(item.inputs, args) : void 0;
5532
7189
  return data ? concat2(selector, data) : selector;
5533
7190
  }
5534
- function from12(abiFunction, options = {}) {
5535
- return from10(abiFunction, options);
7191
+ function from11(abiFunction, options = {}) {
7192
+ return from9(abiFunction, options);
5536
7193
  }
5537
7194
  function fromAbi3(abi2, name, options) {
5538
7195
  const item = fromAbi(abi2, name, options);
@@ -5555,11 +7212,11 @@ async function simulateCalls(client, parameters) {
5555
7212
  const account = parameters.account ? parseAccount(parameters.account) : void 0;
5556
7213
  if (traceAssetChanges && !account)
5557
7214
  throw new BaseError("`account` is required when `traceAssetChanges` is true");
5558
- const getBalanceData = account ? encode3(from11("constructor(bytes, bytes)"), {
7215
+ const getBalanceData = account ? encode4(from10("constructor(bytes, bytes)"), {
5559
7216
  bytecode: deploylessCallViaBytecodeBytecode,
5560
7217
  args: [
5561
7218
  getBalanceCode,
5562
- encodeData(from12("function getBalance(address)"), [account.address])
7219
+ encodeData(from11("function getBalance(address)"), [account.address])
5563
7220
  ]
5564
7221
  }) : void 0;
5565
7222
  const assetAddresses = traceAssetChanges ? await Promise.all(parameters.calls.map(async (call2) => {
@@ -5586,7 +7243,7 @@ async function simulateCalls(client, parameters) {
5586
7243
  {
5587
7244
  calls: assetAddresses.map((address, i) => ({
5588
7245
  abi: [
5589
- from12("function balanceOf(address) returns (uint256)")
7246
+ from11("function balanceOf(address) returns (uint256)")
5590
7247
  ],
5591
7248
  functionName: "balanceOf",
5592
7249
  args: [account.address],
@@ -5618,7 +7275,7 @@ async function simulateCalls(client, parameters) {
5618
7275
  {
5619
7276
  calls: assetAddresses.map((address, i) => ({
5620
7277
  abi: [
5621
- from12("function balanceOf(address) returns (uint256)")
7278
+ from11("function balanceOf(address) returns (uint256)")
5622
7279
  ],
5623
7280
  functionName: "balanceOf",
5624
7281
  args: [account.address],
@@ -5638,7 +7295,7 @@ async function simulateCalls(client, parameters) {
5638
7295
  calls: assetAddresses.map((address, i) => ({
5639
7296
  to: address,
5640
7297
  abi: [
5641
- from12("function decimals() returns (uint256)")
7298
+ from11("function decimals() returns (uint256)")
5642
7299
  ],
5643
7300
  functionName: "decimals",
5644
7301
  from: zeroAddress,
@@ -5656,7 +7313,7 @@ async function simulateCalls(client, parameters) {
5656
7313
  calls: assetAddresses.map((address, i) => ({
5657
7314
  to: address,
5658
7315
  abi: [
5659
- from12("function tokenURI(uint256) returns (string)")
7316
+ from11("function tokenURI(uint256) returns (string)")
5660
7317
  ],
5661
7318
  functionName: "tokenURI",
5662
7319
  args: [0n],
@@ -5674,7 +7331,7 @@ async function simulateCalls(client, parameters) {
5674
7331
  {
5675
7332
  calls: assetAddresses.map((address, i) => ({
5676
7333
  to: address,
5677
- abi: [from12("function symbol() returns (string)")],
7334
+ abi: [from11("function symbol() returns (string)")],
5678
7335
  functionName: "symbol",
5679
7336
  from: zeroAddress,
5680
7337
  nonce: i
@@ -5750,7 +7407,7 @@ var SignatureErc6492_exports = {};
5750
7407
  __export(SignatureErc6492_exports, {
5751
7408
  InvalidWrappedSignatureError: () => InvalidWrappedSignatureError2,
5752
7409
  assert: () => assert5,
5753
- from: () => from13,
7410
+ from: () => from12,
5754
7411
  magicBytes: () => magicBytes2,
5755
7412
  universalSignatureValidatorAbi: () => universalSignatureValidatorAbi,
5756
7413
  universalSignatureValidatorBytecode: () => universalSignatureValidatorBytecode,
@@ -5808,19 +7465,19 @@ function assert5(wrapped) {
5808
7465
  if (slice3(wrapped, -32) !== magicBytes2)
5809
7466
  throw new InvalidWrappedSignatureError2(wrapped);
5810
7467
  }
5811
- function from13(wrapped) {
7468
+ function from12(wrapped) {
5812
7469
  if (typeof wrapped === "string")
5813
7470
  return unwrap2(wrapped);
5814
7471
  return wrapped;
5815
7472
  }
5816
7473
  function unwrap2(wrapped) {
5817
7474
  assert5(wrapped);
5818
- const [to, data, signature] = decode(from5("address, bytes, bytes"), wrapped);
7475
+ const [to, data, signature] = decode(from4("address, bytes, bytes"), wrapped);
5819
7476
  return { data, signature, to };
5820
7477
  }
5821
7478
  function wrap2(value) {
5822
7479
  const { data, signature, to } = value;
5823
- return concat2(encode2(from5("address, bytes, bytes"), [
7480
+ return concat2(encode3(from4("address, bytes, bytes"), [
5824
7481
  to,
5825
7482
  data,
5826
7483
  signature
@@ -5847,7 +7504,7 @@ var InvalidWrappedSignatureError2 = class extends BaseError2 {
5847
7504
  };
5848
7505
 
5849
7506
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/verifyHash.js
5850
- async function verifyHash(client, parameters) {
7507
+ async function verifyHash2(client, parameters) {
5851
7508
  const { address, chain = client.chain, hash: hash2, erc6492VerifierAddress: verifierAddress = parameters.universalSignatureVerifierAddress ?? chain?.contracts?.erc6492Verifier?.address, multicallAddress = parameters.multicallAddress ?? chain?.contracts?.multicall3?.address, mode = "auto" } = parameters;
5852
7509
  if (chain?.verifyHash)
5853
7510
  return await chain.verifyHash(client, parameters);
@@ -6020,9 +7677,9 @@ var VerificationError = class extends Error {
6020
7677
  };
6021
7678
 
6022
7679
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/verifyMessage.js
6023
- async function verifyMessage(client, { address, message, factory, factoryData, signature, ...callRequest }) {
7680
+ async function verifyMessage2(client, { address, message, factory, factoryData, signature, ...callRequest }) {
6024
7681
  const hash2 = hashMessage(message);
6025
- return getAction(client, verifyHash, "verifyHash")({
7682
+ return getAction(client, verifyHash2, "verifyHash")({
6026
7683
  address,
6027
7684
  factory,
6028
7685
  factoryData,
@@ -6033,10 +7690,10 @@ async function verifyMessage(client, { address, message, factory, factoryData, s
6033
7690
  }
6034
7691
 
6035
7692
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/verifyTypedData.js
6036
- async function verifyTypedData(client, parameters) {
7693
+ async function verifyTypedData2(client, parameters) {
6037
7694
  const { address, factory, factoryData, signature, message, primaryType, types, domain, ...callRequest } = parameters;
6038
7695
  const hash2 = hashTypedData({ message, primaryType, types, domain });
6039
- return getAction(client, verifyHash, "verifyHash")({
7696
+ return getAction(client, verifyHash2, "verifyHash")({
6040
7697
  address,
6041
7698
  factory,
6042
7699
  factoryData,
@@ -6234,7 +7891,7 @@ async function waitForTransactionReceipt(client, parameters) {
6234
7891
  shouldRetry: ({ error }) => error instanceof BlockNotFoundError
6235
7892
  });
6236
7893
  retrying = false;
6237
- const replacementTransaction = block.transactions.find(({ from: from14, nonce }) => from14 === replacedTransaction.from && nonce === replacedTransaction.nonce);
7894
+ const replacementTransaction = block.transactions.find(({ from: from13, nonce }) => from13 === replacedTransaction.from && nonce === replacedTransaction.nonce);
6238
7895
  if (!replacementTransaction)
6239
7896
  return;
6240
7897
  receipt = await getAction(client, getTransactionReceipt, "getTransactionReceipt")({
@@ -6692,7 +8349,7 @@ async function verifySiweMessage(client, parameters) {
6692
8349
  if (!isValid)
6693
8350
  return false;
6694
8351
  const hash2 = hashMessage(message);
6695
- return verifyHash(client, {
8352
+ return verifyHash2(client, {
6696
8353
  address: parsed.address,
6697
8354
  hash: hash2,
6698
8355
  signature,
@@ -6704,6 +8361,22 @@ async function verifySiweMessage(client, parameters) {
6704
8361
  function toAmount(amount, decimals) {
6705
8362
  return { amount, decimals, formatted: formatUnits(amount, decimals) };
6706
8363
  }
8364
+ function toBaseUnits(amount, decimals) {
8365
+ if (typeof amount === "bigint")
8366
+ return amount;
8367
+ const resolved = amount.decimals ?? decimals;
8368
+ return parseUnits(amount.formatted, requireTokenDecimals(resolved));
8369
+ }
8370
+ function requireTokenDecimals(decimals) {
8371
+ if (decimals === void 0)
8372
+ throw new Error("Token decimals are required. Pass `amount.decimals` or select a declared token.");
8373
+ return decimals;
8374
+ }
8375
+ function resolveAmountDecimals(amount, decimals) {
8376
+ if (typeof amount === "bigint")
8377
+ return decimals;
8378
+ return amount.decimals ?? decimals;
8379
+ }
6707
8380
  function resolveToken(client, parameters) {
6708
8381
  const { decimals, token } = parameters;
6709
8382
  const declared = findDeclaredToken(client, token);
@@ -6780,6 +8453,10 @@ async function resolveTokenWithDecimals(client, parameters) {
6780
8453
  })
6781
8454
  };
6782
8455
  }
8456
+ function pickWriteParameters(parameters) {
8457
+ const { account, chain, gas, maxFeePerGas, maxPriorityFeePerGas, nonce } = parameters;
8458
+ return { account, chain, gas, maxFeePerGas, maxPriorityFeePerGas, nonce };
8459
+ }
6783
8460
  function defineCall(call2) {
6784
8461
  return {
6785
8462
  ...call2,
@@ -6788,6 +8465,60 @@ function defineCall(call2) {
6788
8465
  };
6789
8466
  }
6790
8467
 
8468
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/token/approve.js
8469
+ async function approve(client, parameters) {
8470
+ return approve.inner(writeContract, client, parameters);
8471
+ }
8472
+ (function(approve2) {
8473
+ async function inner(action, client, parameters) {
8474
+ return await action(client, {
8475
+ ...parameters,
8476
+ ...approve2.call(client, parameters)
8477
+ });
8478
+ }
8479
+ approve2.inner = inner;
8480
+ function call2(client, parameters) {
8481
+ return defineCall(getCall(client, parameters));
8482
+ }
8483
+ approve2.call = call2;
8484
+ async function estimateGas2(client, parameters) {
8485
+ return estimateContractGas(client, {
8486
+ ...pickWriteParameters(parameters),
8487
+ ...approve2.call(client, parameters)
8488
+ });
8489
+ }
8490
+ approve2.estimateGas = estimateGas2;
8491
+ async function simulate(client, parameters) {
8492
+ return simulateContract(client, {
8493
+ ...pickWriteParameters(parameters),
8494
+ ...approve2.call(client, parameters)
8495
+ });
8496
+ }
8497
+ approve2.simulate = simulate;
8498
+ function extractEvent(logs) {
8499
+ const [log] = parseEventLogs({
8500
+ abi: erc20Abi,
8501
+ logs,
8502
+ eventName: "Approval",
8503
+ strict: true
8504
+ });
8505
+ if (!log)
8506
+ throw new Error("`Approval` event not found.");
8507
+ return log;
8508
+ }
8509
+ approve2.extractEvent = extractEvent;
8510
+ })(approve || (approve = {}));
8511
+ function getCall(client, parameters) {
8512
+ const { amount, spender, token } = parameters;
8513
+ const { address, decimals } = resolveToken(client, { token });
8514
+ return {
8515
+ abi: erc20Abi,
8516
+ address,
8517
+ args: [spender, toBaseUnits(amount, decimals)],
8518
+ functionName: "approve"
8519
+ };
8520
+ }
8521
+
6791
8522
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/sendRawTransactionSync.js
6792
8523
  async function sendRawTransactionSync(client, { serializedTransaction, throwOnReceiptRevert, timeout }) {
6793
8524
  const receipt = await client.request({
@@ -6801,28 +8532,215 @@ async function sendRawTransactionSync(client, { serializedTransaction, throwOnRe
6801
8532
  return formatted;
6802
8533
  }
6803
8534
 
6804
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/token/getAllowance.js
6805
- async function getAllowance(client, parameters) {
6806
- const { account, decimals, spender, token, ...rest } = parameters;
6807
- const [amount, { decimals: resolved }] = await Promise.all([
6808
- readContract(client, {
6809
- ...rest,
6810
- ...getAllowance.call(client, { account, spender, token })
6811
- }),
6812
- resolveTokenWithDecimals(client, {
6813
- decimals,
6814
- token
6815
- })
6816
- ]);
6817
- return toAmount(amount, resolved);
6818
- }
6819
- (function(getAllowance2) {
6820
- function call2(client, args) {
6821
- return defineCall({
6822
- address: resolveToken(client, args).address,
6823
- abi: erc20Abi,
6824
- functionName: "allowance",
6825
- args: [args.account, args.spender]
8535
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/sendTransactionSync.js
8536
+ var supportsWalletNamespace2 = new LruMap(128);
8537
+ async function sendTransactionSync(client, parameters) {
8538
+ const { account: account_ = client.account, assertChainId = true, chain = client.chain, accessList, authorizationList, blobs, data, dataSuffix = typeof client.dataSuffix === "string" ? client.dataSuffix : client.dataSuffix?.value, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, pollingInterval, throwOnReceiptRevert, type, value, ...rest } = parameters;
8539
+ const timeout = parameters.timeout ?? Math.max((chain?.blockTime ?? 0) * 3, 5e3);
8540
+ if (typeof account_ === "undefined")
8541
+ throw new AccountNotFoundError({
8542
+ docsPath: "/docs/actions/wallet/sendTransactionSync"
8543
+ });
8544
+ const account = account_ ? parseAccount(account_) : null;
8545
+ let nonceManagerParameters;
8546
+ try {
8547
+ assertRequest(parameters);
8548
+ const to = await (async () => {
8549
+ if (parameters.to)
8550
+ return parameters.to;
8551
+ if (parameters.to === null)
8552
+ return void 0;
8553
+ if (authorizationList && authorizationList.length > 0)
8554
+ return await recoverAuthorizationAddress({
8555
+ authorization: authorizationList[0]
8556
+ }).catch(() => {
8557
+ throw new BaseError("`to` is required. Could not infer from `authorizationList`.");
8558
+ });
8559
+ return void 0;
8560
+ })();
8561
+ if (account?.type === "json-rpc" || account === null) {
8562
+ let chainId;
8563
+ if (chain !== null) {
8564
+ chainId = await getAction(client, getChainId, "getChainId")({});
8565
+ if (assertChainId)
8566
+ assertCurrentChain({
8567
+ currentChainId: chainId,
8568
+ chain
8569
+ });
8570
+ }
8571
+ const chainFormat = client.chain?.formatters?.transactionRequest?.format;
8572
+ const format = chainFormat || formatTransactionRequest;
8573
+ const request = format({
8574
+ // Pick out extra data that might exist on the chain's transaction request type.
8575
+ ...extract(rest, { format: chainFormat }),
8576
+ accessList,
8577
+ account,
8578
+ authorizationList,
8579
+ blobs,
8580
+ chainId,
8581
+ data: dataSuffix ? concat([data ?? "0x", dataSuffix]) : data,
8582
+ gas,
8583
+ gasPrice,
8584
+ maxFeePerBlobGas,
8585
+ maxFeePerGas,
8586
+ maxPriorityFeePerGas,
8587
+ nonce,
8588
+ to,
8589
+ type,
8590
+ value
8591
+ }, "sendTransaction");
8592
+ const isWalletNamespaceSupported = supportsWalletNamespace2.get(client.uid);
8593
+ const method = isWalletNamespaceSupported ? "wallet_sendTransaction" : "eth_sendTransaction";
8594
+ const hash2 = await (async () => {
8595
+ try {
8596
+ return await client.request({
8597
+ method,
8598
+ params: [request]
8599
+ }, { retryCount: 0 });
8600
+ } catch (e) {
8601
+ if (isWalletNamespaceSupported === false)
8602
+ throw e;
8603
+ const error = e;
8604
+ if (error.name === "InvalidInputRpcError" || error.name === "InvalidParamsRpcError" || error.name === "MethodNotFoundRpcError" || error.name === "MethodNotSupportedRpcError") {
8605
+ return await client.request({
8606
+ method: "wallet_sendTransaction",
8607
+ params: [request]
8608
+ }, { retryCount: 0 }).then((hash3) => {
8609
+ supportsWalletNamespace2.set(client.uid, true);
8610
+ return hash3;
8611
+ }).catch((e2) => {
8612
+ const walletNamespaceError = e2;
8613
+ if (walletNamespaceError.name === "MethodNotFoundRpcError" || walletNamespaceError.name === "MethodNotSupportedRpcError") {
8614
+ supportsWalletNamespace2.set(client.uid, false);
8615
+ throw error;
8616
+ }
8617
+ throw walletNamespaceError;
8618
+ });
8619
+ }
8620
+ throw error;
8621
+ }
8622
+ })();
8623
+ const receipt = await getAction(client, waitForTransactionReceipt, "waitForTransactionReceipt")({
8624
+ checkReplacement: false,
8625
+ hash: hash2,
8626
+ pollingInterval,
8627
+ timeout
8628
+ });
8629
+ if (throwOnReceiptRevert && receipt.status === "reverted")
8630
+ throw new TransactionReceiptRevertedError({ receipt });
8631
+ return receipt;
8632
+ }
8633
+ if (account?.type === "local") {
8634
+ if (account.nonceManager && typeof nonce === "undefined") {
8635
+ const requestChainId = rest.chainId;
8636
+ const chainId = await (async () => {
8637
+ if (typeof requestChainId === "number")
8638
+ return requestChainId;
8639
+ if (chain)
8640
+ return chain.id;
8641
+ return getAction(client, getChainId, "getChainId")({});
8642
+ })();
8643
+ nonceManagerParameters = { address: account.address, chainId };
8644
+ }
8645
+ const request = await getAction(client, prepareTransactionRequest, "prepareTransactionRequest")({
8646
+ account,
8647
+ accessList,
8648
+ authorizationList,
8649
+ blobs,
8650
+ chain,
8651
+ data: dataSuffix ? concat([data ?? "0x", dataSuffix]) : data,
8652
+ gas,
8653
+ gasPrice,
8654
+ maxFeePerBlobGas,
8655
+ maxFeePerGas,
8656
+ maxPriorityFeePerGas,
8657
+ nonce,
8658
+ nonceManager: account.nonceManager,
8659
+ parameters: [...defaultParameters, "sidecars"],
8660
+ type,
8661
+ value,
8662
+ ...rest,
8663
+ to
8664
+ });
8665
+ const serializer = chain?.serializers?.transaction;
8666
+ const serializedTransaction = await account.signTransaction(request, {
8667
+ serializer
8668
+ });
8669
+ return await getAction(client, sendRawTransactionSync, "sendRawTransactionSync")({
8670
+ serializedTransaction,
8671
+ throwOnReceiptRevert,
8672
+ timeout: parameters.timeout
8673
+ });
8674
+ }
8675
+ if (account?.type === "smart")
8676
+ throw new AccountTypeNotSupportedError({
8677
+ metaMessages: [
8678
+ "Consider using the `sendUserOperation` Action instead."
8679
+ ],
8680
+ docsPath: "/docs/actions/bundler/sendUserOperation",
8681
+ type: "smart"
8682
+ });
8683
+ throw new AccountTypeNotSupportedError({
8684
+ docsPath: "/docs/actions/wallet/sendTransactionSync",
8685
+ type: account?.type
8686
+ });
8687
+ } catch (err) {
8688
+ if (err instanceof AccountTypeNotSupportedError)
8689
+ throw err;
8690
+ if (nonceManagerParameters && !(err instanceof TransactionReceiptRevertedError))
8691
+ account?.nonceManager?.reset(nonceManagerParameters);
8692
+ throw getTransactionError(err, {
8693
+ ...parameters,
8694
+ account,
8695
+ chain: parameters.chain || void 0
8696
+ });
8697
+ }
8698
+ }
8699
+
8700
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/writeContractSync.js
8701
+ async function writeContractSync(client, parameters) {
8702
+ return writeContract.internal(client, sendTransactionSync, "sendTransactionSync", parameters);
8703
+ }
8704
+
8705
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/token/approveSync.js
8706
+ async function approveSync(client, parameters) {
8707
+ const { amount, token, throwOnReceiptRevert = true } = parameters;
8708
+ const { decimals } = resolveToken(client, { token });
8709
+ const resolved = resolveAmountDecimals(amount, decimals);
8710
+ const receipt = await approve.inner(writeContractSync, client, {
8711
+ ...parameters,
8712
+ throwOnReceiptRevert
8713
+ });
8714
+ const { args } = approve.extractEvent(receipt.logs);
8715
+ return {
8716
+ ...args,
8717
+ ...resolved === void 0 ? {} : { decimals: resolved, formatted: formatUnits(args.value, resolved) },
8718
+ receipt
8719
+ };
8720
+ }
8721
+
8722
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/token/getAllowance.js
8723
+ async function getAllowance(client, parameters) {
8724
+ const { account, decimals, spender, token, ...rest } = parameters;
8725
+ const [amount, { decimals: resolved }] = await Promise.all([
8726
+ readContract(client, {
8727
+ ...rest,
8728
+ ...getAllowance.call(client, { account, spender, token })
8729
+ }),
8730
+ resolveTokenWithDecimals(client, {
8731
+ decimals,
8732
+ token
8733
+ })
8734
+ ]);
8735
+ return toAmount(amount, resolved);
8736
+ }
8737
+ (function(getAllowance2) {
8738
+ function call2(client, args) {
8739
+ return defineCall({
8740
+ address: resolveToken(client, args).address,
8741
+ abi: erc20Abi,
8742
+ functionName: "allowance",
8743
+ args: [args.account, args.spender]
6826
8744
  });
6827
8745
  }
6828
8746
  getAllowance2.call = call2;
@@ -6921,6 +8839,85 @@ async function getTotalSupply(client, parameters) {
6921
8839
  getTotalSupply2.call = call2;
6922
8840
  })(getTotalSupply || (getTotalSupply = {}));
6923
8841
 
8842
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/token/transfer.js
8843
+ async function transfer(client, parameters) {
8844
+ return transfer.inner(writeContract, client, parameters);
8845
+ }
8846
+ (function(transfer2) {
8847
+ async function inner(action, client, parameters) {
8848
+ return await action(client, {
8849
+ ...parameters,
8850
+ ...transfer2.call(client, parameters)
8851
+ });
8852
+ }
8853
+ transfer2.inner = inner;
8854
+ function call2(client, parameters) {
8855
+ return defineCall(getCall2(client, parameters));
8856
+ }
8857
+ transfer2.call = call2;
8858
+ async function estimateGas2(client, parameters) {
8859
+ return estimateContractGas(client, {
8860
+ ...pickWriteParameters(parameters),
8861
+ ...transfer2.call(client, parameters)
8862
+ });
8863
+ }
8864
+ transfer2.estimateGas = estimateGas2;
8865
+ async function simulate(client, parameters) {
8866
+ return simulateContract(client, {
8867
+ ...pickWriteParameters(parameters),
8868
+ ...transfer2.call(client, parameters)
8869
+ });
8870
+ }
8871
+ transfer2.simulate = simulate;
8872
+ function extractEvent(logs) {
8873
+ const [log] = parseEventLogs({
8874
+ abi: erc20Abi,
8875
+ logs,
8876
+ eventName: "Transfer",
8877
+ strict: true
8878
+ });
8879
+ if (!log)
8880
+ throw new Error("`Transfer` event not found.");
8881
+ return log;
8882
+ }
8883
+ transfer2.extractEvent = extractEvent;
8884
+ })(transfer || (transfer = {}));
8885
+ function getCall2(client, parameters) {
8886
+ const { amount, from: from13, to, token } = parameters;
8887
+ const { address, decimals } = resolveToken(client, { token });
8888
+ const value = toBaseUnits(amount, decimals);
8889
+ if (from13)
8890
+ return {
8891
+ abi: erc20Abi,
8892
+ address,
8893
+ args: [from13, to, value],
8894
+ functionName: "transferFrom"
8895
+ };
8896
+ return {
8897
+ abi: erc20Abi,
8898
+ address,
8899
+ args: [to, value],
8900
+ functionName: "transfer"
8901
+ };
8902
+ }
8903
+
8904
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/token/transferSync.js
8905
+ async function transferSync(client, parameters) {
8906
+ const { amount, token, throwOnReceiptRevert = true } = parameters;
8907
+ const { decimals } = resolveToken(client, { token });
8908
+ const resolved = resolveAmountDecimals(amount, decimals);
8909
+ const receipt = await transfer.inner(writeContractSync, client, {
8910
+ ...parameters,
8911
+ throwOnReceiptRevert
8912
+ });
8913
+ const { args } = transfer.extractEvent(receipt.logs);
8914
+ return {
8915
+ ...args,
8916
+ ...resolved === void 0 ? {} : { decimals: resolved, formatted: formatUnits(args.value, resolved) },
8917
+ receipt
8918
+ };
8919
+ }
8920
+
6924
8921
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/clients/decorators/public.js
6925
8922
  function publicActions(client) {
6926
8923
  return {
@@ -6973,10 +8970,10 @@ function publicActions(client) {
6973
8970
  simulateBlocks: (args) => simulateBlocks(client, args),
6974
8971
  simulateCalls: (args) => simulateCalls(client, args),
6975
8972
  simulateContract: (args) => simulateContract(client, args),
6976
- verifyHash: (args) => verifyHash(client, args),
6977
- verifyMessage: (args) => verifyMessage(client, args),
8973
+ verifyHash: (args) => verifyHash2(client, args),
8974
+ verifyMessage: (args) => verifyMessage2(client, args),
6978
8975
  verifySiweMessage: (args) => verifySiweMessage(client, args),
6979
- verifyTypedData: (args) => verifyTypedData(client, args),
8976
+ verifyTypedData: (args) => verifyTypedData2(client, args),
6980
8977
  uninstallFilter: (args) => uninstallFilter(client, args),
6981
8978
  waitForTransactionReceipt: (args) => waitForTransactionReceipt(client, args),
6982
8979
  watchBlocks: (args) => watchBlocks(client, args),
@@ -7008,6 +9005,671 @@ function createPublicClient(parameters) {
7008
9005
  return client.extend(publicActions);
7009
9006
  }
7010
9007
 
9008
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/dropTransaction.js
9009
+ async function dropTransaction(client, { hash: hash2 }) {
9010
+ await client.request({
9011
+ method: `${client.mode}_dropTransaction`,
9012
+ params: [hash2]
9013
+ });
9014
+ }
9015
+
9016
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/dumpState.js
9017
+ async function dumpState(client) {
9018
+ return client.request({
9019
+ method: `${client.mode}_dumpState`
9020
+ });
9021
+ }
9022
+
9023
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/getAutomine.js
9024
+ async function getAutomine(client) {
9025
+ if (client.mode === "ganache")
9026
+ return await client.request({
9027
+ method: "eth_mining"
9028
+ });
9029
+ return await client.request({
9030
+ method: `${client.mode}_getAutomine`
9031
+ });
9032
+ }
9033
+
9034
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/getTxpoolContent.js
9035
+ async function getTxpoolContent(client) {
9036
+ return await client.request({
9037
+ method: "txpool_content"
9038
+ });
9039
+ }
9040
+
9041
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/getTxpoolStatus.js
9042
+ async function getTxpoolStatus(client) {
9043
+ const { pending, queued } = await client.request({
9044
+ method: "txpool_status"
9045
+ });
9046
+ return {
9047
+ pending: hexToNumber(pending),
9048
+ queued: hexToNumber(queued)
9049
+ };
9050
+ }
9051
+
9052
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/impersonateAccount.js
9053
+ async function impersonateAccount(client, { address }) {
9054
+ await client.request({
9055
+ method: `${client.mode}_impersonateAccount`,
9056
+ params: [address]
9057
+ });
9058
+ }
9059
+
9060
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/increaseTime.js
9061
+ async function increaseTime(client, { seconds }) {
9062
+ return await client.request({
9063
+ method: "evm_increaseTime",
9064
+ params: [numberToHex(seconds)]
9065
+ });
9066
+ }
9067
+
9068
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/inspectTxpool.js
9069
+ async function inspectTxpool(client) {
9070
+ return await client.request({
9071
+ method: "txpool_inspect"
9072
+ });
9073
+ }
9074
+
9075
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/loadState.js
9076
+ async function loadState(client, { state }) {
9077
+ await client.request({
9078
+ method: `${client.mode}_loadState`,
9079
+ params: [state]
9080
+ });
9081
+ }
9082
+
9083
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/mine.js
9084
+ async function mine(client, { blocks, interval }) {
9085
+ if (client.mode === "ganache")
9086
+ await client.request({
9087
+ method: "evm_mine",
9088
+ params: [{ blocks: numberToHex(blocks) }]
9089
+ });
9090
+ else
9091
+ await client.request({
9092
+ method: `${client.mode}_mine`,
9093
+ params: [numberToHex(blocks), numberToHex(interval || 0)]
9094
+ });
9095
+ }
9096
+
9097
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/removeBlockTimestampInterval.js
9098
+ async function removeBlockTimestampInterval(client) {
9099
+ await client.request({
9100
+ method: `${client.mode}_removeBlockTimestampInterval`
9101
+ });
9102
+ }
9103
+
9104
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/reset.js
9105
+ async function reset(client, { blockNumber, jsonRpcUrl } = {}) {
9106
+ await client.request({
9107
+ method: `${client.mode}_reset`,
9108
+ params: [{ forking: { blockNumber: Number(blockNumber), jsonRpcUrl } }]
9109
+ });
9110
+ }
9111
+
9112
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/revert.js
9113
+ async function revert(client, { id }) {
9114
+ await client.request({
9115
+ method: "evm_revert",
9116
+ params: [id]
9117
+ });
9118
+ }
9119
+
9120
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/sendUnsignedTransaction.js
9121
+ async function sendUnsignedTransaction(client, args) {
9122
+ const { accessList, data, from: from13, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest } = args;
9123
+ const chainFormat = client.chain?.formatters?.transactionRequest?.format;
9124
+ const format = chainFormat || formatTransactionRequest;
9125
+ const request = format({
9126
+ // Pick out extra data that might exist on the chain's transaction request type.
9127
+ ...extract(rest, { format: chainFormat }),
9128
+ accessList,
9129
+ data,
9130
+ from: from13,
9131
+ gas,
9132
+ gasPrice,
9133
+ maxFeePerGas,
9134
+ maxPriorityFeePerGas,
9135
+ nonce,
9136
+ to,
9137
+ value
9138
+ }, "sendUnsignedTransaction");
9139
+ const hash2 = await client.request({
9140
+ method: "eth_sendUnsignedTransaction",
9141
+ params: [request]
9142
+ });
9143
+ return hash2;
9144
+ }
9145
+
9146
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setAutomine.js
9147
+ async function setAutomine(client, enabled) {
9148
+ if (client.mode === "ganache") {
9149
+ if (enabled)
9150
+ await client.request({ method: "miner_start" });
9151
+ else
9152
+ await client.request({ method: "miner_stop" });
9153
+ } else
9154
+ await client.request({
9155
+ method: "evm_setAutomine",
9156
+ params: [enabled]
9157
+ });
9158
+ }
9159
+
9160
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setBalance.js
9161
+ async function setBalance(client, { address, value }) {
9162
+ if (client.mode === "ganache")
9163
+ await client.request({
9164
+ method: "evm_setAccountBalance",
9165
+ params: [address, numberToHex(value)]
9166
+ });
9167
+ else
9168
+ await client.request({
9169
+ method: `${client.mode}_setBalance`,
9170
+ params: [address, numberToHex(value)]
9171
+ });
9172
+ }
9173
+
9174
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setBlockGasLimit.js
9175
+ async function setBlockGasLimit(client, { gasLimit }) {
9176
+ await client.request({
9177
+ method: "evm_setBlockGasLimit",
9178
+ params: [numberToHex(gasLimit)]
9179
+ });
9180
+ }
9181
+
9182
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setBlockTimestampInterval.js
9183
+ async function setBlockTimestampInterval(client, { interval }) {
9184
+ const interval_ = (() => {
9185
+ if (client.mode === "hardhat")
9186
+ return interval * 1e3;
9187
+ return interval;
9188
+ })();
9189
+ await client.request({
9190
+ method: `${client.mode}_setBlockTimestampInterval`,
9191
+ params: [interval_]
9192
+ });
9193
+ }
9194
+
9195
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setCode.js
9196
+ async function setCode(client, { address, bytecode }) {
9197
+ if (client.mode === "ganache")
9198
+ await client.request({
9199
+ method: "evm_setAccountCode",
9200
+ params: [address, bytecode]
9201
+ });
9202
+ else
9203
+ await client.request({
9204
+ method: `${client.mode}_setCode`,
9205
+ params: [address, bytecode]
9206
+ });
9207
+ }
9208
+
9209
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setCoinbase.js
9210
+ async function setCoinbase(client, { address }) {
9211
+ await client.request({
9212
+ method: `${client.mode}_setCoinbase`,
9213
+ params: [address]
9214
+ });
9215
+ }
9216
+
9217
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setIntervalMining.js
9218
+ async function setIntervalMining(client, { interval }) {
9219
+ const interval_ = (() => {
9220
+ if (client.mode === "hardhat")
9221
+ return interval * 1e3;
9222
+ return interval;
9223
+ })();
9224
+ await client.request({
9225
+ method: "evm_setIntervalMining",
9226
+ params: [interval_]
9227
+ });
9228
+ }
9229
+
9230
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setLoggingEnabled.js
9231
+ async function setLoggingEnabled(client, enabled) {
9232
+ await client.request({
9233
+ method: `${client.mode}_setLoggingEnabled`,
9234
+ params: [enabled]
9235
+ });
9236
+ }
9237
+
9238
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setMinGasPrice.js
9239
+ async function setMinGasPrice(client, { gasPrice }) {
9240
+ await client.request({
9241
+ method: `${client.mode}_setMinGasPrice`,
9242
+ params: [numberToHex(gasPrice)]
9243
+ });
9244
+ }
9245
+
9246
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setNextBlockBaseFeePerGas.js
9247
+ async function setNextBlockBaseFeePerGas(client, { baseFeePerGas }) {
9248
+ await client.request({
9249
+ method: `${client.mode}_setNextBlockBaseFeePerGas`,
9250
+ params: [numberToHex(baseFeePerGas)]
9251
+ });
9252
+ }
9253
+
9254
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setNextBlockTimestamp.js
9255
+ async function setNextBlockTimestamp(client, { timestamp }) {
9256
+ await client.request({
9257
+ method: "evm_setNextBlockTimestamp",
9258
+ params: [numberToHex(timestamp)]
9259
+ });
9260
+ }
9261
+
9262
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setNonce.js
9263
+ async function setNonce(client, { address, nonce }) {
9264
+ await client.request({
9265
+ method: `${client.mode}_setNonce`,
9266
+ params: [address, numberToHex(nonce)]
9267
+ });
9268
+ }
9269
+
9270
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setRpcUrl.js
9271
+ async function setRpcUrl(client, jsonRpcUrl) {
9272
+ await client.request({
9273
+ method: `${client.mode}_setRpcUrl`,
9274
+ params: [jsonRpcUrl]
9275
+ });
9276
+ }
9277
+
9278
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/setStorageAt.js
9279
+ async function setStorageAt(client, { address, index: index2, value }) {
9280
+ await client.request({
9281
+ method: `${client.mode}_setStorageAt`,
9282
+ params: [
9283
+ address,
9284
+ typeof index2 === "number" ? numberToHex(index2) : index2,
9285
+ value
9286
+ ]
9287
+ });
9288
+ }
9289
+
9290
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/snapshot.js
9291
+ async function snapshot(client) {
9292
+ return await client.request({
9293
+ method: "evm_snapshot"
9294
+ });
9295
+ }
9296
+
9297
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/test/stopImpersonatingAccount.js
9298
+ async function stopImpersonatingAccount(client, { address }) {
9299
+ await client.request({
9300
+ method: `${client.mode}_stopImpersonatingAccount`,
9301
+ params: [address]
9302
+ });
9303
+ }
9304
+
9305
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/clients/decorators/test.js
9306
+ function testActions({ mode }) {
9307
+ return (client_) => {
9308
+ const client = client_.extend(() => ({
9309
+ mode
9310
+ }));
9311
+ return {
9312
+ dropTransaction: (args) => dropTransaction(client, args),
9313
+ dumpState: () => dumpState(client),
9314
+ getAutomine: () => getAutomine(client),
9315
+ getTxpoolContent: () => getTxpoolContent(client),
9316
+ getTxpoolStatus: () => getTxpoolStatus(client),
9317
+ impersonateAccount: (args) => impersonateAccount(client, args),
9318
+ increaseTime: (args) => increaseTime(client, args),
9319
+ inspectTxpool: () => inspectTxpool(client),
9320
+ loadState: (args) => loadState(client, args),
9321
+ mine: (args) => mine(client, args),
9322
+ removeBlockTimestampInterval: () => removeBlockTimestampInterval(client),
9323
+ reset: (args) => reset(client, args),
9324
+ revert: (args) => revert(client, args),
9325
+ sendUnsignedTransaction: (args) => sendUnsignedTransaction(client, args),
9326
+ setAutomine: (args) => setAutomine(client, args),
9327
+ setBalance: (args) => setBalance(client, args),
9328
+ setBlockGasLimit: (args) => setBlockGasLimit(client, args),
9329
+ setBlockTimestampInterval: (args) => setBlockTimestampInterval(client, args),
9330
+ setCode: (args) => setCode(client, args),
9331
+ setCoinbase: (args) => setCoinbase(client, args),
9332
+ setIntervalMining: (args) => setIntervalMining(client, args),
9333
+ setLoggingEnabled: (args) => setLoggingEnabled(client, args),
9334
+ setMinGasPrice: (args) => setMinGasPrice(client, args),
9335
+ setNextBlockBaseFeePerGas: (args) => setNextBlockBaseFeePerGas(client, args),
9336
+ setNextBlockTimestamp: (args) => setNextBlockTimestamp(client, args),
9337
+ setNonce: (args) => setNonce(client, args),
9338
+ setRpcUrl: (args) => setRpcUrl(client, args),
9339
+ setStorageAt: (args) => setStorageAt(client, args),
9340
+ snapshot: () => snapshot(client),
9341
+ stopImpersonatingAccount: (args) => stopImpersonatingAccount(client, args)
9342
+ };
9343
+ };
9344
+ }
9345
+
9346
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/clients/createTestClient.js
9347
+ function createTestClient(parameters) {
9348
+ const { key = "test", name = "Test Client", mode } = parameters;
9349
+ const client = createClient({
9350
+ ...parameters,
9351
+ key,
9352
+ name,
9353
+ type: "testClient"
9354
+ });
9355
+ return client.extend((config) => ({
9356
+ mode,
9357
+ ...testActions({ mode })(config)
9358
+ }));
9359
+ }
9360
+
9361
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/addChain.js
9362
+ async function addChain(client, { chain }) {
9363
+ const { id, name, nativeCurrency, rpcUrls, blockExplorers } = chain;
9364
+ await client.request({
9365
+ method: "wallet_addEthereumChain",
9366
+ params: [
9367
+ {
9368
+ chainId: numberToHex(id),
9369
+ chainName: name,
9370
+ nativeCurrency,
9371
+ rpcUrls: rpcUrls.default.http,
9372
+ blockExplorerUrls: blockExplorers ? Object.values(blockExplorers).map(({ url }) => url) : void 0
9373
+ }
9374
+ ]
9375
+ }, { dedupe: true, retryCount: 0 });
9376
+ }
9377
+
9378
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/deployContract.js
9379
+ function deployContract(walletClient, parameters) {
9380
+ const { abi: abi2, args, bytecode, ...request } = parameters;
9381
+ const calldata = encodeDeployData({ abi: abi2, args, bytecode });
9382
+ return sendTransaction(walletClient, {
9383
+ ...request,
9384
+ ...request.authorizationList ? { to: null } : {},
9385
+ data: calldata
9386
+ });
9387
+ }
9388
+
9389
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/getAddresses.js
9390
+ async function getAddresses(client) {
9391
+ if (client.account?.type === "local")
9392
+ return [client.account.address];
9393
+ const addresses = await client.request({ method: "eth_accounts" }, { dedupe: true });
9394
+ return addresses.map((address) => checksumAddress(address));
9395
+ }
9396
+
9397
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/getCapabilities.js
9398
+ async function getCapabilities(client, parameters = {}) {
9399
+ const { account = client.account, chainId } = parameters;
9400
+ const account_ = account ? parseAccount(account) : void 0;
9401
+ const params = chainId ? [account_?.address, [numberToHex(chainId)]] : [account_?.address];
9402
+ const capabilities_raw = await client.request({
9403
+ method: "wallet_getCapabilities",
9404
+ params
9405
+ });
9406
+ const capabilities = {};
9407
+ for (const [chainId2, capabilities_] of Object.entries(capabilities_raw)) {
9408
+ capabilities[Number(chainId2)] = {};
9409
+ for (let [key, value] of Object.entries(capabilities_)) {
9410
+ if (key === "addSubAccount")
9411
+ key = "unstable_addSubAccount";
9412
+ capabilities[Number(chainId2)][key] = value;
9413
+ }
9414
+ }
9415
+ return typeof chainId === "number" ? capabilities[chainId] : capabilities;
9416
+ }
9417
+
9418
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/getPermissions.js
9419
+ async function getPermissions(client) {
9420
+ const permissions = await client.request({ method: "wallet_getPermissions" }, { dedupe: true });
9421
+ return permissions;
9422
+ }
9423
+
9424
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/prepareAuthorization.js
9425
+ async function prepareAuthorization(client, parameters) {
9426
+ const { account: account_ = client.account, chainId, nonce } = parameters;
9427
+ if (!account_)
9428
+ throw new AccountNotFoundError({
9429
+ docsPath: "/docs/eip7702/prepareAuthorization"
9430
+ });
9431
+ const account = parseAccount(account_);
9432
+ const executor = (() => {
9433
+ if (!parameters.executor)
9434
+ return void 0;
9435
+ if (parameters.executor === "self")
9436
+ return parameters.executor;
9437
+ return parseAccount(parameters.executor);
9438
+ })();
9439
+ const authorization = {
9440
+ address: parameters.contractAddress ?? parameters.address,
9441
+ chainId,
9442
+ nonce
9443
+ };
9444
+ if (typeof authorization.chainId === "undefined")
9445
+ authorization.chainId = client.chain?.id ?? await getAction(client, getChainId, "getChainId")({});
9446
+ if (typeof authorization.nonce === "undefined") {
9447
+ authorization.nonce = await getAction(client, getTransactionCount, "getTransactionCount")({
9448
+ address: account.address,
9449
+ blockTag: "pending"
9450
+ });
9451
+ if (executor === "self" || executor?.address && isAddressEqual(executor.address, account.address))
9452
+ authorization.nonce += 1;
9453
+ }
9454
+ return authorization;
9455
+ }
9456
+
9457
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/requestAddresses.js
9458
+ async function requestAddresses(client) {
9459
+ const addresses = await client.request({ method: "eth_requestAccounts" }, { dedupe: true, retryCount: 0 });
9460
+ return addresses.map((address) => getAddress(address));
9461
+ }
9462
+
9463
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/requestPermissions.js
9464
+ async function requestPermissions(client, permissions) {
9465
+ return client.request({
9466
+ method: "wallet_requestPermissions",
9467
+ params: [permissions]
9468
+ }, { retryCount: 0 });
9469
+ }
9470
+
9471
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/sendCallsSync.js
9472
+ async function sendCallsSync(client, parameters) {
9473
+ const { chain = client.chain } = parameters;
9474
+ const timeout = parameters.timeout ?? Math.max((chain?.blockTime ?? 0) * 3, 5e3);
9475
+ const result = await getAction(client, sendCalls, "sendCalls")(parameters);
9476
+ const status = await getAction(client, waitForCallsStatus, "waitForCallsStatus")({
9477
+ ...parameters,
9478
+ id: result.id,
9479
+ timeout
9480
+ });
9481
+ return status;
9482
+ }
9483
+
9484
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/showCallsStatus.js
9485
+ async function showCallsStatus(client, parameters) {
9486
+ const { id } = parameters;
9487
+ await client.request({
9488
+ method: "wallet_showCallsStatus",
9489
+ params: [id]
9490
+ });
9491
+ return;
9492
+ }
9493
+
9494
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/signAuthorization.js
9495
+ async function signAuthorization(client, parameters) {
9496
+ const { account: account_ = client.account } = parameters;
9497
+ if (!account_)
9498
+ throw new AccountNotFoundError({
9499
+ docsPath: "/docs/eip7702/signAuthorization"
9500
+ });
9501
+ const account = parseAccount(account_);
9502
+ if (!account.signAuthorization)
9503
+ throw new AccountTypeNotSupportedError({
9504
+ docsPath: "/docs/eip7702/signAuthorization",
9505
+ metaMessages: [
9506
+ "The `signAuthorization` Action does not support JSON-RPC Accounts."
9507
+ ],
9508
+ type: account.type
9509
+ });
9510
+ const authorization = await prepareAuthorization(client, parameters);
9511
+ return account.signAuthorization(authorization);
9512
+ }
9513
+
9514
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/signMessage.js
9515
+ async function signMessage(client, { account: account_ = client.account, message }) {
9516
+ if (!account_)
9517
+ throw new AccountNotFoundError({
9518
+ docsPath: "/docs/actions/wallet/signMessage"
9519
+ });
9520
+ const account = parseAccount(account_);
9521
+ if (account.signMessage)
9522
+ return account.signMessage({ message });
9523
+ const message_ = (() => {
9524
+ if (typeof message === "string")
9525
+ return stringToHex(message);
9526
+ if (message.raw instanceof Uint8Array)
9527
+ return toHex(message.raw);
9528
+ return message.raw;
9529
+ })();
9530
+ return client.request({
9531
+ method: "personal_sign",
9532
+ params: [message_, account.address]
9533
+ }, { retryCount: 0 });
9534
+ }
9535
+
9536
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/signTransaction.js
9537
+ async function signTransaction(client, parameters) {
9538
+ const { account: account_ = client.account, chain = client.chain, ...transaction } = parameters;
9539
+ if (!account_)
9540
+ throw new AccountNotFoundError({
9541
+ docsPath: "/docs/actions/wallet/signTransaction"
9542
+ });
9543
+ const account = parseAccount(account_);
9544
+ assertRequest({
9545
+ account,
9546
+ ...parameters
9547
+ });
9548
+ const chainId = await getAction(client, getChainId, "getChainId")({});
9549
+ if (chain !== null)
9550
+ assertCurrentChain({
9551
+ currentChainId: chainId,
9552
+ chain
9553
+ });
9554
+ const formatters = chain?.formatters || client.chain?.formatters;
9555
+ const format = formatters?.transactionRequest?.format || formatTransactionRequest;
9556
+ if (account.signTransaction)
9557
+ return account.signTransaction({
9558
+ ...transaction,
9559
+ account,
9560
+ chainId
9561
+ }, { serializer: client.chain?.serializers?.transaction });
9562
+ return await client.request({
9563
+ method: "eth_signTransaction",
9564
+ params: [
9565
+ {
9566
+ ...format({
9567
+ ...transaction,
9568
+ account
9569
+ }, "signTransaction"),
9570
+ chainId: numberToHex(chainId),
9571
+ from: account.address
9572
+ }
9573
+ ]
9574
+ }, { retryCount: 0 });
9575
+ }
9576
+
9577
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/signTypedData.js
9578
+ async function signTypedData(client, parameters) {
9579
+ const { account: account_ = client.account, domain, message, primaryType } = parameters;
9580
+ if (!account_)
9581
+ throw new AccountNotFoundError({
9582
+ docsPath: "/docs/actions/wallet/signTypedData"
9583
+ });
9584
+ const account = parseAccount(account_);
9585
+ const types = {
9586
+ EIP712Domain: getTypesForEIP712Domain({ domain }),
9587
+ ...parameters.types
9588
+ };
9589
+ validateTypedData({ domain, message, primaryType, types });
9590
+ if (account.signTypedData)
9591
+ return account.signTypedData({ domain, message, primaryType, types });
9592
+ const typedData = serializeTypedData({ domain, message, primaryType, types });
9593
+ return client.request({
9594
+ method: "eth_signTypedData_v4",
9595
+ params: [account.address, typedData]
9596
+ }, { retryCount: 0 });
9597
+ }
9598
+
9599
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/switchChain.js
9600
+ async function switchChain(client, { id }) {
9601
+ await client.request({
9602
+ method: "wallet_switchEthereumChain",
9603
+ params: [
9604
+ {
9605
+ chainId: numberToHex(id)
9606
+ }
9607
+ ]
9608
+ }, { retryCount: 0 });
9609
+ }
9610
+
9611
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/watchAsset.js
9612
+ async function watchAsset(client, params) {
9613
+ const added = await client.request({
9614
+ method: "wallet_watchAsset",
9615
+ params
9616
+ }, { retryCount: 0 });
9617
+ return added;
9618
+ }
9619
+
9620
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/clients/decorators/wallet.js
9621
+ function walletActions(client) {
9622
+ return {
9623
+ addChain: (args) => addChain(client, args),
9624
+ deployContract: (args) => deployContract(client, args),
9625
+ fillTransaction: (args) => fillTransaction(client, args),
9626
+ getAddresses: () => getAddresses(client),
9627
+ getCallsStatus: (args) => getCallsStatus(client, args),
9628
+ getCapabilities: (args) => getCapabilities(client, args),
9629
+ getChainId: () => getChainId(client),
9630
+ getPermissions: () => getPermissions(client),
9631
+ prepareAuthorization: (args) => prepareAuthorization(client, args),
9632
+ prepareTransactionRequest: (args) => prepareTransactionRequest(client, args),
9633
+ requestAddresses: () => requestAddresses(client),
9634
+ requestPermissions: (args) => requestPermissions(client, args),
9635
+ sendCalls: (args) => sendCalls(client, args),
9636
+ sendCallsSync: (args) => sendCallsSync(client, args),
9637
+ sendRawTransaction: (args) => sendRawTransaction(client, args),
9638
+ sendRawTransactionSync: (args) => sendRawTransactionSync(client, args),
9639
+ sendTransaction: (args) => sendTransaction(client, args),
9640
+ sendTransactionSync: (args) => sendTransactionSync(client, args),
9641
+ showCallsStatus: (args) => showCallsStatus(client, args),
9642
+ signAuthorization: (args) => signAuthorization(client, args),
9643
+ signMessage: (args) => signMessage(client, args),
9644
+ signTransaction: (args) => signTransaction(client, args),
9645
+ signTypedData: (args) => signTypedData(client, args),
9646
+ switchChain: (args) => switchChain(client, args),
9647
+ waitForCallsStatus: (args) => waitForCallsStatus(client, args),
9648
+ watchAsset: (args) => watchAsset(client, args),
9649
+ writeContract: (args) => writeContract(client, args),
9650
+ writeContractSync: (args) => writeContractSync(client, args),
9651
+ token: {
9652
+ approve: bindActionDecorators(client, approve),
9653
+ approveSync: bindActionDecorators(client, approveSync),
9654
+ transfer: bindActionDecorators(client, transfer),
9655
+ transferSync: bindActionDecorators(client, transferSync)
9656
+ }
9657
+ };
9658
+ }
9659
+
9660
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/clients/createWalletClient.js
9661
+ function createWalletClient(parameters) {
9662
+ const { key = "wallet", name = "Wallet Client", transport } = parameters;
9663
+ const client = createClient({
9664
+ ...parameters,
9665
+ key,
9666
+ name,
9667
+ transport,
9668
+ type: "walletClient"
9669
+ });
9670
+ return client.extend(walletActions);
9671
+ }
9672
+
7011
9673
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/clients/transports/createTransport.js
7012
9674
  function createTransport({ key, methods, name, request, retryCount = 3, retryDelay = 150, timeout, type }, value) {
7013
9675
  const uid2 = uid();
@@ -7027,6 +9689,153 @@ function createTransport({ key, methods, name, request, retryCount = 3, retryDel
7027
9689
  };
7028
9690
  }
7029
9691
 
9692
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/clients/transports/custom.js
9693
+ function custom(provider, config = {}) {
9694
+ const { key = "custom", methods, name = "Custom Provider", retryDelay } = config;
9695
+ return ({ retryCount: defaultRetryCount }) => createTransport({
9696
+ key,
9697
+ methods,
9698
+ name,
9699
+ request: provider.request.bind(provider),
9700
+ retryCount: config.retryCount ?? defaultRetryCount,
9701
+ retryDelay,
9702
+ type: "custom"
9703
+ });
9704
+ }
9705
+
9706
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/clients/transports/fallback.js
9707
+ function fallback(transports_, config = {}) {
9708
+ const { key = "fallback", name = "Fallback", rank = false, shouldThrow: shouldThrow_ = shouldThrow, retryCount, retryDelay } = config;
9709
+ return (({ chain, pollingInterval = 4e3, timeout, ...rest }) => {
9710
+ let transports = transports_;
9711
+ let onResponse = () => {
9712
+ };
9713
+ const transport = createTransport({
9714
+ key,
9715
+ name,
9716
+ async request({ method, params }) {
9717
+ let includes;
9718
+ const fetch2 = async (i = 0) => {
9719
+ const transport2 = transports[i]({
9720
+ ...rest,
9721
+ chain,
9722
+ retryCount: 0,
9723
+ timeout
9724
+ });
9725
+ try {
9726
+ const response = await transport2.request({
9727
+ method,
9728
+ params
9729
+ });
9730
+ onResponse({
9731
+ method,
9732
+ params,
9733
+ response,
9734
+ transport: transport2,
9735
+ status: "success"
9736
+ });
9737
+ return response;
9738
+ } catch (err) {
9739
+ onResponse({
9740
+ error: err,
9741
+ method,
9742
+ params,
9743
+ transport: transport2,
9744
+ status: "error"
9745
+ });
9746
+ if (shouldThrow_(err))
9747
+ throw err;
9748
+ if (i === transports.length - 1)
9749
+ throw err;
9750
+ includes ??= transports.slice(i + 1).some((transport3) => {
9751
+ const { include, exclude } = transport3({ chain }).config.methods || {};
9752
+ if (include)
9753
+ return include.includes(method);
9754
+ if (exclude)
9755
+ return !exclude.includes(method);
9756
+ return true;
9757
+ });
9758
+ if (!includes)
9759
+ throw err;
9760
+ return fetch2(i + 1);
9761
+ }
9762
+ };
9763
+ return fetch2();
9764
+ },
9765
+ retryCount,
9766
+ retryDelay,
9767
+ type: "fallback"
9768
+ }, {
9769
+ onResponse: (fn) => onResponse = fn,
9770
+ transports: transports.map((fn) => fn({ chain, retryCount: 0 }))
9771
+ });
9772
+ if (rank) {
9773
+ const rankOptions = typeof rank === "object" ? rank : {};
9774
+ rankTransports({
9775
+ chain,
9776
+ interval: rankOptions.interval ?? pollingInterval,
9777
+ onTransports: (transports_2) => transports = transports_2,
9778
+ ping: rankOptions.ping,
9779
+ sampleCount: rankOptions.sampleCount,
9780
+ timeout: rankOptions.timeout,
9781
+ transports,
9782
+ weights: rankOptions.weights
9783
+ });
9784
+ }
9785
+ return transport;
9786
+ });
9787
+ }
9788
+ function shouldThrow(error) {
9789
+ if ("code" in error && typeof error.code === "number") {
9790
+ if (error.code === TransactionRejectedRpcError.code || error.code === UserRejectedRequestError.code || error.code === WalletConnectSessionSettlementError.code || ExecutionRevertedError.nodeMessage.test(error.message) || error.code === 5e3)
9791
+ return true;
9792
+ }
9793
+ return false;
9794
+ }
9795
+ function rankTransports({ chain, interval = 4e3, onTransports, ping, sampleCount = 10, timeout = 1e3, transports, weights = {} }) {
9796
+ const { stability: stabilityWeight = 0.7, latency: latencyWeight = 0.3 } = weights;
9797
+ const samples = [];
9798
+ const rankTransports_ = async () => {
9799
+ const sample = await Promise.all(transports.map(async (transport) => {
9800
+ const transport_ = transport({ chain, retryCount: 0, timeout });
9801
+ const start = Date.now();
9802
+ let end;
9803
+ let success;
9804
+ try {
9805
+ await (ping ? ping({ transport: transport_ }) : transport_.request({ method: "net_listening" }));
9806
+ success = 1;
9807
+ } catch {
9808
+ success = 0;
9809
+ } finally {
9810
+ end = Date.now();
9811
+ }
9812
+ const latency = end - start;
9813
+ return { latency, success };
9814
+ }));
9815
+ samples.push(sample);
9816
+ if (samples.length > sampleCount)
9817
+ samples.shift();
9818
+ const maxLatency = Math.max(...samples.map((sample2) => Math.max(...sample2.map(({ latency }) => latency))));
9819
+ const scores = transports.map((_, i) => {
9820
+ const latencies = samples.map((sample2) => sample2[i].latency);
9821
+ const meanLatency = latencies.reduce((acc, latency) => acc + latency, 0) / latencies.length;
9822
+ const latencyScore = 1 - meanLatency / maxLatency;
9823
+ const successes = samples.map((sample2) => sample2[i].success);
9824
+ const stabilityScore = successes.reduce((acc, success) => acc + success, 0) / successes.length;
9825
+ if (stabilityScore === 0)
9826
+ return [0, i];
9827
+ return [
9828
+ latencyWeight * latencyScore + stabilityWeight * stabilityScore,
9829
+ i
9830
+ ];
9831
+ }).sort((a, b) => b[0] - a[0]);
9832
+ onTransports(scores.map(([, i]) => transports[i]));
9833
+ await wait(interval);
9834
+ rankTransports_();
9835
+ };
9836
+ rankTransports_();
9837
+ }
9838
+
7030
9839
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/transport.js
7031
9840
  var UrlRequiredError = class extends BaseError {
7032
9841
  constructor() {
@@ -7114,194 +9923,383 @@ function http(url, config = {}) {
7114
9923
  };
7115
9924
  }
7116
9925
 
7117
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/op-stack/contracts.js
7118
- var contracts = {
7119
- gasPriceOracle: { address: "0x420000000000000000000000000000000000000F" },
7120
- l1Block: { address: "0x4200000000000000000000000000000000000015" },
7121
- l2CrossDomainMessenger: {
7122
- address: "0x4200000000000000000000000000000000000007"
7123
- },
7124
- l2Erc721Bridge: { address: "0x4200000000000000000000000000000000000014" },
7125
- l2StandardBridge: { address: "0x4200000000000000000000000000000000000010" },
7126
- l2ToL1MessagePasser: {
7127
- address: "0x4200000000000000000000000000000000000016"
9926
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/clients/transports/webSocket.js
9927
+ function webSocket(url, config = {}) {
9928
+ const { keepAlive, key = "webSocket", methods, name = "WebSocket JSON-RPC", reconnect, retryDelay } = config;
9929
+ return ({ chain, retryCount: retryCount_, timeout: timeout_ }) => {
9930
+ const retryCount = config.retryCount ?? retryCount_;
9931
+ const timeout = timeout_ ?? config.timeout ?? 1e4;
9932
+ const url_ = url || chain?.rpcUrls.default.webSocket?.[0];
9933
+ const wsRpcClientOpts = { keepAlive, reconnect };
9934
+ if (!url_)
9935
+ throw new UrlRequiredError();
9936
+ return createTransport({
9937
+ key,
9938
+ methods,
9939
+ name,
9940
+ async request({ method, params }) {
9941
+ const body = { method, params };
9942
+ const rpcClient = await getWebSocketRpcClient(url_, wsRpcClientOpts);
9943
+ const { error, result } = await rpcClient.requestAsync({
9944
+ body,
9945
+ timeout
9946
+ });
9947
+ if (error)
9948
+ throw new RpcRequestError({
9949
+ body,
9950
+ error,
9951
+ url: url_
9952
+ });
9953
+ return result;
9954
+ },
9955
+ retryCount,
9956
+ retryDelay,
9957
+ timeout,
9958
+ type: "webSocket"
9959
+ }, {
9960
+ getSocket() {
9961
+ return getSocket(url_);
9962
+ },
9963
+ getRpcClient() {
9964
+ return getWebSocketRpcClient(url_, wsRpcClientOpts);
9965
+ },
9966
+ async subscribe({ params, onData, onError }) {
9967
+ const rpcClient = await getWebSocketRpcClient(url_, wsRpcClientOpts);
9968
+ const { result: subscriptionId } = await new Promise((resolve, reject) => rpcClient.request({
9969
+ body: {
9970
+ method: "eth_subscribe",
9971
+ params
9972
+ },
9973
+ onError(error) {
9974
+ reject(error);
9975
+ onError?.(error);
9976
+ return;
9977
+ },
9978
+ onResponse(response) {
9979
+ if (response.error) {
9980
+ reject(response.error);
9981
+ onError?.(response.error);
9982
+ return;
9983
+ }
9984
+ if (typeof response.id === "number") {
9985
+ resolve(response);
9986
+ return;
9987
+ }
9988
+ if (response.method !== "eth_subscription")
9989
+ return;
9990
+ onData(response.params);
9991
+ }
9992
+ }));
9993
+ return {
9994
+ subscriptionId,
9995
+ async unsubscribe() {
9996
+ return new Promise((resolve) => rpcClient.request({
9997
+ body: {
9998
+ method: "eth_unsubscribe",
9999
+ params: [subscriptionId]
10000
+ },
10001
+ onResponse: resolve
10002
+ }));
10003
+ }
10004
+ };
10005
+ }
10006
+ });
10007
+ };
10008
+ }
10009
+
10010
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/types/eip1193.js
10011
+ var ProviderRpcError = class extends Error {
10012
+ constructor(code, message) {
10013
+ super(message);
10014
+ Object.defineProperty(this, "code", {
10015
+ enumerable: true,
10016
+ configurable: true,
10017
+ writable: true,
10018
+ value: void 0
10019
+ });
10020
+ Object.defineProperty(this, "details", {
10021
+ enumerable: true,
10022
+ configurable: true,
10023
+ writable: true,
10024
+ value: void 0
10025
+ });
10026
+ this.code = code;
10027
+ this.details = message;
7128
10028
  }
7129
10029
  };
7130
10030
 
7131
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/op-stack/formatters.js
7132
- var formatters = {
7133
- block: /* @__PURE__ */ defineBlock({
7134
- format(args) {
7135
- const transactions = args.transactions?.map((transaction) => {
7136
- if (typeof transaction === "string")
7137
- return transaction;
7138
- const formatted = formatTransaction(transaction);
7139
- if (formatted.typeHex === "0x7e") {
7140
- formatted.isSystemTx = transaction.isSystemTx;
7141
- formatted.mint = transaction.mint ? hexToBigInt(transaction.mint) : void 0;
7142
- formatted.sourceHash = transaction.sourceHash;
7143
- formatted.type = "deposit";
10031
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/decodeDeployData.js
10032
+ var docsPath3 = "/docs/contract/decodeDeployData";
10033
+ function decodeDeployData(parameters) {
10034
+ const { abi: abi2, bytecode, data } = parameters;
10035
+ if (data === bytecode)
10036
+ return { bytecode };
10037
+ const description = abi2.find((x) => "type" in x && x.type === "constructor");
10038
+ if (!description)
10039
+ throw new AbiConstructorNotFoundError({ docsPath: docsPath3 });
10040
+ if (!("inputs" in description))
10041
+ throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath3 });
10042
+ if (!description.inputs || description.inputs.length === 0)
10043
+ throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath3 });
10044
+ const args = decodeAbiParameters(description.inputs, `0x${data.replace(bytecode, "")}`);
10045
+ return { args, bytecode };
10046
+ }
10047
+
10048
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/blob/fromBlobs.js
10049
+ function fromBlobs(parameters) {
10050
+ const to = parameters.to ?? (typeof parameters.blobs[0] === "string" ? "hex" : "bytes");
10051
+ const blobs = typeof parameters.blobs[0] === "string" ? parameters.blobs.map((x) => hexToBytes(x)) : parameters.blobs;
10052
+ const length = blobs.reduce((length2, blob) => length2 + blob.length, 0);
10053
+ const data = createCursor(new Uint8Array(length));
10054
+ let active = true;
10055
+ for (const blob of blobs) {
10056
+ const cursor = createCursor(blob);
10057
+ while (active && cursor.position < blob.length) {
10058
+ cursor.incrementPosition(1);
10059
+ let consume = 31;
10060
+ if (blob.length - cursor.position < 31)
10061
+ consume = blob.length - cursor.position;
10062
+ for (const _ in Array.from({ length: consume })) {
10063
+ const byte = cursor.readByte();
10064
+ const isTerminator = byte === 128 && !cursor.inspectBytes(cursor.remaining).includes(128);
10065
+ if (isTerminator) {
10066
+ active = false;
10067
+ break;
7144
10068
  }
7145
- return formatted;
7146
- });
7147
- return {
7148
- transactions,
7149
- stateRoot: args.stateRoot
7150
- };
7151
- }
7152
- }),
7153
- transaction: /* @__PURE__ */ defineTransaction({
7154
- format(args) {
7155
- const transaction = {};
7156
- if (args.type === "0x7e") {
7157
- transaction.isSystemTx = args.isSystemTx;
7158
- transaction.mint = args.mint ? hexToBigInt(args.mint) : void 0;
7159
- transaction.sourceHash = args.sourceHash;
7160
- transaction.type = "deposit";
10069
+ data.pushByte(byte);
7161
10070
  }
7162
- return transaction;
7163
- }
7164
- }),
7165
- transactionReceipt: /* @__PURE__ */ defineTransactionReceipt({
7166
- format(args) {
7167
- return {
7168
- ...args.depositNonce ? { depositNonce: hexToBigInt(args.depositNonce) } : {},
7169
- ...args.depositReceiptVersion ? { depositReceiptVersion: hexToNumber(args.depositReceiptVersion) } : {},
7170
- l1GasPrice: args.l1GasPrice ? hexToBigInt(args.l1GasPrice) : null,
7171
- l1GasUsed: args.l1GasUsed ? hexToBigInt(args.l1GasUsed) : null,
7172
- l1Fee: args.l1Fee ? hexToBigInt(args.l1Fee) : null,
7173
- l1FeeScalar: args.l1FeeScalar ? Number(args.l1FeeScalar) : null
7174
- };
7175
10071
  }
7176
- })
7177
- };
10072
+ }
10073
+ const trimmedData = data.bytes.slice(0, data.position);
10074
+ return to === "hex" ? bytesToHex(trimmedData) : trimmedData;
10075
+ }
7178
10076
 
7179
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/op-stack/serializers.js
7180
- function serializeTransaction2(transaction, signature) {
7181
- if (isDeposit(transaction))
7182
- return serializeTransactionDeposit(transaction);
7183
- return serializeTransaction(transaction, signature);
10077
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/blob/sidecarsToVersionedHashes.js
10078
+ function sidecarsToVersionedHashes(parameters) {
10079
+ const { sidecars, version } = parameters;
10080
+ const to = parameters.to ?? (typeof sidecars[0].blob === "string" ? "hex" : "bytes");
10081
+ const hashes = [];
10082
+ for (const { commitment } of sidecars) {
10083
+ hashes.push(commitmentToVersionedHash({
10084
+ commitment,
10085
+ to,
10086
+ version
10087
+ }));
10088
+ }
10089
+ return hashes;
7184
10090
  }
7185
- var serializers = {
7186
- transaction: serializeTransaction2
7187
- };
7188
- function serializeTransactionDeposit(transaction) {
7189
- assertTransactionDeposit(transaction);
7190
- const { sourceHash, data, from: from14, gas, isSystemTx, mint, to, value } = transaction;
7191
- const serializedTransaction = [
7192
- sourceHash,
7193
- from14,
7194
- to ?? "0x",
7195
- mint ? toHex(mint) : "0x",
7196
- value ? toHex(value) : "0x",
7197
- gas ? toHex(gas) : "0x",
7198
- isSystemTx ? "0x1" : "0x",
7199
- data ?? "0x"
7200
- ];
7201
- return concatHex([
7202
- "0x7e",
7203
- toRlp(serializedTransaction)
7204
- ]);
10091
+
10092
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/ens/toCoinType.js
10093
+ var SLIP44_MSB = 2147483648;
10094
+ function toCoinType(chainId) {
10095
+ if (chainId === 1)
10096
+ return 60n;
10097
+ if (chainId >= SLIP44_MSB || chainId < 0)
10098
+ throw new EnsInvalidChainIdError({ chainId });
10099
+ return BigInt((2147483648 | chainId) >>> 0);
7205
10100
  }
7206
- function isDeposit(transaction) {
7207
- if (transaction.type === "deposit")
7208
- return true;
7209
- if (typeof transaction.sourceHash !== "undefined")
7210
- return true;
7211
- return false;
10101
+
10102
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/kzg/defineKzg.js
10103
+ function defineKzg({ blobToKzgCommitment, computeBlobKzgProof }) {
10104
+ return {
10105
+ blobToKzgCommitment,
10106
+ computeBlobKzgProof
10107
+ };
7212
10108
  }
7213
- function assertTransactionDeposit(transaction) {
7214
- const { from: from14, to } = transaction;
7215
- if (from14 && !isAddress(from14))
7216
- throw new InvalidAddressError({ address: from14 });
7217
- if (to && !isAddress(to))
7218
- throw new InvalidAddressError({ address: to });
10109
+
10110
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/kzg/setupKzg.js
10111
+ function setupKzg(parameters, path) {
10112
+ try {
10113
+ parameters.loadTrustedSetup(path);
10114
+ } catch (e) {
10115
+ const error = e;
10116
+ if (!error.message.includes("trusted setup is already loaded"))
10117
+ throw error;
10118
+ }
10119
+ return defineKzg(parameters);
7219
10120
  }
7220
10121
 
7221
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/op-stack/chainConfig.js
7222
- var chainConfig = {
7223
- blockTime: 2e3,
7224
- contracts,
7225
- formatters,
7226
- serializers
7227
- };
10122
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/compactSignatureToSignature.js
10123
+ function compactSignatureToSignature({ r, yParityAndS }) {
10124
+ const yParityAndS_bytes = hexToBytes(yParityAndS);
10125
+ const yParity = yParityAndS_bytes[0] & 128 ? 1 : 0;
10126
+ const s = yParityAndS_bytes;
10127
+ if (yParity === 1)
10128
+ s[0] &= 127;
10129
+ return { r, s: bytesToHex(s), yParity };
10130
+ }
7228
10131
 
7229
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/chains/definitions/base.js
7230
- var sourceId = 1;
7231
- var base = /* @__PURE__ */ defineChain({
7232
- ...chainConfig,
7233
- id: 8453,
7234
- name: "Base",
7235
- nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
7236
- rpcUrls: {
7237
- default: {
7238
- http: ["https://mainnet.base.org"]
7239
- }
7240
- },
7241
- blockExplorers: {
7242
- default: {
7243
- name: "Basescan",
7244
- url: "https://basescan.org",
7245
- apiUrl: "https://api.basescan.org/api"
7246
- }
7247
- },
7248
- contracts: {
7249
- ...chainConfig.contracts,
7250
- disputeGameFactory: {
7251
- [sourceId]: {
7252
- address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"
7253
- }
7254
- },
7255
- l2OutputOracle: {
7256
- [sourceId]: {
7257
- address: "0x56315b90c40730925ec5485cf004d835058518A0"
7258
- }
7259
- },
7260
- multicall3: {
7261
- address: "0xca11bde05977b3631167028862be2a173976ca11",
7262
- blockCreated: 5022
7263
- },
7264
- portal: {
7265
- [sourceId]: {
7266
- address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",
7267
- blockCreated: 17482143
7268
- }
7269
- },
7270
- l1StandardBridge: {
7271
- [sourceId]: {
7272
- address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35",
7273
- blockCreated: 17482143
7274
- }
7275
- }
7276
- },
7277
- sourceId
7278
- });
7279
- var basePreconf = /* @__PURE__ */ defineChain({
7280
- ...base,
7281
- experimental_preconfirmationTime: 200,
7282
- rpcUrls: {
7283
- default: {
7284
- http: ["https://mainnet-preconf.base.org"]
7285
- }
7286
- }
7287
- });
10132
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/parseCompactSignature.js
10133
+ function parseCompactSignature(signatureHex) {
10134
+ const { r, s } = secp256k1.Signature.fromCompact(signatureHex.slice(2, 130));
10135
+ return {
10136
+ r: numberToHex(r, { size: 32 }),
10137
+ yParityAndS: numberToHex(s, { size: 32 })
10138
+ };
10139
+ }
7288
10140
 
7289
- // src/lib/usdc.ts
7290
- var USDC_ADDRESS = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
7291
- var USDC_DECIMALS = 6;
7292
- async function getUsdcBalance(address, rpcUrl) {
7293
- const client = createPublicClient({ chain: base, transport: http(rpcUrl) });
7294
- return client.readContract({
7295
- address: USDC_ADDRESS,
7296
- abi: erc20Abi,
7297
- functionName: "balanceOf",
7298
- args: [address]
10141
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/parseSignature.js
10142
+ function parseSignature(signatureHex) {
10143
+ const { r, s } = secp256k1.Signature.fromCompact(signatureHex.slice(2, 130));
10144
+ const yParityOrV = Number(`0x${signatureHex.slice(130)}`);
10145
+ const [v, yParity] = (() => {
10146
+ if (yParityOrV === 0 || yParityOrV === 1)
10147
+ return [void 0, yParityOrV];
10148
+ if (yParityOrV === 27)
10149
+ return [BigInt(yParityOrV), 0];
10150
+ if (yParityOrV === 28)
10151
+ return [BigInt(yParityOrV), 1];
10152
+ throw new Error("Invalid yParityOrV value");
10153
+ })();
10154
+ if (typeof v !== "undefined")
10155
+ return {
10156
+ r: numberToHex(r, { size: 32 }),
10157
+ s: numberToHex(s, { size: 32 }),
10158
+ v,
10159
+ yParity
10160
+ };
10161
+ return {
10162
+ r: numberToHex(r, { size: 32 }),
10163
+ s: numberToHex(s, { size: 32 }),
10164
+ yParity
10165
+ };
10166
+ }
10167
+
10168
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/recoverTransactionAddress.js
10169
+ async function recoverTransactionAddress(parameters) {
10170
+ const { serializedTransaction, signature: signature_ } = parameters;
10171
+ const transaction = parseTransaction(serializedTransaction);
10172
+ const signature = signature_ ?? {
10173
+ r: transaction.r,
10174
+ s: transaction.s,
10175
+ v: transaction.v,
10176
+ yParity: transaction.yParity
10177
+ };
10178
+ const serialized = serializeTransaction({
10179
+ ...transaction,
10180
+ r: void 0,
10181
+ s: void 0,
10182
+ v: void 0,
10183
+ yParity: void 0,
10184
+ sidecars: void 0
7299
10185
  });
10186
+ return await recoverAddress({
10187
+ hash: keccak256(serialized),
10188
+ signature
10189
+ });
10190
+ }
10191
+
10192
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/serializeCompactSignature.js
10193
+ function serializeCompactSignature({ r, yParityAndS }) {
10194
+ return `0x${new secp256k1.Signature(hexToBigInt(r), hexToBigInt(yParityAndS)).toCompactHex()}`;
10195
+ }
10196
+
10197
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/signatureToCompactSignature.js
10198
+ function signatureToCompactSignature(signature) {
10199
+ const { r, s, v, yParity } = signature;
10200
+ const yParity_ = Number(yParity ?? v - 27n);
10201
+ let yParityAndS = s;
10202
+ if (yParity_ === 1) {
10203
+ const bytes = hexToBytes(s);
10204
+ bytes[0] |= 128;
10205
+ yParityAndS = bytesToHex(bytes);
10206
+ }
10207
+ return { r, yParityAndS };
7300
10208
  }
7301
10209
 
7302
10210
  export {
7303
- USDC_ADDRESS,
7304
- USDC_DECIMALS,
7305
- getUsdcBalance
10211
+ FilterTypeNotSupportedError,
10212
+ encodeEventTopics,
10213
+ getContractError,
10214
+ recoverPublicKey,
10215
+ recoverAddress,
10216
+ EstimateGasExecutionError,
10217
+ BaseFeeScalarError,
10218
+ Eip1559FeesNotSupportedError,
10219
+ MaxFeePerGasTooLowError,
10220
+ BlockNotFoundError,
10221
+ transactionType,
10222
+ formatTransaction,
10223
+ defineTransaction,
10224
+ formatBlock,
10225
+ defineBlock,
10226
+ formatLog,
10227
+ decodeEventLog,
10228
+ parseEventLogs,
10229
+ withCache,
10230
+ assertCurrentChain,
10231
+ getContract,
10232
+ BundleFailedError,
10233
+ withRetry,
10234
+ formatTransactionReceipt,
10235
+ defineTransactionReceipt,
10236
+ WaitForCallsStatusTimeoutError,
10237
+ createClient,
10238
+ rpcSchema,
10239
+ namehash,
10240
+ labelhash,
10241
+ EnsAvatarInvalidNftUriError,
10242
+ EnsAvatarUriResolutionError,
10243
+ EnsAvatarUnsupportedNamespaceError,
10244
+ EnsInvalidChainIdError,
10245
+ encodePacked,
10246
+ isBytes,
10247
+ getContractAddress,
10248
+ getCreateAddress,
10249
+ getCreate2Address,
10250
+ ccipReadTunnel,
10251
+ defineChain,
10252
+ extendSchema,
10253
+ extractChain,
10254
+ fromRlp,
10255
+ isHash,
10256
+ ripemd1602 as ripemd160,
10257
+ withTimeout,
10258
+ zeroHash,
10259
+ isErc6492Signature,
10260
+ isErc8010Signature,
10261
+ parseErc6492Signature,
10262
+ parseErc8010Signature,
10263
+ recoverMessageAddress,
10264
+ recoverTypedDataAddress,
10265
+ serializeErc6492Signature,
10266
+ serializeErc8010Signature,
10267
+ verifyHash,
10268
+ verifyMessage,
10269
+ verifyTypedData,
10270
+ getSerializedTransactionType,
10271
+ parseTransaction,
10272
+ InvalidDecimalNumberError,
10273
+ parseUnits,
10274
+ parseEther,
10275
+ parseGwei,
10276
+ ethAddress,
10277
+ zeroAddress,
10278
+ publicActions,
10279
+ createPublicClient,
10280
+ testActions,
10281
+ createTestClient,
10282
+ walletActions,
10283
+ createWalletClient,
10284
+ createTransport,
10285
+ custom,
10286
+ fallback,
10287
+ shouldThrow,
10288
+ UrlRequiredError,
10289
+ http,
10290
+ webSocket,
10291
+ ProviderRpcError,
10292
+ decodeDeployData,
10293
+ fromBlobs,
10294
+ sidecarsToVersionedHashes,
10295
+ toCoinType,
10296
+ defineKzg,
10297
+ setupKzg,
10298
+ compactSignatureToSignature,
10299
+ parseCompactSignature,
10300
+ parseSignature,
10301
+ recoverTransactionAddress,
10302
+ serializeCompactSignature,
10303
+ signatureToCompactSignature
7306
10304
  };
7307
- //# sourceMappingURL=chunk-PAAL45FJ.js.map
10305
+ //# sourceMappingURL=chunk-7FK2UN2T.js.map