tenjin-cli 0.1.0-alpha.1 → 0.1.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/NOTICE.md +33 -0
  2. package/README.md +164 -16
  3. package/dist/{_esm-ZH2J4QEH.js → _esm-C5CRWCYU.js} +2 -2
  4. package/dist/_esm-FEASBWRP.js +881 -0
  5. package/dist/buy-U35DQ6XM.js +1598 -0
  6. package/dist/buy-U35DQ6XM.js.map +1 -0
  7. package/dist/candidate-RLYCQMF5.js +127 -0
  8. package/dist/candidate-RLYCQMF5.js.map +1 -0
  9. package/dist/{ccip-UCLT5VOW.js → ccip-NQXCEK2U.js} +6 -5
  10. package/dist/ccip-XR5NE5QK.js +19 -0
  11. package/dist/chunk-27ONARHV.js +171 -0
  12. package/dist/chunk-27ONARHV.js.map +1 -0
  13. package/dist/chunk-2I4QTOLB.js +11 -0
  14. package/dist/chunk-2I4QTOLB.js.map +1 -0
  15. package/dist/chunk-3OV7E5G5.js +18 -0
  16. package/dist/chunk-3OV7E5G5.js.map +1 -0
  17. package/dist/chunk-5CLSD5YN.js +209 -0
  18. package/dist/chunk-5CLSD5YN.js.map +1 -0
  19. package/dist/chunk-7KUW4MJD.js +59 -0
  20. package/dist/chunk-7KUW4MJD.js.map +1 -0
  21. package/dist/{doctor-3QBYN46N.js → chunk-7PHSZKQS.js} +88 -93
  22. package/dist/chunk-7PHSZKQS.js.map +1 -0
  23. package/dist/chunk-CYOF7ROH.js +70 -0
  24. package/dist/chunk-CYOF7ROH.js.map +1 -0
  25. package/dist/chunk-HIVZG55D.js +204 -0
  26. package/dist/chunk-HIVZG55D.js.map +1 -0
  27. package/dist/chunk-HSDCI7OV.js +7806 -0
  28. package/dist/chunk-HSDCI7OV.js.map +1 -0
  29. package/dist/{chunk-EZROUI5U.js → chunk-IYLHQMT5.js} +85 -9
  30. package/dist/chunk-IYLHQMT5.js.map +1 -0
  31. package/dist/chunk-JPHG2JW3.js +96 -0
  32. package/dist/chunk-JPHG2JW3.js.map +1 -0
  33. package/dist/{chunk-ZPZFPVDN.js → chunk-MUBUQVC3.js} +1 -1
  34. package/dist/chunk-MUBUQVC3.js.map +1 -0
  35. package/dist/chunk-N62ROTMC.js +79 -0
  36. package/dist/chunk-N62ROTMC.js.map +1 -0
  37. package/dist/{chunk-T4LKNY7T.js → chunk-NCE5NSN6.js} +166 -11
  38. package/dist/chunk-NCE5NSN6.js.map +1 -0
  39. package/dist/{chunk-YG2DO46P.js → chunk-OYMYCW7J.js} +18 -3
  40. package/dist/{chunk-YG2DO46P.js.map → chunk-OYMYCW7J.js.map} +1 -1
  41. package/dist/chunk-QNP7H47L.js +152 -0
  42. package/dist/chunk-QNP7H47L.js.map +1 -0
  43. package/dist/{chunk-Q53IYV2G.js → chunk-QVX5MWJZ.js} +20 -17
  44. package/dist/{chunk-Q53IYV2G.js.map → chunk-QVX5MWJZ.js.map} +1 -1
  45. package/dist/{chunk-CUWUHTIL.js → chunk-RBJPAZFI.js} +16 -202
  46. package/dist/chunk-RBJPAZFI.js.map +1 -0
  47. package/dist/chunk-RRN3YTK7.js +6199 -0
  48. package/dist/chunk-RRN3YTK7.js.map +1 -0
  49. package/dist/chunk-RY4XKNV3.js +140 -0
  50. package/dist/chunk-RY4XKNV3.js.map +1 -0
  51. package/dist/chunk-S3IGX57D.js +14682 -0
  52. package/dist/chunk-S3IGX57D.js.map +1 -0
  53. package/dist/{config-CEFTL5ZL.js → chunk-TFGSOPWR.js} +115 -18
  54. package/dist/chunk-TFGSOPWR.js.map +1 -0
  55. package/dist/chunk-TLCMMYLY.js +126 -0
  56. package/dist/chunk-TLCMMYLY.js.map +1 -0
  57. package/dist/{chunk-IPOWB3G3.js → chunk-UGX7YPX2.js} +3314 -306
  58. package/dist/chunk-UGX7YPX2.js.map +1 -0
  59. package/dist/chunk-UO22YNY4.js +69 -0
  60. package/dist/chunk-UO22YNY4.js.map +1 -0
  61. package/dist/chunk-UPIEAMGH.js +160 -0
  62. package/dist/chunk-UPIEAMGH.js.map +1 -0
  63. package/dist/chunk-XJIW7USF.js +217 -0
  64. package/dist/chunk-XJIW7USF.js.map +1 -0
  65. package/dist/{chunk-BRJHUQSY.js → chunk-YALGASEU.js} +1548 -1452
  66. package/dist/chunk-YALGASEU.js.map +1 -0
  67. package/dist/chunk-YIYQ2ZNT.js +286 -0
  68. package/dist/chunk-YIYQ2ZNT.js.map +1 -0
  69. package/dist/{chunk-DXPYFVKG.js → chunk-YN5SHIXQ.js} +6 -6
  70. package/dist/chunk-YN5SHIXQ.js.map +1 -0
  71. package/dist/chunk-Z52RA3NC.js +137 -0
  72. package/dist/chunk-Z52RA3NC.js.map +1 -0
  73. package/dist/{chunk-EXBMF5X7.js → chunk-Z6MFJV5Z.js} +151 -19
  74. package/dist/chunk-Z6MFJV5Z.js.map +1 -0
  75. package/dist/chunk-ZABPQJ3M.js +83 -0
  76. package/dist/chunk-ZABPQJ3M.js.map +1 -0
  77. package/dist/{chunk-LPRVHM7P.js → chunk-ZMHYXMO6.js} +1655 -114
  78. package/dist/chunk-ZMHYXMO6.js.map +1 -0
  79. package/dist/{chunk-3IMLRUZE.js → chunk-ZXTAQYNA.js} +6 -2
  80. package/dist/{cli-WA65NP4Y.js → cli-4NNBEQYH.js} +177 -177
  81. package/dist/cli-4NNBEQYH.js.map +1 -0
  82. package/dist/config-2VSXWWHK.js +21 -0
  83. package/dist/doctor-JJPNIBYH.js +20 -0
  84. package/dist/doctor-JJPNIBYH.js.map +1 -0
  85. package/dist/ethersCompat-Df4a6QIZ-3YZIAXDK.js +18 -0
  86. package/dist/ethersCompat-Df4a6QIZ-3YZIAXDK.js.map +1 -0
  87. package/dist/index.js +1 -1
  88. package/dist/inspect-JGYJWFDP.js +96 -0
  89. package/dist/inspect-JGYJWFDP.js.map +1 -0
  90. package/dist/install-ZQRMSRGW.js +378 -0
  91. package/dist/install-ZQRMSRGW.js.map +1 -0
  92. package/dist/lookup-WYVTOMVY.js +113 -0
  93. package/dist/lookup-WYVTOMVY.js.map +1 -0
  94. package/dist/{mine.wasm-GQECMSGN.js → mine.wasm-6PIT3DK6.js} +2 -2
  95. package/dist/outcome-HKKT6QIA.js +66 -0
  96. package/dist/outcome-HKKT6QIA.js.map +1 -0
  97. package/dist/publish-D76B3MBK.js +1480 -0
  98. package/dist/publish-D76B3MBK.js.map +1 -0
  99. package/dist/{secp256k1-BEZS642W.js → secp256k1-N3ZHU7LB.js} +5 -4
  100. package/dist/secp256k1-N3ZHU7LB.js.map +1 -0
  101. package/dist/usdc-JIAJW4SV.js +22 -0
  102. package/dist/usdc-JIAJW4SV.js.map +1 -0
  103. package/dist/viemAdapter-By13KInL-ZZE6UV4Y.js +14 -0
  104. package/dist/viemAdapter-By13KInL-ZZE6UV4Y.js.map +1 -0
  105. package/dist/{wallet-XD576HF3.js → wallet-6QKS6UHW.js} +28 -22
  106. package/dist/{wallet-XD576HF3.js.map → wallet-6QKS6UHW.js.map} +1 -1
  107. package/dist/wallet-PA54CRBL.js +30 -0
  108. package/dist/wallet-PA54CRBL.js.map +1 -0
  109. package/package.json +19 -16
  110. package/skills/tenjin/SKILL.md +199 -0
  111. package/skills/tenjin-publish/SKILL.md +96 -0
  112. package/skills/tenjin-search/SKILL.md +122 -0
  113. package/dist/chunk-BRJHUQSY.js.map +0 -1
  114. package/dist/chunk-CUWUHTIL.js.map +0 -1
  115. package/dist/chunk-DXPYFVKG.js.map +0 -1
  116. package/dist/chunk-EXBMF5X7.js.map +0 -1
  117. package/dist/chunk-EZROUI5U.js.map +0 -1
  118. package/dist/chunk-IPOWB3G3.js.map +0 -1
  119. package/dist/chunk-LPRVHM7P.js.map +0 -1
  120. package/dist/chunk-T4LKNY7T.js.map +0 -1
  121. package/dist/chunk-ZPZFPVDN.js.map +0 -1
  122. package/dist/cli-WA65NP4Y.js.map +0 -1
  123. package/dist/config-CEFTL5ZL.js.map +0 -1
  124. package/dist/doctor-3QBYN46N.js.map +0 -1
  125. package/dist/usdc-44R6XZF2.js +0 -18
  126. package/dist/wallet-ELBTBMXO.js +0 -20
  127. /package/dist/{_esm-ZH2J4QEH.js.map → _esm-C5CRWCYU.js.map} +0 -0
  128. /package/dist/{ccip-UCLT5VOW.js.map → _esm-FEASBWRP.js.map} +0 -0
  129. /package/dist/{chunk-3IMLRUZE.js.map → ccip-NQXCEK2U.js.map} +0 -0
  130. /package/dist/{secp256k1-BEZS642W.js.map → ccip-XR5NE5QK.js.map} +0 -0
  131. /package/dist/{usdc-44R6XZF2.js.map → chunk-ZXTAQYNA.js.map} +0 -0
  132. /package/dist/{wallet-ELBTBMXO.js.map → config-2VSXWWHK.js.map} +0 -0
  133. /package/dist/{mine.wasm-GQECMSGN.js.map → mine.wasm-6PIT3DK6.js.map} +0 -0
@@ -1,9 +1,17 @@
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,
@@ -11,12 +19,17 @@ import {
11
19
  publicKeyToAddress,
12
20
  serializeSignature,
13
21
  serializeTransaction,
22
+ serializeTypedData,
14
23
  toBlobSidecars,
15
- toRlp
16
- } from "./chunk-T4LKNY7T.js";
24
+ toRlp,
25
+ validateTypedData
26
+ } from "./chunk-NCE5NSN6.js";
27
+ import {
28
+ ripemd160
29
+ } from "./chunk-RY4XKNV3.js";
17
30
  import {
18
31
  secp256k1
19
- } from "./chunk-Q53IYV2G.js";
32
+ } from "./chunk-QVX5MWJZ.js";
20
33
  import {
21
34
  AtomicReadyWalletRejectedUpgradeError,
22
35
  AtomicityNotSupportedError,
@@ -43,6 +56,7 @@ import {
43
56
  ResourceUnavailableRpcError,
44
57
  ResponseBodyTooLargeError,
45
58
  RpcRequestError,
59
+ SocketClosedError,
46
60
  SwitchChainError,
47
61
  TimeoutError,
48
62
  TransactionRejectedRpcError,
@@ -54,11 +68,15 @@ import {
54
68
  UnsupportedProviderMethodError,
55
69
  UserRejectedRequestError,
56
70
  WalletConnectSessionSettlementError,
71
+ WebSocketRequestError,
57
72
  addressResolverAbi,
58
73
  assertRequest,
74
+ batchGatewayAbi,
59
75
  call,
76
+ ccipRequest,
60
77
  createBatchScheduler,
61
78
  decodeAbiParameters,
79
+ decodeErrorResult,
62
80
  decodeFunctionResult,
63
81
  defineFormatter,
64
82
  deploylessCallViaBytecodeBytecode,
@@ -71,7 +89,6 @@ import {
71
89
  extract,
72
90
  formatAbiItem as formatAbiItem2,
73
91
  formatAbiParameters,
74
- formatBlockParameter,
75
92
  formatTransactionRequest,
76
93
  getAbiItem,
77
94
  getAbortError,
@@ -86,57 +103,86 @@ import {
86
103
  parseAbiItem,
87
104
  parseAbiParameters,
88
105
  serializeStateOverride,
106
+ solidityError,
89
107
  textResolverAbi,
90
108
  toEventSelector,
91
109
  toRpc,
92
110
  universalResolverResolveAbi,
93
111
  universalResolverReverseAbi,
94
112
  withResolvers
95
- } from "./chunk-LPRVHM7P.js";
113
+ } from "./chunk-ZMHYXMO6.js";
96
114
  import {
115
+ AbiConstructorNotFoundError,
116
+ AbiConstructorParamsNotFoundError,
97
117
  AbiDecodingDataSizeTooSmallError,
98
118
  AbiDecodingZeroDataError,
119
+ AbiEncodingLengthMismatchError,
99
120
  AbiEventNotFoundError,
100
121
  AbiEventSignatureEmptyTopicsError,
101
122
  AbiEventSignatureNotFoundError,
102
123
  BaseError,
103
124
  BaseError2,
125
+ BytesSizeMismatchError,
126
+ ChainMismatchError,
127
+ ChainNotFoundError,
104
128
  DecodeLogDataMismatch,
105
129
  DecodeLogTopicsMismatch,
106
- IntegerOutOfRangeError,
130
+ ExecutionRevertedError,
131
+ IntegerOutOfRangeError2 as IntegerOutOfRangeError,
107
132
  InvalidAddressError,
133
+ InvalidHexValueError,
134
+ InvalidLegacyVError,
135
+ InvalidSerializedTransactionError,
136
+ InvalidSerializedTransactionTypeError,
137
+ InvalidYParityError,
108
138
  LruMap,
109
139
  PositionOutOfBoundsError,
140
+ RlpDepthLimitExceededError,
141
+ RlpListBoundaryExceededError,
142
+ RlpTrailingBytesError,
110
143
  TransactionExecutionError,
111
144
  TransactionNotFoundError,
112
145
  TransactionReceiptNotFoundError,
113
146
  TransactionReceiptRevertedError,
114
147
  UnknownNodeError,
148
+ UnsupportedPackedAbiType,
115
149
  WaitForTransactionReceiptTimeoutError,
150
+ arrayRegex,
151
+ boolToHex,
152
+ bytesRegex,
116
153
  bytesToHex,
154
+ checksumAddress,
117
155
  concat,
118
156
  concat2,
119
157
  concatHex,
158
+ createCursor,
120
159
  encodeAbiParameters,
160
+ etherUnits,
121
161
  formatAbiItem,
162
+ formatBlockParameter,
122
163
  formatEther,
123
164
  formatGwei,
124
165
  formatUnits,
125
166
  from,
126
167
  fromBoolean,
127
168
  fromBytes,
128
- fromHex,
169
+ fromHex2 as fromHex,
129
170
  fromNumber,
130
171
  fromString,
131
172
  fromString2,
132
173
  getAddress,
174
+ gweiUnits,
133
175
  hexToBigInt,
134
176
  hexToBool,
177
+ hexToBytes,
135
178
  hexToNumber,
179
+ integerRegex,
136
180
  isAddress,
137
181
  isHex,
138
182
  keccak256,
139
183
  numberToHex,
184
+ pad,
185
+ padHex,
140
186
  padLeft,
141
187
  padRight,
142
188
  parseAccount,
@@ -147,7 +193,9 @@ import {
147
193
  slice,
148
194
  slice2,
149
195
  slice3,
196
+ sliceHex,
150
197
  stringToBytes,
198
+ stringToHex,
151
199
  stringify,
152
200
  stringify2,
153
201
  toBigInt,
@@ -162,10 +210,10 @@ import {
162
210
  trimLeft2,
163
211
  validate,
164
212
  validate2
165
- } from "./chunk-BRJHUQSY.js";
213
+ } from "./chunk-YALGASEU.js";
166
214
  import {
167
215
  __export
168
- } from "./chunk-3IMLRUZE.js";
216
+ } from "./chunk-ZXTAQYNA.js";
169
217
 
170
218
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/getAction.js
171
219
  function getAction(client, actionFn, name) {
@@ -272,7 +320,7 @@ async function createContractEventFilter(client, parameters) {
272
320
 
273
321
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/errors/getContractError.js
274
322
  var EXECUTION_REVERTED_ERROR_CODE = 3;
275
- function getContractError(err, { abi: abi2, address, args, docsPath: docsPath3, functionName, sender }) {
323
+ function getContractError(err, { abi: abi2, address, args, docsPath: docsPath4, functionName, sender }) {
276
324
  const error = err instanceof RawContractError ? err : err instanceof BaseError ? err.walk((err2) => "data" in err2) || err.walk() : {};
277
325
  const { code, data, details, message, shortMessage } = error;
278
326
  const cause = (() => {
@@ -293,7 +341,7 @@ function getContractError(err, { abi: abi2, address, args, docsPath: docsPath3,
293
341
  abi: abi2,
294
342
  args,
295
343
  contractAddress: address,
296
- docsPath: docsPath3,
344
+ docsPath: docsPath4,
297
345
  functionName,
298
346
  sender
299
347
  });
@@ -302,7 +350,7 @@ function getContractError(err, { abi: abi2, address, args, docsPath: docsPath3,
302
350
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/recoverPublicKey.js
303
351
  async function recoverPublicKey({ hash: hash2, signature }) {
304
352
  const hashHex = isHex(hash2) ? hash2 : toHex(hash2);
305
- const { secp256k1: secp256k12 } = await import("./secp256k1-BEZS642W.js");
353
+ const { secp256k1: secp256k12 } = await import("./secp256k1-N3ZHU7LB.js");
306
354
  const signature_ = (() => {
307
355
  if (typeof signature === "object" && "r" in signature && "s" in signature) {
308
356
  const { r, s, v, yParity } = signature;
@@ -346,7 +394,7 @@ async function recoverAuthorizationAddress(parameters) {
346
394
 
347
395
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/estimateGas.js
348
396
  var EstimateGasExecutionError = class extends BaseError {
349
- 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 }) {
350
398
  const prettyArgs = prettyPrint({
351
399
  from: account?.address,
352
400
  to,
@@ -360,7 +408,7 @@ var EstimateGasExecutionError = class extends BaseError {
360
408
  });
361
409
  super(cause.shortMessage, {
362
410
  cause,
363
- docsPath: docsPath3,
411
+ docsPath: docsPath4,
364
412
  metaMessages: [
365
413
  ...cause.metaMessages ? [...cause.metaMessages, " "] : [],
366
414
  "Estimate Gas Arguments:",
@@ -379,7 +427,7 @@ var EstimateGasExecutionError = class extends BaseError {
379
427
  };
380
428
 
381
429
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/errors/getEstimateGasError.js
382
- function getEstimateGasError(err, { docsPath: docsPath3, ...args }) {
430
+ function getEstimateGasError(err, { docsPath: docsPath4, ...args }) {
383
431
  const cause = (() => {
384
432
  const cause2 = getNodeError(err, args);
385
433
  if (cause2 instanceof UnknownNodeError)
@@ -387,7 +435,7 @@ function getEstimateGasError(err, { docsPath: docsPath3, ...args }) {
387
435
  return cause2;
388
436
  })();
389
437
  return new EstimateGasExecutionError(cause, {
390
- docsPath: docsPath3,
438
+ docsPath: docsPath4,
391
439
  ...args
392
440
  });
393
441
  }
@@ -613,7 +661,7 @@ async function internal_estimateFeesPerGas(client, args) {
613
661
  throw new BaseFeeScalarError();
614
662
  const decimals = baseFeeMultiplier.toString().split(".")[1]?.length ?? 0;
615
663
  const denominator = 10 ** decimals;
616
- const multiply = (base2) => base2 * BigInt(Math.ceil(baseFeeMultiplier * denominator)) / BigInt(denominator);
664
+ const multiply = (base) => base * BigInt(Math.ceil(baseFeeMultiplier * denominator)) / BigInt(denominator);
617
665
  const block = block_ ? block_ : await getAction(client, getBlock, "getBlock")({});
618
666
  if (typeof chain?.fees?.estimateFeesPerGas === "function") {
619
667
  const fees = await chain.fees.estimateFeesPerGas({
@@ -647,25 +695,8 @@ async function internal_estimateFeesPerGas(client, args) {
647
695
  };
648
696
  }
649
697
 
650
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/getTransactionCount.js
651
- async function getTransactionCount(client, { address, blockHash, blockNumber, blockTag = "latest", requireCanonical }) {
652
- const block = formatBlockParameter({
653
- blockHash,
654
- blockNumber,
655
- blockTag,
656
- requireCanonical
657
- });
658
- const count = await client.request({
659
- method: "eth_getTransactionCount",
660
- params: [address, block]
661
- }, {
662
- dedupe: typeof blockNumber === "bigint" || blockHash !== void 0
663
- });
664
- return hexToNumber(count);
665
- }
666
-
667
698
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/errors/getTransactionError.js
668
- function getTransactionError(err, { docsPath: docsPath3, ...args }) {
699
+ function getTransactionError(err, { docsPath: docsPath4, ...args }) {
669
700
  const cause = (() => {
670
701
  const cause2 = getNodeError(err, args);
671
702
  if (cause2 instanceof UnknownNodeError)
@@ -673,7 +704,7 @@ function getTransactionError(err, { docsPath: docsPath3, ...args }) {
673
704
  return cause2;
674
705
  })();
675
706
  return new TransactionExecutionError(cause, {
676
- docsPath: docsPath3,
707
+ docsPath: docsPath4,
677
708
  ...args
678
709
  });
679
710
  }
@@ -688,17 +719,17 @@ async function getChainId(client) {
688
719
 
689
720
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/fillTransaction.js
690
721
  async function fillTransaction(client, parameters) {
691
- 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;
692
723
  const nonce = await (async () => {
693
724
  if (!account)
694
725
  return nonce_;
695
- if (!nonceManager)
726
+ if (!nonceManager2)
696
727
  return nonce_;
697
728
  if (typeof nonce_ !== "undefined")
698
729
  return nonce_;
699
730
  const account_ = parseAccount(account);
700
731
  const chainId = chain ? chain.id : await getAction(client, getChainId, "getChainId")({});
701
- return await nonceManager.consume({
732
+ return await nonceManager2.consume({
702
733
  address: account_.address,
703
734
  chainId,
704
735
  client
@@ -768,7 +799,7 @@ async function fillTransaction(client, parameters) {
768
799
  throw new BaseFeeScalarError();
769
800
  const decimals = feeMultiplier.toString().split(".")[1]?.length ?? 0;
770
801
  const denominator = 10 ** decimals;
771
- const multiplyFee = (base2) => base2 * BigInt(Math.ceil(feeMultiplier * denominator)) / BigInt(denominator);
802
+ const multiplyFee = (base) => base * BigInt(Math.ceil(feeMultiplier * denominator)) / BigInt(denominator);
772
803
  if (!transaction.feePayerSignature) {
773
804
  if (transaction.maxFeePerGas && !parameters.maxFeePerGas)
774
805
  transaction.maxFeePerGas = multiplyFee(transaction.maxFeePerGas);
@@ -806,7 +837,7 @@ async function prepareTransactionRequest(client, args) {
806
837
  let request = args;
807
838
  request.account ??= client.account;
808
839
  request.parameters ??= defaultParameters;
809
- const { account: account_, chain = client.chain, nonceManager, parameters } = request;
840
+ const { account: account_, chain = client.chain, nonceManager: nonceManager2, parameters } = request;
810
841
  const prepareTransactionRequest2 = (() => {
811
842
  if (typeof chain?.prepareTransactionRequest === "function")
812
843
  return {
@@ -834,9 +865,9 @@ async function prepareTransactionRequest(client, args) {
834
865
  }
835
866
  const account = account_ ? parseAccount(account_) : account_;
836
867
  let nonce = request.nonce;
837
- if (parameters.includes("nonce") && typeof nonce === "undefined" && account && nonceManager) {
868
+ if (parameters.includes("nonce") && typeof nonce === "undefined" && account && nonceManager2) {
838
869
  const chainId2 = await getChainId2();
839
- nonce = await nonceManager.consume({
870
+ nonce = await nonceManager2.consume({
840
871
  address: account.address,
841
872
  chainId: chainId2,
842
873
  client
@@ -928,7 +959,7 @@ async function prepareTransactionRequest(client, args) {
928
959
  block = await getAction(client, getBlock, "getBlock")({ blockTag: "latest" });
929
960
  return block;
930
961
  }
931
- if (parameters.includes("nonce") && typeof nonce === "undefined" && account && !nonceManager)
962
+ if (parameters.includes("nonce") && typeof nonce === "undefined" && account && !nonceManager2)
932
963
  request.nonce = await getAction(client, getTransactionCount, "getTransactionCount")({
933
964
  address: account.address,
934
965
  blockTag: "pending"
@@ -1809,17 +1840,34 @@ function watchContractEvent(client, parameters) {
1809
1840
 
1810
1841
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/account.js
1811
1842
  var AccountNotFoundError = class extends BaseError {
1812
- constructor({ docsPath: docsPath3 } = {}) {
1843
+ constructor({ docsPath: docsPath4 } = {}) {
1813
1844
  super([
1814
1845
  "Could not find an Account to execute with this Action.",
1815
1846
  "Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."
1816
1847
  ].join("\n"), {
1817
- docsPath: docsPath3,
1848
+ docsPath: docsPath4,
1818
1849
  docsSlug: "account",
1819
1850
  name: "AccountNotFoundError"
1820
1851
  });
1821
1852
  }
1822
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
+ }
1823
1871
 
1824
1872
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/sendRawTransaction.js
1825
1873
  async function sendRawTransaction(client, { serializedTransaction }) {
@@ -1829,6 +1877,381 @@ async function sendRawTransaction(client, { serializedTransaction }) {
1829
1877
  }, { retryCount: 0 });
1830
1878
  }
1831
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
+
1832
2255
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/promise/withRetry.js
1833
2256
  function withRetry(fn, { delay: delay_ = 100, retryCount = 2, shouldRetry: shouldRetry2 = () => true, signal } = {}) {
1834
2257
  return new Promise((resolve, reject) => {
@@ -1897,6 +2320,244 @@ function formatTransactionReceipt(transactionReceipt, _) {
1897
2320
  }
1898
2321
  var defineTransactionReceipt = /* @__PURE__ */ defineFormatter("transactionReceipt", formatTransactionReceipt);
1899
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
+
1900
2561
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/uid.js
1901
2562
  var size4 = 256;
1902
2563
  var index = size4;
@@ -1944,14 +2605,14 @@ function createClient(parameters) {
1944
2605
  uid: uid(),
1945
2606
  ...experimental_blockTag ? { experimental_blockTag } : {}
1946
2607
  };
1947
- function extend(base2) {
2608
+ function extend(base) {
1948
2609
  return (extendFn) => {
1949
- const extended = extendFn(base2);
2610
+ const extended = extendFn(base);
1950
2611
  for (const key2 in client)
1951
2612
  delete extended[key2];
1952
- const combined = { ...base2, ...extended };
2613
+ const combined = { ...base, ...extended };
1953
2614
  for (const key2 in extended) {
1954
- const a = base2[key2];
2615
+ const a = base[key2];
1955
2616
  const b = extended[key2];
1956
2617
  if (isPlainObject(a) && isPlainObject(b))
1957
2618
  combined[key2] = { ...a, ...b };
@@ -1991,6 +2652,9 @@ function bindActionDecorators(client, action) {
1991
2652
  wrapped[key] = action[key];
1992
2653
  return wrapped;
1993
2654
  }
2655
+ function rpcSchema() {
2656
+ return null;
2657
+ }
1994
2658
 
1995
2659
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/ens/errors.js
1996
2660
  function isNullUniversalResolverError(err) {
@@ -2183,6 +2847,13 @@ var EnsAvatarUnsupportedNamespaceError = class extends BaseError {
2183
2847
  super(`ENS NFT avatar namespace "${namespace}" is not supported. Must be "erc721" or "erc1155".`, { name: "EnsAvatarUnsupportedNamespaceError" });
2184
2848
  }
2185
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
+ };
2186
2857
 
2187
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
2188
2859
  var networkRegex = /(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/;
@@ -2215,12 +2886,12 @@ async function isImageUri(uri) {
2215
2886
  });
2216
2887
  }
2217
2888
  }
2218
- function getGateway(custom, defaultGateway) {
2219
- if (!custom)
2889
+ function getGateway(custom2, defaultGateway) {
2890
+ if (!custom2)
2220
2891
  return defaultGateway;
2221
- if (custom.endsWith("/"))
2222
- return custom.slice(0, -1);
2223
- return custom;
2892
+ if (custom2.endsWith("/"))
2893
+ return custom2.slice(0, -1);
2894
+ return custom2;
2224
2895
  }
2225
2896
  function resolveAvatarUri({ uri, gatewayUrls }) {
2226
2897
  const isEncoded = base64Regex.test(uri);
@@ -2859,6 +3530,109 @@ async function getFilterLogs(_client, { filter }) {
2859
3530
  });
2860
3531
  }
2861
3532
 
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);
3547
+ }
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
+
2862
3636
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/authorization/verifyAuthorization.js
2863
3637
  async function verifyAuthorization({ address, authorization, signature }) {
2864
3638
  return isAddressEqual(getAddress(address), await recoverAuthorizationAddress({
@@ -3064,6 +3838,59 @@ function hashString(str, seed = 0) {
3064
3838
  return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(36);
3065
3839
  }
3066
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
+
3067
3894
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/chain/defineChain.js
3068
3895
  function defineChain(chain) {
3069
3896
  const chainInstance = {
@@ -3072,10 +3899,10 @@ function defineChain(chain) {
3072
3899
  serializers: void 0,
3073
3900
  ...chain
3074
3901
  };
3075
- function extend(base2) {
3902
+ function extend(base) {
3076
3903
  return (fnOrExtended) => {
3077
- const properties = typeof fnOrExtended === "function" ? fnOrExtended(base2) : fnOrExtended;
3078
- const combined = { ...base2, ...properties };
3904
+ const properties = typeof fnOrExtended === "function" ? fnOrExtended(base) : fnOrExtended;
3905
+ const combined = { ...base, ...properties };
3079
3906
  return Object.assign(combined, { extend: extend(combined) });
3080
3907
  };
3081
3908
  }
@@ -3083,9 +3910,96 @@ function defineChain(chain) {
3083
3910
  extend: extend(chainInstance)
3084
3911
  });
3085
3912
  }
3913
+ function extendSchema() {
3914
+ return {};
3915
+ }
3086
3916
 
3087
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/promise/withTimeout.js
3088
- function withTimeout(fn, { errorInstance = new Error("timed out"), timeout, signal }) {
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
+ }
4000
+
4001
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/promise/withTimeout.js
4002
+ function withTimeout(fn, { errorInstance = new Error("timed out"), timeout, signal }) {
3089
4003
  return new Promise((resolve, reject) => {
3090
4004
  ;
3091
4005
  (async () => {
@@ -3289,6 +4203,266 @@ function parseUrl(url_) {
3289
4203
  }
3290
4204
  }
3291
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
+
3292
4466
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/erc8010/SignatureErc8010.js
3293
4467
  var SignatureErc8010_exports = {};
3294
4468
  __export(SignatureErc8010_exports, {
@@ -3583,9 +4757,9 @@ var InvalidChecksumError = class extends BaseError2 {
3583
4757
  };
3584
4758
 
3585
4759
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Solidity.js
3586
- var arrayRegex = /^(.*)\[([0-9]*)\]$/;
3587
- var bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
3588
- 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)?$/;
3589
4763
  var maxInt8 = 2n ** (8n - 1n) - 1n;
3590
4764
  var maxInt16 = 2n ** (16n - 1n) - 1n;
3591
4765
  var maxInt24 = 2n ** (24n - 1n) - 1n;
@@ -3685,19 +4859,19 @@ var maxUint256 = 2n ** 256n - 1n;
3685
4859
 
3686
4860
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/internal/abiParameters.js
3687
4861
  function decodeParameter(cursor, param, options) {
3688
- const { checksumAddress, staticPosition } = options;
4862
+ const { checksumAddress: checksumAddress2, staticPosition } = options;
3689
4863
  const arrayComponents = getArrayComponents(param.type);
3690
4864
  if (arrayComponents) {
3691
4865
  const [length, type] = arrayComponents;
3692
- return decodeArray(cursor, { ...param, type }, { checksumAddress, length, staticPosition });
4866
+ return decodeArray(cursor, { ...param, type }, { checksumAddress: checksumAddress2, length, staticPosition });
3693
4867
  }
3694
4868
  if (param.type === "tuple")
3695
4869
  return decodeTuple(cursor, param, {
3696
- checksumAddress,
4870
+ checksumAddress: checksumAddress2,
3697
4871
  staticPosition
3698
4872
  });
3699
4873
  if (param.type === "address")
3700
- return decodeAddress2(cursor, { checksum: checksumAddress });
4874
+ return decodeAddress2(cursor, { checksum: checksumAddress2 });
3701
4875
  if (param.type === "bool")
3702
4876
  return decodeBool(cursor);
3703
4877
  if (param.type.startsWith("bytes"))
@@ -3717,7 +4891,7 @@ function decodeAddress2(cursor, options = {}) {
3717
4891
  return [wrap3(fromBytes(slice3(value, -20))), 32];
3718
4892
  }
3719
4893
  function decodeArray(cursor, param, options) {
3720
- const { checksumAddress, length, staticPosition } = options;
4894
+ const { checksumAddress: checksumAddress2, length, staticPosition } = options;
3721
4895
  if (!length) {
3722
4896
  const offset = toNumber2(cursor.readBytes(sizeOfOffset));
3723
4897
  const start = staticPosition + offset;
@@ -3730,7 +4904,7 @@ function decodeArray(cursor, param, options) {
3730
4904
  for (let i = 0; i < length2; ++i) {
3731
4905
  cursor.setPosition(startOfData + (dynamicChild ? i * 32 : consumed2));
3732
4906
  const [data, consumed_] = decodeParameter(cursor, param, {
3733
- checksumAddress,
4907
+ checksumAddress: checksumAddress2,
3734
4908
  staticPosition: startOfData
3735
4909
  });
3736
4910
  consumed2 += consumed_;
@@ -3746,7 +4920,7 @@ function decodeArray(cursor, param, options) {
3746
4920
  for (let i = 0; i < length; ++i) {
3747
4921
  cursor.setPosition(start + i * 32);
3748
4922
  const [data] = decodeParameter(cursor, param, {
3749
- checksumAddress,
4923
+ checksumAddress: checksumAddress2,
3750
4924
  staticPosition: start
3751
4925
  });
3752
4926
  value2.push(data);
@@ -3758,7 +4932,7 @@ function decodeArray(cursor, param, options) {
3758
4932
  const value = [];
3759
4933
  for (let i = 0; i < length; ++i) {
3760
4934
  const [data, consumed_] = decodeParameter(cursor, param, {
3761
- checksumAddress,
4935
+ checksumAddress: checksumAddress2,
3762
4936
  staticPosition: staticPosition + consumed
3763
4937
  });
3764
4938
  consumed += consumed_;
@@ -3796,7 +4970,7 @@ function decodeNumber(cursor, param) {
3796
4970
  ];
3797
4971
  }
3798
4972
  function decodeTuple(cursor, param, options) {
3799
- const { checksumAddress, staticPosition } = options;
4973
+ const { checksumAddress: checksumAddress2, staticPosition } = options;
3800
4974
  const hasUnnamedChild = param.components.length === 0 || param.components.some(({ name }) => !name);
3801
4975
  const value = hasUnnamedChild ? [] : {};
3802
4976
  let consumed = 0;
@@ -3807,7 +4981,7 @@ function decodeTuple(cursor, param, options) {
3807
4981
  const component = param.components[i];
3808
4982
  cursor.setPosition(start + consumed);
3809
4983
  const [data, consumed_] = decodeParameter(cursor, component, {
3810
- checksumAddress,
4984
+ checksumAddress: checksumAddress2,
3811
4985
  staticPosition: start
3812
4986
  });
3813
4987
  consumed += consumed_;
@@ -3819,7 +4993,7 @@ function decodeTuple(cursor, param, options) {
3819
4993
  for (let i = 0; i < param.components.length; ++i) {
3820
4994
  const component = param.components[i];
3821
4995
  const [data, consumed_] = decodeParameter(cursor, component, {
3822
- checksumAddress,
4996
+ checksumAddress: checksumAddress2,
3823
4997
  staticPosition
3824
4998
  });
3825
4999
  value[hasUnnamedChild ? i : component?.name] = data;
@@ -3841,24 +5015,24 @@ function decodeString(cursor, { staticPosition }) {
3841
5015
  cursor.setPosition(staticPosition + 32);
3842
5016
  return [value, 32];
3843
5017
  }
3844
- function prepareParameters({ checksumAddress, parameters, values }) {
5018
+ function prepareParameters({ checksumAddress: checksumAddress2, parameters, values }) {
3845
5019
  const preparedParameters = [];
3846
5020
  for (let i = 0; i < parameters.length; i++) {
3847
5021
  preparedParameters.push(prepareParameter({
3848
- checksumAddress,
5022
+ checksumAddress: checksumAddress2,
3849
5023
  parameter: parameters[i],
3850
5024
  value: values[i]
3851
5025
  }));
3852
5026
  }
3853
5027
  return preparedParameters;
3854
5028
  }
3855
- function prepareParameter({ checksumAddress = false, parameter: parameter_, value }) {
5029
+ function prepareParameter({ checksumAddress: checksumAddress2 = false, parameter: parameter_, value }) {
3856
5030
  const parameter = parameter_;
3857
5031
  const arrayComponents = getArrayComponents(parameter.type);
3858
5032
  if (arrayComponents) {
3859
5033
  const [length, type] = arrayComponents;
3860
5034
  return encodeArray(value, {
3861
- checksumAddress,
5035
+ checksumAddress: checksumAddress2,
3862
5036
  length,
3863
5037
  parameter: {
3864
5038
  ...parameter,
@@ -3868,13 +5042,13 @@ function prepareParameter({ checksumAddress = false, parameter: parameter_, valu
3868
5042
  }
3869
5043
  if (parameter.type === "tuple") {
3870
5044
  return encodeTuple(value, {
3871
- checksumAddress,
5045
+ checksumAddress: checksumAddress2,
3872
5046
  parameter
3873
5047
  });
3874
5048
  }
3875
5049
  if (parameter.type === "address") {
3876
5050
  return encodeAddress(value, {
3877
- checksum: checksumAddress
5051
+ checksum: checksumAddress2
3878
5052
  });
3879
5053
  }
3880
5054
  if (parameter.type === "bool") {
@@ -3882,7 +5056,7 @@ function prepareParameter({ checksumAddress = false, parameter: parameter_, valu
3882
5056
  }
3883
5057
  if (parameter.type.startsWith("uint") || parameter.type.startsWith("int")) {
3884
5058
  const signed = parameter.type.startsWith("int");
3885
- const [, , size5 = "256"] = integerRegex.exec(parameter.type) ?? [];
5059
+ const [, , size5 = "256"] = integerRegex2.exec(parameter.type) ?? [];
3886
5060
  return encodeNumber(value, {
3887
5061
  signed,
3888
5062
  size: Number(size5)
@@ -3896,7 +5070,7 @@ function prepareParameter({ checksumAddress = false, parameter: parameter_, valu
3896
5070
  }
3897
5071
  throw new InvalidTypeError(parameter.type);
3898
5072
  }
3899
- function encode(preparedParameters) {
5073
+ function encode2(preparedParameters) {
3900
5074
  let staticSize = 0;
3901
5075
  for (let i = 0; i < preparedParameters.length; i++) {
3902
5076
  const { dynamic, encoded } = preparedParameters[i];
@@ -3929,7 +5103,7 @@ function encodeAddress(value, options) {
3929
5103
  };
3930
5104
  }
3931
5105
  function encodeArray(value, options) {
3932
- const { checksumAddress, length, parameter } = options;
5106
+ const { checksumAddress: checksumAddress2, length, parameter } = options;
3933
5107
  const dynamic = length === null;
3934
5108
  if (!Array.isArray(value))
3935
5109
  throw new InvalidArrayError(value);
@@ -3943,7 +5117,7 @@ function encodeArray(value, options) {
3943
5117
  const preparedParameters = [];
3944
5118
  for (let i = 0; i < value.length; i++) {
3945
5119
  const preparedParam = prepareParameter({
3946
- checksumAddress,
5120
+ checksumAddress: checksumAddress2,
3947
5121
  parameter,
3948
5122
  value: value[i]
3949
5123
  });
@@ -3952,7 +5126,7 @@ function encodeArray(value, options) {
3952
5126
  preparedParameters.push(preparedParam);
3953
5127
  }
3954
5128
  if (dynamic || dynamicChild) {
3955
- const data = encode(preparedParameters);
5129
+ const data = encode2(preparedParameters);
3956
5130
  if (dynamic) {
3957
5131
  const length2 = fromNumber(preparedParameters.length, { size: 32 });
3958
5132
  return {
@@ -3981,7 +5155,7 @@ function encodeBytes(value, { type }) {
3981
5155
  };
3982
5156
  }
3983
5157
  if (bytesSize !== Number.parseInt(parametersize, 10))
3984
- throw new BytesSizeMismatchError({
5158
+ throw new BytesSizeMismatchError2({
3985
5159
  expectedSize: Number.parseInt(parametersize, 10),
3986
5160
  value
3987
5161
  });
@@ -4026,14 +5200,14 @@ function encodeString(value) {
4026
5200
  };
4027
5201
  }
4028
5202
  function encodeTuple(value, options) {
4029
- const { checksumAddress, parameter } = options;
5203
+ const { checksumAddress: checksumAddress2, parameter } = options;
4030
5204
  let dynamic = false;
4031
5205
  const preparedParameters = [];
4032
5206
  for (let i = 0; i < parameter.components.length; i++) {
4033
5207
  const param_ = parameter.components[i];
4034
5208
  const index2 = Array.isArray(value) ? i : param_.name;
4035
5209
  const preparedParam = prepareParameter({
4036
- checksumAddress,
5210
+ checksumAddress: checksumAddress2,
4037
5211
  parameter: param_,
4038
5212
  value: value[index2]
4039
5213
  });
@@ -4043,7 +5217,7 @@ function encodeTuple(value, options) {
4043
5217
  }
4044
5218
  return {
4045
5219
  dynamic,
4046
- encoded: dynamic ? encode(preparedParameters) : concat2(...preparedParameters.map(({ encoded }) => encoded))
5220
+ encoded: dynamic ? encode2(preparedParameters) : concat2(...preparedParameters.map(({ encoded }) => encoded))
4047
5221
  };
4048
5222
  }
4049
5223
  function getArrayComponents(type) {
@@ -4276,7 +5450,7 @@ var RecursiveReadLimitExceededError = class extends BaseError2 {
4276
5450
 
4277
5451
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/AbiParameters.js
4278
5452
  function decode(parameters, data, options = {}) {
4279
- const { as = "Array", checksumAddress = false } = options;
5453
+ const { as = "Array", checksumAddress: checksumAddress2 = false } = options;
4280
5454
  const bytes = typeof data === "string" ? fromHex(data) : data;
4281
5455
  const cursor = create(bytes);
4282
5456
  if (size3(bytes) === 0 && parameters.length > 0)
@@ -4293,7 +5467,7 @@ function decode(parameters, data, options = {}) {
4293
5467
  const param = parameters[i];
4294
5468
  cursor.setPosition(consumed);
4295
5469
  const [data2, consumed_] = decodeParameter(cursor, param, {
4296
- checksumAddress,
5470
+ checksumAddress: checksumAddress2,
4297
5471
  staticPosition: 0
4298
5472
  });
4299
5473
  consumed += consumed_;
@@ -4304,24 +5478,24 @@ function decode(parameters, data, options = {}) {
4304
5478
  }
4305
5479
  return values;
4306
5480
  }
4307
- function encode2(parameters, values, options) {
4308
- const { checksumAddress = false } = options ?? {};
5481
+ function encode3(parameters, values, options) {
5482
+ const { checksumAddress: checksumAddress2 = false } = options ?? {};
4309
5483
  if (parameters.length !== values.length)
4310
5484
  throw new LengthMismatchError({
4311
5485
  expectedLength: parameters.length,
4312
5486
  givenLength: values.length
4313
5487
  });
4314
5488
  const preparedParameters = prepareParameters({
4315
- checksumAddress,
5489
+ checksumAddress: checksumAddress2,
4316
5490
  parameters,
4317
5491
  values
4318
5492
  });
4319
- const data = encode(preparedParameters);
5493
+ const data = encode2(preparedParameters);
4320
5494
  if (data.length === 0)
4321
5495
  return "0x";
4322
5496
  return data;
4323
5497
  }
4324
- function encodePacked(types, values) {
5498
+ function encodePacked2(types, values) {
4325
5499
  if (types.length !== values.length)
4326
5500
  throw new LengthMismatchError({
4327
5501
  expectedLength: types.length,
@@ -4331,12 +5505,12 @@ function encodePacked(types, values) {
4331
5505
  for (let i = 0; i < types.length; i++) {
4332
5506
  const type = types[i];
4333
5507
  const value = values[i];
4334
- data.push(encodePacked.encode(type, value));
5508
+ data.push(encodePacked2.encode(type, value));
4335
5509
  }
4336
5510
  return concat2(...data);
4337
5511
  }
4338
- (function(encodePacked2) {
4339
- function encode4(type, value, isArray = false) {
5512
+ (function(encodePacked3) {
5513
+ function encode5(type, value, isArray = false) {
4340
5514
  if (type === "address") {
4341
5515
  const address = value;
4342
5516
  assert2(address);
@@ -4348,7 +5522,7 @@ function encodePacked(types, values) {
4348
5522
  return value;
4349
5523
  if (type === "bool")
4350
5524
  return padLeft(fromBoolean(value), isArray ? 32 : 1);
4351
- const intMatch = type.match(integerRegex);
5525
+ const intMatch = type.match(integerRegex2);
4352
5526
  if (intMatch) {
4353
5527
  const [_type, baseType, bits = "256"] = intMatch;
4354
5528
  const size5 = Number.parseInt(bits, 10) / 8;
@@ -4357,22 +5531,22 @@ function encodePacked(types, values) {
4357
5531
  signed: baseType === "int"
4358
5532
  });
4359
5533
  }
4360
- const bytesMatch = type.match(bytesRegex);
5534
+ const bytesMatch = type.match(bytesRegex2);
4361
5535
  if (bytesMatch) {
4362
5536
  const [_type, size5] = bytesMatch;
4363
5537
  if (Number.parseInt(size5, 10) !== (value.length - 2) / 2)
4364
- throw new BytesSizeMismatchError({
5538
+ throw new BytesSizeMismatchError2({
4365
5539
  expectedSize: Number.parseInt(size5, 10),
4366
5540
  value
4367
5541
  });
4368
5542
  return padRight(value, isArray ? 32 : 0);
4369
5543
  }
4370
- const arrayMatch = type.match(arrayRegex);
5544
+ const arrayMatch = type.match(arrayRegex2);
4371
5545
  if (arrayMatch && Array.isArray(value)) {
4372
5546
  const [_type, childType] = arrayMatch;
4373
5547
  const data = [];
4374
5548
  for (let i = 0; i < value.length; i++) {
4375
- data.push(encode4(childType, value[i], true));
5549
+ data.push(encode5(childType, value[i], true));
4376
5550
  }
4377
5551
  if (data.length === 0)
4378
5552
  return "0x";
@@ -4380,8 +5554,8 @@ function encodePacked(types, values) {
4380
5554
  }
4381
5555
  throw new InvalidTypeError(type);
4382
5556
  }
4383
- encodePacked2.encode = encode4;
4384
- })(encodePacked || (encodePacked = {}));
5557
+ encodePacked3.encode = encode5;
5558
+ })(encodePacked2 || (encodePacked2 = {}));
4385
5559
  function from4(parameters) {
4386
5560
  if (Array.isArray(parameters) && typeof parameters[0] === "string")
4387
5561
  return parseAbiParameters(parameters);
@@ -4427,7 +5601,7 @@ var ArrayLengthMismatchError = class extends BaseError2 {
4427
5601
  });
4428
5602
  }
4429
5603
  };
4430
- var BytesSizeMismatchError = class extends BaseError2 {
5604
+ var BytesSizeMismatchError2 = class extends BaseError2 {
4431
5605
  constructor({ expectedSize, value }) {
4432
5606
  super(`Size of bytes "${value}" (bytes${size2(value)}) does not match expected size (bytes${expectedSize}).`);
4433
5607
  Object.defineProperty(this, "name", {
@@ -4519,8 +5693,8 @@ function getEncodableList(list) {
4519
5693
  else
4520
5694
  cursor.pushUint32(bodyLength);
4521
5695
  }
4522
- for (const { encode: encode4 } of list) {
4523
- encode4(cursor);
5696
+ for (const { encode: encode5 } of list) {
5697
+ encode5(cursor);
4524
5698
  }
4525
5699
  }
4526
5700
  };
@@ -4584,7 +5758,7 @@ function assert3(signature, options = {}) {
4584
5758
  if (signature.s < 0n || signature.s > maxUint256)
4585
5759
  throw new InvalidSError({ value: signature.s });
4586
5760
  if (typeof signature.yParity === "number" && signature.yParity !== 0 && signature.yParity !== 1)
4587
- throw new InvalidYParityError({ value: signature.yParity });
5761
+ throw new InvalidYParityError2({ value: signature.yParity });
4588
5762
  }
4589
5763
  function fromBytes3(signature) {
4590
5764
  return fromHex4(fromBytes(signature));
@@ -4601,7 +5775,7 @@ function fromHex4(signature) {
4601
5775
  try {
4602
5776
  return vToYParity(yParity2);
4603
5777
  } catch {
4604
- throw new InvalidYParityError({ value: yParity2 });
5778
+ throw new InvalidYParityError2({ value: yParity2 });
4605
5779
  }
4606
5780
  })();
4607
5781
  if (typeof yParity === "undefined")
@@ -4655,7 +5829,7 @@ function fromRpc(signature) {
4655
5829
  if (typeof v === "number" && typeof yParity2 !== "number")
4656
5830
  yParity2 = vToYParity(v);
4657
5831
  if (typeof yParity2 !== "number")
4658
- throw new InvalidYParityError({ value: signature.yParity });
5832
+ throw new InvalidYParityError2({ value: signature.yParity });
4659
5833
  return yParity2;
4660
5834
  })();
4661
5835
  return {
@@ -4730,7 +5904,7 @@ var InvalidSError = class extends BaseError2 {
4730
5904
  });
4731
5905
  }
4732
5906
  };
4733
- var InvalidYParityError = class extends BaseError2 {
5907
+ var InvalidYParityError2 = class extends BaseError2 {
4734
5908
  constructor({ value }) {
4735
5909
  super(`Value \`${value}\` is an invalid y-parity value. Y-parity must be 0 or 1.`);
4736
5910
  Object.defineProperty(this, "name", {
@@ -4845,7 +6019,7 @@ function wrap(value) {
4845
6019
  payload: getSignPayload(value.authorization),
4846
6020
  signature: from6(value.authorization)
4847
6021
  });
4848
- const suffix = encode2(suffixParameters, [
6022
+ const suffix = encode3(suffixParameters, [
4849
6023
  {
4850
6024
  ...value.authorization,
4851
6025
  delegation: value.authorization.address,
@@ -4877,6 +6051,499 @@ var InvalidWrappedSignatureError = class extends BaseError2 {
4877
6051
  }
4878
6052
  };
4879
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
+
4880
6547
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/formatters/proof.js
4881
6548
  function formatStorageProof(storageProof) {
4882
6549
  return storageProof.map((proof) => ({
@@ -4999,7 +6666,7 @@ async function getTransactionReceipt(client, { hash: hash2 }) {
4999
6666
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/multicall.js
5000
6667
  async function multicall(client, parameters) {
5001
6668
  const { account, authorizationList, allowFailure = true, blockHash, blockNumber, blockOverrides, blockTag, requireCanonical, stateOverride } = parameters;
5002
- const contracts2 = parameters.contracts;
6669
+ const contracts = parameters.contracts;
5003
6670
  const batch = typeof client.batch?.multicall === "object" ? client.batch.multicall : {};
5004
6671
  const batchSize = parameters.batchSize ?? batch.batchSize ?? 1024;
5005
6672
  const deployless = parameters.deployless ?? batch.deployless ?? false;
@@ -5020,8 +6687,8 @@ async function multicall(client, parameters) {
5020
6687
  const chunkedCalls = [[]];
5021
6688
  let currentChunk = 0;
5022
6689
  let currentChunkSize = 0;
5023
- for (let i = 0; i < contracts2.length; i++) {
5024
- 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];
5025
6692
  try {
5026
6693
  const callData = encodeFunctionData({ abi: abi2, args, functionName });
5027
6694
  currentChunkSize += (callData.length - 2) / 2;
@@ -5097,7 +6764,7 @@ async function multicall(client, parameters) {
5097
6764
  for (let j = 0; j < aggregate3Result.length; j++) {
5098
6765
  const { returnData, success } = aggregate3Result[j];
5099
6766
  const { callData } = chunkedCalls[i][j];
5100
- const { abi: abi2, address, functionName, args } = contracts2[results.length];
6767
+ const { abi: abi2, address, functionName, args } = contracts[results.length];
5101
6768
  try {
5102
6769
  if (callData === "0x")
5103
6770
  throw new AbiDecodingZeroDataError();
@@ -5124,7 +6791,7 @@ async function multicall(client, parameters) {
5124
6791
  }
5125
6792
  }
5126
6793
  }
5127
- if (results.length !== contracts2.length)
6794
+ if (results.length !== contracts.length)
5128
6795
  throw new BaseError("multicall results mismatch");
5129
6796
  return results;
5130
6797
  }
@@ -5482,7 +7149,7 @@ var NotFoundError = class extends BaseError2 {
5482
7149
  };
5483
7150
 
5484
7151
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/AbiConstructor.js
5485
- function encode3(...parameters) {
7152
+ function encode4(...parameters) {
5486
7153
  const [abiConstructor, options] = (() => {
5487
7154
  if (Array.isArray(parameters[0])) {
5488
7155
  const [abi2, options2] = parameters;
@@ -5491,7 +7158,7 @@ function encode3(...parameters) {
5491
7158
  return parameters;
5492
7159
  })();
5493
7160
  const { bytecode, args } = options;
5494
- 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");
5495
7162
  }
5496
7163
  function from10(abiConstructor) {
5497
7164
  return from9(abiConstructor);
@@ -5518,7 +7185,7 @@ function encodeData(...parameters) {
5518
7185
  args
5519
7186
  }) : abiFunction;
5520
7187
  const selector = getSelector2(item);
5521
- const data = args.length > 0 ? encode2(item.inputs, args) : void 0;
7188
+ const data = args.length > 0 ? encode3(item.inputs, args) : void 0;
5522
7189
  return data ? concat2(selector, data) : selector;
5523
7190
  }
5524
7191
  function from11(abiFunction, options = {}) {
@@ -5545,7 +7212,7 @@ async function simulateCalls(client, parameters) {
5545
7212
  const account = parameters.account ? parseAccount(parameters.account) : void 0;
5546
7213
  if (traceAssetChanges && !account)
5547
7214
  throw new BaseError("`account` is required when `traceAssetChanges` is true");
5548
- const getBalanceData = account ? encode3(from10("constructor(bytes, bytes)"), {
7215
+ const getBalanceData = account ? encode4(from10("constructor(bytes, bytes)"), {
5549
7216
  bytecode: deploylessCallViaBytecodeBytecode,
5550
7217
  args: [
5551
7218
  getBalanceCode,
@@ -5810,7 +7477,7 @@ function unwrap2(wrapped) {
5810
7477
  }
5811
7478
  function wrap2(value) {
5812
7479
  const { data, signature, to } = value;
5813
- return concat2(encode2(from4("address, bytes, bytes"), [
7480
+ return concat2(encode3(from4("address, bytes, bytes"), [
5814
7481
  to,
5815
7482
  data,
5816
7483
  signature
@@ -5837,7 +7504,7 @@ var InvalidWrappedSignatureError2 = class extends BaseError2 {
5837
7504
  };
5838
7505
 
5839
7506
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/verifyHash.js
5840
- async function verifyHash(client, parameters) {
7507
+ async function verifyHash2(client, parameters) {
5841
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;
5842
7509
  if (chain?.verifyHash)
5843
7510
  return await chain.verifyHash(client, parameters);
@@ -6010,9 +7677,9 @@ var VerificationError = class extends Error {
6010
7677
  };
6011
7678
 
6012
7679
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/verifyMessage.js
6013
- async function verifyMessage(client, { address, message, factory, factoryData, signature, ...callRequest }) {
7680
+ async function verifyMessage2(client, { address, message, factory, factoryData, signature, ...callRequest }) {
6014
7681
  const hash2 = hashMessage(message);
6015
- return getAction(client, verifyHash, "verifyHash")({
7682
+ return getAction(client, verifyHash2, "verifyHash")({
6016
7683
  address,
6017
7684
  factory,
6018
7685
  factoryData,
@@ -6023,10 +7690,10 @@ async function verifyMessage(client, { address, message, factory, factoryData, s
6023
7690
  }
6024
7691
 
6025
7692
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/verifyTypedData.js
6026
- async function verifyTypedData(client, parameters) {
7693
+ async function verifyTypedData2(client, parameters) {
6027
7694
  const { address, factory, factoryData, signature, message, primaryType, types, domain, ...callRequest } = parameters;
6028
7695
  const hash2 = hashTypedData({ message, primaryType, types, domain });
6029
- return getAction(client, verifyHash, "verifyHash")({
7696
+ return getAction(client, verifyHash2, "verifyHash")({
6030
7697
  address,
6031
7698
  factory,
6032
7699
  factoryData,
@@ -6682,7 +8349,7 @@ async function verifySiweMessage(client, parameters) {
6682
8349
  if (!isValid)
6683
8350
  return false;
6684
8351
  const hash2 = hashMessage(message);
6685
- return verifyHash(client, {
8352
+ return verifyHash2(client, {
6686
8353
  address: parsed.address,
6687
8354
  hash: hash2,
6688
8355
  signature,
@@ -6694,6 +8361,22 @@ async function verifySiweMessage(client, parameters) {
6694
8361
  function toAmount(amount, decimals) {
6695
8362
  return { amount, decimals, formatted: formatUnits(amount, decimals) };
6696
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
+ }
6697
8380
  function resolveToken(client, parameters) {
6698
8381
  const { decimals, token } = parameters;
6699
8382
  const declared = findDeclaredToken(client, token);
@@ -6770,6 +8453,10 @@ async function resolveTokenWithDecimals(client, parameters) {
6770
8453
  })
6771
8454
  };
6772
8455
  }
8456
+ function pickWriteParameters(parameters) {
8457
+ const { account, chain, gas, maxFeePerGas, maxPriorityFeePerGas, nonce } = parameters;
8458
+ return { account, chain, gas, maxFeePerGas, maxPriorityFeePerGas, nonce };
8459
+ }
6773
8460
  function defineCall(call2) {
6774
8461
  return {
6775
8462
  ...call2,
@@ -6778,6 +8465,60 @@ function defineCall(call2) {
6778
8465
  };
6779
8466
  }
6780
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
+
6781
8522
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/wallet/sendRawTransactionSync.js
6782
8523
  async function sendRawTransactionSync(client, { serializedTransaction, throwOnReceiptRevert, timeout }) {
6783
8524
  const receipt = await client.request({
@@ -6791,6 +8532,193 @@ async function sendRawTransactionSync(client, { serializedTransaction, throwOnRe
6791
8532
  return formatted;
6792
8533
  }
6793
8534
 
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
+
6794
8722
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/token/getAllowance.js
6795
8723
  async function getAllowance(client, parameters) {
6796
8724
  const { account, decimals, spender, token, ...rest } = parameters;
@@ -6911,6 +8839,85 @@ async function getTotalSupply(client, parameters) {
6911
8839
  getTotalSupply2.call = call2;
6912
8840
  })(getTotalSupply || (getTotalSupply = {}));
6913
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
+
6914
8921
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/clients/decorators/public.js
6915
8922
  function publicActions(client) {
6916
8923
  return {
@@ -6963,10 +8970,10 @@ function publicActions(client) {
6963
8970
  simulateBlocks: (args) => simulateBlocks(client, args),
6964
8971
  simulateCalls: (args) => simulateCalls(client, args),
6965
8972
  simulateContract: (args) => simulateContract(client, args),
6966
- verifyHash: (args) => verifyHash(client, args),
6967
- verifyMessage: (args) => verifyMessage(client, args),
8973
+ verifyHash: (args) => verifyHash2(client, args),
8974
+ verifyMessage: (args) => verifyMessage2(client, args),
6968
8975
  verifySiweMessage: (args) => verifySiweMessage(client, args),
6969
- verifyTypedData: (args) => verifyTypedData(client, args),
8976
+ verifyTypedData: (args) => verifyTypedData2(client, args),
6970
8977
  uninstallFilter: (args) => uninstallFilter(client, args),
6971
8978
  waitForTransactionReceipt: (args) => waitForTransactionReceipt(client, args),
6972
8979
  watchBlocks: (args) => watchBlocks(client, args),
@@ -6998,7 +9005,672 @@ function createPublicClient(parameters) {
6998
9005
  return client.extend(publicActions);
6999
9006
  }
7000
9007
 
7001
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/clients/transports/createTransport.js
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
+
9673
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/clients/transports/createTransport.js
7002
9674
  function createTransport({ key, methods, name, request, retryCount = 3, retryDelay = 150, timeout, type }, value) {
7003
9675
  const uid2 = uid();
7004
9676
  return {
@@ -7017,6 +9689,153 @@ function createTransport({ key, methods, name, request, retryCount = 3, retryDel
7017
9689
  };
7018
9690
  }
7019
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
+
7020
9839
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/transport.js
7021
9840
  var UrlRequiredError = class extends BaseError {
7022
9841
  constructor() {
@@ -7104,194 +9923,383 @@ function http(url, config = {}) {
7104
9923
  };
7105
9924
  }
7106
9925
 
7107
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/op-stack/contracts.js
7108
- var contracts = {
7109
- gasPriceOracle: { address: "0x420000000000000000000000000000000000000F" },
7110
- l1Block: { address: "0x4200000000000000000000000000000000000015" },
7111
- l2CrossDomainMessenger: {
7112
- address: "0x4200000000000000000000000000000000000007"
7113
- },
7114
- l2Erc721Bridge: { address: "0x4200000000000000000000000000000000000014" },
7115
- l2StandardBridge: { address: "0x4200000000000000000000000000000000000010" },
7116
- l2ToL1MessagePasser: {
7117
- 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;
7118
10028
  }
7119
10029
  };
7120
10030
 
7121
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/op-stack/formatters.js
7122
- var formatters = {
7123
- block: /* @__PURE__ */ defineBlock({
7124
- format(args) {
7125
- const transactions = args.transactions?.map((transaction) => {
7126
- if (typeof transaction === "string")
7127
- return transaction;
7128
- const formatted = formatTransaction(transaction);
7129
- if (formatted.typeHex === "0x7e") {
7130
- formatted.isSystemTx = transaction.isSystemTx;
7131
- formatted.mint = transaction.mint ? hexToBigInt(transaction.mint) : void 0;
7132
- formatted.sourceHash = transaction.sourceHash;
7133
- 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;
7134
10068
  }
7135
- return formatted;
7136
- });
7137
- return {
7138
- transactions,
7139
- stateRoot: args.stateRoot
7140
- };
7141
- }
7142
- }),
7143
- transaction: /* @__PURE__ */ defineTransaction({
7144
- format(args) {
7145
- const transaction = {};
7146
- if (args.type === "0x7e") {
7147
- transaction.isSystemTx = args.isSystemTx;
7148
- transaction.mint = args.mint ? hexToBigInt(args.mint) : void 0;
7149
- transaction.sourceHash = args.sourceHash;
7150
- transaction.type = "deposit";
10069
+ data.pushByte(byte);
7151
10070
  }
7152
- return transaction;
7153
- }
7154
- }),
7155
- transactionReceipt: /* @__PURE__ */ defineTransactionReceipt({
7156
- format(args) {
7157
- return {
7158
- ...args.depositNonce ? { depositNonce: hexToBigInt(args.depositNonce) } : {},
7159
- ...args.depositReceiptVersion ? { depositReceiptVersion: hexToNumber(args.depositReceiptVersion) } : {},
7160
- l1GasPrice: args.l1GasPrice ? hexToBigInt(args.l1GasPrice) : null,
7161
- l1GasUsed: args.l1GasUsed ? hexToBigInt(args.l1GasUsed) : null,
7162
- l1Fee: args.l1Fee ? hexToBigInt(args.l1Fee) : null,
7163
- l1FeeScalar: args.l1FeeScalar ? Number(args.l1FeeScalar) : null
7164
- };
7165
10071
  }
7166
- })
7167
- };
10072
+ }
10073
+ const trimmedData = data.bytes.slice(0, data.position);
10074
+ return to === "hex" ? bytesToHex(trimmedData) : trimmedData;
10075
+ }
7168
10076
 
7169
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/op-stack/serializers.js
7170
- function serializeTransaction2(transaction, signature) {
7171
- if (isDeposit(transaction))
7172
- return serializeTransactionDeposit(transaction);
7173
- 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;
7174
10090
  }
7175
- var serializers = {
7176
- transaction: serializeTransaction2
7177
- };
7178
- function serializeTransactionDeposit(transaction) {
7179
- assertTransactionDeposit(transaction);
7180
- const { sourceHash, data, from: from13, gas, isSystemTx, mint, to, value } = transaction;
7181
- const serializedTransaction = [
7182
- sourceHash,
7183
- from13,
7184
- to ?? "0x",
7185
- mint ? toHex(mint) : "0x",
7186
- value ? toHex(value) : "0x",
7187
- gas ? toHex(gas) : "0x",
7188
- isSystemTx ? "0x1" : "0x",
7189
- data ?? "0x"
7190
- ];
7191
- return concatHex([
7192
- "0x7e",
7193
- toRlp(serializedTransaction)
7194
- ]);
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);
7195
10100
  }
7196
- function isDeposit(transaction) {
7197
- if (transaction.type === "deposit")
7198
- return true;
7199
- if (typeof transaction.sourceHash !== "undefined")
7200
- return true;
7201
- 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
+ };
7202
10108
  }
7203
- function assertTransactionDeposit(transaction) {
7204
- const { from: from13, to } = transaction;
7205
- if (from13 && !isAddress(from13))
7206
- throw new InvalidAddressError({ address: from13 });
7207
- if (to && !isAddress(to))
7208
- 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);
7209
10120
  }
7210
10121
 
7211
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/op-stack/chainConfig.js
7212
- var chainConfig = {
7213
- blockTime: 2e3,
7214
- contracts,
7215
- formatters,
7216
- serializers
7217
- };
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
+ }
7218
10131
 
7219
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/chains/definitions/base.js
7220
- var sourceId = 1;
7221
- var base = /* @__PURE__ */ defineChain({
7222
- ...chainConfig,
7223
- id: 8453,
7224
- name: "Base",
7225
- nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
7226
- rpcUrls: {
7227
- default: {
7228
- http: ["https://mainnet.base.org"]
7229
- }
7230
- },
7231
- blockExplorers: {
7232
- default: {
7233
- name: "Basescan",
7234
- url: "https://basescan.org",
7235
- apiUrl: "https://api.basescan.org/api"
7236
- }
7237
- },
7238
- contracts: {
7239
- ...chainConfig.contracts,
7240
- disputeGameFactory: {
7241
- [sourceId]: {
7242
- address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"
7243
- }
7244
- },
7245
- l2OutputOracle: {
7246
- [sourceId]: {
7247
- address: "0x56315b90c40730925ec5485cf004d835058518A0"
7248
- }
7249
- },
7250
- multicall3: {
7251
- address: "0xca11bde05977b3631167028862be2a173976ca11",
7252
- blockCreated: 5022
7253
- },
7254
- portal: {
7255
- [sourceId]: {
7256
- address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",
7257
- blockCreated: 17482143
7258
- }
7259
- },
7260
- l1StandardBridge: {
7261
- [sourceId]: {
7262
- address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35",
7263
- blockCreated: 17482143
7264
- }
7265
- }
7266
- },
7267
- sourceId
7268
- });
7269
- var basePreconf = /* @__PURE__ */ defineChain({
7270
- ...base,
7271
- experimental_preconfirmationTime: 200,
7272
- rpcUrls: {
7273
- default: {
7274
- http: ["https://mainnet-preconf.base.org"]
7275
- }
7276
- }
7277
- });
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
+ }
7278
10140
 
7279
- // src/lib/usdc.ts
7280
- var USDC_ADDRESS = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
7281
- var USDC_DECIMALS = 6;
7282
- async function getUsdcBalance(address, rpcUrl) {
7283
- const client = createPublicClient({ chain: base, transport: http(rpcUrl) });
7284
- return client.readContract({
7285
- address: USDC_ADDRESS,
7286
- abi: erc20Abi,
7287
- functionName: "balanceOf",
7288
- 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
10185
+ });
10186
+ return await recoverAddress({
10187
+ hash: keccak256(serialized),
10188
+ signature
7289
10189
  });
7290
10190
  }
7291
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 };
10208
+ }
10209
+
7292
10210
  export {
7293
- USDC_ADDRESS,
7294
- USDC_DECIMALS,
7295
- 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
7296
10304
  };
7297
- //# sourceMappingURL=chunk-IPOWB3G3.js.map
10305
+ //# sourceMappingURL=chunk-UGX7YPX2.js.map