tenjin-cli 0.1.0-alpha.3 → 0.1.0-alpha.5

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 (157) hide show
  1. package/README.md +322 -197
  2. package/dist/{_esm-FEASBWRP.js → _esm-N4KAVXQR.js} +9 -9
  3. package/dist/buy-YMXXVNFH.js +42 -0
  4. package/dist/candidate-H7FR4AU5.js +22 -0
  5. package/dist/{ccip-XR5NE5QK.js → ccip-RPPPKTJR.js} +5 -5
  6. package/dist/{ccip-NQXCEK2U.js → ccip-ZGGWQN4X.js} +4 -4
  7. package/dist/{chunk-MUBUQVC3.js → chunk-2JQ5JSG6.js} +3 -2
  8. package/dist/{chunk-MUBUQVC3.js.map → chunk-2JQ5JSG6.js.map} +1 -1
  9. package/dist/{chunk-662MSGZB.js → chunk-3IRDP7TN.js} +100 -66
  10. package/dist/chunk-3IRDP7TN.js.map +1 -0
  11. package/dist/{chunk-YALGASEU.js → chunk-47PP7TAG.js} +1610 -1610
  12. package/dist/chunk-47PP7TAG.js.map +1 -0
  13. package/dist/{buy-EE6SEXP6.js → chunk-4WVKXKDK.js} +27 -59
  14. package/dist/chunk-4WVKXKDK.js.map +1 -0
  15. package/dist/chunk-5SCU253N.js +412 -0
  16. package/dist/chunk-5SCU253N.js.map +1 -0
  17. package/dist/{chunk-UGX7YPX2.js → chunk-7FK2UN2T.js} +65 -65
  18. package/dist/{chunk-UGX7YPX2.js.map → chunk-7FK2UN2T.js.map} +1 -1
  19. package/dist/chunk-ADJYSM45.js +135 -0
  20. package/dist/chunk-ADJYSM45.js.map +1 -0
  21. package/dist/{chunk-DXTQ3CSI.js → chunk-BIKAUVC2.js} +43 -11
  22. package/dist/chunk-BIKAUVC2.js.map +1 -0
  23. package/dist/{chunk-Z6MFJV5Z.js → chunk-C444K6MI.js} +266 -55
  24. package/dist/chunk-C444K6MI.js.map +1 -0
  25. package/dist/{chunk-JPHG2JW3.js → chunk-CVX6JNGD.js} +26 -26
  26. package/dist/chunk-CVX6JNGD.js.map +1 -0
  27. package/dist/{chunk-S3IGX57D.js → chunk-FU6MCSLG.js} +9 -9
  28. package/dist/{lookup-ZPN2Q67N.js → chunk-HTDALK7M.js} +46 -32
  29. package/dist/chunk-HTDALK7M.js.map +1 -0
  30. package/dist/chunk-IOPWPMT2.js +239 -0
  31. package/dist/chunk-IOPWPMT2.js.map +1 -0
  32. package/dist/{chunk-5CLSD5YN.js → chunk-KYQVEKP5.js} +7 -7
  33. package/dist/{chunk-RRN3YTK7.js → chunk-KZAAWQNP.js} +3 -3
  34. package/dist/{chunk-7KUW4MJD.js → chunk-L4IHCN6B.js} +11 -7
  35. package/dist/chunk-L4IHCN6B.js.map +1 -0
  36. package/dist/{chunk-XHC6FCGZ.js → chunk-LAM66WFJ.js} +25 -11
  37. package/dist/chunk-LAM66WFJ.js.map +1 -0
  38. package/dist/{chunk-NCE5NSN6.js → chunk-M2O56UK7.js} +158 -158
  39. package/dist/chunk-M2O56UK7.js.map +1 -0
  40. package/dist/{chunk-GO75V3NZ.js → chunk-MDDGEGSW.js} +8 -6
  41. package/dist/chunk-MDDGEGSW.js.map +1 -0
  42. package/dist/{chunk-XJIW7USF.js → chunk-MJZZTKCC.js} +112 -6
  43. package/dist/chunk-MJZZTKCC.js.map +1 -0
  44. package/dist/{chunk-Z52RA3NC.js → chunk-NFSOVL3C.js} +51 -21
  45. package/dist/chunk-NFSOVL3C.js.map +1 -0
  46. package/dist/{chunk-FJPLRISB.js → chunk-NJF2WENW.js} +5 -4
  47. package/dist/chunk-NJF2WENW.js.map +1 -0
  48. package/dist/{chunk-OYMYCW7J.js → chunk-PAUXMRSF.js} +45 -4
  49. package/dist/{chunk-OYMYCW7J.js.map → chunk-PAUXMRSF.js.map} +1 -1
  50. package/dist/{chunk-ZABPQJ3M.js → chunk-POJRB2AE.js} +2 -2
  51. package/dist/{publish-BKBQQAW4.js → chunk-PYNSGYBE.js} +254 -57
  52. package/dist/chunk-PYNSGYBE.js.map +1 -0
  53. package/dist/{chunk-YN5SHIXQ.js → chunk-QONTBYQW.js} +12 -9
  54. package/dist/chunk-QONTBYQW.js.map +1 -0
  55. package/dist/chunk-QW2Q2KAH.js +27 -0
  56. package/dist/chunk-QW2Q2KAH.js.map +1 -0
  57. package/dist/chunk-RTJLLPFA.js +599 -0
  58. package/dist/chunk-RTJLLPFA.js.map +1 -0
  59. package/dist/{chunk-CYOF7ROH.js → chunk-S5RYMCV6.js} +3 -3
  60. package/dist/chunk-TXPPMK4L.js +59 -0
  61. package/dist/chunk-TXPPMK4L.js.map +1 -0
  62. package/dist/{chunk-ZMHYXMO6.js → chunk-U5S527PP.js} +3 -3
  63. package/dist/{chunk-RY4XKNV3.js → chunk-UHTVXQ2O.js} +3 -3
  64. package/dist/{chunk-QVX5MWJZ.js → chunk-W6R3HAAG.js} +2 -2
  65. package/dist/{chunk-3OV7E5G5.js → chunk-WWX32ML4.js} +1 -1
  66. package/dist/{chunk-3OV7E5G5.js.map → chunk-WWX32ML4.js.map} +1 -1
  67. package/dist/{chunk-HIVZG55D.js → chunk-XJN5WUKL.js} +2 -2
  68. package/dist/{chunk-HSDCI7OV.js → chunk-YLYINX2H.js} +3 -3
  69. package/dist/{chunk-4ONXEEQL.js → chunk-ZDY2KY5X.js} +2 -2
  70. package/dist/{chunk-4ONXEEQL.js.map → chunk-ZDY2KY5X.js.map} +1 -1
  71. package/dist/{chunk-TLCMMYLY.js → chunk-ZIYVN4CD.js} +6 -6
  72. package/dist/chunk-ZIYVN4CD.js.map +1 -0
  73. package/dist/{candidate-ERMSYYQZ.js → chunk-ZW3B5LWX.js} +15 -19
  74. package/dist/{candidate-ERMSYYQZ.js.map → chunk-ZW3B5LWX.js.map} +1 -1
  75. package/dist/{cli-SBXI5AMS.js → cli-IW76QTN3.js} +64 -40
  76. package/dist/{cli-SBXI5AMS.js.map → cli-IW76QTN3.js.map} +1 -1
  77. package/dist/{config-VELDKLHY.js → config-VCOS7P5K.js} +8 -6
  78. package/dist/{doctor-T3KWNNP2.js → doctor-WS65JG3V.js} +9 -8
  79. package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js → ethersCompat-Df4a6QIZ-WHYKB6HA.js} +5 -5
  80. package/dist/index.js +1 -1
  81. package/dist/inspect-SFJWUQHO.js +33 -0
  82. package/dist/install-RVPQPCKH.js +589 -0
  83. package/dist/install-RVPQPCKH.js.map +1 -0
  84. package/dist/outcome-GNYCSZ7J.js +20 -0
  85. package/dist/publish-DSFWQRUN.js +36 -0
  86. package/dist/publish-DSFWQRUN.js.map +1 -0
  87. package/dist/run-OMPKA43G.js +16807 -0
  88. package/dist/run-OMPKA43G.js.map +1 -0
  89. package/dist/search-KOI6Y7P6.js +24 -0
  90. package/dist/search-KOI6Y7P6.js.map +1 -0
  91. package/dist/{secp256k1-N3ZHU7LB.js → secp256k1-XRPVBC6V.js} +3 -3
  92. package/dist/secp256k1-XRPVBC6V.js.map +1 -0
  93. package/dist/send-3G4C64HJ.js +222 -0
  94. package/dist/send-3G4C64HJ.js.map +1 -0
  95. package/dist/usdc-4VCDHFWX.js +38 -0
  96. package/dist/usdc-4VCDHFWX.js.map +1 -0
  97. package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js → viemAdapter-By13KInL-TUQJBMHM.js} +5 -5
  98. package/dist/viemAdapter-By13KInL-TUQJBMHM.js.map +1 -0
  99. package/dist/wallet-B7KJS2R5.js +40 -0
  100. package/dist/wallet-B7KJS2R5.js.map +1 -0
  101. package/dist/wallet-PP22LAX7.js +31 -0
  102. package/dist/wallet-PP22LAX7.js.map +1 -0
  103. package/package.json +4 -3
  104. package/skills/tenjin/SKILL.md +83 -15
  105. package/skills/tenjin-publish/SKILL.md +118 -18
  106. package/skills/tenjin-search/SKILL.md +149 -31
  107. package/dist/buy-EE6SEXP6.js.map +0 -1
  108. package/dist/chunk-662MSGZB.js.map +0 -1
  109. package/dist/chunk-7KUW4MJD.js.map +0 -1
  110. package/dist/chunk-AWPAWHNX.js +0 -333
  111. package/dist/chunk-AWPAWHNX.js.map +0 -1
  112. package/dist/chunk-DXTQ3CSI.js.map +0 -1
  113. package/dist/chunk-ESPNTPQ2.js +0 -207
  114. package/dist/chunk-ESPNTPQ2.js.map +0 -1
  115. package/dist/chunk-FJPLRISB.js.map +0 -1
  116. package/dist/chunk-GO75V3NZ.js.map +0 -1
  117. package/dist/chunk-JPHG2JW3.js.map +0 -1
  118. package/dist/chunk-NCE5NSN6.js.map +0 -1
  119. package/dist/chunk-TLCMMYLY.js.map +0 -1
  120. package/dist/chunk-XHC6FCGZ.js.map +0 -1
  121. package/dist/chunk-XJIW7USF.js.map +0 -1
  122. package/dist/chunk-YALGASEU.js.map +0 -1
  123. package/dist/chunk-YN5SHIXQ.js.map +0 -1
  124. package/dist/chunk-Z52RA3NC.js.map +0 -1
  125. package/dist/chunk-Z6MFJV5Z.js.map +0 -1
  126. package/dist/inspect-LMKOXE4Y.js +0 -96
  127. package/dist/inspect-LMKOXE4Y.js.map +0 -1
  128. package/dist/install-LEX3ENQ6.js +0 -387
  129. package/dist/install-LEX3ENQ6.js.map +0 -1
  130. package/dist/lookup-ZPN2Q67N.js.map +0 -1
  131. package/dist/outcome-N7TAK6WR.js +0 -66
  132. package/dist/outcome-N7TAK6WR.js.map +0 -1
  133. package/dist/publish-BKBQQAW4.js.map +0 -1
  134. package/dist/usdc-JIAJW4SV.js +0 -22
  135. package/dist/wallet-CWEMYVIH.js +0 -179
  136. package/dist/wallet-CWEMYVIH.js.map +0 -1
  137. package/dist/wallet-PA54CRBL.js +0 -30
  138. /package/dist/{_esm-FEASBWRP.js.map → _esm-N4KAVXQR.js.map} +0 -0
  139. /package/dist/{ccip-NQXCEK2U.js.map → buy-YMXXVNFH.js.map} +0 -0
  140. /package/dist/{ccip-XR5NE5QK.js.map → candidate-H7FR4AU5.js.map} +0 -0
  141. /package/dist/{config-VELDKLHY.js.map → ccip-RPPPKTJR.js.map} +0 -0
  142. /package/dist/{doctor-T3KWNNP2.js.map → ccip-ZGGWQN4X.js.map} +0 -0
  143. /package/dist/{chunk-S3IGX57D.js.map → chunk-FU6MCSLG.js.map} +0 -0
  144. /package/dist/{chunk-5CLSD5YN.js.map → chunk-KYQVEKP5.js.map} +0 -0
  145. /package/dist/{chunk-RRN3YTK7.js.map → chunk-KZAAWQNP.js.map} +0 -0
  146. /package/dist/{chunk-ZABPQJ3M.js.map → chunk-POJRB2AE.js.map} +0 -0
  147. /package/dist/{chunk-CYOF7ROH.js.map → chunk-S5RYMCV6.js.map} +0 -0
  148. /package/dist/{chunk-ZMHYXMO6.js.map → chunk-U5S527PP.js.map} +0 -0
  149. /package/dist/{chunk-RY4XKNV3.js.map → chunk-UHTVXQ2O.js.map} +0 -0
  150. /package/dist/{chunk-QVX5MWJZ.js.map → chunk-W6R3HAAG.js.map} +0 -0
  151. /package/dist/{chunk-HIVZG55D.js.map → chunk-XJN5WUKL.js.map} +0 -0
  152. /package/dist/{chunk-HSDCI7OV.js.map → chunk-YLYINX2H.js.map} +0 -0
  153. /package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js.map → config-VCOS7P5K.js.map} +0 -0
  154. /package/dist/{secp256k1-N3ZHU7LB.js.map → doctor-WS65JG3V.js.map} +0 -0
  155. /package/dist/{usdc-JIAJW4SV.js.map → ethersCompat-Df4a6QIZ-WHYKB6HA.js.map} +0 -0
  156. /package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js.map → inspect-SFJWUQHO.js.map} +0 -0
  157. /package/dist/{wallet-PA54CRBL.js.map → outcome-GNYCSZ7J.js.map} +0 -0
@@ -1,11 +1,27 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
2
  import {
3
3
  keccak_256
4
- } from "./chunk-HIVZG55D.js";
4
+ } from "./chunk-XJN5WUKL.js";
5
5
  import {
6
6
  equalBytes
7
7
  } from "./chunk-RBJPAZFI.js";
8
8
 
9
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/isHex.js
10
+ function isHex(value, { strict = true } = {}) {
11
+ if (!value)
12
+ return false;
13
+ if (typeof value !== "string")
14
+ return false;
15
+ return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
16
+ }
17
+
18
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/size.js
19
+ function size(value) {
20
+ if (isHex(value, { strict: false }))
21
+ return Math.ceil((value.length - 2) / 2);
22
+ return value.length;
23
+ }
24
+
9
25
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/version.js
10
26
  var version = "2.55.2";
11
27
 
@@ -96,281 +112,536 @@ function walk(err, fn) {
96
112
  return fn ? null : err;
97
113
  }
98
114
 
99
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/encoding.js
100
- var IntegerOutOfRangeError = class extends BaseError {
101
- constructor({ max, min, signed, size: size4, value }) {
102
- super(`Number "${value}" is not in safe ${size4 ? `${size4 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
115
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/formatAbiItem.js
116
+ function formatAbiItem(abiItem, { includeName = false } = {}) {
117
+ if (abiItem.type !== "function" && abiItem.type !== "event" && abiItem.type !== "error")
118
+ throw new InvalidDefinitionTypeError(abiItem.type);
119
+ return `${abiItem.name}(${formatAbiParams(abiItem.inputs, { includeName })})`;
120
+ }
121
+ function formatAbiParams(params, { includeName = false } = {}) {
122
+ if (!params)
123
+ return "";
124
+ return params.map((param) => formatAbiParam(param, { includeName })).join(includeName ? ", " : ",");
125
+ }
126
+ function formatAbiParam(param, { includeName }) {
127
+ if (param.type.startsWith("tuple")) {
128
+ return `(${formatAbiParams(param.components, { includeName })})${param.type.slice("tuple".length)}`;
103
129
  }
104
- };
105
- var InvalidBytesBooleanError = class extends BaseError {
106
- constructor(bytes) {
107
- super(`Bytes value "${bytes}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {
108
- name: "InvalidBytesBooleanError"
130
+ return param.type + (includeName && param.name ? ` ${param.name}` : "");
131
+ }
132
+
133
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/abi.js
134
+ var AbiConstructorNotFoundError = class extends BaseError {
135
+ constructor({ docsPath }) {
136
+ super([
137
+ "A constructor was not found on the ABI.",
138
+ "Make sure you are using the correct ABI and that the constructor exists on it."
139
+ ].join("\n"), {
140
+ docsPath,
141
+ name: "AbiConstructorNotFoundError"
109
142
  });
110
143
  }
111
144
  };
112
- var InvalidHexBooleanError = class extends BaseError {
113
- constructor(hex) {
114
- super(`Hex value "${hex}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`, { name: "InvalidHexBooleanError" });
145
+ var AbiConstructorParamsNotFoundError = class extends BaseError {
146
+ constructor({ docsPath }) {
147
+ super([
148
+ "Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.",
149
+ "Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."
150
+ ].join("\n"), {
151
+ docsPath,
152
+ name: "AbiConstructorParamsNotFoundError"
153
+ });
115
154
  }
116
155
  };
117
- var InvalidHexValueError = class extends BaseError {
118
- constructor(value) {
119
- super(`Hex value "${value}" is an odd length (${value.length}). It must be an even length.`, { name: "InvalidHexValueError" });
156
+ var AbiDecodingDataSizeInvalidError = class extends BaseError {
157
+ constructor({ data, size: size4 }) {
158
+ super([
159
+ `Data size of ${size4} bytes is invalid.`,
160
+ "Size must be in increments of 32 bytes (size % 32 === 0)."
161
+ ].join("\n"), {
162
+ metaMessages: [`Data: ${data} (${size4} bytes)`],
163
+ name: "AbiDecodingDataSizeInvalidError"
164
+ });
120
165
  }
121
166
  };
122
- var RlpDepthLimitExceededError = class extends BaseError {
123
- constructor({ limit }) {
124
- super(`RLP depth limit of \`${limit}\` exceeded.`, {
125
- name: "RlpDepthLimitExceededError"
167
+ var AbiDecodingDataSizeTooSmallError = class extends BaseError {
168
+ constructor({ data, params, size: size4 }) {
169
+ super([`Data size of ${size4} bytes is too small for given parameters.`].join("\n"), {
170
+ metaMessages: [
171
+ `Params: (${formatAbiParams(params, { includeName: true })})`,
172
+ `Data: ${data} (${size4} bytes)`
173
+ ],
174
+ name: "AbiDecodingDataSizeTooSmallError"
175
+ });
176
+ Object.defineProperty(this, "data", {
177
+ enumerable: true,
178
+ configurable: true,
179
+ writable: true,
180
+ value: void 0
181
+ });
182
+ Object.defineProperty(this, "params", {
183
+ enumerable: true,
184
+ configurable: true,
185
+ writable: true,
186
+ value: void 0
187
+ });
188
+ Object.defineProperty(this, "size", {
189
+ enumerable: true,
190
+ configurable: true,
191
+ writable: true,
192
+ value: void 0
126
193
  });
194
+ this.data = data;
195
+ this.params = params;
196
+ this.size = size4;
127
197
  }
128
198
  };
129
- var RlpListBoundaryExceededError = class extends BaseError {
130
- constructor({ consumed, declared }) {
131
- super(`RLP list items consumed \`${consumed}\` bytes but the list declared a length of \`${declared}\`.`, { name: "RlpListBoundaryExceededError" });
199
+ var AbiDecodingZeroDataError = class extends BaseError {
200
+ constructor({ cause } = {}) {
201
+ super('Cannot decode zero data ("0x") with ABI parameters.', {
202
+ name: "AbiDecodingZeroDataError",
203
+ cause
204
+ });
132
205
  }
133
206
  };
134
- var RlpTrailingBytesError = class extends BaseError {
135
- constructor({ count }) {
136
- super(`RLP payload encodes a single item, but \`${count}\` trailing ${count === 1 ? "byte remains" : "bytes remain"}.`, { name: "RlpTrailingBytesError" });
207
+ var AbiEncodingArrayLengthMismatchError = class extends BaseError {
208
+ constructor({ expectedLength, givenLength, type }) {
209
+ super([
210
+ `ABI encoding array length mismatch for type ${type}.`,
211
+ `Expected length: ${expectedLength}`,
212
+ `Given length: ${givenLength}`
213
+ ].join("\n"), { name: "AbiEncodingArrayLengthMismatchError" });
137
214
  }
138
215
  };
139
- var SizeOverflowError = class extends BaseError {
140
- constructor({ givenSize, maxSize }) {
141
- super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: "SizeOverflowError" });
216
+ var AbiEncodingBytesSizeMismatchError = class extends BaseError {
217
+ constructor({ expectedSize, value }) {
218
+ super(`Size of bytes "${value}" (bytes${size(value)}) does not match expected size (bytes${expectedSize}).`, { name: "AbiEncodingBytesSizeMismatchError" });
142
219
  }
143
220
  };
144
-
145
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/data.js
146
- var SliceOffsetOutOfBoundsError = class extends BaseError {
147
- constructor({ offset, position, size: size4 }) {
148
- super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size4}).`, { name: "SliceOffsetOutOfBoundsError" });
221
+ var AbiEncodingLengthMismatchError = class extends BaseError {
222
+ constructor({ expectedLength, givenLength }) {
223
+ super([
224
+ "ABI encoding params/values length mismatch.",
225
+ `Expected length (params): ${expectedLength}`,
226
+ `Given length (values): ${givenLength}`
227
+ ].join("\n"), { name: "AbiEncodingLengthMismatchError" });
149
228
  }
150
229
  };
151
- var SizeExceedsPaddingSizeError = class extends BaseError {
152
- constructor({ size: size4, targetSize, type }) {
153
- super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${size4}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
230
+ var AbiErrorInputsNotFoundError = class extends BaseError {
231
+ constructor(errorName, { docsPath }) {
232
+ super([
233
+ `Arguments (\`args\`) were provided to "${errorName}", but "${errorName}" on the ABI does not contain any parameters (\`inputs\`).`,
234
+ "Cannot encode error result without knowing what the parameter types are.",
235
+ "Make sure you are using the correct ABI and that the inputs exist on it."
236
+ ].join("\n"), {
237
+ docsPath,
238
+ name: "AbiErrorInputsNotFoundError"
239
+ });
154
240
  }
155
241
  };
156
- var InvalidBytesLengthError = class extends BaseError {
157
- constructor({ size: size4, targetSize, type }) {
158
- super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${size4} ${type} long.`, { name: "InvalidBytesLengthError" });
242
+ var AbiErrorNotFoundError = class extends BaseError {
243
+ constructor(errorName, { docsPath } = {}) {
244
+ super([
245
+ `Error ${errorName ? `"${errorName}" ` : ""}not found on ABI.`,
246
+ "Make sure you are using the correct ABI and that the error exists on it."
247
+ ].join("\n"), {
248
+ docsPath,
249
+ name: "AbiErrorNotFoundError"
250
+ });
159
251
  }
160
252
  };
161
-
162
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/pad.js
163
- function pad(hexOrBytes, { dir, size: size4 = 32 } = {}) {
164
- if (typeof hexOrBytes === "string")
165
- return padHex(hexOrBytes, { dir, size: size4 });
166
- return padBytes(hexOrBytes, { dir, size: size4 });
167
- }
168
- function padHex(hex_, { dir, size: size4 = 32 } = {}) {
169
- if (size4 === null)
170
- return hex_;
171
- const hex = hex_.replace("0x", "");
172
- if (hex.length > size4 * 2)
173
- throw new SizeExceedsPaddingSizeError({
174
- size: Math.ceil(hex.length / 2),
175
- targetSize: size4,
176
- type: "hex"
253
+ var AbiErrorSignatureNotFoundError = class extends BaseError {
254
+ constructor(signature, { docsPath, cause }) {
255
+ super([
256
+ `Encoded error signature "${signature}" not found on ABI.`,
257
+ "Make sure you are using the correct ABI and that the error exists on it.",
258
+ `You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${signature}.`
259
+ ].join("\n"), {
260
+ docsPath,
261
+ name: "AbiErrorSignatureNotFoundError",
262
+ cause
177
263
  });
178
- return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size4 * 2, "0")}`;
179
- }
180
- function padBytes(bytes, { dir, size: size4 = 32 } = {}) {
181
- if (size4 === null)
182
- return bytes;
183
- if (bytes.length > size4)
184
- throw new SizeExceedsPaddingSizeError({
185
- size: bytes.length,
186
- targetSize: size4,
187
- type: "bytes"
264
+ Object.defineProperty(this, "signature", {
265
+ enumerable: true,
266
+ configurable: true,
267
+ writable: true,
268
+ value: void 0
188
269
  });
189
- const paddedBytes = new Uint8Array(size4);
190
- for (let i = 0; i < size4; i++) {
191
- const padEnd = dir === "right";
192
- paddedBytes[padEnd ? i : size4 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
270
+ this.signature = signature;
193
271
  }
194
- return paddedBytes;
195
- }
196
-
197
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/isHex.js
198
- function isHex(value, { strict = true } = {}) {
199
- if (!value)
200
- return false;
201
- if (typeof value !== "string")
202
- return false;
203
- return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
204
- }
205
-
206
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/size.js
207
- function size(value) {
208
- if (isHex(value, { strict: false }))
209
- return Math.ceil((value.length - 2) / 2);
210
- return value.length;
211
- }
212
-
213
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/trim.js
214
- function trim(hexOrBytes, { dir = "left" } = {}) {
215
- let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
216
- let sliceLength = 0;
217
- for (let i = 0; i < data.length - 1; i++) {
218
- if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
219
- sliceLength++;
220
- else
221
- break;
272
+ };
273
+ var AbiEventSignatureEmptyTopicsError = class extends BaseError {
274
+ constructor({ docsPath }) {
275
+ super("Cannot extract event signature from empty topics.", {
276
+ docsPath,
277
+ name: "AbiEventSignatureEmptyTopicsError"
278
+ });
222
279
  }
223
- data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
224
- if (typeof hexOrBytes === "string") {
225
- if (data.length === 1 && dir === "right")
226
- data = `${data}0`;
227
- return `0x${data.length % 2 === 1 ? `0${data}` : data}`;
280
+ };
281
+ var AbiEventSignatureNotFoundError = class extends BaseError {
282
+ constructor(signature, { docsPath }) {
283
+ super([
284
+ `Encoded event signature "${signature}" not found on ABI.`,
285
+ "Make sure you are using the correct ABI and that the event exists on it.",
286
+ `You can look up the signature here: https://4byte.sourcify.dev/?q=${signature}.`
287
+ ].join("\n"), {
288
+ docsPath,
289
+ name: "AbiEventSignatureNotFoundError"
290
+ });
228
291
  }
229
- return data;
230
- }
231
-
232
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/fromHex.js
233
- function assertSize(hexOrBytes, { size: size4 }) {
234
- if (size(hexOrBytes) > size4)
235
- throw new SizeOverflowError({
236
- givenSize: size(hexOrBytes),
237
- maxSize: size4
292
+ };
293
+ var AbiEventNotFoundError = class extends BaseError {
294
+ constructor(eventName, { docsPath } = {}) {
295
+ super([
296
+ `Event ${eventName ? `"${eventName}" ` : ""}not found on ABI.`,
297
+ "Make sure you are using the correct ABI and that the event exists on it."
298
+ ].join("\n"), {
299
+ docsPath,
300
+ name: "AbiEventNotFoundError"
238
301
  });
239
- }
240
- function fromHex(hex, toOrOpts) {
241
- const opts = typeof toOrOpts === "string" ? { to: toOrOpts } : toOrOpts;
242
- const to = opts.to;
243
- if (to === "number")
244
- return hexToNumber(hex, opts);
245
- if (to === "bigint")
246
- return hexToBigInt(hex, opts);
247
- if (to === "string")
248
- return hexToString(hex, opts);
249
- if (to === "boolean")
250
- return hexToBool(hex, opts);
251
- return hexToBytes(hex, opts);
252
- }
253
- function hexToBigInt(hex, opts = {}) {
254
- const { signed } = opts;
255
- if (opts.size)
256
- assertSize(hex, { size: opts.size });
257
- const value = BigInt(hex);
258
- if (!signed)
259
- return value;
260
- const size4 = (hex.length - 2) / 2;
261
- const max = (1n << BigInt(size4) * 8n - 1n) - 1n;
262
- if (value <= max)
263
- return value;
264
- return value - BigInt(`0x${"f".padStart(size4 * 2, "f")}`) - 1n;
265
- }
266
- function hexToBool(hex_, opts = {}) {
267
- let hex = hex_;
268
- if (opts.size) {
269
- assertSize(hex, { size: opts.size });
270
- hex = trim(hex);
271
302
  }
272
- if (trim(hex) === "0x00")
273
- return false;
274
- if (trim(hex) === "0x01")
275
- return true;
276
- throw new InvalidHexBooleanError(hex);
277
- }
278
- function hexToNumber(hex, opts = {}) {
279
- const value = hexToBigInt(hex, opts);
280
- const number = Number(value);
281
- if (!Number.isSafeInteger(number))
282
- throw new IntegerOutOfRangeError({
283
- max: `${Number.MAX_SAFE_INTEGER}`,
284
- min: `${Number.MIN_SAFE_INTEGER}`,
285
- signed: opts.signed,
286
- size: opts.size,
287
- value: `${value}n`
303
+ };
304
+ var AbiFunctionNotFoundError = class extends BaseError {
305
+ constructor(functionName, { docsPath } = {}) {
306
+ super([
307
+ `Function ${functionName ? `"${functionName}" ` : ""}not found on ABI.`,
308
+ "Make sure you are using the correct ABI and that the function exists on it."
309
+ ].join("\n"), {
310
+ docsPath,
311
+ name: "AbiFunctionNotFoundError"
288
312
  });
289
- return number;
290
- }
291
- function hexToString(hex, opts = {}) {
292
- let bytes = hexToBytes(hex);
293
- if (opts.size) {
294
- assertSize(bytes, { size: opts.size });
295
- bytes = trim(bytes, { dir: "right" });
296
313
  }
297
- return new TextDecoder().decode(bytes);
298
- }
299
-
300
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/toHex.js
301
- var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
302
- function toHex(value, opts = {}) {
303
- if (typeof value === "number" || typeof value === "bigint")
304
- return numberToHex(value, opts);
305
- if (typeof value === "string") {
306
- return stringToHex(value, opts);
314
+ };
315
+ var AbiFunctionOutputsNotFoundError = class extends BaseError {
316
+ constructor(functionName, { docsPath }) {
317
+ super([
318
+ `Function "${functionName}" does not contain any \`outputs\` on ABI.`,
319
+ "Cannot decode function result without knowing what the parameter types are.",
320
+ "Make sure you are using the correct ABI and that the function exists on it."
321
+ ].join("\n"), {
322
+ docsPath,
323
+ name: "AbiFunctionOutputsNotFoundError"
324
+ });
307
325
  }
308
- if (typeof value === "boolean")
309
- return boolToHex(value, opts);
310
- return bytesToHex(value, opts);
311
- }
312
- function boolToHex(value, opts = {}) {
313
- const hex = `0x${Number(value)}`;
314
- if (typeof opts.size === "number") {
315
- assertSize(hex, { size: opts.size });
316
- return pad(hex, { size: opts.size });
326
+ };
327
+ var AbiFunctionSignatureNotFoundError = class extends BaseError {
328
+ constructor(signature, { docsPath }) {
329
+ super([
330
+ `Encoded function signature "${signature}" not found on ABI.`,
331
+ "Make sure you are using the correct ABI and that the function exists on it.",
332
+ `You can look up the signature here: https://4byte.sourcify.dev/?q=${signature}.`
333
+ ].join("\n"), {
334
+ docsPath,
335
+ name: "AbiFunctionSignatureNotFoundError"
336
+ });
317
337
  }
318
- return hex;
319
- }
320
- function bytesToHex(value, opts = {}) {
321
- let string = "";
322
- for (let i = 0; i < value.length; i++) {
323
- string += hexes[value[i]];
338
+ };
339
+ var AbiItemAmbiguityError = class extends BaseError {
340
+ constructor(x, y) {
341
+ super("Found ambiguous types in overloaded ABI items.", {
342
+ metaMessages: [
343
+ `\`${x.type}\` in \`${formatAbiItem(x.abiItem)}\`, and`,
344
+ `\`${y.type}\` in \`${formatAbiItem(y.abiItem)}\``,
345
+ "",
346
+ "These types encode differently and cannot be distinguished at runtime.",
347
+ "Remove one of the ambiguous items in the ABI."
348
+ ],
349
+ name: "AbiItemAmbiguityError"
350
+ });
324
351
  }
325
- const hex = `0x${string}`;
326
- if (typeof opts.size === "number") {
327
- assertSize(hex, { size: opts.size });
328
- return pad(hex, { dir: "right", size: opts.size });
352
+ };
353
+ var BytesSizeMismatchError = class extends BaseError {
354
+ constructor({ expectedSize, givenSize }) {
355
+ super(`Expected bytes${expectedSize}, got bytes${givenSize}.`, {
356
+ name: "BytesSizeMismatchError"
357
+ });
329
358
  }
330
- return hex;
331
- }
332
- function numberToHex(value_, opts = {}) {
333
- const { signed, size: size4 } = opts;
334
- const value = BigInt(value_);
335
- let maxValue;
336
- if (size4) {
337
- if (signed)
338
- maxValue = (1n << BigInt(size4) * 8n - 1n) - 1n;
339
- else
340
- maxValue = 2n ** (BigInt(size4) * 8n) - 1n;
341
- } else if (typeof value_ === "number") {
342
- maxValue = BigInt(Number.MAX_SAFE_INTEGER);
359
+ };
360
+ var DecodeLogDataMismatch = class extends BaseError {
361
+ constructor({ abiItem, data, params, size: size4 }) {
362
+ super([
363
+ `Data size of ${size4} bytes is too small for non-indexed event parameters.`
364
+ ].join("\n"), {
365
+ metaMessages: [
366
+ `Params: (${formatAbiParams(params, { includeName: true })})`,
367
+ `Data: ${data} (${size4} bytes)`
368
+ ],
369
+ name: "DecodeLogDataMismatch"
370
+ });
371
+ Object.defineProperty(this, "abiItem", {
372
+ enumerable: true,
373
+ configurable: true,
374
+ writable: true,
375
+ value: void 0
376
+ });
377
+ Object.defineProperty(this, "data", {
378
+ enumerable: true,
379
+ configurable: true,
380
+ writable: true,
381
+ value: void 0
382
+ });
383
+ Object.defineProperty(this, "params", {
384
+ enumerable: true,
385
+ configurable: true,
386
+ writable: true,
387
+ value: void 0
388
+ });
389
+ Object.defineProperty(this, "size", {
390
+ enumerable: true,
391
+ configurable: true,
392
+ writable: true,
393
+ value: void 0
394
+ });
395
+ this.abiItem = abiItem;
396
+ this.data = data;
397
+ this.params = params;
398
+ this.size = size4;
343
399
  }
344
- const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
345
- if (maxValue && value > maxValue || value < minValue) {
346
- const suffix = typeof value_ === "bigint" ? "n" : "";
347
- throw new IntegerOutOfRangeError({
348
- max: maxValue ? `${maxValue}${suffix}` : void 0,
349
- min: `${minValue}${suffix}`,
350
- signed,
351
- size: size4,
352
- value: `${value_}${suffix}`
400
+ };
401
+ var DecodeLogTopicsMismatch = class extends BaseError {
402
+ constructor({ abiItem, param }) {
403
+ super([
404
+ `Expected a topic for indexed event parameter${param.name ? ` "${param.name}"` : ""} on event "${formatAbiItem(abiItem, { includeName: true })}".`
405
+ ].join("\n"), { name: "DecodeLogTopicsMismatch" });
406
+ Object.defineProperty(this, "abiItem", {
407
+ enumerable: true,
408
+ configurable: true,
409
+ writable: true,
410
+ value: void 0
353
411
  });
412
+ this.abiItem = abiItem;
354
413
  }
355
- const hex = `0x${(signed && value < 0 ? (1n << BigInt(size4 * 8)) + BigInt(value) : value).toString(16)}`;
356
- if (size4)
357
- return pad(hex, { size: size4 });
358
- return hex;
359
- }
360
- var encoder = /* @__PURE__ */ new TextEncoder();
361
- function stringToHex(value_, opts = {}) {
362
- const value = encoder.encode(value_);
363
- return bytesToHex(value, opts);
364
- }
365
-
366
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/toBytes.js
367
- var encoder2 = /* @__PURE__ */ new TextEncoder();
368
- function toBytes(value, opts = {}) {
369
- if (typeof value === "number" || typeof value === "bigint")
370
- return numberToBytes(value, opts);
371
- if (typeof value === "boolean")
372
- return boolToBytes(value, opts);
373
- if (isHex(value))
414
+ };
415
+ var InvalidAbiEncodingTypeError = class extends BaseError {
416
+ constructor(type, { docsPath }) {
417
+ super([
418
+ `Type "${type}" is not a valid encoding type.`,
419
+ "Please provide a valid ABI type."
420
+ ].join("\n"), { docsPath, name: "InvalidAbiEncodingType" });
421
+ }
422
+ };
423
+ var InvalidAbiDecodingTypeError = class extends BaseError {
424
+ constructor(type, { docsPath }) {
425
+ super([
426
+ `Type "${type}" is not a valid decoding type.`,
427
+ "Please provide a valid ABI type."
428
+ ].join("\n"), { docsPath, name: "InvalidAbiDecodingType" });
429
+ }
430
+ };
431
+ var InvalidArrayError = class extends BaseError {
432
+ constructor(value) {
433
+ super([`Value "${value}" is not a valid array.`].join("\n"), {
434
+ name: "InvalidArrayError"
435
+ });
436
+ }
437
+ };
438
+ var InvalidDefinitionTypeError = class extends BaseError {
439
+ constructor(type) {
440
+ super([
441
+ `"${type}" is not a valid definition type.`,
442
+ 'Valid types: "function", "event", "error"'
443
+ ].join("\n"), { name: "InvalidDefinitionTypeError" });
444
+ }
445
+ };
446
+ var UnsupportedPackedAbiType = class extends BaseError {
447
+ constructor(type) {
448
+ super(`Type "${type}" is not supported for packed encoding.`, {
449
+ name: "UnsupportedPackedAbiType"
450
+ });
451
+ }
452
+ };
453
+
454
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/data.js
455
+ var SliceOffsetOutOfBoundsError = class extends BaseError {
456
+ constructor({ offset, position, size: size4 }) {
457
+ super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size4}).`, { name: "SliceOffsetOutOfBoundsError" });
458
+ }
459
+ };
460
+ var SizeExceedsPaddingSizeError = class extends BaseError {
461
+ constructor({ size: size4, targetSize, type }) {
462
+ super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${size4}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
463
+ }
464
+ };
465
+ var InvalidBytesLengthError = class extends BaseError {
466
+ constructor({ size: size4, targetSize, type }) {
467
+ super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${size4} ${type} long.`, { name: "InvalidBytesLengthError" });
468
+ }
469
+ };
470
+
471
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/pad.js
472
+ function pad(hexOrBytes, { dir, size: size4 = 32 } = {}) {
473
+ if (typeof hexOrBytes === "string")
474
+ return padHex(hexOrBytes, { dir, size: size4 });
475
+ return padBytes(hexOrBytes, { dir, size: size4 });
476
+ }
477
+ function padHex(hex_, { dir, size: size4 = 32 } = {}) {
478
+ if (size4 === null)
479
+ return hex_;
480
+ const hex = hex_.replace("0x", "");
481
+ if (hex.length > size4 * 2)
482
+ throw new SizeExceedsPaddingSizeError({
483
+ size: Math.ceil(hex.length / 2),
484
+ targetSize: size4,
485
+ type: "hex"
486
+ });
487
+ return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size4 * 2, "0")}`;
488
+ }
489
+ function padBytes(bytes, { dir, size: size4 = 32 } = {}) {
490
+ if (size4 === null)
491
+ return bytes;
492
+ if (bytes.length > size4)
493
+ throw new SizeExceedsPaddingSizeError({
494
+ size: bytes.length,
495
+ targetSize: size4,
496
+ type: "bytes"
497
+ });
498
+ const paddedBytes = new Uint8Array(size4);
499
+ for (let i = 0; i < size4; i++) {
500
+ const padEnd = dir === "right";
501
+ paddedBytes[padEnd ? i : size4 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
502
+ }
503
+ return paddedBytes;
504
+ }
505
+
506
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/encoding.js
507
+ var IntegerOutOfRangeError = class extends BaseError {
508
+ constructor({ max, min, signed, size: size4, value }) {
509
+ super(`Number "${value}" is not in safe ${size4 ? `${size4 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
510
+ }
511
+ };
512
+ var InvalidBytesBooleanError = class extends BaseError {
513
+ constructor(bytes) {
514
+ super(`Bytes value "${bytes}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {
515
+ name: "InvalidBytesBooleanError"
516
+ });
517
+ }
518
+ };
519
+ var InvalidHexBooleanError = class extends BaseError {
520
+ constructor(hex) {
521
+ super(`Hex value "${hex}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`, { name: "InvalidHexBooleanError" });
522
+ }
523
+ };
524
+ var InvalidHexValueError = class extends BaseError {
525
+ constructor(value) {
526
+ super(`Hex value "${value}" is an odd length (${value.length}). It must be an even length.`, { name: "InvalidHexValueError" });
527
+ }
528
+ };
529
+ var RlpDepthLimitExceededError = class extends BaseError {
530
+ constructor({ limit }) {
531
+ super(`RLP depth limit of \`${limit}\` exceeded.`, {
532
+ name: "RlpDepthLimitExceededError"
533
+ });
534
+ }
535
+ };
536
+ var RlpListBoundaryExceededError = class extends BaseError {
537
+ constructor({ consumed, declared }) {
538
+ super(`RLP list items consumed \`${consumed}\` bytes but the list declared a length of \`${declared}\`.`, { name: "RlpListBoundaryExceededError" });
539
+ }
540
+ };
541
+ var RlpTrailingBytesError = class extends BaseError {
542
+ constructor({ count }) {
543
+ super(`RLP payload encodes a single item, but \`${count}\` trailing ${count === 1 ? "byte remains" : "bytes remain"}.`, { name: "RlpTrailingBytesError" });
544
+ }
545
+ };
546
+ var SizeOverflowError = class extends BaseError {
547
+ constructor({ givenSize, maxSize }) {
548
+ super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: "SizeOverflowError" });
549
+ }
550
+ };
551
+
552
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/trim.js
553
+ function trim(hexOrBytes, { dir = "left" } = {}) {
554
+ let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
555
+ let sliceLength = 0;
556
+ for (let i = 0; i < data.length - 1; i++) {
557
+ if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
558
+ sliceLength++;
559
+ else
560
+ break;
561
+ }
562
+ data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
563
+ if (typeof hexOrBytes === "string") {
564
+ if (data.length === 1 && dir === "right")
565
+ data = `${data}0`;
566
+ return `0x${data.length % 2 === 1 ? `0${data}` : data}`;
567
+ }
568
+ return data;
569
+ }
570
+
571
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/toHex.js
572
+ var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
573
+ function toHex(value, opts = {}) {
574
+ if (typeof value === "number" || typeof value === "bigint")
575
+ return numberToHex(value, opts);
576
+ if (typeof value === "string") {
577
+ return stringToHex(value, opts);
578
+ }
579
+ if (typeof value === "boolean")
580
+ return boolToHex(value, opts);
581
+ return bytesToHex(value, opts);
582
+ }
583
+ function boolToHex(value, opts = {}) {
584
+ const hex = `0x${Number(value)}`;
585
+ if (typeof opts.size === "number") {
586
+ assertSize(hex, { size: opts.size });
587
+ return pad(hex, { size: opts.size });
588
+ }
589
+ return hex;
590
+ }
591
+ function bytesToHex(value, opts = {}) {
592
+ let string = "";
593
+ for (let i = 0; i < value.length; i++) {
594
+ string += hexes[value[i]];
595
+ }
596
+ const hex = `0x${string}`;
597
+ if (typeof opts.size === "number") {
598
+ assertSize(hex, { size: opts.size });
599
+ return pad(hex, { dir: "right", size: opts.size });
600
+ }
601
+ return hex;
602
+ }
603
+ function numberToHex(value_, opts = {}) {
604
+ const { signed, size: size4 } = opts;
605
+ const value = BigInt(value_);
606
+ let maxValue;
607
+ if (size4) {
608
+ if (signed)
609
+ maxValue = (1n << BigInt(size4) * 8n - 1n) - 1n;
610
+ else
611
+ maxValue = 2n ** (BigInt(size4) * 8n) - 1n;
612
+ } else if (typeof value_ === "number") {
613
+ maxValue = BigInt(Number.MAX_SAFE_INTEGER);
614
+ }
615
+ const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
616
+ if (maxValue && value > maxValue || value < minValue) {
617
+ const suffix = typeof value_ === "bigint" ? "n" : "";
618
+ throw new IntegerOutOfRangeError({
619
+ max: maxValue ? `${maxValue}${suffix}` : void 0,
620
+ min: `${minValue}${suffix}`,
621
+ signed,
622
+ size: size4,
623
+ value: `${value_}${suffix}`
624
+ });
625
+ }
626
+ const hex = `0x${(signed && value < 0 ? (1n << BigInt(size4 * 8)) + BigInt(value) : value).toString(16)}`;
627
+ if (size4)
628
+ return pad(hex, { size: size4 });
629
+ return hex;
630
+ }
631
+ var encoder = /* @__PURE__ */ new TextEncoder();
632
+ function stringToHex(value_, opts = {}) {
633
+ const value = encoder.encode(value_);
634
+ return bytesToHex(value, opts);
635
+ }
636
+
637
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/toBytes.js
638
+ var encoder2 = /* @__PURE__ */ new TextEncoder();
639
+ function toBytes(value, opts = {}) {
640
+ if (typeof value === "number" || typeof value === "bigint")
641
+ return numberToBytes(value, opts);
642
+ if (typeof value === "boolean")
643
+ return boolToBytes(value, opts);
644
+ if (isHex(value))
374
645
  return hexToBytes(value, opts);
375
646
  return stringToBytes(value, opts);
376
647
  }
@@ -434,27 +705,95 @@ function stringToBytes(value, opts = {}) {
434
705
  return bytes;
435
706
  }
436
707
 
437
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/address.js
438
- var InvalidAddressError = class extends BaseError {
439
- constructor({ address }) {
440
- super(`Address "${address}" is invalid.`, {
441
- metaMessages: [
442
- "- Address must be a hex value of 20 bytes (40 hex characters).",
443
- "- Address must match its checksum counterpart."
444
- ],
445
- name: "InvalidAddressError"
708
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/fromHex.js
709
+ function assertSize(hexOrBytes, { size: size4 }) {
710
+ if (size(hexOrBytes) > size4)
711
+ throw new SizeOverflowError({
712
+ givenSize: size(hexOrBytes),
713
+ maxSize: size4
446
714
  });
447
- }
448
- };
449
-
450
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/hash/keccak256.js
451
- function keccak256(value, to_) {
452
- const to = to_ || "hex";
453
- const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);
454
- if (to === "bytes")
455
- return bytes;
456
- return toHex(bytes);
457
715
  }
716
+ function fromHex(hex, toOrOpts) {
717
+ const opts = typeof toOrOpts === "string" ? { to: toOrOpts } : toOrOpts;
718
+ const to = opts.to;
719
+ if (to === "number")
720
+ return hexToNumber(hex, opts);
721
+ if (to === "bigint")
722
+ return hexToBigInt(hex, opts);
723
+ if (to === "string")
724
+ return hexToString(hex, opts);
725
+ if (to === "boolean")
726
+ return hexToBool(hex, opts);
727
+ return hexToBytes(hex, opts);
728
+ }
729
+ function hexToBigInt(hex, opts = {}) {
730
+ const { signed } = opts;
731
+ if (opts.size)
732
+ assertSize(hex, { size: opts.size });
733
+ const value = BigInt(hex);
734
+ if (!signed)
735
+ return value;
736
+ const size4 = (hex.length - 2) / 2;
737
+ const max = (1n << BigInt(size4) * 8n - 1n) - 1n;
738
+ if (value <= max)
739
+ return value;
740
+ return value - BigInt(`0x${"f".padStart(size4 * 2, "f")}`) - 1n;
741
+ }
742
+ function hexToBool(hex_, opts = {}) {
743
+ let hex = hex_;
744
+ if (opts.size) {
745
+ assertSize(hex, { size: opts.size });
746
+ hex = trim(hex);
747
+ }
748
+ if (trim(hex) === "0x00")
749
+ return false;
750
+ if (trim(hex) === "0x01")
751
+ return true;
752
+ throw new InvalidHexBooleanError(hex);
753
+ }
754
+ function hexToNumber(hex, opts = {}) {
755
+ const value = hexToBigInt(hex, opts);
756
+ const number = Number(value);
757
+ if (!Number.isSafeInteger(number))
758
+ throw new IntegerOutOfRangeError({
759
+ max: `${Number.MAX_SAFE_INTEGER}`,
760
+ min: `${Number.MIN_SAFE_INTEGER}`,
761
+ signed: opts.signed,
762
+ size: opts.size,
763
+ value: `${value}n`
764
+ });
765
+ return number;
766
+ }
767
+ function hexToString(hex, opts = {}) {
768
+ let bytes = hexToBytes(hex);
769
+ if (opts.size) {
770
+ assertSize(bytes, { size: opts.size });
771
+ bytes = trim(bytes, { dir: "right" });
772
+ }
773
+ return new TextDecoder().decode(bytes);
774
+ }
775
+
776
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/hash/keccak256.js
777
+ function keccak256(value, to_) {
778
+ const to = to_ || "hex";
779
+ const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);
780
+ if (to === "bytes")
781
+ return bytes;
782
+ return toHex(bytes);
783
+ }
784
+
785
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/address.js
786
+ var InvalidAddressError = class extends BaseError {
787
+ constructor({ address }) {
788
+ super(`Address "${address}" is invalid.`, {
789
+ metaMessages: [
790
+ "- Address must be a hex value of 20 bytes (40 hex characters).",
791
+ "- Address must match its checksum counterpart."
792
+ ],
793
+ name: "InvalidAddressError"
794
+ });
795
+ }
796
+ };
458
797
 
459
798
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/lru.js
460
799
  var LruMap = class extends Map {
@@ -559,393 +898,527 @@ function concatHex(values) {
559
898
  return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
560
899
  }
561
900
 
562
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/unit.js
563
- var etherUnits = {
564
- gwei: 9,
565
- wei: 18
566
- };
567
- var gweiUnits = {
568
- ether: -9,
569
- wei: 9
570
- };
571
- var weiUnits = {
572
- ether: -18,
573
- gwei: -9
574
- };
575
-
576
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/formatUnits.js
577
- function formatUnits(value, decimals) {
578
- let display = value.toString();
579
- const negative = display.startsWith("-");
580
- if (negative)
581
- display = display.slice(1);
582
- display = display.padStart(decimals, "0");
583
- let [integer, fraction] = [
584
- display.slice(0, display.length - decimals),
585
- display.slice(display.length - decimals)
586
- ];
587
- fraction = fraction.replace(/(0+)$/, "");
588
- return `${negative ? "-" : ""}${integer || "0"}${fraction ? `.${fraction}` : ""}`;
901
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/slice.js
902
+ function slice(value, start, end, { strict } = {}) {
903
+ if (isHex(value, { strict: false }))
904
+ return sliceHex(value, start, end, {
905
+ strict
906
+ });
907
+ return sliceBytes(value, start, end, {
908
+ strict
909
+ });
589
910
  }
590
-
591
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/formatEther.js
592
- function formatEther(wei, unit = "wei") {
593
- return formatUnits(wei, etherUnits[unit]);
911
+ function assertStartOffset(value, start) {
912
+ if (typeof start === "number" && start > 0 && start > size(value) - 1)
913
+ throw new SliceOffsetOutOfBoundsError({
914
+ offset: start,
915
+ position: "start",
916
+ size: size(value)
917
+ });
594
918
  }
595
-
596
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/formatGwei.js
597
- function formatGwei(wei, unit = "wei") {
598
- return formatUnits(wei, gweiUnits[unit]);
919
+ function assertEndOffset(value, start, end) {
920
+ if (typeof start === "number" && typeof end === "number" && size(value) !== end - start) {
921
+ throw new SliceOffsetOutOfBoundsError({
922
+ offset: end,
923
+ position: "end",
924
+ size: size(value)
925
+ });
926
+ }
927
+ }
928
+ function sliceBytes(value_, start, end, { strict } = {}) {
929
+ assertStartOffset(value_, start);
930
+ const value = value_.slice(start, end);
931
+ if (strict)
932
+ assertEndOffset(value, start, end);
933
+ return value;
934
+ }
935
+ function sliceHex(value_, start, end, { strict } = {}) {
936
+ assertStartOffset(value_, start);
937
+ const value = `0x${value_.replace("0x", "").slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;
938
+ if (strict)
939
+ assertEndOffset(value, start, end);
940
+ return value;
599
941
  }
600
942
 
601
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/transaction.js
602
- function prettyPrint(args) {
603
- const entries = Object.entries(args).map(([key, value]) => {
604
- if (value === void 0 || value === false)
605
- return null;
606
- return [key, value];
607
- }).filter(Boolean);
608
- const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);
609
- return entries.map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`).join("\n");
943
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/regex.js
944
+ var arrayRegex = /^(.*)\[([0-9]*)\]$/;
945
+ var bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
946
+ 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)?$/;
947
+
948
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
949
+ function encodeAbiParameters(params, values) {
950
+ if (params.length !== values.length)
951
+ throw new AbiEncodingLengthMismatchError({
952
+ expectedLength: params.length,
953
+ givenLength: values.length
954
+ });
955
+ const preparedParams = prepareParams({
956
+ params,
957
+ values
958
+ });
959
+ return encodeParams(preparedParams);
610
960
  }
611
- var FeeConflictError = class extends BaseError {
612
- constructor() {
613
- super([
614
- "Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.",
615
- "Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."
616
- ].join("\n"), { name: "FeeConflictError" });
961
+ function prepareParams({ params, values }) {
962
+ const preparedParams = [];
963
+ for (let i = 0; i < params.length; i++) {
964
+ preparedParams.push(prepareParam({ param: params[i], value: values[i] }));
617
965
  }
618
- };
619
- var InvalidLegacyVError = class extends BaseError {
620
- constructor({ v }) {
621
- super(`Invalid \`v\` value "${v}". Expected 27 or 28.`, {
622
- name: "InvalidLegacyVError"
623
- });
966
+ return preparedParams;
967
+ }
968
+ function prepareParam({ param, value }) {
969
+ const arrayComponents = getArrayComponents(param.type);
970
+ if (arrayComponents) {
971
+ const [length, type] = arrayComponents;
972
+ return encodeArray(value, { length, param: { ...param, type } });
624
973
  }
625
- };
626
- var InvalidYParityError = class extends BaseError {
627
- constructor({ yParity }) {
628
- super(`Invalid \`yParity\` value "${yParity}". Expected 0 or 1.`, {
629
- name: "InvalidYParityError"
974
+ if (param.type === "tuple") {
975
+ return encodeTuple(value, {
976
+ param
630
977
  });
631
978
  }
632
- };
633
- var InvalidSerializableTransactionError = class extends BaseError {
634
- constructor({ transaction }) {
635
- super("Cannot infer a transaction type from provided transaction.", {
636
- metaMessages: [
637
- "Provided Transaction:",
638
- "{",
639
- prettyPrint(transaction),
640
- "}",
641
- "",
642
- "To infer the type, either provide:",
643
- "- a `type` to the Transaction, or",
644
- "- an EIP-1559 Transaction with `maxFeePerGas`, or",
645
- "- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
646
- "- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
647
- "- an EIP-7702 Transaction with `authorizationList`, or",
648
- "- a Legacy Transaction with `gasPrice`"
649
- ],
650
- name: "InvalidSerializableTransactionError"
651
- });
979
+ if (param.type === "address") {
980
+ return encodeAddress(value);
652
981
  }
653
- };
654
- var InvalidSerializedTransactionTypeError = class extends BaseError {
655
- constructor({ serializedType }) {
656
- super(`Serialized transaction type "${serializedType}" is invalid.`, {
657
- name: "InvalidSerializedTransactionType"
658
- });
659
- Object.defineProperty(this, "serializedType", {
660
- enumerable: true,
661
- configurable: true,
662
- writable: true,
663
- value: void 0
982
+ if (param.type === "bool") {
983
+ return encodeBool(value);
984
+ }
985
+ if (param.type.startsWith("uint") || param.type.startsWith("int")) {
986
+ const signed = param.type.startsWith("int");
987
+ const [, , size4 = "256"] = integerRegex.exec(param.type) ?? [];
988
+ return encodeNumber(value, {
989
+ signed,
990
+ size: Number(size4)
664
991
  });
665
- this.serializedType = serializedType;
666
992
  }
667
- };
668
- var InvalidSerializedTransactionError = class extends BaseError {
669
- constructor({ attributes, serializedTransaction, type }) {
670
- const missing = Object.entries(attributes).map(([key, value]) => typeof value === "undefined" ? key : void 0).filter(Boolean);
671
- super(`Invalid serialized transaction of type "${type}" was provided.`, {
672
- metaMessages: [
673
- `Serialized Transaction: "${serializedTransaction}"`,
674
- missing.length > 0 ? `Missing Attributes: ${missing.join(", ")}` : ""
675
- ].filter(Boolean),
676
- name: "InvalidSerializedTransactionError"
677
- });
678
- Object.defineProperty(this, "serializedTransaction", {
679
- enumerable: true,
680
- configurable: true,
681
- writable: true,
682
- value: void 0
683
- });
684
- Object.defineProperty(this, "type", {
685
- enumerable: true,
686
- configurable: true,
687
- writable: true,
688
- value: void 0
689
- });
690
- this.serializedTransaction = serializedTransaction;
691
- this.type = type;
993
+ if (param.type.startsWith("bytes")) {
994
+ return encodeBytes(value, { param });
692
995
  }
693
- };
694
- var InvalidStorageKeySizeError = class extends BaseError {
695
- constructor({ storageKey }) {
696
- super(`Size for storage key "${storageKey}" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
996
+ if (param.type === "string") {
997
+ return encodeString(value);
697
998
  }
698
- };
699
- var TransactionExecutionError = class extends BaseError {
700
- constructor(cause, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value }) {
701
- const prettyArgs = prettyPrint({
702
- chain: chain && `${chain?.name} (id: ${chain?.id})`,
703
- from: account?.address,
704
- to,
705
- value: typeof value !== "undefined" && `${formatEther(value)} ${chain?.nativeCurrency?.symbol || "ETH"}`,
706
- data,
707
- gas,
708
- gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
709
- maxFeePerGas: typeof maxFeePerGas !== "undefined" && `${formatGwei(maxFeePerGas)} gwei`,
710
- maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== "undefined" && `${formatGwei(maxPriorityFeePerGas)} gwei`,
711
- nonce
712
- });
713
- super(cause.shortMessage, {
714
- cause,
715
- docsPath,
716
- metaMessages: [
717
- ...cause.metaMessages ? [...cause.metaMessages, " "] : [],
718
- "Request Arguments:",
719
- prettyArgs
720
- ].filter(Boolean),
721
- name: "TransactionExecutionError"
722
- });
723
- Object.defineProperty(this, "cause", {
724
- enumerable: true,
725
- configurable: true,
726
- writable: true,
727
- value: void 0
728
- });
729
- this.cause = cause;
999
+ throw new InvalidAbiEncodingTypeError(param.type, {
1000
+ docsPath: "/docs/contract/encodeAbiParameters"
1001
+ });
1002
+ }
1003
+ function encodeParams(preparedParams) {
1004
+ let staticSize = 0;
1005
+ for (let i = 0; i < preparedParams.length; i++) {
1006
+ const { dynamic, encoded } = preparedParams[i];
1007
+ if (dynamic)
1008
+ staticSize += 32;
1009
+ else
1010
+ staticSize += size(encoded);
730
1011
  }
731
- };
732
- var TransactionNotFoundError = class extends BaseError {
733
- constructor({ blockHash, blockNumber, blockTag, hash, index }) {
734
- let identifier = "Transaction";
735
- if (blockTag && index !== void 0)
736
- identifier = `Transaction at block time "${blockTag}" at index "${index}"`;
737
- if (blockHash && index !== void 0)
738
- identifier = `Transaction at block hash "${blockHash}" at index "${index}"`;
739
- if (blockNumber && index !== void 0)
740
- identifier = `Transaction at block number "${blockNumber}" at index "${index}"`;
741
- if (hash)
742
- identifier = `Transaction with hash "${hash}"`;
743
- super(`${identifier} could not be found.`, {
744
- name: "TransactionNotFoundError"
745
- });
1012
+ const staticParams = [];
1013
+ const dynamicParams = [];
1014
+ let dynamicSize = 0;
1015
+ for (let i = 0; i < preparedParams.length; i++) {
1016
+ const { dynamic, encoded } = preparedParams[i];
1017
+ if (dynamic) {
1018
+ staticParams.push(numberToHex(staticSize + dynamicSize, { size: 32 }));
1019
+ dynamicParams.push(encoded);
1020
+ dynamicSize += size(encoded);
1021
+ } else {
1022
+ staticParams.push(encoded);
1023
+ }
746
1024
  }
747
- };
748
- var TransactionReceiptNotFoundError = class extends BaseError {
749
- constructor({ hash }) {
750
- super(`Transaction receipt with hash "${hash}" could not be found. The Transaction may not be processed on a block yet.`, {
751
- name: "TransactionReceiptNotFoundError"
1025
+ return concatHex([...staticParams, ...dynamicParams]);
1026
+ }
1027
+ function encodeAddress(value) {
1028
+ if (!isAddress(value))
1029
+ throw new InvalidAddressError({ address: value });
1030
+ return { dynamic: false, encoded: padHex(value.toLowerCase()) };
1031
+ }
1032
+ function encodeArray(value, { length, param }) {
1033
+ const dynamic = length === null;
1034
+ if (!Array.isArray(value))
1035
+ throw new InvalidArrayError(value);
1036
+ if (!dynamic && value.length !== length)
1037
+ throw new AbiEncodingArrayLengthMismatchError({
1038
+ expectedLength: length,
1039
+ givenLength: value.length,
1040
+ type: `${param.type}[${length}]`
752
1041
  });
1042
+ let dynamicChild = value.length === 0 && isDynamicType(param);
1043
+ const preparedParams = [];
1044
+ for (let i = 0; i < value.length; i++) {
1045
+ const preparedParam = prepareParam({ param, value: value[i] });
1046
+ if (preparedParam.dynamic)
1047
+ dynamicChild = true;
1048
+ preparedParams.push(preparedParam);
753
1049
  }
754
- };
755
- var TransactionReceiptRevertedError = class extends BaseError {
756
- constructor({ receipt }) {
757
- super(`Transaction with hash "${receipt.transactionHash}" reverted.`, {
758
- metaMessages: [
759
- 'The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.',
760
- " ",
761
- "You can attempt to extract the revert reason by:",
762
- "- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract",
763
- "- using the `call` Action with raw `data`"
764
- ],
765
- name: "TransactionReceiptRevertedError"
766
- });
767
- Object.defineProperty(this, "receipt", {
768
- enumerable: true,
769
- configurable: true,
770
- writable: true,
771
- value: void 0
1050
+ if (dynamic || dynamicChild) {
1051
+ const data = encodeParams(preparedParams);
1052
+ if (dynamic) {
1053
+ const length2 = numberToHex(preparedParams.length, { size: 32 });
1054
+ return {
1055
+ dynamic: true,
1056
+ encoded: concatHex([length2, data])
1057
+ };
1058
+ }
1059
+ if (dynamicChild)
1060
+ return { dynamic: true, encoded: data };
1061
+ }
1062
+ return {
1063
+ dynamic: false,
1064
+ encoded: concatHex(preparedParams.map(({ encoded }) => encoded))
1065
+ };
1066
+ }
1067
+ function encodeBytes(value, { param }) {
1068
+ const [, paramSize] = param.type.split("bytes");
1069
+ const bytesSize = size(value);
1070
+ if (!paramSize) {
1071
+ let value_ = value;
1072
+ if (bytesSize % 32 !== 0)
1073
+ value_ = padHex(value_, {
1074
+ dir: "right",
1075
+ size: Math.ceil((value.length - 2) / 2 / 32) * 32
1076
+ });
1077
+ return {
1078
+ dynamic: true,
1079
+ encoded: concatHex([
1080
+ padHex(numberToHex(bytesSize, { size: 32 })),
1081
+ value_
1082
+ ])
1083
+ };
1084
+ }
1085
+ if (bytesSize !== Number.parseInt(paramSize, 10))
1086
+ throw new AbiEncodingBytesSizeMismatchError({
1087
+ expectedSize: Number.parseInt(paramSize, 10),
1088
+ value
772
1089
  });
773
- this.receipt = receipt;
1090
+ return { dynamic: false, encoded: padHex(value, { dir: "right" }) };
1091
+ }
1092
+ function encodeBool(value) {
1093
+ if (typeof value !== "boolean")
1094
+ throw new BaseError(`Invalid boolean value: "${value}" (type: ${typeof value}). Expected: \`true\` or \`false\`.`);
1095
+ return { dynamic: false, encoded: padHex(boolToHex(value)) };
1096
+ }
1097
+ function encodeNumber(value, { signed, size: size4 = 256 }) {
1098
+ if (typeof size4 === "number") {
1099
+ const max = 2n ** (BigInt(size4) - (signed ? 1n : 0n)) - 1n;
1100
+ const min = signed ? -max - 1n : 0n;
1101
+ if (value > max || value < min)
1102
+ throw new IntegerOutOfRangeError({
1103
+ max: max.toString(),
1104
+ min: min.toString(),
1105
+ signed,
1106
+ size: size4 / 8,
1107
+ value: value.toString()
1108
+ });
774
1109
  }
775
- };
776
- var WaitForTransactionReceiptTimeoutError = class extends BaseError {
777
- constructor({ hash }) {
778
- super(`Timed out while waiting for transaction with hash "${hash}" to be confirmed.`, { name: "WaitForTransactionReceiptTimeoutError" });
1110
+ return {
1111
+ dynamic: false,
1112
+ encoded: numberToHex(value, {
1113
+ size: 32,
1114
+ signed
1115
+ })
1116
+ };
1117
+ }
1118
+ function encodeString(value) {
1119
+ const hexValue = stringToHex(value);
1120
+ const partsLength = Math.ceil(size(hexValue) / 32);
1121
+ const parts = [];
1122
+ for (let i = 0; i < partsLength; i++) {
1123
+ parts.push(padHex(slice(hexValue, i * 32, (i + 1) * 32), {
1124
+ dir: "right"
1125
+ }));
779
1126
  }
780
- };
781
-
782
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/number.js
783
- var maxInt8 = 2n ** (8n - 1n) - 1n;
784
- var maxInt16 = 2n ** (16n - 1n) - 1n;
785
- var maxInt24 = 2n ** (24n - 1n) - 1n;
786
- var maxInt32 = 2n ** (32n - 1n) - 1n;
787
- var maxInt40 = 2n ** (40n - 1n) - 1n;
788
- var maxInt48 = 2n ** (48n - 1n) - 1n;
789
- var maxInt56 = 2n ** (56n - 1n) - 1n;
790
- var maxInt64 = 2n ** (64n - 1n) - 1n;
791
- var maxInt72 = 2n ** (72n - 1n) - 1n;
792
- var maxInt80 = 2n ** (80n - 1n) - 1n;
793
- var maxInt88 = 2n ** (88n - 1n) - 1n;
794
- var maxInt96 = 2n ** (96n - 1n) - 1n;
795
- var maxInt104 = 2n ** (104n - 1n) - 1n;
796
- var maxInt112 = 2n ** (112n - 1n) - 1n;
797
- var maxInt120 = 2n ** (120n - 1n) - 1n;
798
- var maxInt128 = 2n ** (128n - 1n) - 1n;
799
- var maxInt136 = 2n ** (136n - 1n) - 1n;
800
- var maxInt144 = 2n ** (144n - 1n) - 1n;
801
- var maxInt152 = 2n ** (152n - 1n) - 1n;
802
- var maxInt160 = 2n ** (160n - 1n) - 1n;
803
- var maxInt168 = 2n ** (168n - 1n) - 1n;
804
- var maxInt176 = 2n ** (176n - 1n) - 1n;
805
- var maxInt184 = 2n ** (184n - 1n) - 1n;
806
- var maxInt192 = 2n ** (192n - 1n) - 1n;
807
- var maxInt200 = 2n ** (200n - 1n) - 1n;
808
- var maxInt208 = 2n ** (208n - 1n) - 1n;
809
- var maxInt216 = 2n ** (216n - 1n) - 1n;
810
- var maxInt224 = 2n ** (224n - 1n) - 1n;
811
- var maxInt232 = 2n ** (232n - 1n) - 1n;
812
- var maxInt240 = 2n ** (240n - 1n) - 1n;
813
- var maxInt248 = 2n ** (248n - 1n) - 1n;
814
- var maxInt256 = 2n ** (256n - 1n) - 1n;
815
- var minInt8 = -(2n ** (8n - 1n));
816
- var minInt16 = -(2n ** (16n - 1n));
817
- var minInt24 = -(2n ** (24n - 1n));
818
- var minInt32 = -(2n ** (32n - 1n));
819
- var minInt40 = -(2n ** (40n - 1n));
820
- var minInt48 = -(2n ** (48n - 1n));
821
- var minInt56 = -(2n ** (56n - 1n));
822
- var minInt64 = -(2n ** (64n - 1n));
823
- var minInt72 = -(2n ** (72n - 1n));
824
- var minInt80 = -(2n ** (80n - 1n));
825
- var minInt88 = -(2n ** (88n - 1n));
826
- var minInt96 = -(2n ** (96n - 1n));
827
- var minInt104 = -(2n ** (104n - 1n));
828
- var minInt112 = -(2n ** (112n - 1n));
829
- var minInt120 = -(2n ** (120n - 1n));
830
- var minInt128 = -(2n ** (128n - 1n));
831
- var minInt136 = -(2n ** (136n - 1n));
832
- var minInt144 = -(2n ** (144n - 1n));
833
- var minInt152 = -(2n ** (152n - 1n));
834
- var minInt160 = -(2n ** (160n - 1n));
835
- var minInt168 = -(2n ** (168n - 1n));
836
- var minInt176 = -(2n ** (176n - 1n));
837
- var minInt184 = -(2n ** (184n - 1n));
838
- var minInt192 = -(2n ** (192n - 1n));
839
- var minInt200 = -(2n ** (200n - 1n));
840
- var minInt208 = -(2n ** (208n - 1n));
841
- var minInt216 = -(2n ** (216n - 1n));
842
- var minInt224 = -(2n ** (224n - 1n));
843
- var minInt232 = -(2n ** (232n - 1n));
844
- var minInt240 = -(2n ** (240n - 1n));
845
- var minInt248 = -(2n ** (248n - 1n));
846
- var minInt256 = -(2n ** (256n - 1n));
847
- var maxUint8 = 2n ** 8n - 1n;
848
- var maxUint16 = 2n ** 16n - 1n;
849
- var maxUint24 = 2n ** 24n - 1n;
850
- var maxUint32 = 2n ** 32n - 1n;
851
- var maxUint40 = 2n ** 40n - 1n;
852
- var maxUint48 = 2n ** 48n - 1n;
853
- var maxUint56 = 2n ** 56n - 1n;
854
- var maxUint64 = 2n ** 64n - 1n;
855
- var maxUint72 = 2n ** 72n - 1n;
856
- var maxUint80 = 2n ** 80n - 1n;
857
- var maxUint88 = 2n ** 88n - 1n;
858
- var maxUint96 = 2n ** 96n - 1n;
859
- var maxUint104 = 2n ** 104n - 1n;
860
- var maxUint112 = 2n ** 112n - 1n;
861
- var maxUint120 = 2n ** 120n - 1n;
862
- var maxUint128 = 2n ** 128n - 1n;
863
- var maxUint136 = 2n ** 136n - 1n;
864
- var maxUint144 = 2n ** 144n - 1n;
865
- var maxUint152 = 2n ** 152n - 1n;
866
- var maxUint160 = 2n ** 160n - 1n;
867
- var maxUint168 = 2n ** 168n - 1n;
868
- var maxUint176 = 2n ** 176n - 1n;
869
- var maxUint184 = 2n ** 184n - 1n;
870
- var maxUint192 = 2n ** 192n - 1n;
871
- var maxUint200 = 2n ** 200n - 1n;
872
- var maxUint208 = 2n ** 208n - 1n;
873
- var maxUint216 = 2n ** 216n - 1n;
874
- var maxUint224 = 2n ** 224n - 1n;
875
- var maxUint232 = 2n ** 232n - 1n;
876
- var maxUint240 = 2n ** 240n - 1n;
877
- var maxUint248 = 2n ** 248n - 1n;
878
- var maxUint256 = 2n ** 256n - 1n;
879
-
880
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/chain.js
881
- var ChainDoesNotSupportContract = class extends BaseError {
882
- constructor({ blockNumber, chain, contract }) {
883
- super(`Chain "${chain.name}" does not support contract "${contract.name}".`, {
884
- metaMessages: [
885
- "This could be due to any of the following:",
886
- ...blockNumber && contract.blockCreated && contract.blockCreated > blockNumber ? [
887
- `- The contract "${contract.name}" was not deployed until block ${contract.blockCreated} (current block ${blockNumber}).`
888
- ] : [
889
- `- The chain does not have the contract "${contract.name}" configured.`
890
- ]
891
- ],
892
- name: "ChainDoesNotSupportContract"
1127
+ return {
1128
+ dynamic: true,
1129
+ encoded: concatHex([
1130
+ padHex(numberToHex(size(hexValue), { size: 32 })),
1131
+ ...parts
1132
+ ])
1133
+ };
1134
+ }
1135
+ function encodeTuple(value, { param }) {
1136
+ let dynamic = false;
1137
+ const preparedParams = [];
1138
+ for (let i = 0; i < param.components.length; i++) {
1139
+ const param_ = param.components[i];
1140
+ const index = Array.isArray(value) ? i : param_.name;
1141
+ const preparedParam = prepareParam({
1142
+ param: param_,
1143
+ value: value[index]
893
1144
  });
1145
+ preparedParams.push(preparedParam);
1146
+ if (preparedParam.dynamic)
1147
+ dynamic = true;
894
1148
  }
1149
+ return {
1150
+ dynamic,
1151
+ encoded: dynamic ? encodeParams(preparedParams) : concatHex(preparedParams.map(({ encoded }) => encoded))
1152
+ };
1153
+ }
1154
+ function getArrayComponents(type) {
1155
+ const matches = type.match(/^(.*)\[(\d+)?\]$/);
1156
+ return matches ? (
1157
+ // Return `null` if the array is dynamic.
1158
+ [matches[2] ? Number(matches[2]) : null, matches[1]]
1159
+ ) : void 0;
1160
+ }
1161
+ function isDynamicType(param) {
1162
+ const { type } = param;
1163
+ if (type === "string")
1164
+ return true;
1165
+ if (type === "bytes")
1166
+ return true;
1167
+ if (type.endsWith("[]"))
1168
+ return true;
1169
+ if (type === "tuple")
1170
+ return param.components.some(isDynamicType);
1171
+ const arrayComponents = getArrayComponents(type);
1172
+ if (arrayComponents)
1173
+ return isDynamicType({ ...param, type: arrayComponents[1] });
1174
+ return false;
1175
+ }
1176
+
1177
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/stringify.js
1178
+ var stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {
1179
+ const value2 = typeof value_ === "bigint" ? value_.toString() : value_;
1180
+ return typeof replacer === "function" ? replacer(key, value2) : value2;
1181
+ }, space);
1182
+
1183
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/unit.js
1184
+ var etherUnits = {
1185
+ gwei: 9,
1186
+ wei: 18
895
1187
  };
896
- var ChainMismatchError = class extends BaseError {
897
- constructor({ chain, currentChainId }) {
898
- super(`The current chain of the wallet (id: ${currentChainId}) does not match the target chain for the transaction (id: ${chain.id} \u2013 ${chain.name}).`, {
899
- metaMessages: [
900
- `Current Chain ID: ${currentChainId}`,
901
- `Expected Chain ID: ${chain.id} \u2013 ${chain.name}`
902
- ],
903
- name: "ChainMismatchError"
904
- });
905
- }
1188
+ var gweiUnits = {
1189
+ ether: -9,
1190
+ wei: 9
906
1191
  };
907
- var ChainNotFoundError = class extends BaseError {
1192
+ var weiUnits = {
1193
+ ether: -18,
1194
+ gwei: -9
1195
+ };
1196
+
1197
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/formatUnits.js
1198
+ function formatUnits(value, decimals) {
1199
+ let display = value.toString();
1200
+ const negative = display.startsWith("-");
1201
+ if (negative)
1202
+ display = display.slice(1);
1203
+ display = display.padStart(decimals, "0");
1204
+ let [integer, fraction] = [
1205
+ display.slice(0, display.length - decimals),
1206
+ display.slice(display.length - decimals)
1207
+ ];
1208
+ fraction = fraction.replace(/(0+)$/, "");
1209
+ return `${negative ? "-" : ""}${integer || "0"}${fraction ? `.${fraction}` : ""}`;
1210
+ }
1211
+
1212
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/formatEther.js
1213
+ function formatEther(wei, unit = "wei") {
1214
+ return formatUnits(wei, etherUnits[unit]);
1215
+ }
1216
+
1217
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/formatGwei.js
1218
+ function formatGwei(wei, unit = "wei") {
1219
+ return formatUnits(wei, gweiUnits[unit]);
1220
+ }
1221
+
1222
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/transaction.js
1223
+ function prettyPrint(args) {
1224
+ const entries = Object.entries(args).map(([key, value]) => {
1225
+ if (value === void 0 || value === false)
1226
+ return null;
1227
+ return [key, value];
1228
+ }).filter(Boolean);
1229
+ const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);
1230
+ return entries.map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`).join("\n");
1231
+ }
1232
+ var FeeConflictError = class extends BaseError {
908
1233
  constructor() {
909
1234
  super([
910
- "No chain was provided to the request.",
911
- "Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."
912
- ].join("\n"), {
913
- name: "ChainNotFoundError"
914
- });
1235
+ "Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.",
1236
+ "Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."
1237
+ ].join("\n"), { name: "FeeConflictError" });
915
1238
  }
916
1239
  };
917
- var ClientChainNotConfiguredError = class extends BaseError {
918
- constructor() {
919
- super("No chain was provided to the Client.", {
920
- name: "ClientChainNotConfiguredError"
1240
+ var InvalidLegacyVError = class extends BaseError {
1241
+ constructor({ v }) {
1242
+ super(`Invalid \`v\` value "${v}". Expected 27 or 28.`, {
1243
+ name: "InvalidLegacyVError"
921
1244
  });
922
1245
  }
923
1246
  };
924
- var InvalidChainIdError = class extends BaseError {
925
- constructor({ chainId }) {
926
- super(typeof chainId === "number" ? `Chain ID "${chainId}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
1247
+ var InvalidYParityError = class extends BaseError {
1248
+ constructor({ yParity }) {
1249
+ super(`Invalid \`yParity\` value "${yParity}". Expected 0 or 1.`, {
1250
+ name: "InvalidYParityError"
1251
+ });
927
1252
  }
928
1253
  };
929
-
930
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/node.js
931
- var ExecutionRevertedError = class extends BaseError {
932
- constructor({ cause, message } = {}) {
933
- const reason = message?.replace("execution reverted: ", "")?.replace("execution reverted", "");
934
- super(`Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`, {
935
- cause,
936
- name: "ExecutionRevertedError"
1254
+ var InvalidSerializableTransactionError = class extends BaseError {
1255
+ constructor({ transaction }) {
1256
+ super("Cannot infer a transaction type from provided transaction.", {
1257
+ metaMessages: [
1258
+ "Provided Transaction:",
1259
+ "{",
1260
+ prettyPrint(transaction),
1261
+ "}",
1262
+ "",
1263
+ "To infer the type, either provide:",
1264
+ "- a `type` to the Transaction, or",
1265
+ "- an EIP-1559 Transaction with `maxFeePerGas`, or",
1266
+ "- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
1267
+ "- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
1268
+ "- an EIP-7702 Transaction with `authorizationList`, or",
1269
+ "- a Legacy Transaction with `gasPrice`"
1270
+ ],
1271
+ name: "InvalidSerializableTransactionError"
937
1272
  });
938
1273
  }
939
1274
  };
940
- Object.defineProperty(ExecutionRevertedError, "code", {
941
- enumerable: true,
942
- configurable: true,
943
- writable: true,
944
- value: 3
945
- });
946
- Object.defineProperty(ExecutionRevertedError, "nodeMessage", {
947
- enumerable: true,
948
- configurable: true,
1275
+ var InvalidSerializedTransactionTypeError = class extends BaseError {
1276
+ constructor({ serializedType }) {
1277
+ super(`Serialized transaction type "${serializedType}" is invalid.`, {
1278
+ name: "InvalidSerializedTransactionType"
1279
+ });
1280
+ Object.defineProperty(this, "serializedType", {
1281
+ enumerable: true,
1282
+ configurable: true,
1283
+ writable: true,
1284
+ value: void 0
1285
+ });
1286
+ this.serializedType = serializedType;
1287
+ }
1288
+ };
1289
+ var InvalidSerializedTransactionError = class extends BaseError {
1290
+ constructor({ attributes, serializedTransaction, type }) {
1291
+ const missing = Object.entries(attributes).map(([key, value]) => typeof value === "undefined" ? key : void 0).filter(Boolean);
1292
+ super(`Invalid serialized transaction of type "${type}" was provided.`, {
1293
+ metaMessages: [
1294
+ `Serialized Transaction: "${serializedTransaction}"`,
1295
+ missing.length > 0 ? `Missing Attributes: ${missing.join(", ")}` : ""
1296
+ ].filter(Boolean),
1297
+ name: "InvalidSerializedTransactionError"
1298
+ });
1299
+ Object.defineProperty(this, "serializedTransaction", {
1300
+ enumerable: true,
1301
+ configurable: true,
1302
+ writable: true,
1303
+ value: void 0
1304
+ });
1305
+ Object.defineProperty(this, "type", {
1306
+ enumerable: true,
1307
+ configurable: true,
1308
+ writable: true,
1309
+ value: void 0
1310
+ });
1311
+ this.serializedTransaction = serializedTransaction;
1312
+ this.type = type;
1313
+ }
1314
+ };
1315
+ var InvalidStorageKeySizeError = class extends BaseError {
1316
+ constructor({ storageKey }) {
1317
+ super(`Size for storage key "${storageKey}" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
1318
+ }
1319
+ };
1320
+ var TransactionExecutionError = class extends BaseError {
1321
+ constructor(cause, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value }) {
1322
+ const prettyArgs = prettyPrint({
1323
+ chain: chain && `${chain?.name} (id: ${chain?.id})`,
1324
+ from: account?.address,
1325
+ to,
1326
+ value: typeof value !== "undefined" && `${formatEther(value)} ${chain?.nativeCurrency?.symbol || "ETH"}`,
1327
+ data,
1328
+ gas,
1329
+ gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
1330
+ maxFeePerGas: typeof maxFeePerGas !== "undefined" && `${formatGwei(maxFeePerGas)} gwei`,
1331
+ maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== "undefined" && `${formatGwei(maxPriorityFeePerGas)} gwei`,
1332
+ nonce
1333
+ });
1334
+ super(cause.shortMessage, {
1335
+ cause,
1336
+ docsPath,
1337
+ metaMessages: [
1338
+ ...cause.metaMessages ? [...cause.metaMessages, " "] : [],
1339
+ "Request Arguments:",
1340
+ prettyArgs
1341
+ ].filter(Boolean),
1342
+ name: "TransactionExecutionError"
1343
+ });
1344
+ Object.defineProperty(this, "cause", {
1345
+ enumerable: true,
1346
+ configurable: true,
1347
+ writable: true,
1348
+ value: void 0
1349
+ });
1350
+ this.cause = cause;
1351
+ }
1352
+ };
1353
+ var TransactionNotFoundError = class extends BaseError {
1354
+ constructor({ blockHash, blockNumber, blockTag, hash, index }) {
1355
+ let identifier = "Transaction";
1356
+ if (blockTag && index !== void 0)
1357
+ identifier = `Transaction at block time "${blockTag}" at index "${index}"`;
1358
+ if (blockHash && index !== void 0)
1359
+ identifier = `Transaction at block hash "${blockHash}" at index "${index}"`;
1360
+ if (blockNumber && index !== void 0)
1361
+ identifier = `Transaction at block number "${blockNumber}" at index "${index}"`;
1362
+ if (hash)
1363
+ identifier = `Transaction with hash "${hash}"`;
1364
+ super(`${identifier} could not be found.`, {
1365
+ name: "TransactionNotFoundError"
1366
+ });
1367
+ }
1368
+ };
1369
+ var TransactionReceiptNotFoundError = class extends BaseError {
1370
+ constructor({ hash }) {
1371
+ super(`Transaction receipt with hash "${hash}" could not be found. The Transaction may not be processed on a block yet.`, {
1372
+ name: "TransactionReceiptNotFoundError"
1373
+ });
1374
+ }
1375
+ };
1376
+ var TransactionReceiptRevertedError = class extends BaseError {
1377
+ constructor({ receipt }) {
1378
+ super(`Transaction with hash "${receipt.transactionHash}" reverted.`, {
1379
+ metaMessages: [
1380
+ 'The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.',
1381
+ " ",
1382
+ "You can attempt to extract the revert reason by:",
1383
+ "- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract",
1384
+ "- using the `call` Action with raw `data`"
1385
+ ],
1386
+ name: "TransactionReceiptRevertedError"
1387
+ });
1388
+ Object.defineProperty(this, "receipt", {
1389
+ enumerable: true,
1390
+ configurable: true,
1391
+ writable: true,
1392
+ value: void 0
1393
+ });
1394
+ this.receipt = receipt;
1395
+ }
1396
+ };
1397
+ var WaitForTransactionReceiptTimeoutError = class extends BaseError {
1398
+ constructor({ hash }) {
1399
+ super(`Timed out while waiting for transaction with hash "${hash}" to be confirmed.`, { name: "WaitForTransactionReceiptTimeoutError" });
1400
+ }
1401
+ };
1402
+
1403
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/node.js
1404
+ var ExecutionRevertedError = class extends BaseError {
1405
+ constructor({ cause, message } = {}) {
1406
+ const reason = message?.replace("execution reverted: ", "")?.replace("execution reverted", "");
1407
+ super(`Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`, {
1408
+ cause,
1409
+ name: "ExecutionRevertedError"
1410
+ });
1411
+ }
1412
+ };
1413
+ Object.defineProperty(ExecutionRevertedError, "code", {
1414
+ enumerable: true,
1415
+ configurable: true,
1416
+ writable: true,
1417
+ value: 3
1418
+ });
1419
+ Object.defineProperty(ExecutionRevertedError, "nodeMessage", {
1420
+ enumerable: true,
1421
+ configurable: true,
949
1422
  writable: true,
950
1423
  value: /execution reverted|gas required exceeds allowance/
951
1424
  });
@@ -1106,637 +1579,159 @@ var UnknownNodeError = class extends BaseError {
1106
1579
  }
1107
1580
  };
1108
1581
 
1109
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/slice.js
1110
- function slice(value, start, end, { strict } = {}) {
1111
- if (isHex(value, { strict: false }))
1112
- return sliceHex(value, start, end, {
1113
- strict
1114
- });
1115
- return sliceBytes(value, start, end, {
1116
- strict
1117
- });
1118
- }
1119
- function assertStartOffset(value, start) {
1120
- if (typeof start === "number" && start > 0 && start > size(value) - 1)
1121
- throw new SliceOffsetOutOfBoundsError({
1122
- offset: start,
1123
- position: "start",
1124
- size: size(value)
1125
- });
1126
- }
1127
- function assertEndOffset(value, start, end) {
1128
- if (typeof start === "number" && typeof end === "number" && size(value) !== end - start) {
1129
- throw new SliceOffsetOutOfBoundsError({
1130
- offset: end,
1131
- position: "end",
1132
- size: size(value)
1133
- });
1134
- }
1135
- }
1136
- function sliceBytes(value_, start, end, { strict } = {}) {
1137
- assertStartOffset(value_, start);
1138
- const value = value_.slice(start, end);
1139
- if (strict)
1140
- assertEndOffset(value, start, end);
1141
- return value;
1142
- }
1143
- function sliceHex(value_, start, end, { strict } = {}) {
1144
- assertStartOffset(value_, start);
1145
- const value = `0x${value_.replace("0x", "").slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;
1146
- if (strict)
1147
- assertEndOffset(value, start, end);
1148
- return value;
1149
- }
1150
-
1151
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/formatAbiItem.js
1152
- function formatAbiItem(abiItem, { includeName = false } = {}) {
1153
- if (abiItem.type !== "function" && abiItem.type !== "event" && abiItem.type !== "error")
1154
- throw new InvalidDefinitionTypeError(abiItem.type);
1155
- return `${abiItem.name}(${formatAbiParams(abiItem.inputs, { includeName })})`;
1156
- }
1157
- function formatAbiParams(params, { includeName = false } = {}) {
1158
- if (!params)
1159
- return "";
1160
- return params.map((param) => formatAbiParam(param, { includeName })).join(includeName ? ", " : ",");
1161
- }
1162
- function formatAbiParam(param, { includeName }) {
1163
- if (param.type.startsWith("tuple")) {
1164
- return `(${formatAbiParams(param.components, { includeName })})${param.type.slice("tuple".length)}`;
1165
- }
1166
- return param.type + (includeName && param.name ? ` ${param.name}` : "");
1167
- }
1168
-
1169
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/abi.js
1170
- var AbiConstructorNotFoundError = class extends BaseError {
1171
- constructor({ docsPath }) {
1172
- super([
1173
- "A constructor was not found on the ABI.",
1174
- "Make sure you are using the correct ABI and that the constructor exists on it."
1175
- ].join("\n"), {
1176
- docsPath,
1177
- name: "AbiConstructorNotFoundError"
1178
- });
1179
- }
1180
- };
1181
- var AbiConstructorParamsNotFoundError = class extends BaseError {
1182
- constructor({ docsPath }) {
1183
- super([
1184
- "Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.",
1185
- "Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."
1186
- ].join("\n"), {
1187
- docsPath,
1188
- name: "AbiConstructorParamsNotFoundError"
1189
- });
1190
- }
1191
- };
1192
- var AbiDecodingDataSizeInvalidError = class extends BaseError {
1193
- constructor({ data, size: size4 }) {
1194
- super([
1195
- `Data size of ${size4} bytes is invalid.`,
1196
- "Size must be in increments of 32 bytes (size % 32 === 0)."
1197
- ].join("\n"), {
1198
- metaMessages: [`Data: ${data} (${size4} bytes)`],
1199
- name: "AbiDecodingDataSizeInvalidError"
1200
- });
1201
- }
1202
- };
1203
- var AbiDecodingDataSizeTooSmallError = class extends BaseError {
1204
- constructor({ data, params, size: size4 }) {
1205
- super([`Data size of ${size4} bytes is too small for given parameters.`].join("\n"), {
1206
- metaMessages: [
1207
- `Params: (${formatAbiParams(params, { includeName: true })})`,
1208
- `Data: ${data} (${size4} bytes)`
1209
- ],
1210
- name: "AbiDecodingDataSizeTooSmallError"
1211
- });
1212
- Object.defineProperty(this, "data", {
1213
- enumerable: true,
1214
- configurable: true,
1215
- writable: true,
1216
- value: void 0
1217
- });
1218
- Object.defineProperty(this, "params", {
1219
- enumerable: true,
1220
- configurable: true,
1221
- writable: true,
1222
- value: void 0
1223
- });
1224
- Object.defineProperty(this, "size", {
1225
- enumerable: true,
1226
- configurable: true,
1227
- writable: true,
1228
- value: void 0
1229
- });
1230
- this.data = data;
1231
- this.params = params;
1232
- this.size = size4;
1233
- }
1234
- };
1235
- var AbiDecodingZeroDataError = class extends BaseError {
1236
- constructor({ cause } = {}) {
1237
- super('Cannot decode zero data ("0x") with ABI parameters.', {
1238
- name: "AbiDecodingZeroDataError",
1239
- cause
1240
- });
1241
- }
1242
- };
1243
- var AbiEncodingArrayLengthMismatchError = class extends BaseError {
1244
- constructor({ expectedLength, givenLength, type }) {
1245
- super([
1246
- `ABI encoding array length mismatch for type ${type}.`,
1247
- `Expected length: ${expectedLength}`,
1248
- `Given length: ${givenLength}`
1249
- ].join("\n"), { name: "AbiEncodingArrayLengthMismatchError" });
1250
- }
1251
- };
1252
- var AbiEncodingBytesSizeMismatchError = class extends BaseError {
1253
- constructor({ expectedSize, value }) {
1254
- super(`Size of bytes "${value}" (bytes${size(value)}) does not match expected size (bytes${expectedSize}).`, { name: "AbiEncodingBytesSizeMismatchError" });
1255
- }
1256
- };
1257
- var AbiEncodingLengthMismatchError = class extends BaseError {
1258
- constructor({ expectedLength, givenLength }) {
1259
- super([
1260
- "ABI encoding params/values length mismatch.",
1261
- `Expected length (params): ${expectedLength}`,
1262
- `Given length (values): ${givenLength}`
1263
- ].join("\n"), { name: "AbiEncodingLengthMismatchError" });
1264
- }
1265
- };
1266
- var AbiErrorInputsNotFoundError = class extends BaseError {
1267
- constructor(errorName, { docsPath }) {
1268
- super([
1269
- `Arguments (\`args\`) were provided to "${errorName}", but "${errorName}" on the ABI does not contain any parameters (\`inputs\`).`,
1270
- "Cannot encode error result without knowing what the parameter types are.",
1271
- "Make sure you are using the correct ABI and that the inputs exist on it."
1272
- ].join("\n"), {
1273
- docsPath,
1274
- name: "AbiErrorInputsNotFoundError"
1275
- });
1276
- }
1277
- };
1278
- var AbiErrorNotFoundError = class extends BaseError {
1279
- constructor(errorName, { docsPath } = {}) {
1280
- super([
1281
- `Error ${errorName ? `"${errorName}" ` : ""}not found on ABI.`,
1282
- "Make sure you are using the correct ABI and that the error exists on it."
1283
- ].join("\n"), {
1284
- docsPath,
1285
- name: "AbiErrorNotFoundError"
1286
- });
1287
- }
1288
- };
1289
- var AbiErrorSignatureNotFoundError = class extends BaseError {
1290
- constructor(signature, { docsPath, cause }) {
1291
- super([
1292
- `Encoded error signature "${signature}" not found on ABI.`,
1293
- "Make sure you are using the correct ABI and that the error exists on it.",
1294
- `You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${signature}.`
1295
- ].join("\n"), {
1296
- docsPath,
1297
- name: "AbiErrorSignatureNotFoundError",
1298
- cause
1299
- });
1300
- Object.defineProperty(this, "signature", {
1301
- enumerable: true,
1302
- configurable: true,
1303
- writable: true,
1304
- value: void 0
1305
- });
1306
- this.signature = signature;
1307
- }
1308
- };
1309
- var AbiEventSignatureEmptyTopicsError = class extends BaseError {
1310
- constructor({ docsPath }) {
1311
- super("Cannot extract event signature from empty topics.", {
1312
- docsPath,
1313
- name: "AbiEventSignatureEmptyTopicsError"
1314
- });
1315
- }
1316
- };
1317
- var AbiEventSignatureNotFoundError = class extends BaseError {
1318
- constructor(signature, { docsPath }) {
1319
- super([
1320
- `Encoded event signature "${signature}" not found on ABI.`,
1321
- "Make sure you are using the correct ABI and that the event exists on it.",
1322
- `You can look up the signature here: https://4byte.sourcify.dev/?q=${signature}.`
1323
- ].join("\n"), {
1324
- docsPath,
1325
- name: "AbiEventSignatureNotFoundError"
1582
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/number.js
1583
+ var maxInt8 = 2n ** (8n - 1n) - 1n;
1584
+ var maxInt16 = 2n ** (16n - 1n) - 1n;
1585
+ var maxInt24 = 2n ** (24n - 1n) - 1n;
1586
+ var maxInt32 = 2n ** (32n - 1n) - 1n;
1587
+ var maxInt40 = 2n ** (40n - 1n) - 1n;
1588
+ var maxInt48 = 2n ** (48n - 1n) - 1n;
1589
+ var maxInt56 = 2n ** (56n - 1n) - 1n;
1590
+ var maxInt64 = 2n ** (64n - 1n) - 1n;
1591
+ var maxInt72 = 2n ** (72n - 1n) - 1n;
1592
+ var maxInt80 = 2n ** (80n - 1n) - 1n;
1593
+ var maxInt88 = 2n ** (88n - 1n) - 1n;
1594
+ var maxInt96 = 2n ** (96n - 1n) - 1n;
1595
+ var maxInt104 = 2n ** (104n - 1n) - 1n;
1596
+ var maxInt112 = 2n ** (112n - 1n) - 1n;
1597
+ var maxInt120 = 2n ** (120n - 1n) - 1n;
1598
+ var maxInt128 = 2n ** (128n - 1n) - 1n;
1599
+ var maxInt136 = 2n ** (136n - 1n) - 1n;
1600
+ var maxInt144 = 2n ** (144n - 1n) - 1n;
1601
+ var maxInt152 = 2n ** (152n - 1n) - 1n;
1602
+ var maxInt160 = 2n ** (160n - 1n) - 1n;
1603
+ var maxInt168 = 2n ** (168n - 1n) - 1n;
1604
+ var maxInt176 = 2n ** (176n - 1n) - 1n;
1605
+ var maxInt184 = 2n ** (184n - 1n) - 1n;
1606
+ var maxInt192 = 2n ** (192n - 1n) - 1n;
1607
+ var maxInt200 = 2n ** (200n - 1n) - 1n;
1608
+ var maxInt208 = 2n ** (208n - 1n) - 1n;
1609
+ var maxInt216 = 2n ** (216n - 1n) - 1n;
1610
+ var maxInt224 = 2n ** (224n - 1n) - 1n;
1611
+ var maxInt232 = 2n ** (232n - 1n) - 1n;
1612
+ var maxInt240 = 2n ** (240n - 1n) - 1n;
1613
+ var maxInt248 = 2n ** (248n - 1n) - 1n;
1614
+ var maxInt256 = 2n ** (256n - 1n) - 1n;
1615
+ var minInt8 = -(2n ** (8n - 1n));
1616
+ var minInt16 = -(2n ** (16n - 1n));
1617
+ var minInt24 = -(2n ** (24n - 1n));
1618
+ var minInt32 = -(2n ** (32n - 1n));
1619
+ var minInt40 = -(2n ** (40n - 1n));
1620
+ var minInt48 = -(2n ** (48n - 1n));
1621
+ var minInt56 = -(2n ** (56n - 1n));
1622
+ var minInt64 = -(2n ** (64n - 1n));
1623
+ var minInt72 = -(2n ** (72n - 1n));
1624
+ var minInt80 = -(2n ** (80n - 1n));
1625
+ var minInt88 = -(2n ** (88n - 1n));
1626
+ var minInt96 = -(2n ** (96n - 1n));
1627
+ var minInt104 = -(2n ** (104n - 1n));
1628
+ var minInt112 = -(2n ** (112n - 1n));
1629
+ var minInt120 = -(2n ** (120n - 1n));
1630
+ var minInt128 = -(2n ** (128n - 1n));
1631
+ var minInt136 = -(2n ** (136n - 1n));
1632
+ var minInt144 = -(2n ** (144n - 1n));
1633
+ var minInt152 = -(2n ** (152n - 1n));
1634
+ var minInt160 = -(2n ** (160n - 1n));
1635
+ var minInt168 = -(2n ** (168n - 1n));
1636
+ var minInt176 = -(2n ** (176n - 1n));
1637
+ var minInt184 = -(2n ** (184n - 1n));
1638
+ var minInt192 = -(2n ** (192n - 1n));
1639
+ var minInt200 = -(2n ** (200n - 1n));
1640
+ var minInt208 = -(2n ** (208n - 1n));
1641
+ var minInt216 = -(2n ** (216n - 1n));
1642
+ var minInt224 = -(2n ** (224n - 1n));
1643
+ var minInt232 = -(2n ** (232n - 1n));
1644
+ var minInt240 = -(2n ** (240n - 1n));
1645
+ var minInt248 = -(2n ** (248n - 1n));
1646
+ var minInt256 = -(2n ** (256n - 1n));
1647
+ var maxUint8 = 2n ** 8n - 1n;
1648
+ var maxUint16 = 2n ** 16n - 1n;
1649
+ var maxUint24 = 2n ** 24n - 1n;
1650
+ var maxUint32 = 2n ** 32n - 1n;
1651
+ var maxUint40 = 2n ** 40n - 1n;
1652
+ var maxUint48 = 2n ** 48n - 1n;
1653
+ var maxUint56 = 2n ** 56n - 1n;
1654
+ var maxUint64 = 2n ** 64n - 1n;
1655
+ var maxUint72 = 2n ** 72n - 1n;
1656
+ var maxUint80 = 2n ** 80n - 1n;
1657
+ var maxUint88 = 2n ** 88n - 1n;
1658
+ var maxUint96 = 2n ** 96n - 1n;
1659
+ var maxUint104 = 2n ** 104n - 1n;
1660
+ var maxUint112 = 2n ** 112n - 1n;
1661
+ var maxUint120 = 2n ** 120n - 1n;
1662
+ var maxUint128 = 2n ** 128n - 1n;
1663
+ var maxUint136 = 2n ** 136n - 1n;
1664
+ var maxUint144 = 2n ** 144n - 1n;
1665
+ var maxUint152 = 2n ** 152n - 1n;
1666
+ var maxUint160 = 2n ** 160n - 1n;
1667
+ var maxUint168 = 2n ** 168n - 1n;
1668
+ var maxUint176 = 2n ** 176n - 1n;
1669
+ var maxUint184 = 2n ** 184n - 1n;
1670
+ var maxUint192 = 2n ** 192n - 1n;
1671
+ var maxUint200 = 2n ** 200n - 1n;
1672
+ var maxUint208 = 2n ** 208n - 1n;
1673
+ var maxUint216 = 2n ** 216n - 1n;
1674
+ var maxUint224 = 2n ** 224n - 1n;
1675
+ var maxUint232 = 2n ** 232n - 1n;
1676
+ var maxUint240 = 2n ** 240n - 1n;
1677
+ var maxUint248 = 2n ** 248n - 1n;
1678
+ var maxUint256 = 2n ** 256n - 1n;
1679
+
1680
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/chain.js
1681
+ var ChainDoesNotSupportContract = class extends BaseError {
1682
+ constructor({ blockNumber, chain, contract }) {
1683
+ super(`Chain "${chain.name}" does not support contract "${contract.name}".`, {
1684
+ metaMessages: [
1685
+ "This could be due to any of the following:",
1686
+ ...blockNumber && contract.blockCreated && contract.blockCreated > blockNumber ? [
1687
+ `- The contract "${contract.name}" was not deployed until block ${contract.blockCreated} (current block ${blockNumber}).`
1688
+ ] : [
1689
+ `- The chain does not have the contract "${contract.name}" configured.`
1690
+ ]
1691
+ ],
1692
+ name: "ChainDoesNotSupportContract"
1326
1693
  });
1327
1694
  }
1328
1695
  };
1329
- var AbiEventNotFoundError = class extends BaseError {
1330
- constructor(eventName, { docsPath } = {}) {
1331
- super([
1332
- `Event ${eventName ? `"${eventName}" ` : ""}not found on ABI.`,
1333
- "Make sure you are using the correct ABI and that the event exists on it."
1334
- ].join("\n"), {
1335
- docsPath,
1336
- name: "AbiEventNotFoundError"
1696
+ var ChainMismatchError = class extends BaseError {
1697
+ constructor({ chain, currentChainId }) {
1698
+ super(`The current chain of the wallet (id: ${currentChainId}) does not match the target chain for the transaction (id: ${chain.id} \u2013 ${chain.name}).`, {
1699
+ metaMessages: [
1700
+ `Current Chain ID: ${currentChainId}`,
1701
+ `Expected Chain ID: ${chain.id} \u2013 ${chain.name}`
1702
+ ],
1703
+ name: "ChainMismatchError"
1337
1704
  });
1338
1705
  }
1339
1706
  };
1340
- var AbiFunctionNotFoundError = class extends BaseError {
1341
- constructor(functionName, { docsPath } = {}) {
1707
+ var ChainNotFoundError = class extends BaseError {
1708
+ constructor() {
1342
1709
  super([
1343
- `Function ${functionName ? `"${functionName}" ` : ""}not found on ABI.`,
1344
- "Make sure you are using the correct ABI and that the function exists on it."
1710
+ "No chain was provided to the request.",
1711
+ "Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."
1345
1712
  ].join("\n"), {
1346
- docsPath,
1347
- name: "AbiFunctionNotFoundError"
1713
+ name: "ChainNotFoundError"
1348
1714
  });
1349
1715
  }
1350
1716
  };
1351
- var AbiFunctionOutputsNotFoundError = class extends BaseError {
1352
- constructor(functionName, { docsPath }) {
1353
- super([
1354
- `Function "${functionName}" does not contain any \`outputs\` on ABI.`,
1355
- "Cannot decode function result without knowing what the parameter types are.",
1356
- "Make sure you are using the correct ABI and that the function exists on it."
1357
- ].join("\n"), {
1358
- docsPath,
1359
- name: "AbiFunctionOutputsNotFoundError"
1360
- });
1361
- }
1362
- };
1363
- var AbiFunctionSignatureNotFoundError = class extends BaseError {
1364
- constructor(signature, { docsPath }) {
1365
- super([
1366
- `Encoded function signature "${signature}" not found on ABI.`,
1367
- "Make sure you are using the correct ABI and that the function exists on it.",
1368
- `You can look up the signature here: https://4byte.sourcify.dev/?q=${signature}.`
1369
- ].join("\n"), {
1370
- docsPath,
1371
- name: "AbiFunctionSignatureNotFoundError"
1372
- });
1373
- }
1374
- };
1375
- var AbiItemAmbiguityError = class extends BaseError {
1376
- constructor(x, y) {
1377
- super("Found ambiguous types in overloaded ABI items.", {
1378
- metaMessages: [
1379
- `\`${x.type}\` in \`${formatAbiItem(x.abiItem)}\`, and`,
1380
- `\`${y.type}\` in \`${formatAbiItem(y.abiItem)}\``,
1381
- "",
1382
- "These types encode differently and cannot be distinguished at runtime.",
1383
- "Remove one of the ambiguous items in the ABI."
1384
- ],
1385
- name: "AbiItemAmbiguityError"
1386
- });
1387
- }
1388
- };
1389
- var BytesSizeMismatchError = class extends BaseError {
1390
- constructor({ expectedSize, givenSize }) {
1391
- super(`Expected bytes${expectedSize}, got bytes${givenSize}.`, {
1392
- name: "BytesSizeMismatchError"
1393
- });
1394
- }
1395
- };
1396
- var DecodeLogDataMismatch = class extends BaseError {
1397
- constructor({ abiItem, data, params, size: size4 }) {
1398
- super([
1399
- `Data size of ${size4} bytes is too small for non-indexed event parameters.`
1400
- ].join("\n"), {
1401
- metaMessages: [
1402
- `Params: (${formatAbiParams(params, { includeName: true })})`,
1403
- `Data: ${data} (${size4} bytes)`
1404
- ],
1405
- name: "DecodeLogDataMismatch"
1406
- });
1407
- Object.defineProperty(this, "abiItem", {
1408
- enumerable: true,
1409
- configurable: true,
1410
- writable: true,
1411
- value: void 0
1412
- });
1413
- Object.defineProperty(this, "data", {
1414
- enumerable: true,
1415
- configurable: true,
1416
- writable: true,
1417
- value: void 0
1418
- });
1419
- Object.defineProperty(this, "params", {
1420
- enumerable: true,
1421
- configurable: true,
1422
- writable: true,
1423
- value: void 0
1424
- });
1425
- Object.defineProperty(this, "size", {
1426
- enumerable: true,
1427
- configurable: true,
1428
- writable: true,
1429
- value: void 0
1430
- });
1431
- this.abiItem = abiItem;
1432
- this.data = data;
1433
- this.params = params;
1434
- this.size = size4;
1435
- }
1436
- };
1437
- var DecodeLogTopicsMismatch = class extends BaseError {
1438
- constructor({ abiItem, param }) {
1439
- super([
1440
- `Expected a topic for indexed event parameter${param.name ? ` "${param.name}"` : ""} on event "${formatAbiItem(abiItem, { includeName: true })}".`
1441
- ].join("\n"), { name: "DecodeLogTopicsMismatch" });
1442
- Object.defineProperty(this, "abiItem", {
1443
- enumerable: true,
1444
- configurable: true,
1445
- writable: true,
1446
- value: void 0
1447
- });
1448
- this.abiItem = abiItem;
1449
- }
1450
- };
1451
- var InvalidAbiEncodingTypeError = class extends BaseError {
1452
- constructor(type, { docsPath }) {
1453
- super([
1454
- `Type "${type}" is not a valid encoding type.`,
1455
- "Please provide a valid ABI type."
1456
- ].join("\n"), { docsPath, name: "InvalidAbiEncodingType" });
1457
- }
1458
- };
1459
- var InvalidAbiDecodingTypeError = class extends BaseError {
1460
- constructor(type, { docsPath }) {
1461
- super([
1462
- `Type "${type}" is not a valid decoding type.`,
1463
- "Please provide a valid ABI type."
1464
- ].join("\n"), { docsPath, name: "InvalidAbiDecodingType" });
1465
- }
1466
- };
1467
- var InvalidArrayError = class extends BaseError {
1468
- constructor(value) {
1469
- super([`Value "${value}" is not a valid array.`].join("\n"), {
1470
- name: "InvalidArrayError"
1471
- });
1472
- }
1473
- };
1474
- var InvalidDefinitionTypeError = class extends BaseError {
1475
- constructor(type) {
1476
- super([
1477
- `"${type}" is not a valid definition type.`,
1478
- 'Valid types: "function", "event", "error"'
1479
- ].join("\n"), { name: "InvalidDefinitionTypeError" });
1480
- }
1481
- };
1482
- var UnsupportedPackedAbiType = class extends BaseError {
1483
- constructor(type) {
1484
- super(`Type "${type}" is not supported for packed encoding.`, {
1485
- name: "UnsupportedPackedAbiType"
1486
- });
1487
- }
1488
- };
1489
-
1490
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/regex.js
1491
- var arrayRegex = /^(.*)\[([0-9]*)\]$/;
1492
- var bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
1493
- 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)?$/;
1494
-
1495
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
1496
- function encodeAbiParameters(params, values) {
1497
- if (params.length !== values.length)
1498
- throw new AbiEncodingLengthMismatchError({
1499
- expectedLength: params.length,
1500
- givenLength: values.length
1501
- });
1502
- const preparedParams = prepareParams({
1503
- params,
1504
- values
1505
- });
1506
- return encodeParams(preparedParams);
1507
- }
1508
- function prepareParams({ params, values }) {
1509
- const preparedParams = [];
1510
- for (let i = 0; i < params.length; i++) {
1511
- preparedParams.push(prepareParam({ param: params[i], value: values[i] }));
1512
- }
1513
- return preparedParams;
1514
- }
1515
- function prepareParam({ param, value }) {
1516
- const arrayComponents = getArrayComponents(param.type);
1517
- if (arrayComponents) {
1518
- const [length, type] = arrayComponents;
1519
- return encodeArray(value, { length, param: { ...param, type } });
1520
- }
1521
- if (param.type === "tuple") {
1522
- return encodeTuple(value, {
1523
- param
1524
- });
1525
- }
1526
- if (param.type === "address") {
1527
- return encodeAddress(value);
1528
- }
1529
- if (param.type === "bool") {
1530
- return encodeBool(value);
1531
- }
1532
- if (param.type.startsWith("uint") || param.type.startsWith("int")) {
1533
- const signed = param.type.startsWith("int");
1534
- const [, , size4 = "256"] = integerRegex.exec(param.type) ?? [];
1535
- return encodeNumber(value, {
1536
- signed,
1537
- size: Number(size4)
1538
- });
1539
- }
1540
- if (param.type.startsWith("bytes")) {
1541
- return encodeBytes(value, { param });
1542
- }
1543
- if (param.type === "string") {
1544
- return encodeString(value);
1545
- }
1546
- throw new InvalidAbiEncodingTypeError(param.type, {
1547
- docsPath: "/docs/contract/encodeAbiParameters"
1548
- });
1549
- }
1550
- function encodeParams(preparedParams) {
1551
- let staticSize = 0;
1552
- for (let i = 0; i < preparedParams.length; i++) {
1553
- const { dynamic, encoded } = preparedParams[i];
1554
- if (dynamic)
1555
- staticSize += 32;
1556
- else
1557
- staticSize += size(encoded);
1558
- }
1559
- const staticParams = [];
1560
- const dynamicParams = [];
1561
- let dynamicSize = 0;
1562
- for (let i = 0; i < preparedParams.length; i++) {
1563
- const { dynamic, encoded } = preparedParams[i];
1564
- if (dynamic) {
1565
- staticParams.push(numberToHex(staticSize + dynamicSize, { size: 32 }));
1566
- dynamicParams.push(encoded);
1567
- dynamicSize += size(encoded);
1568
- } else {
1569
- staticParams.push(encoded);
1570
- }
1571
- }
1572
- return concatHex([...staticParams, ...dynamicParams]);
1573
- }
1574
- function encodeAddress(value) {
1575
- if (!isAddress(value))
1576
- throw new InvalidAddressError({ address: value });
1577
- return { dynamic: false, encoded: padHex(value.toLowerCase()) };
1578
- }
1579
- function encodeArray(value, { length, param }) {
1580
- const dynamic = length === null;
1581
- if (!Array.isArray(value))
1582
- throw new InvalidArrayError(value);
1583
- if (!dynamic && value.length !== length)
1584
- throw new AbiEncodingArrayLengthMismatchError({
1585
- expectedLength: length,
1586
- givenLength: value.length,
1587
- type: `${param.type}[${length}]`
1588
- });
1589
- let dynamicChild = value.length === 0 && isDynamicType(param);
1590
- const preparedParams = [];
1591
- for (let i = 0; i < value.length; i++) {
1592
- const preparedParam = prepareParam({ param, value: value[i] });
1593
- if (preparedParam.dynamic)
1594
- dynamicChild = true;
1595
- preparedParams.push(preparedParam);
1596
- }
1597
- if (dynamic || dynamicChild) {
1598
- const data = encodeParams(preparedParams);
1599
- if (dynamic) {
1600
- const length2 = numberToHex(preparedParams.length, { size: 32 });
1601
- return {
1602
- dynamic: true,
1603
- encoded: concatHex([length2, data])
1604
- };
1605
- }
1606
- if (dynamicChild)
1607
- return { dynamic: true, encoded: data };
1608
- }
1609
- return {
1610
- dynamic: false,
1611
- encoded: concatHex(preparedParams.map(({ encoded }) => encoded))
1612
- };
1613
- }
1614
- function encodeBytes(value, { param }) {
1615
- const [, paramSize] = param.type.split("bytes");
1616
- const bytesSize = size(value);
1617
- if (!paramSize) {
1618
- let value_ = value;
1619
- if (bytesSize % 32 !== 0)
1620
- value_ = padHex(value_, {
1621
- dir: "right",
1622
- size: Math.ceil((value.length - 2) / 2 / 32) * 32
1623
- });
1624
- return {
1625
- dynamic: true,
1626
- encoded: concatHex([
1627
- padHex(numberToHex(bytesSize, { size: 32 })),
1628
- value_
1629
- ])
1630
- };
1631
- }
1632
- if (bytesSize !== Number.parseInt(paramSize, 10))
1633
- throw new AbiEncodingBytesSizeMismatchError({
1634
- expectedSize: Number.parseInt(paramSize, 10),
1635
- value
1636
- });
1637
- return { dynamic: false, encoded: padHex(value, { dir: "right" }) };
1638
- }
1639
- function encodeBool(value) {
1640
- if (typeof value !== "boolean")
1641
- throw new BaseError(`Invalid boolean value: "${value}" (type: ${typeof value}). Expected: \`true\` or \`false\`.`);
1642
- return { dynamic: false, encoded: padHex(boolToHex(value)) };
1643
- }
1644
- function encodeNumber(value, { signed, size: size4 = 256 }) {
1645
- if (typeof size4 === "number") {
1646
- const max = 2n ** (BigInt(size4) - (signed ? 1n : 0n)) - 1n;
1647
- const min = signed ? -max - 1n : 0n;
1648
- if (value > max || value < min)
1649
- throw new IntegerOutOfRangeError({
1650
- max: max.toString(),
1651
- min: min.toString(),
1652
- signed,
1653
- size: size4 / 8,
1654
- value: value.toString()
1655
- });
1656
- }
1657
- return {
1658
- dynamic: false,
1659
- encoded: numberToHex(value, {
1660
- size: 32,
1661
- signed
1662
- })
1663
- };
1664
- }
1665
- function encodeString(value) {
1666
- const hexValue = stringToHex(value);
1667
- const partsLength = Math.ceil(size(hexValue) / 32);
1668
- const parts = [];
1669
- for (let i = 0; i < partsLength; i++) {
1670
- parts.push(padHex(slice(hexValue, i * 32, (i + 1) * 32), {
1671
- dir: "right"
1672
- }));
1673
- }
1674
- return {
1675
- dynamic: true,
1676
- encoded: concatHex([
1677
- padHex(numberToHex(size(hexValue), { size: 32 })),
1678
- ...parts
1679
- ])
1680
- };
1681
- }
1682
- function encodeTuple(value, { param }) {
1683
- let dynamic = false;
1684
- const preparedParams = [];
1685
- for (let i = 0; i < param.components.length; i++) {
1686
- const param_ = param.components[i];
1687
- const index = Array.isArray(value) ? i : param_.name;
1688
- const preparedParam = prepareParam({
1689
- param: param_,
1690
- value: value[index]
1691
- });
1692
- preparedParams.push(preparedParam);
1693
- if (preparedParam.dynamic)
1694
- dynamic = true;
1695
- }
1696
- return {
1697
- dynamic,
1698
- encoded: dynamic ? encodeParams(preparedParams) : concatHex(preparedParams.map(({ encoded }) => encoded))
1699
- };
1700
- }
1701
- function getArrayComponents(type) {
1702
- const matches = type.match(/^(.*)\[(\d+)?\]$/);
1703
- return matches ? (
1704
- // Return `null` if the array is dynamic.
1705
- [matches[2] ? Number(matches[2]) : null, matches[1]]
1706
- ) : void 0;
1707
- }
1708
- function isDynamicType(param) {
1709
- const { type } = param;
1710
- if (type === "string")
1711
- return true;
1712
- if (type === "bytes")
1713
- return true;
1714
- if (type.endsWith("[]"))
1715
- return true;
1716
- if (type === "tuple")
1717
- return param.components.some(isDynamicType);
1718
- const arrayComponents = getArrayComponents(type);
1719
- if (arrayComponents)
1720
- return isDynamicType({ ...param, type: arrayComponents[1] });
1721
- return false;
1722
- }
1723
-
1724
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/stringify.js
1725
- var stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {
1726
- const value2 = typeof value_ === "bigint" ? value_.toString() : value_;
1727
- return typeof replacer === "function" ? replacer(key, value2) : value2;
1728
- }, space);
1717
+ var ClientChainNotConfiguredError = class extends BaseError {
1718
+ constructor() {
1719
+ super("No chain was provided to the Client.", {
1720
+ name: "ClientChainNotConfiguredError"
1721
+ });
1722
+ }
1723
+ };
1724
+ var InvalidChainIdError = class extends BaseError {
1725
+ constructor({ chainId }) {
1726
+ super(typeof chainId === "number" ? `Chain ID "${chainId}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
1727
+ }
1728
+ };
1729
1729
 
1730
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/block/formatBlockParameter.js
1731
- function formatBlockParameter(parameters) {
1732
- const { blockHash, blockNumber, blockTag, requireCanonical } = parameters;
1733
- if (requireCanonical !== void 0 && !blockHash)
1734
- throw new BaseError("`requireCanonical` can only be provided when `blockHash` is set.");
1735
- if (blockHash)
1736
- return requireCanonical ? { blockHash, requireCanonical } : { blockHash };
1737
- if (typeof blockNumber === "bigint")
1738
- return numberToHex(blockNumber);
1739
- return blockTag ?? "latest";
1730
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/accounts/utils/parseAccount.js
1731
+ function parseAccount(account) {
1732
+ if (typeof account === "string")
1733
+ return { address: account, type: "json-rpc" };
1734
+ return account;
1740
1735
  }
1741
1736
 
1742
1737
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/cursor.js
@@ -1927,11 +1922,16 @@ function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
1927
1922
  return cursor;
1928
1923
  }
1929
1924
 
1930
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/accounts/utils/parseAccount.js
1931
- function parseAccount(account) {
1932
- if (typeof account === "string")
1933
- return { address: account, type: "json-rpc" };
1934
- return account;
1925
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/block/formatBlockParameter.js
1926
+ function formatBlockParameter(parameters) {
1927
+ const { blockHash, blockNumber, blockTag, requireCanonical } = parameters;
1928
+ if (requireCanonical !== void 0 && !blockHash)
1929
+ throw new BaseError("`requireCanonical` can only be provided when `blockHash` is set.");
1930
+ if (blockHash)
1931
+ return requireCanonical ? { blockHash, requireCanonical } : { blockHash };
1932
+ if (typeof blockNumber === "bigint")
1933
+ return numberToHex(blockNumber);
1934
+ return blockTag ?? "latest";
1935
1935
  }
1936
1936
 
1937
1937
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/version.js
@@ -2159,63 +2159,262 @@ function assertStartOffset3(value, start) {
2159
2159
  position: "start",
2160
2160
  size: size3(value)
2161
2161
  });
2162
- }
2163
- function assertEndOffset3(value, start, end) {
2164
- if (typeof start === "number" && typeof end === "number" && size3(value) !== end - start) {
2165
- throw new SliceOffsetOutOfBoundsError3({
2166
- offset: end,
2167
- position: "end",
2168
- size: size3(value)
2162
+ }
2163
+ function assertEndOffset3(value, start, end) {
2164
+ if (typeof start === "number" && typeof end === "number" && size3(value) !== end - start) {
2165
+ throw new SliceOffsetOutOfBoundsError3({
2166
+ offset: end,
2167
+ position: "end",
2168
+ size: size3(value)
2169
+ });
2170
+ }
2171
+ }
2172
+ function pad3(hex_, options = {}) {
2173
+ const { dir, size: size4 = 32 } = options;
2174
+ if (size4 === 0)
2175
+ return hex_;
2176
+ const hex = hex_.replace("0x", "");
2177
+ if (hex.length > size4 * 2)
2178
+ throw new SizeExceedsPaddingSizeError3({
2179
+ size: Math.ceil(hex.length / 2),
2180
+ targetSize: size4,
2181
+ type: "Hex"
2182
+ });
2183
+ return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size4 * 2, "0")}`;
2184
+ }
2185
+ function trim3(value, options = {}) {
2186
+ const { dir = "left" } = options;
2187
+ let data = value.replace("0x", "");
2188
+ let sliceLength = 0;
2189
+ for (let i = 0; i < data.length - 1; i++) {
2190
+ if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
2191
+ sliceLength++;
2192
+ else
2193
+ break;
2194
+ }
2195
+ data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
2196
+ if (data === "0")
2197
+ return "0x";
2198
+ if (dir === "right" && data.length % 2 === 1)
2199
+ return `0x${data}0`;
2200
+ return `0x${data}`;
2201
+ }
2202
+
2203
+ // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Json.js
2204
+ var bigIntSuffix = "#__bigint";
2205
+ function stringify2(value, replacer, space) {
2206
+ return JSON.stringify(value, (key, value2) => {
2207
+ if (typeof replacer === "function")
2208
+ return replacer(key, value2);
2209
+ if (typeof value2 === "bigint")
2210
+ return value2.toString() + bigIntSuffix;
2211
+ return value2;
2212
+ }, space);
2213
+ }
2214
+
2215
+ // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Hex.js
2216
+ var encoder3 = /* @__PURE__ */ new TextEncoder();
2217
+ var hexes2 = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
2218
+ function assert(value, options = {}) {
2219
+ const { strict = false } = options;
2220
+ if (!value)
2221
+ throw new InvalidHexTypeError(value);
2222
+ if (typeof value !== "string")
2223
+ throw new InvalidHexTypeError(value);
2224
+ if (strict) {
2225
+ if (!/^0x[0-9a-fA-F]*$/.test(value))
2226
+ throw new InvalidHexValueError2(value);
2227
+ }
2228
+ if (!value.startsWith("0x"))
2229
+ throw new InvalidHexValueError2(value);
2230
+ }
2231
+ function concat2(...values) {
2232
+ return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
2233
+ }
2234
+ function from(value) {
2235
+ if (value instanceof Uint8Array)
2236
+ return fromBytes(value);
2237
+ if (Array.isArray(value))
2238
+ return fromBytes(new Uint8Array(value));
2239
+ return value;
2240
+ }
2241
+ function fromBoolean(value, options = {}) {
2242
+ const hex = `0x${Number(value)}`;
2243
+ if (typeof options.size === "number") {
2244
+ assertSize3(hex, options.size);
2245
+ return padLeft(hex, options.size);
2246
+ }
2247
+ return hex;
2248
+ }
2249
+ function fromBytes(value, options = {}) {
2250
+ let string = "";
2251
+ for (let i = 0; i < value.length; i++)
2252
+ string += hexes2[value[i]];
2253
+ const hex = `0x${string}`;
2254
+ if (typeof options.size === "number") {
2255
+ assertSize3(hex, options.size);
2256
+ return padRight(hex, options.size);
2257
+ }
2258
+ return hex;
2259
+ }
2260
+ function fromNumber(value, options = {}) {
2261
+ const { signed, size: size4 } = options;
2262
+ const value_ = BigInt(value);
2263
+ let maxValue;
2264
+ if (size4) {
2265
+ if (signed)
2266
+ maxValue = (1n << BigInt(size4) * 8n - 1n) - 1n;
2267
+ else
2268
+ maxValue = 2n ** (BigInt(size4) * 8n) - 1n;
2269
+ } else if (typeof value === "number") {
2270
+ maxValue = BigInt(Number.MAX_SAFE_INTEGER);
2271
+ }
2272
+ const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
2273
+ if (maxValue && value_ > maxValue || value_ < minValue) {
2274
+ const suffix = typeof value === "bigint" ? "n" : "";
2275
+ throw new IntegerOutOfRangeError2({
2276
+ max: maxValue ? `${maxValue}${suffix}` : void 0,
2277
+ min: `${minValue}${suffix}`,
2278
+ signed,
2279
+ size: size4,
2280
+ value: `${value}${suffix}`
2281
+ });
2282
+ }
2283
+ const stringValue = (signed && value_ < 0 ? BigInt.asUintN(size4 * 8, BigInt(value_)) : value_).toString(16);
2284
+ const hex = `0x${stringValue}`;
2285
+ if (size4)
2286
+ return padLeft(hex, size4);
2287
+ return hex;
2288
+ }
2289
+ function fromString(value, options = {}) {
2290
+ return fromBytes(encoder3.encode(value), options);
2291
+ }
2292
+ function padLeft(value, size4) {
2293
+ return pad3(value, { dir: "left", size: size4 });
2294
+ }
2295
+ function padRight(value, size4) {
2296
+ return pad3(value, { dir: "right", size: size4 });
2297
+ }
2298
+ function slice2(value, start, end, options = {}) {
2299
+ const { strict } = options;
2300
+ assertStartOffset3(value, start);
2301
+ const value_ = `0x${value.replace("0x", "").slice((start ?? 0) * 2, (end ?? value.length) * 2)}`;
2302
+ if (strict)
2303
+ assertEndOffset3(value_, start, end);
2304
+ return value_;
2305
+ }
2306
+ function size3(value) {
2307
+ return Math.ceil((value.length - 2) / 2);
2308
+ }
2309
+ function trimLeft(value) {
2310
+ return trim3(value, { dir: "left" });
2311
+ }
2312
+ function toBigInt(hex, options = {}) {
2313
+ const { signed } = options;
2314
+ if (options.size)
2315
+ assertSize3(hex, options.size);
2316
+ const value = BigInt(hex);
2317
+ if (!signed)
2318
+ return value;
2319
+ const size4 = (hex.length - 2) / 2;
2320
+ const max_unsigned = (1n << BigInt(size4) * 8n) - 1n;
2321
+ const max_signed = max_unsigned >> 1n;
2322
+ if (value <= max_signed)
2323
+ return value;
2324
+ return value - max_unsigned - 1n;
2325
+ }
2326
+ function toNumber(hex, options = {}) {
2327
+ const { signed, size: size4 } = options;
2328
+ if (!signed && !size4)
2329
+ return Number(hex);
2330
+ return Number(toBigInt(hex, options));
2331
+ }
2332
+ function validate(value, options = {}) {
2333
+ const { strict = false } = options;
2334
+ try {
2335
+ assert(value, { strict });
2336
+ return true;
2337
+ } catch {
2338
+ return false;
2339
+ }
2340
+ }
2341
+ var IntegerOutOfRangeError2 = class extends BaseError2 {
2342
+ constructor({ max, min, signed, size: size4, value }) {
2343
+ super(`Number \`${value}\` is not in safe${size4 ? ` ${size4 * 8}-bit` : ""}${signed ? " signed" : " unsigned"} integer range ${max ? `(\`${min}\` to \`${max}\`)` : `(above \`${min}\`)`}`);
2344
+ Object.defineProperty(this, "name", {
2345
+ enumerable: true,
2346
+ configurable: true,
2347
+ writable: true,
2348
+ value: "Hex.IntegerOutOfRangeError"
2349
+ });
2350
+ }
2351
+ };
2352
+ var InvalidHexTypeError = class extends BaseError2 {
2353
+ constructor(value) {
2354
+ super(`Value \`${typeof value === "object" ? stringify2(value) : value}\` of type \`${typeof value}\` is an invalid hex type.`, {
2355
+ metaMessages: ['Hex types must be represented as `"0x${string}"`.']
2356
+ });
2357
+ Object.defineProperty(this, "name", {
2358
+ enumerable: true,
2359
+ configurable: true,
2360
+ writable: true,
2361
+ value: "Hex.InvalidHexTypeError"
2362
+ });
2363
+ }
2364
+ };
2365
+ var InvalidHexValueError2 = class extends BaseError2 {
2366
+ constructor(value) {
2367
+ super(`Value \`${value}\` is an invalid hex value.`, {
2368
+ metaMessages: [
2369
+ 'Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).'
2370
+ ]
2371
+ });
2372
+ Object.defineProperty(this, "name", {
2373
+ enumerable: true,
2374
+ configurable: true,
2375
+ writable: true,
2376
+ value: "Hex.InvalidHexValueError"
2377
+ });
2378
+ }
2379
+ };
2380
+ var SizeOverflowError3 = class extends BaseError2 {
2381
+ constructor({ givenSize, maxSize }) {
2382
+ super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
2383
+ Object.defineProperty(this, "name", {
2384
+ enumerable: true,
2385
+ configurable: true,
2386
+ writable: true,
2387
+ value: "Hex.SizeOverflowError"
2388
+ });
2389
+ }
2390
+ };
2391
+ var SliceOffsetOutOfBoundsError3 = class extends BaseError2 {
2392
+ constructor({ offset, position, size: size4 }) {
2393
+ super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size4}\`).`);
2394
+ Object.defineProperty(this, "name", {
2395
+ enumerable: true,
2396
+ configurable: true,
2397
+ writable: true,
2398
+ value: "Hex.SliceOffsetOutOfBoundsError"
2169
2399
  });
2170
2400
  }
2171
- }
2172
- function pad3(hex_, options = {}) {
2173
- const { dir, size: size4 = 32 } = options;
2174
- if (size4 === 0)
2175
- return hex_;
2176
- const hex = hex_.replace("0x", "");
2177
- if (hex.length > size4 * 2)
2178
- throw new SizeExceedsPaddingSizeError3({
2179
- size: Math.ceil(hex.length / 2),
2180
- targetSize: size4,
2181
- type: "Hex"
2401
+ };
2402
+ var SizeExceedsPaddingSizeError3 = class extends BaseError2 {
2403
+ constructor({ size: size4, targetSize, type }) {
2404
+ super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size4}\`) exceeds padding size (\`${targetSize}\`).`);
2405
+ Object.defineProperty(this, "name", {
2406
+ enumerable: true,
2407
+ configurable: true,
2408
+ writable: true,
2409
+ value: "Hex.SizeExceedsPaddingSizeError"
2182
2410
  });
2183
- return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size4 * 2, "0")}`;
2184
- }
2185
- function trim3(value, options = {}) {
2186
- const { dir = "left" } = options;
2187
- let data = value.replace("0x", "");
2188
- let sliceLength = 0;
2189
- for (let i = 0; i < data.length - 1; i++) {
2190
- if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
2191
- sliceLength++;
2192
- else
2193
- break;
2194
2411
  }
2195
- data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
2196
- if (data === "0")
2197
- return "0x";
2198
- if (dir === "right" && data.length % 2 === 1)
2199
- return `0x${data}0`;
2200
- return `0x${data}`;
2201
- }
2202
-
2203
- // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Json.js
2204
- var bigIntSuffix = "#__bigint";
2205
- function stringify2(value, replacer, space) {
2206
- return JSON.stringify(value, (key, value2) => {
2207
- if (typeof replacer === "function")
2208
- return replacer(key, value2);
2209
- if (typeof value2 === "bigint")
2210
- return value2.toString() + bigIntSuffix;
2211
- return value2;
2212
- }, space);
2213
- }
2412
+ };
2214
2413
 
2215
2414
  // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Bytes.js
2216
2415
  var decoder = /* @__PURE__ */ new TextDecoder();
2217
- var encoder3 = /* @__PURE__ */ new TextEncoder();
2218
- function assert(value) {
2416
+ var encoder4 = /* @__PURE__ */ new TextEncoder();
2417
+ function assert2(value) {
2219
2418
  if (value instanceof Uint8Array)
2220
2419
  return;
2221
2420
  if (!value)
@@ -2227,7 +2426,7 @@ function assert(value) {
2227
2426
  if (value.BYTES_PER_ELEMENT !== 1 || value.constructor.name !== "Uint8Array")
2228
2427
  throw new InvalidBytesTypeError(value);
2229
2428
  }
2230
- function concat2(...values) {
2429
+ function concat3(...values) {
2231
2430
  let length = 0;
2232
2431
  for (const arr of values) {
2233
2432
  length += arr.length;
@@ -2240,7 +2439,7 @@ function concat2(...values) {
2240
2439
  }
2241
2440
  return result;
2242
2441
  }
2243
- function from(value) {
2442
+ function from2(value) {
2244
2443
  if (value instanceof Uint8Array)
2245
2444
  return value;
2246
2445
  if (typeof value === "string")
@@ -2272,9 +2471,9 @@ function fromHex2(value, options = {}) {
2272
2471
  }
2273
2472
  return bytes;
2274
2473
  }
2275
- function fromString(value, options = {}) {
2474
+ function fromString2(value, options = {}) {
2276
2475
  const { size: size4 } = options;
2277
- const bytes = encoder3.encode(value);
2476
+ const bytes = encoder4.encode(value);
2278
2477
  if (typeof size4 === "number") {
2279
2478
  assertSize2(bytes, size4);
2280
2479
  return padRight2(bytes, size4);
@@ -2293,7 +2492,7 @@ function random(length) {
2293
2492
  function size2(value) {
2294
2493
  return value.length;
2295
2494
  }
2296
- function slice2(value, start, end, options = {}) {
2495
+ function slice3(value, start, end, options = {}) {
2297
2496
  const { strict } = options;
2298
2497
  assertStartOffset2(value, start);
2299
2498
  const value_ = value.slice(start, end);
@@ -2313,7 +2512,7 @@ function toBoolean(bytes, options = {}) {
2313
2512
  let bytes_ = bytes;
2314
2513
  if (typeof size4 !== "undefined") {
2315
2514
  assertSize2(bytes_, size4);
2316
- bytes_ = trimLeft(bytes_);
2515
+ bytes_ = trimLeft2(bytes_);
2317
2516
  }
2318
2517
  if (bytes_.length > 1 || bytes_[0] > 1)
2319
2518
  throw new InvalidBytesBooleanError2(bytes_);
@@ -2322,300 +2521,136 @@ function toBoolean(bytes, options = {}) {
2322
2521
  function toHex2(value, options = {}) {
2323
2522
  return fromBytes(value, options);
2324
2523
  }
2325
- function toNumber2(bytes, options = {}) {
2326
- const { size: size4 } = options;
2327
- if (typeof size4 !== "undefined")
2328
- assertSize2(bytes, size4);
2329
- const hex = fromBytes(bytes, options);
2330
- return toNumber(hex, options);
2331
- }
2332
- function toString(bytes, options = {}) {
2333
- const { size: size4 } = options;
2334
- let bytes_ = bytes;
2335
- if (typeof size4 !== "undefined") {
2336
- assertSize2(bytes_, size4);
2337
- bytes_ = trimRight(bytes_);
2338
- }
2339
- return decoder.decode(bytes_);
2340
- }
2341
- function trimLeft(value) {
2342
- return trim2(value, { dir: "left" });
2343
- }
2344
- function trimRight(value) {
2345
- return trim2(value, { dir: "right" });
2346
- }
2347
- function validate(value) {
2348
- try {
2349
- assert(value);
2350
- return true;
2351
- } catch {
2352
- return false;
2353
- }
2354
- }
2355
- var InvalidBytesBooleanError2 = class extends BaseError2 {
2356
- constructor(bytes) {
2357
- super(`Bytes value \`${bytes}\` is not a valid boolean.`, {
2358
- metaMessages: [
2359
- "The bytes array must contain a single byte of either a `0` or `1` value."
2360
- ]
2361
- });
2362
- Object.defineProperty(this, "name", {
2363
- enumerable: true,
2364
- configurable: true,
2365
- writable: true,
2366
- value: "Bytes.InvalidBytesBooleanError"
2367
- });
2368
- }
2369
- };
2370
- var InvalidBytesTypeError = class extends BaseError2 {
2371
- constructor(value) {
2372
- super(`Value \`${typeof value === "object" ? stringify2(value) : value}\` of type \`${typeof value}\` is an invalid Bytes value.`, {
2373
- metaMessages: ["Bytes values must be of type `Bytes`."]
2374
- });
2375
- Object.defineProperty(this, "name", {
2376
- enumerable: true,
2377
- configurable: true,
2378
- writable: true,
2379
- value: "Bytes.InvalidBytesTypeError"
2380
- });
2381
- }
2382
- };
2383
- var SizeOverflowError2 = class extends BaseError2 {
2384
- constructor({ givenSize, maxSize }) {
2385
- super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
2386
- Object.defineProperty(this, "name", {
2387
- enumerable: true,
2388
- configurable: true,
2389
- writable: true,
2390
- value: "Bytes.SizeOverflowError"
2391
- });
2392
- }
2393
- };
2394
- var SliceOffsetOutOfBoundsError2 = class extends BaseError2 {
2395
- constructor({ offset, position, size: size4 }) {
2396
- super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size4}\`).`);
2397
- Object.defineProperty(this, "name", {
2398
- enumerable: true,
2399
- configurable: true,
2400
- writable: true,
2401
- value: "Bytes.SliceOffsetOutOfBoundsError"
2402
- });
2403
- }
2404
- };
2405
- var SizeExceedsPaddingSizeError2 = class extends BaseError2 {
2406
- constructor({ size: size4, targetSize, type }) {
2407
- super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size4}\`) exceeds padding size (\`${targetSize}\`).`);
2408
- Object.defineProperty(this, "name", {
2409
- enumerable: true,
2410
- configurable: true,
2411
- writable: true,
2412
- value: "Bytes.SizeExceedsPaddingSizeError"
2413
- });
2414
- }
2415
- };
2416
-
2417
- // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Hex.js
2418
- var encoder4 = /* @__PURE__ */ new TextEncoder();
2419
- var hexes2 = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
2420
- function assert2(value, options = {}) {
2421
- const { strict = false } = options;
2422
- if (!value)
2423
- throw new InvalidHexTypeError(value);
2424
- if (typeof value !== "string")
2425
- throw new InvalidHexTypeError(value);
2426
- if (strict) {
2427
- if (!/^0x[0-9a-fA-F]*$/.test(value))
2428
- throw new InvalidHexValueError2(value);
2429
- }
2430
- if (!value.startsWith("0x"))
2431
- throw new InvalidHexValueError2(value);
2432
- }
2433
- function concat3(...values) {
2434
- return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
2435
- }
2436
- function from2(value) {
2437
- if (value instanceof Uint8Array)
2438
- return fromBytes(value);
2439
- if (Array.isArray(value))
2440
- return fromBytes(new Uint8Array(value));
2441
- return value;
2442
- }
2443
- function fromBoolean(value, options = {}) {
2444
- const hex = `0x${Number(value)}`;
2445
- if (typeof options.size === "number") {
2446
- assertSize3(hex, options.size);
2447
- return padLeft(hex, options.size);
2448
- }
2449
- return hex;
2450
- }
2451
- function fromBytes(value, options = {}) {
2452
- let string = "";
2453
- for (let i = 0; i < value.length; i++)
2454
- string += hexes2[value[i]];
2455
- const hex = `0x${string}`;
2456
- if (typeof options.size === "number") {
2457
- assertSize3(hex, options.size);
2458
- return padRight(hex, options.size);
2459
- }
2460
- return hex;
2461
- }
2462
- function fromNumber(value, options = {}) {
2463
- const { signed, size: size4 } = options;
2464
- const value_ = BigInt(value);
2465
- let maxValue;
2466
- if (size4) {
2467
- if (signed)
2468
- maxValue = (1n << BigInt(size4) * 8n - 1n) - 1n;
2469
- else
2470
- maxValue = 2n ** (BigInt(size4) * 8n) - 1n;
2471
- } else if (typeof value === "number") {
2472
- maxValue = BigInt(Number.MAX_SAFE_INTEGER);
2473
- }
2474
- const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
2475
- if (maxValue && value_ > maxValue || value_ < minValue) {
2476
- const suffix = typeof value === "bigint" ? "n" : "";
2477
- throw new IntegerOutOfRangeError2({
2478
- max: maxValue ? `${maxValue}${suffix}` : void 0,
2479
- min: `${minValue}${suffix}`,
2480
- signed,
2481
- size: size4,
2482
- value: `${value}${suffix}`
2483
- });
2484
- }
2485
- const stringValue = (signed && value_ < 0 ? BigInt.asUintN(size4 * 8, BigInt(value_)) : value_).toString(16);
2486
- const hex = `0x${stringValue}`;
2487
- if (size4)
2488
- return padLeft(hex, size4);
2489
- return hex;
2490
- }
2491
- function fromString2(value, options = {}) {
2492
- return fromBytes(encoder4.encode(value), options);
2493
- }
2494
- function padLeft(value, size4) {
2495
- return pad3(value, { dir: "left", size: size4 });
2496
- }
2497
- function padRight(value, size4) {
2498
- return pad3(value, { dir: "right", size: size4 });
2499
- }
2500
- function slice3(value, start, end, options = {}) {
2501
- const { strict } = options;
2502
- assertStartOffset3(value, start);
2503
- const value_ = `0x${value.replace("0x", "").slice((start ?? 0) * 2, (end ?? value.length) * 2)}`;
2504
- if (strict)
2505
- assertEndOffset3(value_, start, end);
2506
- return value_;
2524
+ function toNumber2(bytes, options = {}) {
2525
+ const { size: size4 } = options;
2526
+ if (typeof size4 !== "undefined")
2527
+ assertSize2(bytes, size4);
2528
+ const hex = fromBytes(bytes, options);
2529
+ return toNumber(hex, options);
2507
2530
  }
2508
- function size3(value) {
2509
- return Math.ceil((value.length - 2) / 2);
2531
+ function toString(bytes, options = {}) {
2532
+ const { size: size4 } = options;
2533
+ let bytes_ = bytes;
2534
+ if (typeof size4 !== "undefined") {
2535
+ assertSize2(bytes_, size4);
2536
+ bytes_ = trimRight(bytes_);
2537
+ }
2538
+ return decoder.decode(bytes_);
2510
2539
  }
2511
2540
  function trimLeft2(value) {
2512
- return trim3(value, { dir: "left" });
2513
- }
2514
- function toBigInt(hex, options = {}) {
2515
- const { signed } = options;
2516
- if (options.size)
2517
- assertSize3(hex, options.size);
2518
- const value = BigInt(hex);
2519
- if (!signed)
2520
- return value;
2521
- const size4 = (hex.length - 2) / 2;
2522
- const max_unsigned = (1n << BigInt(size4) * 8n) - 1n;
2523
- const max_signed = max_unsigned >> 1n;
2524
- if (value <= max_signed)
2525
- return value;
2526
- return value - max_unsigned - 1n;
2541
+ return trim2(value, { dir: "left" });
2527
2542
  }
2528
- function toNumber(hex, options = {}) {
2529
- const { signed, size: size4 } = options;
2530
- if (!signed && !size4)
2531
- return Number(hex);
2532
- return Number(toBigInt(hex, options));
2543
+ function trimRight(value) {
2544
+ return trim2(value, { dir: "right" });
2533
2545
  }
2534
- function validate2(value, options = {}) {
2535
- const { strict = false } = options;
2546
+ function validate2(value) {
2536
2547
  try {
2537
- assert2(value, { strict });
2548
+ assert2(value);
2538
2549
  return true;
2539
2550
  } catch {
2540
2551
  return false;
2541
2552
  }
2542
2553
  }
2543
- var IntegerOutOfRangeError2 = class extends BaseError2 {
2544
- constructor({ max, min, signed, size: size4, value }) {
2545
- super(`Number \`${value}\` is not in safe${size4 ? ` ${size4 * 8}-bit` : ""}${signed ? " signed" : " unsigned"} integer range ${max ? `(\`${min}\` to \`${max}\`)` : `(above \`${min}\`)`}`);
2546
- Object.defineProperty(this, "name", {
2547
- enumerable: true,
2548
- configurable: true,
2549
- writable: true,
2550
- value: "Hex.IntegerOutOfRangeError"
2551
- });
2552
- }
2553
- };
2554
- var InvalidHexTypeError = class extends BaseError2 {
2555
- constructor(value) {
2556
- super(`Value \`${typeof value === "object" ? stringify2(value) : value}\` of type \`${typeof value}\` is an invalid hex type.`, {
2557
- metaMessages: ['Hex types must be represented as `"0x${string}"`.']
2554
+ var InvalidBytesBooleanError2 = class extends BaseError2 {
2555
+ constructor(bytes) {
2556
+ super(`Bytes value \`${bytes}\` is not a valid boolean.`, {
2557
+ metaMessages: [
2558
+ "The bytes array must contain a single byte of either a `0` or `1` value."
2559
+ ]
2558
2560
  });
2559
2561
  Object.defineProperty(this, "name", {
2560
2562
  enumerable: true,
2561
2563
  configurable: true,
2562
2564
  writable: true,
2563
- value: "Hex.InvalidHexTypeError"
2565
+ value: "Bytes.InvalidBytesBooleanError"
2564
2566
  });
2565
2567
  }
2566
2568
  };
2567
- var InvalidHexValueError2 = class extends BaseError2 {
2569
+ var InvalidBytesTypeError = class extends BaseError2 {
2568
2570
  constructor(value) {
2569
- super(`Value \`${value}\` is an invalid hex value.`, {
2570
- metaMessages: [
2571
- 'Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).'
2572
- ]
2571
+ super(`Value \`${typeof value === "object" ? stringify2(value) : value}\` of type \`${typeof value}\` is an invalid Bytes value.`, {
2572
+ metaMessages: ["Bytes values must be of type `Bytes`."]
2573
2573
  });
2574
2574
  Object.defineProperty(this, "name", {
2575
2575
  enumerable: true,
2576
2576
  configurable: true,
2577
2577
  writable: true,
2578
- value: "Hex.InvalidHexValueError"
2578
+ value: "Bytes.InvalidBytesTypeError"
2579
2579
  });
2580
2580
  }
2581
2581
  };
2582
- var SizeOverflowError3 = class extends BaseError2 {
2582
+ var SizeOverflowError2 = class extends BaseError2 {
2583
2583
  constructor({ givenSize, maxSize }) {
2584
2584
  super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
2585
2585
  Object.defineProperty(this, "name", {
2586
2586
  enumerable: true,
2587
2587
  configurable: true,
2588
2588
  writable: true,
2589
- value: "Hex.SizeOverflowError"
2589
+ value: "Bytes.SizeOverflowError"
2590
2590
  });
2591
2591
  }
2592
2592
  };
2593
- var SliceOffsetOutOfBoundsError3 = class extends BaseError2 {
2593
+ var SliceOffsetOutOfBoundsError2 = class extends BaseError2 {
2594
2594
  constructor({ offset, position, size: size4 }) {
2595
2595
  super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size4}\`).`);
2596
2596
  Object.defineProperty(this, "name", {
2597
2597
  enumerable: true,
2598
2598
  configurable: true,
2599
2599
  writable: true,
2600
- value: "Hex.SliceOffsetOutOfBoundsError"
2600
+ value: "Bytes.SliceOffsetOutOfBoundsError"
2601
2601
  });
2602
2602
  }
2603
2603
  };
2604
- var SizeExceedsPaddingSizeError3 = class extends BaseError2 {
2604
+ var SizeExceedsPaddingSizeError2 = class extends BaseError2 {
2605
2605
  constructor({ size: size4, targetSize, type }) {
2606
2606
  super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size4}\`) exceeds padding size (\`${targetSize}\`).`);
2607
2607
  Object.defineProperty(this, "name", {
2608
2608
  enumerable: true,
2609
2609
  configurable: true,
2610
2610
  writable: true,
2611
- value: "Hex.SizeExceedsPaddingSizeError"
2611
+ value: "Bytes.SizeExceedsPaddingSizeError"
2612
2612
  });
2613
2613
  }
2614
2614
  };
2615
2615
 
2616
2616
  export {
2617
+ formatAbiItem,
2618
+ isHex,
2619
+ size,
2617
2620
  setErrorConfig,
2618
2621
  BaseError,
2622
+ AbiConstructorNotFoundError,
2623
+ AbiConstructorParamsNotFoundError,
2624
+ AbiDecodingDataSizeInvalidError,
2625
+ AbiDecodingDataSizeTooSmallError,
2626
+ AbiDecodingZeroDataError,
2627
+ AbiEncodingArrayLengthMismatchError,
2628
+ AbiEncodingBytesSizeMismatchError,
2629
+ AbiEncodingLengthMismatchError,
2630
+ AbiErrorInputsNotFoundError,
2631
+ AbiErrorNotFoundError,
2632
+ AbiErrorSignatureNotFoundError,
2633
+ AbiEventSignatureEmptyTopicsError,
2634
+ AbiEventSignatureNotFoundError,
2635
+ AbiEventNotFoundError,
2636
+ AbiFunctionNotFoundError,
2637
+ AbiFunctionOutputsNotFoundError,
2638
+ AbiFunctionSignatureNotFoundError,
2639
+ AbiItemAmbiguityError,
2640
+ BytesSizeMismatchError,
2641
+ DecodeLogDataMismatch,
2642
+ DecodeLogTopicsMismatch,
2643
+ InvalidAbiEncodingTypeError,
2644
+ InvalidAbiDecodingTypeError,
2645
+ InvalidArrayError,
2646
+ InvalidDefinitionTypeError,
2647
+ UnsupportedPackedAbiType,
2648
+ SliceOffsetOutOfBoundsError,
2649
+ SizeExceedsPaddingSizeError,
2650
+ InvalidBytesLengthError,
2651
+ pad,
2652
+ padHex,
2653
+ padBytes,
2619
2654
  IntegerOutOfRangeError,
2620
2655
  InvalidBytesBooleanError,
2621
2656
  InvalidHexBooleanError,
@@ -2624,20 +2659,7 @@ export {
2624
2659
  RlpListBoundaryExceededError,
2625
2660
  RlpTrailingBytesError,
2626
2661
  SizeOverflowError,
2627
- SliceOffsetOutOfBoundsError,
2628
- SizeExceedsPaddingSizeError,
2629
- InvalidBytesLengthError,
2630
- pad,
2631
- padHex,
2632
- padBytes,
2633
- isHex,
2634
- size,
2635
2662
  trim,
2636
- toBytes,
2637
- boolToBytes,
2638
- hexToBytes,
2639
- numberToBytes,
2640
- stringToBytes,
2641
2663
  assertSize,
2642
2664
  fromHex,
2643
2665
  hexToBigInt,
@@ -2649,18 +2671,32 @@ export {
2649
2671
  bytesToHex,
2650
2672
  numberToHex,
2651
2673
  stringToHex,
2652
- formatBlockParameter,
2653
- LruMap,
2654
- InvalidAddressError,
2674
+ toBytes,
2675
+ boolToBytes,
2676
+ hexToBytes,
2677
+ numberToBytes,
2678
+ stringToBytes,
2655
2679
  keccak256,
2680
+ InvalidAddressError,
2681
+ LruMap,
2656
2682
  checksumAddress,
2657
2683
  getAddress,
2658
2684
  isAddress,
2659
2685
  concat,
2660
2686
  concatBytes,
2661
2687
  concatHex,
2688
+ slice,
2689
+ sliceBytes,
2690
+ sliceHex,
2691
+ arrayRegex,
2692
+ bytesRegex,
2693
+ integerRegex,
2694
+ encodeAbiParameters,
2695
+ getArrayComponents,
2696
+ parseAccount,
2662
2697
  PositionOutOfBoundsError,
2663
2698
  createCursor,
2699
+ stringify,
2664
2700
  etherUnits,
2665
2701
  gweiUnits,
2666
2702
  weiUnits,
@@ -2680,6 +2716,18 @@ export {
2680
2716
  TransactionReceiptNotFoundError,
2681
2717
  TransactionReceiptRevertedError,
2682
2718
  WaitForTransactionReceiptTimeoutError,
2719
+ ExecutionRevertedError,
2720
+ FeeCapTooHighError,
2721
+ FeeCapTooLowError,
2722
+ NonceTooHighError,
2723
+ NonceTooLowError,
2724
+ NonceMaxValueError,
2725
+ InsufficientFundsError,
2726
+ IntrinsicGasTooHighError,
2727
+ IntrinsicGasTooLowError,
2728
+ TransactionTypeNotSupportedError,
2729
+ TipAboveFeeCapError,
2730
+ UnknownNodeError,
2683
2731
  maxInt8,
2684
2732
  maxInt16,
2685
2733
  maxInt24,
@@ -2776,90 +2824,42 @@ export {
2776
2824
  maxUint240,
2777
2825
  maxUint248,
2778
2826
  maxUint256,
2779
- ChainDoesNotSupportContract,
2780
- ChainMismatchError,
2781
- ChainNotFoundError,
2782
- ClientChainNotConfiguredError,
2783
- InvalidChainIdError,
2784
- ExecutionRevertedError,
2785
- FeeCapTooHighError,
2786
- FeeCapTooLowError,
2787
- NonceTooHighError,
2788
- NonceTooLowError,
2789
- NonceMaxValueError,
2790
- InsufficientFundsError,
2791
- IntrinsicGasTooHighError,
2792
- IntrinsicGasTooLowError,
2793
- TransactionTypeNotSupportedError,
2794
- TipAboveFeeCapError,
2795
- UnknownNodeError,
2796
- slice,
2797
- sliceBytes,
2798
- sliceHex,
2799
- formatAbiItem,
2800
- AbiConstructorNotFoundError,
2801
- AbiConstructorParamsNotFoundError,
2802
- AbiDecodingDataSizeInvalidError,
2803
- AbiDecodingDataSizeTooSmallError,
2804
- AbiDecodingZeroDataError,
2805
- AbiEncodingArrayLengthMismatchError,
2806
- AbiEncodingBytesSizeMismatchError,
2807
- AbiEncodingLengthMismatchError,
2808
- AbiErrorInputsNotFoundError,
2809
- AbiErrorNotFoundError,
2810
- AbiErrorSignatureNotFoundError,
2811
- AbiEventSignatureEmptyTopicsError,
2812
- AbiEventSignatureNotFoundError,
2813
- AbiEventNotFoundError,
2814
- AbiFunctionNotFoundError,
2815
- AbiFunctionOutputsNotFoundError,
2816
- AbiFunctionSignatureNotFoundError,
2817
- AbiItemAmbiguityError,
2818
- BytesSizeMismatchError,
2819
- DecodeLogDataMismatch,
2820
- DecodeLogTopicsMismatch,
2821
- InvalidAbiEncodingTypeError,
2822
- InvalidAbiDecodingTypeError,
2823
- InvalidArrayError,
2824
- InvalidDefinitionTypeError,
2825
- UnsupportedPackedAbiType,
2826
- arrayRegex,
2827
- bytesRegex,
2828
- integerRegex,
2829
- encodeAbiParameters,
2830
- getArrayComponents,
2831
- stringify,
2832
- parseAccount,
2827
+ formatBlockParameter,
2833
2828
  BaseError2,
2834
2829
  stringify2,
2835
2830
  concat3 as concat2,
2836
2831
  from2 as from,
2837
- fromBoolean,
2838
- fromBytes,
2839
- fromNumber,
2832
+ fromHex2,
2840
2833
  fromString2 as fromString,
2841
- padLeft,
2842
- padRight,
2834
+ isEqual,
2835
+ random,
2836
+ size2,
2843
2837
  slice3 as slice2,
2844
- size3 as size2,
2838
+ toBigInt2 as toBigInt,
2839
+ toBoolean,
2840
+ toHex2,
2841
+ toNumber2 as toNumber,
2842
+ toString,
2845
2843
  trimLeft2 as trimLeft,
2846
- toNumber,
2847
2844
  validate2 as validate,
2848
- IntegerOutOfRangeError2,
2849
2845
  concat2 as concat3,
2850
2846
  from as from2,
2851
- fromHex2,
2847
+ fromBoolean,
2848
+ fromBytes,
2849
+ fromNumber,
2852
2850
  fromString as fromString2,
2853
- isEqual,
2854
- random,
2855
- size2 as size3,
2851
+ padLeft,
2852
+ padRight,
2856
2853
  slice2 as slice3,
2857
- toBigInt2 as toBigInt,
2858
- toBoolean,
2859
- toHex2,
2860
- toNumber2,
2861
- toString,
2854
+ size3,
2862
2855
  trimLeft as trimLeft2,
2863
- validate as validate2
2856
+ toNumber as toNumber2,
2857
+ validate as validate2,
2858
+ IntegerOutOfRangeError2,
2859
+ ChainDoesNotSupportContract,
2860
+ ChainMismatchError,
2861
+ ChainNotFoundError,
2862
+ ClientChainNotConfiguredError,
2863
+ InvalidChainIdError
2864
2864
  };
2865
- //# sourceMappingURL=chunk-YALGASEU.js.map
2865
+ //# sourceMappingURL=chunk-47PP7TAG.js.map