tenjin-cli 0.1.0-alpha.0 → 0.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.md +33 -0
- package/README.md +198 -18
- package/dist/{_esm-ZH2J4QEH.js → _esm-C5CRWCYU.js} +2 -2
- package/dist/_esm-FEASBWRP.js +881 -0
- package/dist/buy-U35DQ6XM.js +1598 -0
- package/dist/buy-U35DQ6XM.js.map +1 -0
- package/dist/candidate-RLYCQMF5.js +127 -0
- package/dist/candidate-RLYCQMF5.js.map +1 -0
- package/dist/{ccip-FXWZDDF5.js → ccip-NQXCEK2U.js} +6 -5
- package/dist/ccip-XR5NE5QK.js +19 -0
- package/dist/chunk-27ONARHV.js +171 -0
- package/dist/chunk-27ONARHV.js.map +1 -0
- package/dist/chunk-2I4QTOLB.js +11 -0
- package/dist/chunk-2I4QTOLB.js.map +1 -0
- package/dist/chunk-3OV7E5G5.js +18 -0
- package/dist/chunk-3OV7E5G5.js.map +1 -0
- package/dist/chunk-5CLSD5YN.js +209 -0
- package/dist/chunk-5CLSD5YN.js.map +1 -0
- package/dist/chunk-7KUW4MJD.js +59 -0
- package/dist/chunk-7KUW4MJD.js.map +1 -0
- package/dist/{doctor-MVLZRVPU.js → chunk-7PHSZKQS.js} +88 -93
- package/dist/chunk-7PHSZKQS.js.map +1 -0
- package/dist/chunk-CYOF7ROH.js +70 -0
- package/dist/chunk-CYOF7ROH.js.map +1 -0
- package/dist/chunk-HIVZG55D.js +204 -0
- package/dist/chunk-HIVZG55D.js.map +1 -0
- package/dist/chunk-HSDCI7OV.js +7806 -0
- package/dist/chunk-HSDCI7OV.js.map +1 -0
- package/dist/{chunk-LTTRND4A.js → chunk-IYLHQMT5.js} +85 -9
- package/dist/chunk-IYLHQMT5.js.map +1 -0
- package/dist/chunk-JPHG2JW3.js +96 -0
- package/dist/chunk-JPHG2JW3.js.map +1 -0
- package/dist/{chunk-ZPZFPVDN.js → chunk-MUBUQVC3.js} +1 -1
- package/dist/chunk-MUBUQVC3.js.map +1 -0
- package/dist/chunk-N62ROTMC.js +79 -0
- package/dist/chunk-N62ROTMC.js.map +1 -0
- package/dist/{chunk-SXQQ2ZSR.js → chunk-NCE5NSN6.js} +186 -18
- package/dist/chunk-NCE5NSN6.js.map +1 -0
- package/dist/{chunk-FIYZLITH.js → chunk-OYMYCW7J.js} +23 -4
- package/dist/{chunk-FIYZLITH.js.map → chunk-OYMYCW7J.js.map} +1 -1
- package/dist/chunk-QNP7H47L.js +152 -0
- package/dist/chunk-QNP7H47L.js.map +1 -0
- package/dist/{chunk-TX5T3LKJ.js → chunk-QVX5MWJZ.js} +21 -17
- package/dist/{chunk-TX5T3LKJ.js.map → chunk-QVX5MWJZ.js.map} +1 -1
- package/dist/{chunk-CPUZRZ2A.js → chunk-RBJPAZFI.js} +25 -170
- package/dist/chunk-RBJPAZFI.js.map +1 -0
- package/dist/chunk-RRN3YTK7.js +6199 -0
- package/dist/chunk-RRN3YTK7.js.map +1 -0
- package/dist/chunk-RY4XKNV3.js +140 -0
- package/dist/chunk-RY4XKNV3.js.map +1 -0
- package/dist/chunk-S3IGX57D.js +14682 -0
- package/dist/chunk-S3IGX57D.js.map +1 -0
- package/dist/{config-XVXZ3V2Q.js → chunk-TFGSOPWR.js} +117 -62
- package/dist/chunk-TFGSOPWR.js.map +1 -0
- package/dist/chunk-TLCMMYLY.js +126 -0
- package/dist/chunk-TLCMMYLY.js.map +1 -0
- package/dist/{chunk-PAAL45FJ.js → chunk-UGX7YPX2.js} +3446 -448
- package/dist/chunk-UGX7YPX2.js.map +1 -0
- package/dist/chunk-UO22YNY4.js +69 -0
- package/dist/chunk-UO22YNY4.js.map +1 -0
- package/dist/chunk-UPIEAMGH.js +160 -0
- package/dist/chunk-UPIEAMGH.js.map +1 -0
- package/dist/chunk-XJIW7USF.js +217 -0
- package/dist/chunk-XJIW7USF.js.map +1 -0
- package/dist/{chunk-F5DZJLU3.js → chunk-YALGASEU.js} +2065 -1258
- package/dist/chunk-YALGASEU.js.map +1 -0
- package/dist/chunk-YBMMV4Y4.js +51 -0
- package/dist/chunk-YBMMV4Y4.js.map +1 -0
- package/dist/chunk-YIYQ2ZNT.js +286 -0
- package/dist/chunk-YIYQ2ZNT.js.map +1 -0
- package/dist/{chunk-376LHMK2.js → chunk-YN5SHIXQ.js} +36 -10
- package/dist/chunk-YN5SHIXQ.js.map +1 -0
- package/dist/chunk-Z52RA3NC.js +137 -0
- package/dist/chunk-Z52RA3NC.js.map +1 -0
- package/dist/chunk-Z6MFJV5Z.js +1330 -0
- package/dist/chunk-Z6MFJV5Z.js.map +1 -0
- package/dist/chunk-ZABPQJ3M.js +83 -0
- package/dist/chunk-ZABPQJ3M.js.map +1 -0
- package/dist/{chunk-WOHCAMDQ.js → chunk-ZMHYXMO6.js} +1887 -1029
- package/dist/chunk-ZMHYXMO6.js.map +1 -0
- package/dist/{chunk-3IMLRUZE.js → chunk-ZXTAQYNA.js} +6 -2
- package/dist/{cli-LMHGCZ5S.js → cli-4NNBEQYH.js} +175 -179
- package/dist/cli-4NNBEQYH.js.map +1 -0
- package/dist/config-2VSXWWHK.js +21 -0
- package/dist/doctor-JJPNIBYH.js +20 -0
- package/dist/doctor-JJPNIBYH.js.map +1 -0
- package/dist/ethersCompat-Df4a6QIZ-3YZIAXDK.js +18 -0
- package/dist/ethersCompat-Df4a6QIZ-3YZIAXDK.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/inspect-JGYJWFDP.js +96 -0
- package/dist/inspect-JGYJWFDP.js.map +1 -0
- package/dist/install-ZQRMSRGW.js +378 -0
- package/dist/install-ZQRMSRGW.js.map +1 -0
- package/dist/lookup-WYVTOMVY.js +113 -0
- package/dist/lookup-WYVTOMVY.js.map +1 -0
- package/dist/{mine.wasm-GQECMSGN.js → mine.wasm-6PIT3DK6.js} +2 -2
- package/dist/outcome-HKKT6QIA.js +66 -0
- package/dist/outcome-HKKT6QIA.js.map +1 -0
- package/dist/publish-D76B3MBK.js +1480 -0
- package/dist/publish-D76B3MBK.js.map +1 -0
- package/dist/{secp256k1-35YNNB6F.js → secp256k1-N3ZHU7LB.js} +5 -4
- package/dist/secp256k1-N3ZHU7LB.js.map +1 -0
- package/dist/usdc-JIAJW4SV.js +22 -0
- package/dist/usdc-JIAJW4SV.js.map +1 -0
- package/dist/viemAdapter-By13KInL-ZZE6UV4Y.js +14 -0
- package/dist/viemAdapter-By13KInL-ZZE6UV4Y.js.map +1 -0
- package/dist/wallet-6QKS6UHW.js +179 -0
- package/dist/wallet-6QKS6UHW.js.map +1 -0
- package/dist/wallet-PA54CRBL.js +30 -0
- package/dist/wallet-PA54CRBL.js.map +1 -0
- package/package.json +20 -15
- package/skills/tenjin/SKILL.md +199 -0
- package/skills/tenjin-publish/SKILL.md +96 -0
- package/skills/tenjin-search/SKILL.md +122 -0
- package/dist/chunk-376LHMK2.js.map +0 -1
- package/dist/chunk-CPUZRZ2A.js.map +0 -1
- package/dist/chunk-F5DZJLU3.js.map +0 -1
- package/dist/chunk-LTTRND4A.js.map +0 -1
- package/dist/chunk-PAAL45FJ.js.map +0 -1
- package/dist/chunk-QHIEYBLV.js +0 -320
- package/dist/chunk-QHIEYBLV.js.map +0 -1
- package/dist/chunk-SXQQ2ZSR.js.map +0 -1
- package/dist/chunk-WOHCAMDQ.js.map +0 -1
- package/dist/chunk-ZPZFPVDN.js.map +0 -1
- package/dist/cli-LMHGCZ5S.js.map +0 -1
- package/dist/config-XVXZ3V2Q.js.map +0 -1
- package/dist/doctor-MVLZRVPU.js.map +0 -1
- package/dist/usdc-OQUOFF6R.js +0 -18
- package/dist/wallet-NRKWLKHX.js +0 -153
- package/dist/wallet-NRKWLKHX.js.map +0 -1
- package/dist/wallet-QUWK2PA4.js +0 -22
- /package/dist/{_esm-ZH2J4QEH.js.map → _esm-C5CRWCYU.js.map} +0 -0
- /package/dist/{ccip-FXWZDDF5.js.map → _esm-FEASBWRP.js.map} +0 -0
- /package/dist/{chunk-3IMLRUZE.js.map → ccip-NQXCEK2U.js.map} +0 -0
- /package/dist/{secp256k1-35YNNB6F.js.map → ccip-XR5NE5QK.js.map} +0 -0
- /package/dist/{usdc-OQUOFF6R.js.map → chunk-ZXTAQYNA.js.map} +0 -0
- /package/dist/{wallet-QUWK2PA4.js.map → config-2VSXWWHK.js.map} +0 -0
- /package/dist/{mine.wasm-GQECMSGN.js.map → mine.wasm-6PIT3DK6.js.map} +0 -0
|
@@ -1,78 +1,10 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
clean,
|
|
9
|
-
createHasher,
|
|
10
|
-
rotlBH,
|
|
11
|
-
rotlBL,
|
|
12
|
-
rotlSH,
|
|
13
|
-
rotlSL,
|
|
14
|
-
split,
|
|
15
|
-
swap32IfBE,
|
|
16
|
-
toBytes,
|
|
17
|
-
u32
|
|
18
|
-
} from "./chunk-CPUZRZ2A.js";
|
|
19
|
-
|
|
20
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/isHex.js
|
|
21
|
-
function isHex(value, { strict = true } = {}) {
|
|
22
|
-
if (!value)
|
|
23
|
-
return false;
|
|
24
|
-
if (typeof value !== "string")
|
|
25
|
-
return false;
|
|
26
|
-
return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/concat.js
|
|
30
|
-
function concat(values) {
|
|
31
|
-
if (typeof values[0] === "string")
|
|
32
|
-
return concatHex(values);
|
|
33
|
-
return concatBytes(values);
|
|
34
|
-
}
|
|
35
|
-
function concatBytes(values) {
|
|
36
|
-
let length = 0;
|
|
37
|
-
for (const arr of values) {
|
|
38
|
-
length += arr.length;
|
|
39
|
-
}
|
|
40
|
-
const result = new Uint8Array(length);
|
|
41
|
-
let offset = 0;
|
|
42
|
-
for (const arr of values) {
|
|
43
|
-
result.set(arr, offset);
|
|
44
|
-
offset += arr.length;
|
|
45
|
-
}
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
function concatHex(values) {
|
|
49
|
-
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/formatAbiItem.js
|
|
53
|
-
function formatAbiItem(abiItem, { includeName = false } = {}) {
|
|
54
|
-
if (abiItem.type !== "function" && abiItem.type !== "event" && abiItem.type !== "error")
|
|
55
|
-
throw new InvalidDefinitionTypeError(abiItem.type);
|
|
56
|
-
return `${abiItem.name}(${formatAbiParams(abiItem.inputs, { includeName })})`;
|
|
57
|
-
}
|
|
58
|
-
function formatAbiParams(params, { includeName = false } = {}) {
|
|
59
|
-
if (!params)
|
|
60
|
-
return "";
|
|
61
|
-
return params.map((param) => formatAbiParam(param, { includeName })).join(includeName ? ", " : ",");
|
|
62
|
-
}
|
|
63
|
-
function formatAbiParam(param, { includeName }) {
|
|
64
|
-
if (param.type.startsWith("tuple")) {
|
|
65
|
-
return `(${formatAbiParams(param.components, { includeName })})${param.type.slice("tuple".length)}`;
|
|
66
|
-
}
|
|
67
|
-
return param.type + (includeName && param.name ? ` ${param.name}` : "");
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/size.js
|
|
71
|
-
function size(value) {
|
|
72
|
-
if (isHex(value, { strict: false }))
|
|
73
|
-
return Math.ceil((value.length - 2) / 2);
|
|
74
|
-
return value.length;
|
|
75
|
-
}
|
|
3
|
+
keccak_256
|
|
4
|
+
} from "./chunk-HIVZG55D.js";
|
|
5
|
+
import {
|
|
6
|
+
equalBytes
|
|
7
|
+
} from "./chunk-RBJPAZFI.js";
|
|
76
8
|
|
|
77
9
|
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/version.js
|
|
78
10
|
var version = "2.55.2";
|
|
@@ -82,6 +14,9 @@ var errorConfig = {
|
|
|
82
14
|
getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : void 0,
|
|
83
15
|
version: `viem@${version}`
|
|
84
16
|
};
|
|
17
|
+
function setErrorConfig(config) {
|
|
18
|
+
errorConfig = config;
|
|
19
|
+
}
|
|
85
20
|
var BaseError = class _BaseError extends Error {
|
|
86
21
|
constructor(shortMessage, args = {}) {
|
|
87
22
|
const details = (() => {
|
|
@@ -161,429 +96,118 @@ function walk(err, fn) {
|
|
|
161
96
|
return fn ? null : err;
|
|
162
97
|
}
|
|
163
98
|
|
|
164
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/
|
|
165
|
-
var
|
|
166
|
-
constructor({
|
|
167
|
-
super(
|
|
168
|
-
"A constructor was not found on the ABI.",
|
|
169
|
-
"Make sure you are using the correct ABI and that the constructor exists on it."
|
|
170
|
-
].join("\n"), {
|
|
171
|
-
docsPath,
|
|
172
|
-
name: "AbiConstructorNotFoundError"
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
var AbiConstructorParamsNotFoundError = class extends BaseError {
|
|
177
|
-
constructor({ docsPath }) {
|
|
178
|
-
super([
|
|
179
|
-
"Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.",
|
|
180
|
-
"Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."
|
|
181
|
-
].join("\n"), {
|
|
182
|
-
docsPath,
|
|
183
|
-
name: "AbiConstructorParamsNotFoundError"
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
var AbiDecodingDataSizeTooSmallError = class extends BaseError {
|
|
188
|
-
constructor({ data, params, size: size2 }) {
|
|
189
|
-
super([`Data size of ${size2} bytes is too small for given parameters.`].join("\n"), {
|
|
190
|
-
metaMessages: [
|
|
191
|
-
`Params: (${formatAbiParams(params, { includeName: true })})`,
|
|
192
|
-
`Data: ${data} (${size2} bytes)`
|
|
193
|
-
],
|
|
194
|
-
name: "AbiDecodingDataSizeTooSmallError"
|
|
195
|
-
});
|
|
196
|
-
Object.defineProperty(this, "data", {
|
|
197
|
-
enumerable: true,
|
|
198
|
-
configurable: true,
|
|
199
|
-
writable: true,
|
|
200
|
-
value: void 0
|
|
201
|
-
});
|
|
202
|
-
Object.defineProperty(this, "params", {
|
|
203
|
-
enumerable: true,
|
|
204
|
-
configurable: true,
|
|
205
|
-
writable: true,
|
|
206
|
-
value: void 0
|
|
207
|
-
});
|
|
208
|
-
Object.defineProperty(this, "size", {
|
|
209
|
-
enumerable: true,
|
|
210
|
-
configurable: true,
|
|
211
|
-
writable: true,
|
|
212
|
-
value: void 0
|
|
213
|
-
});
|
|
214
|
-
this.data = data;
|
|
215
|
-
this.params = params;
|
|
216
|
-
this.size = size2;
|
|
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" });
|
|
217
103
|
}
|
|
218
104
|
};
|
|
219
|
-
var
|
|
220
|
-
constructor(
|
|
221
|
-
super(
|
|
222
|
-
name: "
|
|
223
|
-
cause
|
|
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"
|
|
224
109
|
});
|
|
225
110
|
}
|
|
226
111
|
};
|
|
227
|
-
var
|
|
228
|
-
constructor(
|
|
229
|
-
super(
|
|
230
|
-
`ABI encoding array length mismatch for type ${type}.`,
|
|
231
|
-
`Expected length: ${expectedLength}`,
|
|
232
|
-
`Given length: ${givenLength}`
|
|
233
|
-
].join("\n"), { name: "AbiEncodingArrayLengthMismatchError" });
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
var AbiEncodingBytesSizeMismatchError = class extends BaseError {
|
|
237
|
-
constructor({ expectedSize, value }) {
|
|
238
|
-
super(`Size of bytes "${value}" (bytes${size(value)}) does not match expected size (bytes${expectedSize}).`, { name: "AbiEncodingBytesSizeMismatchError" });
|
|
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" });
|
|
239
115
|
}
|
|
240
116
|
};
|
|
241
|
-
var
|
|
242
|
-
constructor(
|
|
243
|
-
super(
|
|
244
|
-
"ABI encoding params/values length mismatch.",
|
|
245
|
-
`Expected length (params): ${expectedLength}`,
|
|
246
|
-
`Given length (values): ${givenLength}`
|
|
247
|
-
].join("\n"), { name: "AbiEncodingLengthMismatchError" });
|
|
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" });
|
|
248
120
|
}
|
|
249
121
|
};
|
|
250
|
-
var
|
|
251
|
-
constructor(
|
|
252
|
-
super(
|
|
253
|
-
|
|
254
|
-
"Cannot encode error result without knowing what the parameter types are.",
|
|
255
|
-
"Make sure you are using the correct ABI and that the inputs exist on it."
|
|
256
|
-
].join("\n"), {
|
|
257
|
-
docsPath,
|
|
258
|
-
name: "AbiErrorInputsNotFoundError"
|
|
122
|
+
var RlpDepthLimitExceededError = class extends BaseError {
|
|
123
|
+
constructor({ limit }) {
|
|
124
|
+
super(`RLP depth limit of \`${limit}\` exceeded.`, {
|
|
125
|
+
name: "RlpDepthLimitExceededError"
|
|
259
126
|
});
|
|
260
127
|
}
|
|
261
128
|
};
|
|
262
|
-
var
|
|
263
|
-
constructor(
|
|
264
|
-
super(
|
|
265
|
-
`Error ${errorName ? `"${errorName}" ` : ""}not found on ABI.`,
|
|
266
|
-
"Make sure you are using the correct ABI and that the error exists on it."
|
|
267
|
-
].join("\n"), {
|
|
268
|
-
docsPath,
|
|
269
|
-
name: "AbiErrorNotFoundError"
|
|
270
|
-
});
|
|
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" });
|
|
271
132
|
}
|
|
272
133
|
};
|
|
273
|
-
var
|
|
274
|
-
constructor(
|
|
275
|
-
super(
|
|
276
|
-
`Encoded error signature "${signature}" not found on ABI.`,
|
|
277
|
-
"Make sure you are using the correct ABI and that the error exists on it.",
|
|
278
|
-
`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${signature}.`
|
|
279
|
-
].join("\n"), {
|
|
280
|
-
docsPath,
|
|
281
|
-
name: "AbiErrorSignatureNotFoundError",
|
|
282
|
-
cause
|
|
283
|
-
});
|
|
284
|
-
Object.defineProperty(this, "signature", {
|
|
285
|
-
enumerable: true,
|
|
286
|
-
configurable: true,
|
|
287
|
-
writable: true,
|
|
288
|
-
value: void 0
|
|
289
|
-
});
|
|
290
|
-
this.signature = signature;
|
|
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" });
|
|
291
137
|
}
|
|
292
138
|
};
|
|
293
|
-
var
|
|
294
|
-
constructor({
|
|
295
|
-
super(
|
|
296
|
-
docsPath,
|
|
297
|
-
name: "AbiEventSignatureEmptyTopicsError"
|
|
298
|
-
});
|
|
139
|
+
var SizeOverflowError = class extends BaseError {
|
|
140
|
+
constructor({ givenSize, maxSize }) {
|
|
141
|
+
super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: "SizeOverflowError" });
|
|
299
142
|
}
|
|
300
143
|
};
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
`You can look up the signature here: https://4byte.sourcify.dev/?q=${signature}.`
|
|
307
|
-
].join("\n"), {
|
|
308
|
-
docsPath,
|
|
309
|
-
name: "AbiEventSignatureNotFoundError"
|
|
310
|
-
});
|
|
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" });
|
|
311
149
|
}
|
|
312
150
|
};
|
|
313
|
-
var
|
|
314
|
-
constructor(
|
|
315
|
-
super(
|
|
316
|
-
`Event ${eventName ? `"${eventName}" ` : ""}not found on ABI.`,
|
|
317
|
-
"Make sure you are using the correct ABI and that the event exists on it."
|
|
318
|
-
].join("\n"), {
|
|
319
|
-
docsPath,
|
|
320
|
-
name: "AbiEventNotFoundError"
|
|
321
|
-
});
|
|
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" });
|
|
322
154
|
}
|
|
323
155
|
};
|
|
324
|
-
var
|
|
325
|
-
constructor(
|
|
326
|
-
super(
|
|
327
|
-
`Function ${functionName ? `"${functionName}" ` : ""}not found on ABI.`,
|
|
328
|
-
"Make sure you are using the correct ABI and that the function exists on it."
|
|
329
|
-
].join("\n"), {
|
|
330
|
-
docsPath,
|
|
331
|
-
name: "AbiFunctionNotFoundError"
|
|
332
|
-
});
|
|
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" });
|
|
333
159
|
}
|
|
334
160
|
};
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
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"
|
|
344
177
|
});
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
name: "AbiFunctionSignatureNotFoundError"
|
|
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"
|
|
356
188
|
});
|
|
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];
|
|
357
193
|
}
|
|
358
|
-
|
|
359
|
-
var AbiItemAmbiguityError = class extends BaseError {
|
|
360
|
-
constructor(x, y) {
|
|
361
|
-
super("Found ambiguous types in overloaded ABI items.", {
|
|
362
|
-
metaMessages: [
|
|
363
|
-
`\`${x.type}\` in \`${formatAbiItem(x.abiItem)}\`, and`,
|
|
364
|
-
`\`${y.type}\` in \`${formatAbiItem(y.abiItem)}\``,
|
|
365
|
-
"",
|
|
366
|
-
"These types encode differently and cannot be distinguished at runtime.",
|
|
367
|
-
"Remove one of the ambiguous items in the ABI."
|
|
368
|
-
],
|
|
369
|
-
name: "AbiItemAmbiguityError"
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
var BytesSizeMismatchError = class extends BaseError {
|
|
374
|
-
constructor({ expectedSize, givenSize }) {
|
|
375
|
-
super(`Expected bytes${expectedSize}, got bytes${givenSize}.`, {
|
|
376
|
-
name: "BytesSizeMismatchError"
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
var DecodeLogDataMismatch = class extends BaseError {
|
|
381
|
-
constructor({ abiItem, data, params, size: size2 }) {
|
|
382
|
-
super([
|
|
383
|
-
`Data size of ${size2} bytes is too small for non-indexed event parameters.`
|
|
384
|
-
].join("\n"), {
|
|
385
|
-
metaMessages: [
|
|
386
|
-
`Params: (${formatAbiParams(params, { includeName: true })})`,
|
|
387
|
-
`Data: ${data} (${size2} bytes)`
|
|
388
|
-
],
|
|
389
|
-
name: "DecodeLogDataMismatch"
|
|
390
|
-
});
|
|
391
|
-
Object.defineProperty(this, "abiItem", {
|
|
392
|
-
enumerable: true,
|
|
393
|
-
configurable: true,
|
|
394
|
-
writable: true,
|
|
395
|
-
value: void 0
|
|
396
|
-
});
|
|
397
|
-
Object.defineProperty(this, "data", {
|
|
398
|
-
enumerable: true,
|
|
399
|
-
configurable: true,
|
|
400
|
-
writable: true,
|
|
401
|
-
value: void 0
|
|
402
|
-
});
|
|
403
|
-
Object.defineProperty(this, "params", {
|
|
404
|
-
enumerable: true,
|
|
405
|
-
configurable: true,
|
|
406
|
-
writable: true,
|
|
407
|
-
value: void 0
|
|
408
|
-
});
|
|
409
|
-
Object.defineProperty(this, "size", {
|
|
410
|
-
enumerable: true,
|
|
411
|
-
configurable: true,
|
|
412
|
-
writable: true,
|
|
413
|
-
value: void 0
|
|
414
|
-
});
|
|
415
|
-
this.abiItem = abiItem;
|
|
416
|
-
this.data = data;
|
|
417
|
-
this.params = params;
|
|
418
|
-
this.size = size2;
|
|
419
|
-
}
|
|
420
|
-
};
|
|
421
|
-
var DecodeLogTopicsMismatch = class extends BaseError {
|
|
422
|
-
constructor({ abiItem, param }) {
|
|
423
|
-
super([
|
|
424
|
-
`Expected a topic for indexed event parameter${param.name ? ` "${param.name}"` : ""} on event "${formatAbiItem(abiItem, { includeName: true })}".`
|
|
425
|
-
].join("\n"), { name: "DecodeLogTopicsMismatch" });
|
|
426
|
-
Object.defineProperty(this, "abiItem", {
|
|
427
|
-
enumerable: true,
|
|
428
|
-
configurable: true,
|
|
429
|
-
writable: true,
|
|
430
|
-
value: void 0
|
|
431
|
-
});
|
|
432
|
-
this.abiItem = abiItem;
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
var InvalidAbiEncodingTypeError = class extends BaseError {
|
|
436
|
-
constructor(type, { docsPath }) {
|
|
437
|
-
super([
|
|
438
|
-
`Type "${type}" is not a valid encoding type.`,
|
|
439
|
-
"Please provide a valid ABI type."
|
|
440
|
-
].join("\n"), { docsPath, name: "InvalidAbiEncodingType" });
|
|
441
|
-
}
|
|
442
|
-
};
|
|
443
|
-
var InvalidAbiDecodingTypeError = class extends BaseError {
|
|
444
|
-
constructor(type, { docsPath }) {
|
|
445
|
-
super([
|
|
446
|
-
`Type "${type}" is not a valid decoding type.`,
|
|
447
|
-
"Please provide a valid ABI type."
|
|
448
|
-
].join("\n"), { docsPath, name: "InvalidAbiDecodingType" });
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
var InvalidArrayError = class extends BaseError {
|
|
452
|
-
constructor(value) {
|
|
453
|
-
super([`Value "${value}" is not a valid array.`].join("\n"), {
|
|
454
|
-
name: "InvalidArrayError"
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
};
|
|
458
|
-
var InvalidDefinitionTypeError = class extends BaseError {
|
|
459
|
-
constructor(type) {
|
|
460
|
-
super([
|
|
461
|
-
`"${type}" is not a valid definition type.`,
|
|
462
|
-
'Valid types: "function", "event", "error"'
|
|
463
|
-
].join("\n"), { name: "InvalidDefinitionTypeError" });
|
|
464
|
-
}
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/address.js
|
|
468
|
-
var InvalidAddressError = class extends BaseError {
|
|
469
|
-
constructor({ address }) {
|
|
470
|
-
super(`Address "${address}" is invalid.`, {
|
|
471
|
-
metaMessages: [
|
|
472
|
-
"- Address must be a hex value of 20 bytes (40 hex characters).",
|
|
473
|
-
"- Address must match its checksum counterpart."
|
|
474
|
-
],
|
|
475
|
-
name: "InvalidAddressError"
|
|
476
|
-
});
|
|
477
|
-
}
|
|
478
|
-
};
|
|
479
|
-
|
|
480
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/encoding.js
|
|
481
|
-
var IntegerOutOfRangeError = class extends BaseError {
|
|
482
|
-
constructor({ max, min, signed, size: size2, value }) {
|
|
483
|
-
super(`Number "${value}" is not in safe ${size2 ? `${size2 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
|
|
484
|
-
}
|
|
485
|
-
};
|
|
486
|
-
var InvalidBytesBooleanError = class extends BaseError {
|
|
487
|
-
constructor(bytes) {
|
|
488
|
-
super(`Bytes value "${bytes}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {
|
|
489
|
-
name: "InvalidBytesBooleanError"
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
};
|
|
493
|
-
var InvalidHexBooleanError = class extends BaseError {
|
|
494
|
-
constructor(hex) {
|
|
495
|
-
super(`Hex value "${hex}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`, { name: "InvalidHexBooleanError" });
|
|
496
|
-
}
|
|
497
|
-
};
|
|
498
|
-
var SizeOverflowError = class extends BaseError {
|
|
499
|
-
constructor({ givenSize, maxSize }) {
|
|
500
|
-
super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: "SizeOverflowError" });
|
|
501
|
-
}
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/lru.js
|
|
505
|
-
var LruMap = class extends Map {
|
|
506
|
-
constructor(size2) {
|
|
507
|
-
super();
|
|
508
|
-
Object.defineProperty(this, "maxSize", {
|
|
509
|
-
enumerable: true,
|
|
510
|
-
configurable: true,
|
|
511
|
-
writable: true,
|
|
512
|
-
value: void 0
|
|
513
|
-
});
|
|
514
|
-
this.maxSize = size2;
|
|
515
|
-
}
|
|
516
|
-
get(key) {
|
|
517
|
-
const value = super.get(key);
|
|
518
|
-
if (super.has(key)) {
|
|
519
|
-
super.delete(key);
|
|
520
|
-
super.set(key, value);
|
|
521
|
-
}
|
|
522
|
-
return value;
|
|
523
|
-
}
|
|
524
|
-
set(key, value) {
|
|
525
|
-
if (super.has(key))
|
|
526
|
-
super.delete(key);
|
|
527
|
-
super.set(key, value);
|
|
528
|
-
if (this.maxSize && this.size > this.maxSize) {
|
|
529
|
-
const firstKey = super.keys().next().value;
|
|
530
|
-
if (firstKey !== void 0)
|
|
531
|
-
super.delete(firstKey);
|
|
532
|
-
}
|
|
533
|
-
return this;
|
|
534
|
-
}
|
|
535
|
-
};
|
|
536
|
-
|
|
537
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/data.js
|
|
538
|
-
var SliceOffsetOutOfBoundsError = class extends BaseError {
|
|
539
|
-
constructor({ offset, position, size: size2 }) {
|
|
540
|
-
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size2}).`, { name: "SliceOffsetOutOfBoundsError" });
|
|
541
|
-
}
|
|
542
|
-
};
|
|
543
|
-
var SizeExceedsPaddingSizeError = class extends BaseError {
|
|
544
|
-
constructor({ size: size2, targetSize, type }) {
|
|
545
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${size2}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
546
|
-
}
|
|
547
|
-
};
|
|
548
|
-
var InvalidBytesLengthError = class extends BaseError {
|
|
549
|
-
constructor({ size: size2, targetSize, type }) {
|
|
550
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${size2} ${type} long.`, { name: "InvalidBytesLengthError" });
|
|
551
|
-
}
|
|
552
|
-
};
|
|
553
|
-
|
|
554
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/pad.js
|
|
555
|
-
function pad(hexOrBytes, { dir, size: size2 = 32 } = {}) {
|
|
556
|
-
if (typeof hexOrBytes === "string")
|
|
557
|
-
return padHex(hexOrBytes, { dir, size: size2 });
|
|
558
|
-
return padBytes(hexOrBytes, { dir, size: size2 });
|
|
194
|
+
return paddedBytes;
|
|
559
195
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
type: "hex"
|
|
569
|
-
});
|
|
570
|
-
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size2 * 2, "0")}`;
|
|
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");
|
|
571
204
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
if (
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
targetSize: size2,
|
|
579
|
-
type: "bytes"
|
|
580
|
-
});
|
|
581
|
-
const paddedBytes = new Uint8Array(size2);
|
|
582
|
-
for (let i = 0; i < size2; i++) {
|
|
583
|
-
const padEnd = dir === "right";
|
|
584
|
-
paddedBytes[padEnd ? i : size2 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
|
|
585
|
-
}
|
|
586
|
-
return paddedBytes;
|
|
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;
|
|
587
211
|
}
|
|
588
212
|
|
|
589
213
|
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/trim.js
|
|
@@ -606,13 +230,26 @@ function trim(hexOrBytes, { dir = "left" } = {}) {
|
|
|
606
230
|
}
|
|
607
231
|
|
|
608
232
|
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/fromHex.js
|
|
609
|
-
function assertSize(hexOrBytes, { size:
|
|
610
|
-
if (size(hexOrBytes) >
|
|
233
|
+
function assertSize(hexOrBytes, { size: size4 }) {
|
|
234
|
+
if (size(hexOrBytes) > size4)
|
|
611
235
|
throw new SizeOverflowError({
|
|
612
236
|
givenSize: size(hexOrBytes),
|
|
613
|
-
maxSize:
|
|
237
|
+
maxSize: size4
|
|
614
238
|
});
|
|
615
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
|
+
}
|
|
616
253
|
function hexToBigInt(hex, opts = {}) {
|
|
617
254
|
const { signed } = opts;
|
|
618
255
|
if (opts.size)
|
|
@@ -620,11 +257,11 @@ function hexToBigInt(hex, opts = {}) {
|
|
|
620
257
|
const value = BigInt(hex);
|
|
621
258
|
if (!signed)
|
|
622
259
|
return value;
|
|
623
|
-
const
|
|
624
|
-
const max = (1n << BigInt(
|
|
260
|
+
const size4 = (hex.length - 2) / 2;
|
|
261
|
+
const max = (1n << BigInt(size4) * 8n - 1n) - 1n;
|
|
625
262
|
if (value <= max)
|
|
626
263
|
return value;
|
|
627
|
-
return value - BigInt(`0x${"f".padStart(
|
|
264
|
+
return value - BigInt(`0x${"f".padStart(size4 * 2, "f")}`) - 1n;
|
|
628
265
|
}
|
|
629
266
|
function hexToBool(hex_, opts = {}) {
|
|
630
267
|
let hex = hex_;
|
|
@@ -651,6 +288,14 @@ function hexToNumber(hex, opts = {}) {
|
|
|
651
288
|
});
|
|
652
289
|
return number;
|
|
653
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
|
+
}
|
|
297
|
+
return new TextDecoder().decode(bytes);
|
|
298
|
+
}
|
|
654
299
|
|
|
655
300
|
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/toHex.js
|
|
656
301
|
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
@@ -685,14 +330,14 @@ function bytesToHex(value, opts = {}) {
|
|
|
685
330
|
return hex;
|
|
686
331
|
}
|
|
687
332
|
function numberToHex(value_, opts = {}) {
|
|
688
|
-
const { signed, size:
|
|
333
|
+
const { signed, size: size4 } = opts;
|
|
689
334
|
const value = BigInt(value_);
|
|
690
335
|
let maxValue;
|
|
691
|
-
if (
|
|
336
|
+
if (size4) {
|
|
692
337
|
if (signed)
|
|
693
|
-
maxValue = (1n << BigInt(
|
|
338
|
+
maxValue = (1n << BigInt(size4) * 8n - 1n) - 1n;
|
|
694
339
|
else
|
|
695
|
-
maxValue = 2n ** (BigInt(
|
|
340
|
+
maxValue = 2n ** (BigInt(size4) * 8n) - 1n;
|
|
696
341
|
} else if (typeof value_ === "number") {
|
|
697
342
|
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
698
343
|
}
|
|
@@ -703,13 +348,13 @@ function numberToHex(value_, opts = {}) {
|
|
|
703
348
|
max: maxValue ? `${maxValue}${suffix}` : void 0,
|
|
704
349
|
min: `${minValue}${suffix}`,
|
|
705
350
|
signed,
|
|
706
|
-
size:
|
|
351
|
+
size: size4,
|
|
707
352
|
value: `${value_}${suffix}`
|
|
708
353
|
});
|
|
709
354
|
}
|
|
710
|
-
const hex = `0x${(signed && value < 0 ? (1n << BigInt(
|
|
711
|
-
if (
|
|
712
|
-
return pad(hex, { size:
|
|
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 });
|
|
713
358
|
return hex;
|
|
714
359
|
}
|
|
715
360
|
var encoder = /* @__PURE__ */ new TextEncoder();
|
|
@@ -720,7 +365,7 @@ function stringToHex(value_, opts = {}) {
|
|
|
720
365
|
|
|
721
366
|
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/toBytes.js
|
|
722
367
|
var encoder2 = /* @__PURE__ */ new TextEncoder();
|
|
723
|
-
function
|
|
368
|
+
function toBytes(value, opts = {}) {
|
|
724
369
|
if (typeof value === "number" || typeof value === "bigint")
|
|
725
370
|
return numberToBytes(value, opts);
|
|
726
371
|
if (typeof value === "boolean")
|
|
@@ -789,221 +434,60 @@ function stringToBytes(value, opts = {}) {
|
|
|
789
434
|
return bytes;
|
|
790
435
|
}
|
|
791
436
|
|
|
792
|
-
// node_modules/.pnpm
|
|
793
|
-
var
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
|
|
803
|
-
[x, y] = [y, (2 * x + 3 * y) % 5];
|
|
804
|
-
SHA3_PI.push(2 * (5 * y + x));
|
|
805
|
-
SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
|
|
806
|
-
let t = _0n;
|
|
807
|
-
for (let j = 0; j < 7; j++) {
|
|
808
|
-
R = (R << _1n ^ (R >> _7n) * _0x71n) % _256n;
|
|
809
|
-
if (R & _2n)
|
|
810
|
-
t ^= _1n << (_1n << /* @__PURE__ */ BigInt(j)) - _1n;
|
|
811
|
-
}
|
|
812
|
-
_SHA3_IOTA.push(t);
|
|
813
|
-
}
|
|
814
|
-
var IOTAS = split(_SHA3_IOTA, true);
|
|
815
|
-
var SHA3_IOTA_H = IOTAS[0];
|
|
816
|
-
var SHA3_IOTA_L = IOTAS[1];
|
|
817
|
-
var rotlH = (h, l, s) => s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s);
|
|
818
|
-
var rotlL = (h, l, s) => s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s);
|
|
819
|
-
function keccakP(s, rounds = 24) {
|
|
820
|
-
const B = new Uint32Array(5 * 2);
|
|
821
|
-
for (let round = 24 - rounds; round < 24; round++) {
|
|
822
|
-
for (let x = 0; x < 10; x++)
|
|
823
|
-
B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
|
|
824
|
-
for (let x = 0; x < 10; x += 2) {
|
|
825
|
-
const idx1 = (x + 8) % 10;
|
|
826
|
-
const idx0 = (x + 2) % 10;
|
|
827
|
-
const B0 = B[idx0];
|
|
828
|
-
const B1 = B[idx0 + 1];
|
|
829
|
-
const Th = rotlH(B0, B1, 1) ^ B[idx1];
|
|
830
|
-
const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
|
|
831
|
-
for (let y = 0; y < 50; y += 10) {
|
|
832
|
-
s[x + y] ^= Th;
|
|
833
|
-
s[x + y + 1] ^= Tl;
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
let curH = s[2];
|
|
837
|
-
let curL = s[3];
|
|
838
|
-
for (let t = 0; t < 24; t++) {
|
|
839
|
-
const shift = SHA3_ROTL[t];
|
|
840
|
-
const Th = rotlH(curH, curL, shift);
|
|
841
|
-
const Tl = rotlL(curH, curL, shift);
|
|
842
|
-
const PI = SHA3_PI[t];
|
|
843
|
-
curH = s[PI];
|
|
844
|
-
curL = s[PI + 1];
|
|
845
|
-
s[PI] = Th;
|
|
846
|
-
s[PI + 1] = Tl;
|
|
847
|
-
}
|
|
848
|
-
for (let y = 0; y < 50; y += 10) {
|
|
849
|
-
for (let x = 0; x < 10; x++)
|
|
850
|
-
B[x] = s[y + x];
|
|
851
|
-
for (let x = 0; x < 10; x++)
|
|
852
|
-
s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
|
|
853
|
-
}
|
|
854
|
-
s[0] ^= SHA3_IOTA_H[round];
|
|
855
|
-
s[1] ^= SHA3_IOTA_L[round];
|
|
856
|
-
}
|
|
857
|
-
clean(B);
|
|
858
|
-
}
|
|
859
|
-
var Keccak = class _Keccak extends Hash {
|
|
860
|
-
// NOTE: we accept arguments in bytes instead of bits here.
|
|
861
|
-
constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
|
|
862
|
-
super();
|
|
863
|
-
this.pos = 0;
|
|
864
|
-
this.posOut = 0;
|
|
865
|
-
this.finished = false;
|
|
866
|
-
this.destroyed = false;
|
|
867
|
-
this.enableXOF = false;
|
|
868
|
-
this.blockLen = blockLen;
|
|
869
|
-
this.suffix = suffix;
|
|
870
|
-
this.outputLen = outputLen;
|
|
871
|
-
this.enableXOF = enableXOF;
|
|
872
|
-
this.rounds = rounds;
|
|
873
|
-
anumber(outputLen);
|
|
874
|
-
if (!(0 < blockLen && blockLen < 200))
|
|
875
|
-
throw new Error("only keccak-f1600 function is supported");
|
|
876
|
-
this.state = new Uint8Array(200);
|
|
877
|
-
this.state32 = u32(this.state);
|
|
878
|
-
}
|
|
879
|
-
clone() {
|
|
880
|
-
return this._cloneInto();
|
|
881
|
-
}
|
|
882
|
-
keccak() {
|
|
883
|
-
swap32IfBE(this.state32);
|
|
884
|
-
keccakP(this.state32, this.rounds);
|
|
885
|
-
swap32IfBE(this.state32);
|
|
886
|
-
this.posOut = 0;
|
|
887
|
-
this.pos = 0;
|
|
888
|
-
}
|
|
889
|
-
update(data) {
|
|
890
|
-
aexists(this);
|
|
891
|
-
data = toBytes(data);
|
|
892
|
-
abytes(data);
|
|
893
|
-
const { blockLen, state } = this;
|
|
894
|
-
const len = data.length;
|
|
895
|
-
for (let pos = 0; pos < len; ) {
|
|
896
|
-
const take = Math.min(blockLen - this.pos, len - pos);
|
|
897
|
-
for (let i = 0; i < take; i++)
|
|
898
|
-
state[this.pos++] ^= data[pos++];
|
|
899
|
-
if (this.pos === blockLen)
|
|
900
|
-
this.keccak();
|
|
901
|
-
}
|
|
902
|
-
return this;
|
|
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"
|
|
446
|
+
});
|
|
903
447
|
}
|
|
904
|
-
|
|
905
|
-
if (this.finished)
|
|
906
|
-
return;
|
|
907
|
-
this.finished = true;
|
|
908
|
-
const { state, suffix, pos, blockLen } = this;
|
|
909
|
-
state[pos] ^= suffix;
|
|
910
|
-
if ((suffix & 128) !== 0 && pos === blockLen - 1)
|
|
911
|
-
this.keccak();
|
|
912
|
-
state[blockLen - 1] ^= 128;
|
|
913
|
-
this.keccak();
|
|
914
|
-
}
|
|
915
|
-
writeInto(out) {
|
|
916
|
-
aexists(this, false);
|
|
917
|
-
abytes(out);
|
|
918
|
-
this.finish();
|
|
919
|
-
const bufferOut = this.state;
|
|
920
|
-
const { blockLen } = this;
|
|
921
|
-
for (let pos = 0, len = out.length; pos < len; ) {
|
|
922
|
-
if (this.posOut >= blockLen)
|
|
923
|
-
this.keccak();
|
|
924
|
-
const take = Math.min(blockLen - this.posOut, len - pos);
|
|
925
|
-
out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
|
|
926
|
-
this.posOut += take;
|
|
927
|
-
pos += take;
|
|
928
|
-
}
|
|
929
|
-
return out;
|
|
930
|
-
}
|
|
931
|
-
xofInto(out) {
|
|
932
|
-
if (!this.enableXOF)
|
|
933
|
-
throw new Error("XOF is not possible for this instance");
|
|
934
|
-
return this.writeInto(out);
|
|
935
|
-
}
|
|
936
|
-
xof(bytes) {
|
|
937
|
-
anumber(bytes);
|
|
938
|
-
return this.xofInto(new Uint8Array(bytes));
|
|
939
|
-
}
|
|
940
|
-
digestInto(out) {
|
|
941
|
-
aoutput(out, this);
|
|
942
|
-
if (this.finished)
|
|
943
|
-
throw new Error("digest() was already called");
|
|
944
|
-
this.writeInto(out);
|
|
945
|
-
this.destroy();
|
|
946
|
-
return out;
|
|
947
|
-
}
|
|
948
|
-
digest() {
|
|
949
|
-
return this.digestInto(new Uint8Array(this.outputLen));
|
|
950
|
-
}
|
|
951
|
-
destroy() {
|
|
952
|
-
this.destroyed = true;
|
|
953
|
-
clean(this.state);
|
|
954
|
-
}
|
|
955
|
-
_cloneInto(to) {
|
|
956
|
-
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
|
957
|
-
to || (to = new _Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
|
|
958
|
-
to.state32.set(this.state32);
|
|
959
|
-
to.pos = this.pos;
|
|
960
|
-
to.posOut = this.posOut;
|
|
961
|
-
to.finished = this.finished;
|
|
962
|
-
to.rounds = rounds;
|
|
963
|
-
to.suffix = suffix;
|
|
964
|
-
to.outputLen = outputLen;
|
|
965
|
-
to.enableXOF = enableXOF;
|
|
966
|
-
to.destroyed = this.destroyed;
|
|
967
|
-
return to;
|
|
968
|
-
}
|
|
969
|
-
};
|
|
970
|
-
var gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen));
|
|
971
|
-
var keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))();
|
|
448
|
+
};
|
|
972
449
|
|
|
973
450
|
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/hash/keccak256.js
|
|
974
451
|
function keccak256(value, to_) {
|
|
975
452
|
const to = to_ || "hex";
|
|
976
|
-
const bytes = keccak_256(isHex(value, { strict: false }) ?
|
|
453
|
+
const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);
|
|
977
454
|
if (to === "bytes")
|
|
978
455
|
return bytes;
|
|
979
456
|
return toHex(bytes);
|
|
980
457
|
}
|
|
981
458
|
|
|
982
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/
|
|
983
|
-
var
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
459
|
+
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/lru.js
|
|
460
|
+
var LruMap = class extends Map {
|
|
461
|
+
constructor(size4) {
|
|
462
|
+
super();
|
|
463
|
+
Object.defineProperty(this, "maxSize", {
|
|
464
|
+
enumerable: true,
|
|
465
|
+
configurable: true,
|
|
466
|
+
writable: true,
|
|
467
|
+
value: void 0
|
|
468
|
+
});
|
|
469
|
+
this.maxSize = size4;
|
|
470
|
+
}
|
|
471
|
+
get(key) {
|
|
472
|
+
const value = super.get(key);
|
|
473
|
+
if (super.has(key)) {
|
|
474
|
+
super.delete(key);
|
|
475
|
+
super.set(key, value);
|
|
476
|
+
}
|
|
477
|
+
return value;
|
|
478
|
+
}
|
|
479
|
+
set(key, value) {
|
|
480
|
+
if (super.has(key))
|
|
481
|
+
super.delete(key);
|
|
482
|
+
super.set(key, value);
|
|
483
|
+
if (this.maxSize && this.size > this.maxSize) {
|
|
484
|
+
const firstKey = super.keys().next().value;
|
|
485
|
+
if (firstKey !== void 0)
|
|
486
|
+
super.delete(firstKey);
|
|
487
|
+
}
|
|
488
|
+
return this;
|
|
489
|
+
}
|
|
490
|
+
};
|
|
1007
491
|
|
|
1008
492
|
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/address/isAddress.js
|
|
1009
493
|
var addressRegex = /^0x[a-fA-F0-9]{40}$/;
|
|
@@ -1026,363 +510,190 @@ function isAddress(address, options) {
|
|
|
1026
510
|
return result;
|
|
1027
511
|
}
|
|
1028
512
|
|
|
1029
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
513
|
+
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/address/getAddress.js
|
|
514
|
+
var checksumAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
515
|
+
function checksumAddress(address_, chainId) {
|
|
516
|
+
if (checksumAddressCache.has(`${address_}.${chainId}`))
|
|
517
|
+
return checksumAddressCache.get(`${address_}.${chainId}`);
|
|
518
|
+
const hexAddress = chainId ? `${chainId}${address_.toLowerCase()}` : address_.substring(2).toLowerCase();
|
|
519
|
+
const hash = keccak256(stringToBytes(hexAddress), "bytes");
|
|
520
|
+
const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split("");
|
|
521
|
+
for (let i = 0; i < 40; i += 2) {
|
|
522
|
+
if (hash[i >> 1] >> 4 >= 8 && address[i]) {
|
|
523
|
+
address[i] = address[i].toUpperCase();
|
|
524
|
+
}
|
|
525
|
+
if ((hash[i >> 1] & 15) >= 8 && address[i + 1]) {
|
|
526
|
+
address[i + 1] = address[i + 1].toUpperCase();
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
const result = `0x${address.join("")}`;
|
|
530
|
+
checksumAddressCache.set(`${address_}.${chainId}`, result);
|
|
531
|
+
return result;
|
|
1038
532
|
}
|
|
1039
|
-
function
|
|
1040
|
-
if (
|
|
1041
|
-
throw new
|
|
1042
|
-
|
|
1043
|
-
position: "start",
|
|
1044
|
-
size: size(value)
|
|
1045
|
-
});
|
|
533
|
+
function getAddress(address, chainId) {
|
|
534
|
+
if (!isAddress(address, { strict: false }))
|
|
535
|
+
throw new InvalidAddressError({ address });
|
|
536
|
+
return checksumAddress(address, chainId);
|
|
1046
537
|
}
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
538
|
+
|
|
539
|
+
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/concat.js
|
|
540
|
+
function concat(values) {
|
|
541
|
+
if (typeof values[0] === "string")
|
|
542
|
+
return concatHex(values);
|
|
543
|
+
return concatBytes(values);
|
|
544
|
+
}
|
|
545
|
+
function concatBytes(values) {
|
|
546
|
+
let length = 0;
|
|
547
|
+
for (const arr of values) {
|
|
548
|
+
length += arr.length;
|
|
1054
549
|
}
|
|
550
|
+
const result = new Uint8Array(length);
|
|
551
|
+
let offset = 0;
|
|
552
|
+
for (const arr of values) {
|
|
553
|
+
result.set(arr, offset);
|
|
554
|
+
offset += arr.length;
|
|
555
|
+
}
|
|
556
|
+
return result;
|
|
1055
557
|
}
|
|
1056
|
-
function
|
|
1057
|
-
|
|
1058
|
-
const value = value_.slice(start, end);
|
|
1059
|
-
if (strict)
|
|
1060
|
-
assertEndOffset(value, start, end);
|
|
1061
|
-
return value;
|
|
558
|
+
function concatHex(values) {
|
|
559
|
+
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
|
1062
560
|
}
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
561
|
+
|
|
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}` : ""}`;
|
|
1069
589
|
}
|
|
1070
590
|
|
|
1071
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/
|
|
1072
|
-
|
|
1073
|
-
|
|
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]);
|
|
594
|
+
}
|
|
1074
595
|
|
|
1075
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/
|
|
1076
|
-
function
|
|
1077
|
-
|
|
1078
|
-
throw new AbiEncodingLengthMismatchError({
|
|
1079
|
-
expectedLength: params.length,
|
|
1080
|
-
givenLength: values.length
|
|
1081
|
-
});
|
|
1082
|
-
const preparedParams = prepareParams({
|
|
1083
|
-
params,
|
|
1084
|
-
values
|
|
1085
|
-
});
|
|
1086
|
-
return encodeParams(preparedParams);
|
|
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]);
|
|
1087
599
|
}
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
600
|
+
|
|
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");
|
|
1094
610
|
}
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
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" });
|
|
1100
617
|
}
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
618
|
+
};
|
|
619
|
+
var InvalidLegacyVError = class extends BaseError {
|
|
620
|
+
constructor({ v }) {
|
|
621
|
+
super(`Invalid \`v\` value "${v}". Expected 27 or 28.`, {
|
|
622
|
+
name: "InvalidLegacyVError"
|
|
1104
623
|
});
|
|
1105
624
|
}
|
|
1106
|
-
|
|
1107
|
-
|
|
625
|
+
};
|
|
626
|
+
var InvalidYParityError = class extends BaseError {
|
|
627
|
+
constructor({ yParity }) {
|
|
628
|
+
super(`Invalid \`yParity\` value "${yParity}". Expected 0 or 1.`, {
|
|
629
|
+
name: "InvalidYParityError"
|
|
630
|
+
});
|
|
1108
631
|
}
|
|
1109
|
-
|
|
1110
|
-
|
|
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
|
+
});
|
|
1111
652
|
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
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
|
|
1118
664
|
});
|
|
665
|
+
this.serializedType = serializedType;
|
|
1119
666
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
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;
|
|
1122
692
|
}
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
docsPath: "/docs/contract/encodeAbiParameters"
|
|
1128
|
-
});
|
|
1129
|
-
}
|
|
1130
|
-
function encodeParams(preparedParams) {
|
|
1131
|
-
let staticSize = 0;
|
|
1132
|
-
for (let i = 0; i < preparedParams.length; i++) {
|
|
1133
|
-
const { dynamic, encoded } = preparedParams[i];
|
|
1134
|
-
if (dynamic)
|
|
1135
|
-
staticSize += 32;
|
|
1136
|
-
else
|
|
1137
|
-
staticSize += size(encoded);
|
|
1138
|
-
}
|
|
1139
|
-
const staticParams = [];
|
|
1140
|
-
const dynamicParams = [];
|
|
1141
|
-
let dynamicSize = 0;
|
|
1142
|
-
for (let i = 0; i < preparedParams.length; i++) {
|
|
1143
|
-
const { dynamic, encoded } = preparedParams[i];
|
|
1144
|
-
if (dynamic) {
|
|
1145
|
-
staticParams.push(numberToHex(staticSize + dynamicSize, { size: 32 }));
|
|
1146
|
-
dynamicParams.push(encoded);
|
|
1147
|
-
dynamicSize += size(encoded);
|
|
1148
|
-
} else {
|
|
1149
|
-
staticParams.push(encoded);
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
return concatHex([...staticParams, ...dynamicParams]);
|
|
1153
|
-
}
|
|
1154
|
-
function encodeAddress(value) {
|
|
1155
|
-
if (!isAddress(value))
|
|
1156
|
-
throw new InvalidAddressError({ address: value });
|
|
1157
|
-
return { dynamic: false, encoded: padHex(value.toLowerCase()) };
|
|
1158
|
-
}
|
|
1159
|
-
function encodeArray(value, { length, param }) {
|
|
1160
|
-
const dynamic = length === null;
|
|
1161
|
-
if (!Array.isArray(value))
|
|
1162
|
-
throw new InvalidArrayError(value);
|
|
1163
|
-
if (!dynamic && value.length !== length)
|
|
1164
|
-
throw new AbiEncodingArrayLengthMismatchError({
|
|
1165
|
-
expectedLength: length,
|
|
1166
|
-
givenLength: value.length,
|
|
1167
|
-
type: `${param.type}[${length}]`
|
|
1168
|
-
});
|
|
1169
|
-
let dynamicChild = value.length === 0 && isDynamicType(param);
|
|
1170
|
-
const preparedParams = [];
|
|
1171
|
-
for (let i = 0; i < value.length; i++) {
|
|
1172
|
-
const preparedParam = prepareParam({ param, value: value[i] });
|
|
1173
|
-
if (preparedParam.dynamic)
|
|
1174
|
-
dynamicChild = true;
|
|
1175
|
-
preparedParams.push(preparedParam);
|
|
1176
|
-
}
|
|
1177
|
-
if (dynamic || dynamicChild) {
|
|
1178
|
-
const data = encodeParams(preparedParams);
|
|
1179
|
-
if (dynamic) {
|
|
1180
|
-
const length2 = numberToHex(preparedParams.length, { size: 32 });
|
|
1181
|
-
return {
|
|
1182
|
-
dynamic: true,
|
|
1183
|
-
encoded: concatHex([length2, data])
|
|
1184
|
-
};
|
|
1185
|
-
}
|
|
1186
|
-
if (dynamicChild)
|
|
1187
|
-
return { dynamic: true, encoded: data };
|
|
1188
|
-
}
|
|
1189
|
-
return {
|
|
1190
|
-
dynamic: false,
|
|
1191
|
-
encoded: concatHex(preparedParams.map(({ encoded }) => encoded))
|
|
1192
|
-
};
|
|
1193
|
-
}
|
|
1194
|
-
function encodeBytes(value, { param }) {
|
|
1195
|
-
const [, paramSize] = param.type.split("bytes");
|
|
1196
|
-
const bytesSize = size(value);
|
|
1197
|
-
if (!paramSize) {
|
|
1198
|
-
let value_ = value;
|
|
1199
|
-
if (bytesSize % 32 !== 0)
|
|
1200
|
-
value_ = padHex(value_, {
|
|
1201
|
-
dir: "right",
|
|
1202
|
-
size: Math.ceil((value.length - 2) / 2 / 32) * 32
|
|
1203
|
-
});
|
|
1204
|
-
return {
|
|
1205
|
-
dynamic: true,
|
|
1206
|
-
encoded: concatHex([
|
|
1207
|
-
padHex(numberToHex(bytesSize, { size: 32 })),
|
|
1208
|
-
value_
|
|
1209
|
-
])
|
|
1210
|
-
};
|
|
1211
|
-
}
|
|
1212
|
-
if (bytesSize !== Number.parseInt(paramSize, 10))
|
|
1213
|
-
throw new AbiEncodingBytesSizeMismatchError({
|
|
1214
|
-
expectedSize: Number.parseInt(paramSize, 10),
|
|
1215
|
-
value
|
|
1216
|
-
});
|
|
1217
|
-
return { dynamic: false, encoded: padHex(value, { dir: "right" }) };
|
|
1218
|
-
}
|
|
1219
|
-
function encodeBool(value) {
|
|
1220
|
-
if (typeof value !== "boolean")
|
|
1221
|
-
throw new BaseError(`Invalid boolean value: "${value}" (type: ${typeof value}). Expected: \`true\` or \`false\`.`);
|
|
1222
|
-
return { dynamic: false, encoded: padHex(boolToHex(value)) };
|
|
1223
|
-
}
|
|
1224
|
-
function encodeNumber(value, { signed, size: size2 = 256 }) {
|
|
1225
|
-
if (typeof size2 === "number") {
|
|
1226
|
-
const max = 2n ** (BigInt(size2) - (signed ? 1n : 0n)) - 1n;
|
|
1227
|
-
const min = signed ? -max - 1n : 0n;
|
|
1228
|
-
if (value > max || value < min)
|
|
1229
|
-
throw new IntegerOutOfRangeError({
|
|
1230
|
-
max: max.toString(),
|
|
1231
|
-
min: min.toString(),
|
|
1232
|
-
signed,
|
|
1233
|
-
size: size2 / 8,
|
|
1234
|
-
value: value.toString()
|
|
1235
|
-
});
|
|
1236
|
-
}
|
|
1237
|
-
return {
|
|
1238
|
-
dynamic: false,
|
|
1239
|
-
encoded: numberToHex(value, {
|
|
1240
|
-
size: 32,
|
|
1241
|
-
signed
|
|
1242
|
-
})
|
|
1243
|
-
};
|
|
1244
|
-
}
|
|
1245
|
-
function encodeString(value) {
|
|
1246
|
-
const hexValue = stringToHex(value);
|
|
1247
|
-
const partsLength = Math.ceil(size(hexValue) / 32);
|
|
1248
|
-
const parts = [];
|
|
1249
|
-
for (let i = 0; i < partsLength; i++) {
|
|
1250
|
-
parts.push(padHex(slice(hexValue, i * 32, (i + 1) * 32), {
|
|
1251
|
-
dir: "right"
|
|
1252
|
-
}));
|
|
1253
|
-
}
|
|
1254
|
-
return {
|
|
1255
|
-
dynamic: true,
|
|
1256
|
-
encoded: concatHex([
|
|
1257
|
-
padHex(numberToHex(size(hexValue), { size: 32 })),
|
|
1258
|
-
...parts
|
|
1259
|
-
])
|
|
1260
|
-
};
|
|
1261
|
-
}
|
|
1262
|
-
function encodeTuple(value, { param }) {
|
|
1263
|
-
let dynamic = false;
|
|
1264
|
-
const preparedParams = [];
|
|
1265
|
-
for (let i = 0; i < param.components.length; i++) {
|
|
1266
|
-
const param_ = param.components[i];
|
|
1267
|
-
const index = Array.isArray(value) ? i : param_.name;
|
|
1268
|
-
const preparedParam = prepareParam({
|
|
1269
|
-
param: param_,
|
|
1270
|
-
value: value[index]
|
|
1271
|
-
});
|
|
1272
|
-
preparedParams.push(preparedParam);
|
|
1273
|
-
if (preparedParam.dynamic)
|
|
1274
|
-
dynamic = true;
|
|
1275
|
-
}
|
|
1276
|
-
return {
|
|
1277
|
-
dynamic,
|
|
1278
|
-
encoded: dynamic ? encodeParams(preparedParams) : concatHex(preparedParams.map(({ encoded }) => encoded))
|
|
1279
|
-
};
|
|
1280
|
-
}
|
|
1281
|
-
function getArrayComponents(type) {
|
|
1282
|
-
const matches = type.match(/^(.*)\[(\d+)?\]$/);
|
|
1283
|
-
return matches ? (
|
|
1284
|
-
// Return `null` if the array is dynamic.
|
|
1285
|
-
[matches[2] ? Number(matches[2]) : null, matches[1]]
|
|
1286
|
-
) : void 0;
|
|
1287
|
-
}
|
|
1288
|
-
function isDynamicType(param) {
|
|
1289
|
-
const { type } = param;
|
|
1290
|
-
if (type === "string")
|
|
1291
|
-
return true;
|
|
1292
|
-
if (type === "bytes")
|
|
1293
|
-
return true;
|
|
1294
|
-
if (type.endsWith("[]"))
|
|
1295
|
-
return true;
|
|
1296
|
-
if (type === "tuple")
|
|
1297
|
-
return param.components.some(isDynamicType);
|
|
1298
|
-
const arrayComponents = getArrayComponents(type);
|
|
1299
|
-
if (arrayComponents)
|
|
1300
|
-
return isDynamicType({ ...param, type: arrayComponents[1] });
|
|
1301
|
-
return false;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/stringify.js
|
|
1305
|
-
var stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {
|
|
1306
|
-
const value2 = typeof value_ === "bigint" ? value_.toString() : value_;
|
|
1307
|
-
return typeof replacer === "function" ? replacer(key, value2) : value2;
|
|
1308
|
-
}, space);
|
|
1309
|
-
|
|
1310
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/unit.js
|
|
1311
|
-
var etherUnits = {
|
|
1312
|
-
gwei: 9,
|
|
1313
|
-
wei: 18
|
|
1314
|
-
};
|
|
1315
|
-
var gweiUnits = {
|
|
1316
|
-
ether: -9,
|
|
1317
|
-
wei: 9
|
|
1318
|
-
};
|
|
1319
|
-
|
|
1320
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/formatUnits.js
|
|
1321
|
-
function formatUnits(value, decimals) {
|
|
1322
|
-
let display = value.toString();
|
|
1323
|
-
const negative = display.startsWith("-");
|
|
1324
|
-
if (negative)
|
|
1325
|
-
display = display.slice(1);
|
|
1326
|
-
display = display.padStart(decimals, "0");
|
|
1327
|
-
let [integer, fraction] = [
|
|
1328
|
-
display.slice(0, display.length - decimals),
|
|
1329
|
-
display.slice(display.length - decimals)
|
|
1330
|
-
];
|
|
1331
|
-
fraction = fraction.replace(/(0+)$/, "");
|
|
1332
|
-
return `${negative ? "-" : ""}${integer || "0"}${fraction ? `.${fraction}` : ""}`;
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/formatEther.js
|
|
1336
|
-
function formatEther(wei, unit = "wei") {
|
|
1337
|
-
return formatUnits(wei, etherUnits[unit]);
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/formatGwei.js
|
|
1341
|
-
function formatGwei(wei, unit = "wei") {
|
|
1342
|
-
return formatUnits(wei, gweiUnits[unit]);
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/transaction.js
|
|
1346
|
-
function prettyPrint(args) {
|
|
1347
|
-
const entries = Object.entries(args).map(([key, value]) => {
|
|
1348
|
-
if (value === void 0 || value === false)
|
|
1349
|
-
return null;
|
|
1350
|
-
return [key, value];
|
|
1351
|
-
}).filter(Boolean);
|
|
1352
|
-
const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);
|
|
1353
|
-
return entries.map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`).join("\n");
|
|
1354
|
-
}
|
|
1355
|
-
var InvalidLegacyVError = class extends BaseError {
|
|
1356
|
-
constructor({ v }) {
|
|
1357
|
-
super(`Invalid \`v\` value "${v}". Expected 27 or 28.`, {
|
|
1358
|
-
name: "InvalidLegacyVError"
|
|
1359
|
-
});
|
|
1360
|
-
}
|
|
1361
|
-
};
|
|
1362
|
-
var InvalidSerializableTransactionError = class extends BaseError {
|
|
1363
|
-
constructor({ transaction }) {
|
|
1364
|
-
super("Cannot infer a transaction type from provided transaction.", {
|
|
1365
|
-
metaMessages: [
|
|
1366
|
-
"Provided Transaction:",
|
|
1367
|
-
"{",
|
|
1368
|
-
prettyPrint(transaction),
|
|
1369
|
-
"}",
|
|
1370
|
-
"",
|
|
1371
|
-
"To infer the type, either provide:",
|
|
1372
|
-
"- a `type` to the Transaction, or",
|
|
1373
|
-
"- an EIP-1559 Transaction with `maxFeePerGas`, or",
|
|
1374
|
-
"- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
|
|
1375
|
-
"- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
|
|
1376
|
-
"- an EIP-7702 Transaction with `authorizationList`, or",
|
|
1377
|
-
"- a Legacy Transaction with `gasPrice`"
|
|
1378
|
-
],
|
|
1379
|
-
name: "InvalidSerializableTransactionError"
|
|
1380
|
-
});
|
|
1381
|
-
}
|
|
1382
|
-
};
|
|
1383
|
-
var InvalidStorageKeySizeError = class extends BaseError {
|
|
1384
|
-
constructor({ storageKey }) {
|
|
1385
|
-
super(`Size for storage key "${storageKey}" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
|
|
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" });
|
|
1386
697
|
}
|
|
1387
698
|
};
|
|
1388
699
|
var TransactionExecutionError = class extends BaseError {
|
|
@@ -1582,8 +893,29 @@ var ChainDoesNotSupportContract = class extends BaseError {
|
|
|
1582
893
|
});
|
|
1583
894
|
}
|
|
1584
895
|
};
|
|
1585
|
-
var
|
|
1586
|
-
constructor() {
|
|
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
|
+
}
|
|
906
|
+
};
|
|
907
|
+
var ChainNotFoundError = class extends BaseError {
|
|
908
|
+
constructor() {
|
|
909
|
+
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
|
+
});
|
|
915
|
+
}
|
|
916
|
+
};
|
|
917
|
+
var ClientChainNotConfiguredError = class extends BaseError {
|
|
918
|
+
constructor() {
|
|
1587
919
|
super("No chain was provided to the Client.", {
|
|
1588
920
|
name: "ClientChainNotConfiguredError"
|
|
1589
921
|
});
|
|
@@ -1729,289 +1061,1724 @@ var IntrinsicGasTooLowError = class extends BaseError {
|
|
|
1729
1061
|
});
|
|
1730
1062
|
}
|
|
1731
1063
|
};
|
|
1732
|
-
Object.defineProperty(IntrinsicGasTooLowError, "nodeMessage", {
|
|
1733
|
-
enumerable: true,
|
|
1734
|
-
configurable: true,
|
|
1735
|
-
writable: true,
|
|
1736
|
-
value: /intrinsic gas too low/
|
|
1737
|
-
});
|
|
1738
|
-
var TransactionTypeNotSupportedError = class extends BaseError {
|
|
1739
|
-
constructor({ cause }) {
|
|
1740
|
-
super("The transaction type is not supported for this chain.", {
|
|
1741
|
-
cause,
|
|
1742
|
-
name: "TransactionTypeNotSupportedError"
|
|
1064
|
+
Object.defineProperty(IntrinsicGasTooLowError, "nodeMessage", {
|
|
1065
|
+
enumerable: true,
|
|
1066
|
+
configurable: true,
|
|
1067
|
+
writable: true,
|
|
1068
|
+
value: /intrinsic gas too low/
|
|
1069
|
+
});
|
|
1070
|
+
var TransactionTypeNotSupportedError = class extends BaseError {
|
|
1071
|
+
constructor({ cause }) {
|
|
1072
|
+
super("The transaction type is not supported for this chain.", {
|
|
1073
|
+
cause,
|
|
1074
|
+
name: "TransactionTypeNotSupportedError"
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1077
|
+
};
|
|
1078
|
+
Object.defineProperty(TransactionTypeNotSupportedError, "nodeMessage", {
|
|
1079
|
+
enumerable: true,
|
|
1080
|
+
configurable: true,
|
|
1081
|
+
writable: true,
|
|
1082
|
+
value: /transaction type not valid/
|
|
1083
|
+
});
|
|
1084
|
+
var TipAboveFeeCapError = class extends BaseError {
|
|
1085
|
+
constructor({ cause, maxPriorityFeePerGas, maxFeePerGas } = {}) {
|
|
1086
|
+
super([
|
|
1087
|
+
`The provided tip (\`maxPriorityFeePerGas\`${maxPriorityFeePerGas ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}).`
|
|
1088
|
+
].join("\n"), {
|
|
1089
|
+
cause,
|
|
1090
|
+
name: "TipAboveFeeCapError"
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
};
|
|
1094
|
+
Object.defineProperty(TipAboveFeeCapError, "nodeMessage", {
|
|
1095
|
+
enumerable: true,
|
|
1096
|
+
configurable: true,
|
|
1097
|
+
writable: true,
|
|
1098
|
+
value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
|
|
1099
|
+
});
|
|
1100
|
+
var UnknownNodeError = class extends BaseError {
|
|
1101
|
+
constructor({ cause }) {
|
|
1102
|
+
super(`An error occurred while executing: ${cause?.shortMessage}`, {
|
|
1103
|
+
cause,
|
|
1104
|
+
name: "UnknownNodeError"
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
};
|
|
1108
|
+
|
|
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"
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
};
|
|
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"
|
|
1337
|
+
});
|
|
1338
|
+
}
|
|
1339
|
+
};
|
|
1340
|
+
var AbiFunctionNotFoundError = class extends BaseError {
|
|
1341
|
+
constructor(functionName, { docsPath } = {}) {
|
|
1342
|
+
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."
|
|
1345
|
+
].join("\n"), {
|
|
1346
|
+
docsPath,
|
|
1347
|
+
name: "AbiFunctionNotFoundError"
|
|
1348
|
+
});
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
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);
|
|
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";
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/cursor.js
|
|
1743
|
+
var NegativeOffsetError = class extends BaseError {
|
|
1744
|
+
constructor({ offset }) {
|
|
1745
|
+
super(`Offset \`${offset}\` cannot be negative.`, {
|
|
1746
|
+
name: "NegativeOffsetError"
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
};
|
|
1750
|
+
var PositionOutOfBoundsError = class extends BaseError {
|
|
1751
|
+
constructor({ length, position }) {
|
|
1752
|
+
super(`Position \`${position}\` is out of bounds (\`0 < position < ${length}\`).`, { name: "PositionOutOfBoundsError" });
|
|
1753
|
+
}
|
|
1754
|
+
};
|
|
1755
|
+
var RecursiveReadLimitExceededError = class extends BaseError {
|
|
1756
|
+
constructor({ count, limit }) {
|
|
1757
|
+
super(`Recursive read limit of \`${limit}\` exceeded (recursive read count: \`${count}\`).`, { name: "RecursiveReadLimitExceededError" });
|
|
1758
|
+
}
|
|
1759
|
+
};
|
|
1760
|
+
|
|
1761
|
+
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/cursor.js
|
|
1762
|
+
var staticCursor = {
|
|
1763
|
+
bytes: new Uint8Array(),
|
|
1764
|
+
dataView: new DataView(new ArrayBuffer(0)),
|
|
1765
|
+
position: 0,
|
|
1766
|
+
positionReadCount: /* @__PURE__ */ new Map(),
|
|
1767
|
+
recursiveReadCount: 0,
|
|
1768
|
+
recursiveReadLimit: Number.POSITIVE_INFINITY,
|
|
1769
|
+
assertReadLimit() {
|
|
1770
|
+
if (this.recursiveReadCount >= this.recursiveReadLimit)
|
|
1771
|
+
throw new RecursiveReadLimitExceededError({
|
|
1772
|
+
count: this.recursiveReadCount + 1,
|
|
1773
|
+
limit: this.recursiveReadLimit
|
|
1774
|
+
});
|
|
1775
|
+
},
|
|
1776
|
+
assertPosition(position) {
|
|
1777
|
+
if (position < 0 || position > this.bytes.length - 1)
|
|
1778
|
+
throw new PositionOutOfBoundsError({
|
|
1779
|
+
length: this.bytes.length,
|
|
1780
|
+
position
|
|
1781
|
+
});
|
|
1782
|
+
},
|
|
1783
|
+
decrementPosition(offset) {
|
|
1784
|
+
if (offset < 0)
|
|
1785
|
+
throw new NegativeOffsetError({ offset });
|
|
1786
|
+
const position = this.position - offset;
|
|
1787
|
+
this.assertPosition(position);
|
|
1788
|
+
this.position = position;
|
|
1789
|
+
},
|
|
1790
|
+
getReadCount(position) {
|
|
1791
|
+
return this.positionReadCount.get(position || this.position) || 0;
|
|
1792
|
+
},
|
|
1793
|
+
incrementPosition(offset) {
|
|
1794
|
+
if (offset < 0)
|
|
1795
|
+
throw new NegativeOffsetError({ offset });
|
|
1796
|
+
const position = this.position + offset;
|
|
1797
|
+
this.assertPosition(position);
|
|
1798
|
+
this.position = position;
|
|
1799
|
+
},
|
|
1800
|
+
inspectByte(position_) {
|
|
1801
|
+
const position = position_ ?? this.position;
|
|
1802
|
+
this.assertPosition(position);
|
|
1803
|
+
return this.bytes[position];
|
|
1804
|
+
},
|
|
1805
|
+
inspectBytes(length, position_) {
|
|
1806
|
+
const position = position_ ?? this.position;
|
|
1807
|
+
this.assertPosition(position + length - 1);
|
|
1808
|
+
return this.bytes.subarray(position, position + length);
|
|
1809
|
+
},
|
|
1810
|
+
inspectUint8(position_) {
|
|
1811
|
+
const position = position_ ?? this.position;
|
|
1812
|
+
this.assertPosition(position);
|
|
1813
|
+
return this.bytes[position];
|
|
1814
|
+
},
|
|
1815
|
+
inspectUint16(position_) {
|
|
1816
|
+
const position = position_ ?? this.position;
|
|
1817
|
+
this.assertPosition(position + 1);
|
|
1818
|
+
return this.dataView.getUint16(position);
|
|
1819
|
+
},
|
|
1820
|
+
inspectUint24(position_) {
|
|
1821
|
+
const position = position_ ?? this.position;
|
|
1822
|
+
this.assertPosition(position + 2);
|
|
1823
|
+
return (this.dataView.getUint16(position) << 8) + this.dataView.getUint8(position + 2);
|
|
1824
|
+
},
|
|
1825
|
+
inspectUint32(position_) {
|
|
1826
|
+
const position = position_ ?? this.position;
|
|
1827
|
+
this.assertPosition(position + 3);
|
|
1828
|
+
return this.dataView.getUint32(position);
|
|
1829
|
+
},
|
|
1830
|
+
pushByte(byte) {
|
|
1831
|
+
this.assertPosition(this.position);
|
|
1832
|
+
this.bytes[this.position] = byte;
|
|
1833
|
+
this.position++;
|
|
1834
|
+
},
|
|
1835
|
+
pushBytes(bytes) {
|
|
1836
|
+
this.assertPosition(this.position + bytes.length - 1);
|
|
1837
|
+
this.bytes.set(bytes, this.position);
|
|
1838
|
+
this.position += bytes.length;
|
|
1839
|
+
},
|
|
1840
|
+
pushUint8(value) {
|
|
1841
|
+
this.assertPosition(this.position);
|
|
1842
|
+
this.bytes[this.position] = value;
|
|
1843
|
+
this.position++;
|
|
1844
|
+
},
|
|
1845
|
+
pushUint16(value) {
|
|
1846
|
+
this.assertPosition(this.position + 1);
|
|
1847
|
+
this.dataView.setUint16(this.position, value);
|
|
1848
|
+
this.position += 2;
|
|
1849
|
+
},
|
|
1850
|
+
pushUint24(value) {
|
|
1851
|
+
this.assertPosition(this.position + 2);
|
|
1852
|
+
this.dataView.setUint16(this.position, value >> 8);
|
|
1853
|
+
this.dataView.setUint8(this.position + 2, value & ~4294967040);
|
|
1854
|
+
this.position += 3;
|
|
1855
|
+
},
|
|
1856
|
+
pushUint32(value) {
|
|
1857
|
+
this.assertPosition(this.position + 3);
|
|
1858
|
+
this.dataView.setUint32(this.position, value);
|
|
1859
|
+
this.position += 4;
|
|
1860
|
+
},
|
|
1861
|
+
readByte() {
|
|
1862
|
+
this.assertReadLimit();
|
|
1863
|
+
this._touch();
|
|
1864
|
+
const value = this.inspectByte();
|
|
1865
|
+
this.position++;
|
|
1866
|
+
return value;
|
|
1867
|
+
},
|
|
1868
|
+
readBytes(length, size4) {
|
|
1869
|
+
this.assertReadLimit();
|
|
1870
|
+
this._touch();
|
|
1871
|
+
const value = this.inspectBytes(length);
|
|
1872
|
+
this.position += size4 ?? length;
|
|
1873
|
+
return value;
|
|
1874
|
+
},
|
|
1875
|
+
readUint8() {
|
|
1876
|
+
this.assertReadLimit();
|
|
1877
|
+
this._touch();
|
|
1878
|
+
const value = this.inspectUint8();
|
|
1879
|
+
this.position += 1;
|
|
1880
|
+
return value;
|
|
1881
|
+
},
|
|
1882
|
+
readUint16() {
|
|
1883
|
+
this.assertReadLimit();
|
|
1884
|
+
this._touch();
|
|
1885
|
+
const value = this.inspectUint16();
|
|
1886
|
+
this.position += 2;
|
|
1887
|
+
return value;
|
|
1888
|
+
},
|
|
1889
|
+
readUint24() {
|
|
1890
|
+
this.assertReadLimit();
|
|
1891
|
+
this._touch();
|
|
1892
|
+
const value = this.inspectUint24();
|
|
1893
|
+
this.position += 3;
|
|
1894
|
+
return value;
|
|
1895
|
+
},
|
|
1896
|
+
readUint32() {
|
|
1897
|
+
this.assertReadLimit();
|
|
1898
|
+
this._touch();
|
|
1899
|
+
const value = this.inspectUint32();
|
|
1900
|
+
this.position += 4;
|
|
1901
|
+
return value;
|
|
1902
|
+
},
|
|
1903
|
+
get remaining() {
|
|
1904
|
+
return this.bytes.length - this.position;
|
|
1905
|
+
},
|
|
1906
|
+
setPosition(position) {
|
|
1907
|
+
const oldPosition = this.position;
|
|
1908
|
+
this.assertPosition(position);
|
|
1909
|
+
this.position = position;
|
|
1910
|
+
return () => this.position = oldPosition;
|
|
1911
|
+
},
|
|
1912
|
+
_touch() {
|
|
1913
|
+
if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)
|
|
1914
|
+
return;
|
|
1915
|
+
const count = this.getReadCount();
|
|
1916
|
+
this.positionReadCount.set(this.position, count + 1);
|
|
1917
|
+
if (count > 0)
|
|
1918
|
+
this.recursiveReadCount++;
|
|
1919
|
+
}
|
|
1920
|
+
};
|
|
1921
|
+
function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
|
|
1922
|
+
const cursor = Object.create(staticCursor);
|
|
1923
|
+
cursor.bytes = bytes;
|
|
1924
|
+
cursor.dataView = new DataView(bytes.buffer ?? bytes, bytes.byteOffset, bytes.byteLength);
|
|
1925
|
+
cursor.positionReadCount = /* @__PURE__ */ new Map();
|
|
1926
|
+
cursor.recursiveReadLimit = recursiveReadLimit;
|
|
1927
|
+
return cursor;
|
|
1928
|
+
}
|
|
1929
|
+
|
|
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;
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/version.js
|
|
1938
|
+
var version2 = "0.1.1";
|
|
1939
|
+
|
|
1940
|
+
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/internal/errors.js
|
|
1941
|
+
function getVersion() {
|
|
1942
|
+
return version2;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Errors.js
|
|
1946
|
+
var BaseError2 = class _BaseError extends Error {
|
|
1947
|
+
static setStaticOptions(options) {
|
|
1948
|
+
_BaseError.prototype.docsOrigin = options.docsOrigin;
|
|
1949
|
+
_BaseError.prototype.showVersion = options.showVersion;
|
|
1950
|
+
_BaseError.prototype.version = options.version;
|
|
1951
|
+
}
|
|
1952
|
+
constructor(shortMessage, options = {}) {
|
|
1953
|
+
const details = (() => {
|
|
1954
|
+
if (options.cause instanceof _BaseError) {
|
|
1955
|
+
if (options.cause.details)
|
|
1956
|
+
return options.cause.details;
|
|
1957
|
+
if (options.cause.shortMessage)
|
|
1958
|
+
return options.cause.shortMessage;
|
|
1959
|
+
}
|
|
1960
|
+
if (options.cause && "details" in options.cause && typeof options.cause.details === "string")
|
|
1961
|
+
return options.cause.details;
|
|
1962
|
+
if (options.cause?.message)
|
|
1963
|
+
return options.cause.message;
|
|
1964
|
+
return options.details;
|
|
1965
|
+
})();
|
|
1966
|
+
const docsPath = (() => {
|
|
1967
|
+
if (options.cause instanceof _BaseError)
|
|
1968
|
+
return options.cause.docsPath || options.docsPath;
|
|
1969
|
+
return options.docsPath;
|
|
1970
|
+
})();
|
|
1971
|
+
const docsBaseUrl = options.docsOrigin ?? _BaseError.prototype.docsOrigin;
|
|
1972
|
+
const docs = `${docsBaseUrl}${docsPath ?? ""}`;
|
|
1973
|
+
const showVersion = Boolean(options.version ?? _BaseError.prototype.showVersion);
|
|
1974
|
+
const version3 = options.version ?? _BaseError.prototype.version;
|
|
1975
|
+
const message = [
|
|
1976
|
+
shortMessage || "An error occurred.",
|
|
1977
|
+
...options.metaMessages ? ["", ...options.metaMessages] : [],
|
|
1978
|
+
...details || docsPath || showVersion ? [
|
|
1979
|
+
"",
|
|
1980
|
+
details ? `Details: ${details}` : void 0,
|
|
1981
|
+
docsPath ? `See: ${docs}` : void 0,
|
|
1982
|
+
showVersion ? `Version: ${version3}` : void 0
|
|
1983
|
+
] : []
|
|
1984
|
+
].filter((x) => typeof x === "string").join("\n");
|
|
1985
|
+
super(message, options.cause ? { cause: options.cause } : void 0);
|
|
1986
|
+
Object.defineProperty(this, "details", {
|
|
1987
|
+
enumerable: true,
|
|
1988
|
+
configurable: true,
|
|
1989
|
+
writable: true,
|
|
1990
|
+
value: void 0
|
|
1991
|
+
});
|
|
1992
|
+
Object.defineProperty(this, "docs", {
|
|
1993
|
+
enumerable: true,
|
|
1994
|
+
configurable: true,
|
|
1995
|
+
writable: true,
|
|
1996
|
+
value: void 0
|
|
1997
|
+
});
|
|
1998
|
+
Object.defineProperty(this, "docsOrigin", {
|
|
1999
|
+
enumerable: true,
|
|
2000
|
+
configurable: true,
|
|
2001
|
+
writable: true,
|
|
2002
|
+
value: void 0
|
|
2003
|
+
});
|
|
2004
|
+
Object.defineProperty(this, "docsPath", {
|
|
2005
|
+
enumerable: true,
|
|
2006
|
+
configurable: true,
|
|
2007
|
+
writable: true,
|
|
2008
|
+
value: void 0
|
|
2009
|
+
});
|
|
2010
|
+
Object.defineProperty(this, "shortMessage", {
|
|
2011
|
+
enumerable: true,
|
|
2012
|
+
configurable: true,
|
|
2013
|
+
writable: true,
|
|
2014
|
+
value: void 0
|
|
2015
|
+
});
|
|
2016
|
+
Object.defineProperty(this, "showVersion", {
|
|
2017
|
+
enumerable: true,
|
|
2018
|
+
configurable: true,
|
|
2019
|
+
writable: true,
|
|
2020
|
+
value: void 0
|
|
2021
|
+
});
|
|
2022
|
+
Object.defineProperty(this, "version", {
|
|
2023
|
+
enumerable: true,
|
|
2024
|
+
configurable: true,
|
|
2025
|
+
writable: true,
|
|
2026
|
+
value: void 0
|
|
2027
|
+
});
|
|
2028
|
+
Object.defineProperty(this, "cause", {
|
|
2029
|
+
enumerable: true,
|
|
2030
|
+
configurable: true,
|
|
2031
|
+
writable: true,
|
|
2032
|
+
value: void 0
|
|
2033
|
+
});
|
|
2034
|
+
Object.defineProperty(this, "name", {
|
|
2035
|
+
enumerable: true,
|
|
2036
|
+
configurable: true,
|
|
2037
|
+
writable: true,
|
|
2038
|
+
value: "BaseError"
|
|
2039
|
+
});
|
|
2040
|
+
this.cause = options.cause;
|
|
2041
|
+
this.details = details;
|
|
2042
|
+
this.docs = docs;
|
|
2043
|
+
this.docsOrigin = docsBaseUrl;
|
|
2044
|
+
this.docsPath = docsPath;
|
|
2045
|
+
this.shortMessage = shortMessage;
|
|
2046
|
+
this.showVersion = showVersion;
|
|
2047
|
+
this.version = version3;
|
|
2048
|
+
}
|
|
2049
|
+
walk(fn) {
|
|
2050
|
+
return walk2(this, fn);
|
|
2051
|
+
}
|
|
2052
|
+
};
|
|
2053
|
+
Object.defineProperty(BaseError2, "defaultStaticOptions", {
|
|
2054
|
+
enumerable: true,
|
|
2055
|
+
configurable: true,
|
|
2056
|
+
writable: true,
|
|
2057
|
+
value: {
|
|
2058
|
+
docsOrigin: "https://oxlib.sh",
|
|
2059
|
+
showVersion: false,
|
|
2060
|
+
version: `ox@${getVersion()}`
|
|
2061
|
+
}
|
|
2062
|
+
});
|
|
2063
|
+
(() => {
|
|
2064
|
+
BaseError2.setStaticOptions(BaseError2.defaultStaticOptions);
|
|
2065
|
+
})();
|
|
2066
|
+
function walk2(err, fn) {
|
|
2067
|
+
if (fn?.(err))
|
|
2068
|
+
return err;
|
|
2069
|
+
if (err && typeof err === "object" && "cause" in err && err.cause)
|
|
2070
|
+
return walk2(err.cause, fn);
|
|
2071
|
+
return fn ? null : err;
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/internal/bytes.js
|
|
2075
|
+
function assertSize2(bytes, size_) {
|
|
2076
|
+
if (size2(bytes) > size_)
|
|
2077
|
+
throw new SizeOverflowError2({
|
|
2078
|
+
givenSize: size2(bytes),
|
|
2079
|
+
maxSize: size_
|
|
2080
|
+
});
|
|
2081
|
+
}
|
|
2082
|
+
function assertStartOffset2(value, start) {
|
|
2083
|
+
if (typeof start === "number" && start > 0 && start > size2(value) - 1)
|
|
2084
|
+
throw new SliceOffsetOutOfBoundsError2({
|
|
2085
|
+
offset: start,
|
|
2086
|
+
position: "start",
|
|
2087
|
+
size: size2(value)
|
|
2088
|
+
});
|
|
2089
|
+
}
|
|
2090
|
+
function assertEndOffset2(value, start, end) {
|
|
2091
|
+
if (typeof start === "number" && typeof end === "number" && size2(value) !== end - start) {
|
|
2092
|
+
throw new SliceOffsetOutOfBoundsError2({
|
|
2093
|
+
offset: end,
|
|
2094
|
+
position: "end",
|
|
2095
|
+
size: size2(value)
|
|
2096
|
+
});
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
var charCodeMap2 = {
|
|
2100
|
+
zero: 48,
|
|
2101
|
+
nine: 57,
|
|
2102
|
+
A: 65,
|
|
2103
|
+
F: 70,
|
|
2104
|
+
a: 97,
|
|
2105
|
+
f: 102
|
|
2106
|
+
};
|
|
2107
|
+
function charCodeToBase162(char) {
|
|
2108
|
+
if (char >= charCodeMap2.zero && char <= charCodeMap2.nine)
|
|
2109
|
+
return char - charCodeMap2.zero;
|
|
2110
|
+
if (char >= charCodeMap2.A && char <= charCodeMap2.F)
|
|
2111
|
+
return char - (charCodeMap2.A - 10);
|
|
2112
|
+
if (char >= charCodeMap2.a && char <= charCodeMap2.f)
|
|
2113
|
+
return char - (charCodeMap2.a - 10);
|
|
2114
|
+
return void 0;
|
|
2115
|
+
}
|
|
2116
|
+
function pad2(bytes, options = {}) {
|
|
2117
|
+
const { dir, size: size4 = 32 } = options;
|
|
2118
|
+
if (size4 === 0)
|
|
2119
|
+
return bytes;
|
|
2120
|
+
if (bytes.length > size4)
|
|
2121
|
+
throw new SizeExceedsPaddingSizeError2({
|
|
2122
|
+
size: bytes.length,
|
|
2123
|
+
targetSize: size4,
|
|
2124
|
+
type: "Bytes"
|
|
2125
|
+
});
|
|
2126
|
+
const paddedBytes = new Uint8Array(size4);
|
|
2127
|
+
for (let i = 0; i < size4; i++) {
|
|
2128
|
+
const padEnd = dir === "right";
|
|
2129
|
+
paddedBytes[padEnd ? i : size4 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
|
|
2130
|
+
}
|
|
2131
|
+
return paddedBytes;
|
|
2132
|
+
}
|
|
2133
|
+
function trim2(value, options = {}) {
|
|
2134
|
+
const { dir = "left" } = options;
|
|
2135
|
+
let data = value;
|
|
2136
|
+
let sliceLength = 0;
|
|
2137
|
+
for (let i = 0; i < data.length - 1; i++) {
|
|
2138
|
+
if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
|
|
2139
|
+
sliceLength++;
|
|
2140
|
+
else
|
|
2141
|
+
break;
|
|
2142
|
+
}
|
|
2143
|
+
data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
|
|
2144
|
+
return data;
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/internal/hex.js
|
|
2148
|
+
function assertSize3(hex, size_) {
|
|
2149
|
+
if (size3(hex) > size_)
|
|
2150
|
+
throw new SizeOverflowError3({
|
|
2151
|
+
givenSize: size3(hex),
|
|
2152
|
+
maxSize: size_
|
|
2153
|
+
});
|
|
2154
|
+
}
|
|
2155
|
+
function assertStartOffset3(value, start) {
|
|
2156
|
+
if (typeof start === "number" && start > 0 && start > size3(value) - 1)
|
|
2157
|
+
throw new SliceOffsetOutOfBoundsError3({
|
|
2158
|
+
offset: start,
|
|
2159
|
+
position: "start",
|
|
2160
|
+
size: size3(value)
|
|
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)
|
|
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/Bytes.js
|
|
2216
|
+
var decoder = /* @__PURE__ */ new TextDecoder();
|
|
2217
|
+
var encoder3 = /* @__PURE__ */ new TextEncoder();
|
|
2218
|
+
function assert(value) {
|
|
2219
|
+
if (value instanceof Uint8Array)
|
|
2220
|
+
return;
|
|
2221
|
+
if (!value)
|
|
2222
|
+
throw new InvalidBytesTypeError(value);
|
|
2223
|
+
if (typeof value !== "object")
|
|
2224
|
+
throw new InvalidBytesTypeError(value);
|
|
2225
|
+
if (!("BYTES_PER_ELEMENT" in value))
|
|
2226
|
+
throw new InvalidBytesTypeError(value);
|
|
2227
|
+
if (value.BYTES_PER_ELEMENT !== 1 || value.constructor.name !== "Uint8Array")
|
|
2228
|
+
throw new InvalidBytesTypeError(value);
|
|
2229
|
+
}
|
|
2230
|
+
function concat2(...values) {
|
|
2231
|
+
let length = 0;
|
|
2232
|
+
for (const arr of values) {
|
|
2233
|
+
length += arr.length;
|
|
2234
|
+
}
|
|
2235
|
+
const result = new Uint8Array(length);
|
|
2236
|
+
for (let i = 0, index = 0; i < values.length; i++) {
|
|
2237
|
+
const arr = values[i];
|
|
2238
|
+
result.set(arr, index);
|
|
2239
|
+
index += arr.length;
|
|
2240
|
+
}
|
|
2241
|
+
return result;
|
|
2242
|
+
}
|
|
2243
|
+
function from(value) {
|
|
2244
|
+
if (value instanceof Uint8Array)
|
|
2245
|
+
return value;
|
|
2246
|
+
if (typeof value === "string")
|
|
2247
|
+
return fromHex2(value);
|
|
2248
|
+
return fromArray(value);
|
|
2249
|
+
}
|
|
2250
|
+
function fromArray(value) {
|
|
2251
|
+
return value instanceof Uint8Array ? value : new Uint8Array(value);
|
|
2252
|
+
}
|
|
2253
|
+
function fromHex2(value, options = {}) {
|
|
2254
|
+
const { size: size4 } = options;
|
|
2255
|
+
let hex = value;
|
|
2256
|
+
if (size4) {
|
|
2257
|
+
assertSize3(value, size4);
|
|
2258
|
+
hex = padRight(value, size4);
|
|
2259
|
+
}
|
|
2260
|
+
let hexString = hex.slice(2);
|
|
2261
|
+
if (hexString.length % 2)
|
|
2262
|
+
hexString = `0${hexString}`;
|
|
2263
|
+
const length = hexString.length / 2;
|
|
2264
|
+
const bytes = new Uint8Array(length);
|
|
2265
|
+
for (let index = 0, j = 0; index < length; index++) {
|
|
2266
|
+
const nibbleLeft = charCodeToBase162(hexString.charCodeAt(j++));
|
|
2267
|
+
const nibbleRight = charCodeToBase162(hexString.charCodeAt(j++));
|
|
2268
|
+
if (nibbleLeft === void 0 || nibbleRight === void 0) {
|
|
2269
|
+
throw new BaseError2(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
|
|
2270
|
+
}
|
|
2271
|
+
bytes[index] = nibbleLeft << 4 | nibbleRight;
|
|
2272
|
+
}
|
|
2273
|
+
return bytes;
|
|
2274
|
+
}
|
|
2275
|
+
function fromString(value, options = {}) {
|
|
2276
|
+
const { size: size4 } = options;
|
|
2277
|
+
const bytes = encoder3.encode(value);
|
|
2278
|
+
if (typeof size4 === "number") {
|
|
2279
|
+
assertSize2(bytes, size4);
|
|
2280
|
+
return padRight2(bytes, size4);
|
|
2281
|
+
}
|
|
2282
|
+
return bytes;
|
|
2283
|
+
}
|
|
2284
|
+
function isEqual(bytesA, bytesB) {
|
|
2285
|
+
return equalBytes(bytesA, bytesB);
|
|
2286
|
+
}
|
|
2287
|
+
function padRight2(value, size4) {
|
|
2288
|
+
return pad2(value, { dir: "right", size: size4 });
|
|
2289
|
+
}
|
|
2290
|
+
function random(length) {
|
|
2291
|
+
return crypto.getRandomValues(new Uint8Array(length));
|
|
2292
|
+
}
|
|
2293
|
+
function size2(value) {
|
|
2294
|
+
return value.length;
|
|
2295
|
+
}
|
|
2296
|
+
function slice2(value, start, end, options = {}) {
|
|
2297
|
+
const { strict } = options;
|
|
2298
|
+
assertStartOffset2(value, start);
|
|
2299
|
+
const value_ = value.slice(start, end);
|
|
2300
|
+
if (strict)
|
|
2301
|
+
assertEndOffset2(value_, start, end);
|
|
2302
|
+
return value_;
|
|
2303
|
+
}
|
|
2304
|
+
function toBigInt2(bytes, options = {}) {
|
|
2305
|
+
const { size: size4 } = options;
|
|
2306
|
+
if (typeof size4 !== "undefined")
|
|
2307
|
+
assertSize2(bytes, size4);
|
|
2308
|
+
const hex = fromBytes(bytes, options);
|
|
2309
|
+
return toBigInt(hex, options);
|
|
2310
|
+
}
|
|
2311
|
+
function toBoolean(bytes, options = {}) {
|
|
2312
|
+
const { size: size4 } = options;
|
|
2313
|
+
let bytes_ = bytes;
|
|
2314
|
+
if (typeof size4 !== "undefined") {
|
|
2315
|
+
assertSize2(bytes_, size4);
|
|
2316
|
+
bytes_ = trimLeft(bytes_);
|
|
2317
|
+
}
|
|
2318
|
+
if (bytes_.length > 1 || bytes_[0] > 1)
|
|
2319
|
+
throw new InvalidBytesBooleanError2(bytes_);
|
|
2320
|
+
return Boolean(bytes_[0]);
|
|
2321
|
+
}
|
|
2322
|
+
function toHex2(value, options = {}) {
|
|
2323
|
+
return fromBytes(value, options);
|
|
2324
|
+
}
|
|
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_;
|
|
2507
|
+
}
|
|
2508
|
+
function size3(value) {
|
|
2509
|
+
return Math.ceil((value.length - 2) / 2);
|
|
2510
|
+
}
|
|
2511
|
+
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;
|
|
2527
|
+
}
|
|
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));
|
|
2533
|
+
}
|
|
2534
|
+
function validate2(value, options = {}) {
|
|
2535
|
+
const { strict = false } = options;
|
|
2536
|
+
try {
|
|
2537
|
+
assert2(value, { strict });
|
|
2538
|
+
return true;
|
|
2539
|
+
} catch {
|
|
2540
|
+
return false;
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
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}"`.']
|
|
1743
2558
|
});
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
writable: true,
|
|
1750
|
-
value: /transaction type not valid/
|
|
1751
|
-
});
|
|
1752
|
-
var TipAboveFeeCapError = class extends BaseError {
|
|
1753
|
-
constructor({ cause, maxPriorityFeePerGas, maxFeePerGas } = {}) {
|
|
1754
|
-
super([
|
|
1755
|
-
`The provided tip (\`maxPriorityFeePerGas\`${maxPriorityFeePerGas ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}).`
|
|
1756
|
-
].join("\n"), {
|
|
1757
|
-
cause,
|
|
1758
|
-
name: "TipAboveFeeCapError"
|
|
2559
|
+
Object.defineProperty(this, "name", {
|
|
2560
|
+
enumerable: true,
|
|
2561
|
+
configurable: true,
|
|
2562
|
+
writable: true,
|
|
2563
|
+
value: "Hex.InvalidHexTypeError"
|
|
1759
2564
|
});
|
|
1760
2565
|
}
|
|
1761
2566
|
};
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
var UnknownNodeError = class extends BaseError {
|
|
1769
|
-
constructor({ cause }) {
|
|
1770
|
-
super(`An error occurred while executing: ${cause?.shortMessage}`, {
|
|
1771
|
-
cause,
|
|
1772
|
-
name: "UnknownNodeError"
|
|
2567
|
+
var InvalidHexValueError2 = class extends BaseError2 {
|
|
2568
|
+
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
|
+
]
|
|
1773
2573
|
});
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
if (typeof account === "string")
|
|
1780
|
-
return { address: account, type: "json-rpc" };
|
|
1781
|
-
return account;
|
|
1782
|
-
}
|
|
1783
|
-
|
|
1784
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/cursor.js
|
|
1785
|
-
var NegativeOffsetError = class extends BaseError {
|
|
1786
|
-
constructor({ offset }) {
|
|
1787
|
-
super(`Offset \`${offset}\` cannot be negative.`, {
|
|
1788
|
-
name: "NegativeOffsetError"
|
|
2574
|
+
Object.defineProperty(this, "name", {
|
|
2575
|
+
enumerable: true,
|
|
2576
|
+
configurable: true,
|
|
2577
|
+
writable: true,
|
|
2578
|
+
value: "Hex.InvalidHexValueError"
|
|
1789
2579
|
});
|
|
1790
2580
|
}
|
|
1791
2581
|
};
|
|
1792
|
-
var
|
|
1793
|
-
constructor({
|
|
1794
|
-
super(`
|
|
2582
|
+
var SizeOverflowError3 = class extends BaseError2 {
|
|
2583
|
+
constructor({ givenSize, maxSize }) {
|
|
2584
|
+
super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
|
|
2585
|
+
Object.defineProperty(this, "name", {
|
|
2586
|
+
enumerable: true,
|
|
2587
|
+
configurable: true,
|
|
2588
|
+
writable: true,
|
|
2589
|
+
value: "Hex.SizeOverflowError"
|
|
2590
|
+
});
|
|
1795
2591
|
}
|
|
1796
2592
|
};
|
|
1797
|
-
var
|
|
1798
|
-
constructor({
|
|
1799
|
-
super(`
|
|
2593
|
+
var SliceOffsetOutOfBoundsError3 = class extends BaseError2 {
|
|
2594
|
+
constructor({ offset, position, size: size4 }) {
|
|
2595
|
+
super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size4}\`).`);
|
|
2596
|
+
Object.defineProperty(this, "name", {
|
|
2597
|
+
enumerable: true,
|
|
2598
|
+
configurable: true,
|
|
2599
|
+
writable: true,
|
|
2600
|
+
value: "Hex.SliceOffsetOutOfBoundsError"
|
|
2601
|
+
});
|
|
1800
2602
|
}
|
|
1801
2603
|
};
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
assertReadLimit() {
|
|
1812
|
-
if (this.recursiveReadCount >= this.recursiveReadLimit)
|
|
1813
|
-
throw new RecursiveReadLimitExceededError({
|
|
1814
|
-
count: this.recursiveReadCount + 1,
|
|
1815
|
-
limit: this.recursiveReadLimit
|
|
1816
|
-
});
|
|
1817
|
-
},
|
|
1818
|
-
assertPosition(position) {
|
|
1819
|
-
if (position < 0 || position > this.bytes.length - 1)
|
|
1820
|
-
throw new PositionOutOfBoundsError({
|
|
1821
|
-
length: this.bytes.length,
|
|
1822
|
-
position
|
|
1823
|
-
});
|
|
1824
|
-
},
|
|
1825
|
-
decrementPosition(offset) {
|
|
1826
|
-
if (offset < 0)
|
|
1827
|
-
throw new NegativeOffsetError({ offset });
|
|
1828
|
-
const position = this.position - offset;
|
|
1829
|
-
this.assertPosition(position);
|
|
1830
|
-
this.position = position;
|
|
1831
|
-
},
|
|
1832
|
-
getReadCount(position) {
|
|
1833
|
-
return this.positionReadCount.get(position || this.position) || 0;
|
|
1834
|
-
},
|
|
1835
|
-
incrementPosition(offset) {
|
|
1836
|
-
if (offset < 0)
|
|
1837
|
-
throw new NegativeOffsetError({ offset });
|
|
1838
|
-
const position = this.position + offset;
|
|
1839
|
-
this.assertPosition(position);
|
|
1840
|
-
this.position = position;
|
|
1841
|
-
},
|
|
1842
|
-
inspectByte(position_) {
|
|
1843
|
-
const position = position_ ?? this.position;
|
|
1844
|
-
this.assertPosition(position);
|
|
1845
|
-
return this.bytes[position];
|
|
1846
|
-
},
|
|
1847
|
-
inspectBytes(length, position_) {
|
|
1848
|
-
const position = position_ ?? this.position;
|
|
1849
|
-
this.assertPosition(position + length - 1);
|
|
1850
|
-
return this.bytes.subarray(position, position + length);
|
|
1851
|
-
},
|
|
1852
|
-
inspectUint8(position_) {
|
|
1853
|
-
const position = position_ ?? this.position;
|
|
1854
|
-
this.assertPosition(position);
|
|
1855
|
-
return this.bytes[position];
|
|
1856
|
-
},
|
|
1857
|
-
inspectUint16(position_) {
|
|
1858
|
-
const position = position_ ?? this.position;
|
|
1859
|
-
this.assertPosition(position + 1);
|
|
1860
|
-
return this.dataView.getUint16(position);
|
|
1861
|
-
},
|
|
1862
|
-
inspectUint24(position_) {
|
|
1863
|
-
const position = position_ ?? this.position;
|
|
1864
|
-
this.assertPosition(position + 2);
|
|
1865
|
-
return (this.dataView.getUint16(position) << 8) + this.dataView.getUint8(position + 2);
|
|
1866
|
-
},
|
|
1867
|
-
inspectUint32(position_) {
|
|
1868
|
-
const position = position_ ?? this.position;
|
|
1869
|
-
this.assertPosition(position + 3);
|
|
1870
|
-
return this.dataView.getUint32(position);
|
|
1871
|
-
},
|
|
1872
|
-
pushByte(byte) {
|
|
1873
|
-
this.assertPosition(this.position);
|
|
1874
|
-
this.bytes[this.position] = byte;
|
|
1875
|
-
this.position++;
|
|
1876
|
-
},
|
|
1877
|
-
pushBytes(bytes) {
|
|
1878
|
-
this.assertPosition(this.position + bytes.length - 1);
|
|
1879
|
-
this.bytes.set(bytes, this.position);
|
|
1880
|
-
this.position += bytes.length;
|
|
1881
|
-
},
|
|
1882
|
-
pushUint8(value) {
|
|
1883
|
-
this.assertPosition(this.position);
|
|
1884
|
-
this.bytes[this.position] = value;
|
|
1885
|
-
this.position++;
|
|
1886
|
-
},
|
|
1887
|
-
pushUint16(value) {
|
|
1888
|
-
this.assertPosition(this.position + 1);
|
|
1889
|
-
this.dataView.setUint16(this.position, value);
|
|
1890
|
-
this.position += 2;
|
|
1891
|
-
},
|
|
1892
|
-
pushUint24(value) {
|
|
1893
|
-
this.assertPosition(this.position + 2);
|
|
1894
|
-
this.dataView.setUint16(this.position, value >> 8);
|
|
1895
|
-
this.dataView.setUint8(this.position + 2, value & ~4294967040);
|
|
1896
|
-
this.position += 3;
|
|
1897
|
-
},
|
|
1898
|
-
pushUint32(value) {
|
|
1899
|
-
this.assertPosition(this.position + 3);
|
|
1900
|
-
this.dataView.setUint32(this.position, value);
|
|
1901
|
-
this.position += 4;
|
|
1902
|
-
},
|
|
1903
|
-
readByte() {
|
|
1904
|
-
this.assertReadLimit();
|
|
1905
|
-
this._touch();
|
|
1906
|
-
const value = this.inspectByte();
|
|
1907
|
-
this.position++;
|
|
1908
|
-
return value;
|
|
1909
|
-
},
|
|
1910
|
-
readBytes(length, size2) {
|
|
1911
|
-
this.assertReadLimit();
|
|
1912
|
-
this._touch();
|
|
1913
|
-
const value = this.inspectBytes(length);
|
|
1914
|
-
this.position += size2 ?? length;
|
|
1915
|
-
return value;
|
|
1916
|
-
},
|
|
1917
|
-
readUint8() {
|
|
1918
|
-
this.assertReadLimit();
|
|
1919
|
-
this._touch();
|
|
1920
|
-
const value = this.inspectUint8();
|
|
1921
|
-
this.position += 1;
|
|
1922
|
-
return value;
|
|
1923
|
-
},
|
|
1924
|
-
readUint16() {
|
|
1925
|
-
this.assertReadLimit();
|
|
1926
|
-
this._touch();
|
|
1927
|
-
const value = this.inspectUint16();
|
|
1928
|
-
this.position += 2;
|
|
1929
|
-
return value;
|
|
1930
|
-
},
|
|
1931
|
-
readUint24() {
|
|
1932
|
-
this.assertReadLimit();
|
|
1933
|
-
this._touch();
|
|
1934
|
-
const value = this.inspectUint24();
|
|
1935
|
-
this.position += 3;
|
|
1936
|
-
return value;
|
|
1937
|
-
},
|
|
1938
|
-
readUint32() {
|
|
1939
|
-
this.assertReadLimit();
|
|
1940
|
-
this._touch();
|
|
1941
|
-
const value = this.inspectUint32();
|
|
1942
|
-
this.position += 4;
|
|
1943
|
-
return value;
|
|
1944
|
-
},
|
|
1945
|
-
get remaining() {
|
|
1946
|
-
return this.bytes.length - this.position;
|
|
1947
|
-
},
|
|
1948
|
-
setPosition(position) {
|
|
1949
|
-
const oldPosition = this.position;
|
|
1950
|
-
this.assertPosition(position);
|
|
1951
|
-
this.position = position;
|
|
1952
|
-
return () => this.position = oldPosition;
|
|
1953
|
-
},
|
|
1954
|
-
_touch() {
|
|
1955
|
-
if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)
|
|
1956
|
-
return;
|
|
1957
|
-
const count = this.getReadCount();
|
|
1958
|
-
this.positionReadCount.set(this.position, count + 1);
|
|
1959
|
-
if (count > 0)
|
|
1960
|
-
this.recursiveReadCount++;
|
|
2604
|
+
var SizeExceedsPaddingSizeError3 = class extends BaseError2 {
|
|
2605
|
+
constructor({ size: size4, targetSize, type }) {
|
|
2606
|
+
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size4}\`) exceeds padding size (\`${targetSize}\`).`);
|
|
2607
|
+
Object.defineProperty(this, "name", {
|
|
2608
|
+
enumerable: true,
|
|
2609
|
+
configurable: true,
|
|
2610
|
+
writable: true,
|
|
2611
|
+
value: "Hex.SizeExceedsPaddingSizeError"
|
|
2612
|
+
});
|
|
1961
2613
|
}
|
|
1962
2614
|
};
|
|
1963
|
-
function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
|
|
1964
|
-
const cursor = Object.create(staticCursor);
|
|
1965
|
-
cursor.bytes = bytes;
|
|
1966
|
-
cursor.dataView = new DataView(bytes.buffer ?? bytes, bytes.byteOffset, bytes.byteLength);
|
|
1967
|
-
cursor.positionReadCount = /* @__PURE__ */ new Map();
|
|
1968
|
-
cursor.recursiveReadLimit = recursiveReadLimit;
|
|
1969
|
-
return cursor;
|
|
1970
|
-
}
|
|
1971
2615
|
|
|
1972
2616
|
export {
|
|
2617
|
+
setErrorConfig,
|
|
1973
2618
|
BaseError,
|
|
2619
|
+
IntegerOutOfRangeError,
|
|
1974
2620
|
InvalidBytesBooleanError,
|
|
2621
|
+
InvalidHexBooleanError,
|
|
2622
|
+
InvalidHexValueError,
|
|
2623
|
+
RlpDepthLimitExceededError,
|
|
2624
|
+
RlpListBoundaryExceededError,
|
|
2625
|
+
RlpTrailingBytesError,
|
|
2626
|
+
SizeOverflowError,
|
|
2627
|
+
SliceOffsetOutOfBoundsError,
|
|
2628
|
+
SizeExceedsPaddingSizeError,
|
|
1975
2629
|
InvalidBytesLengthError,
|
|
2630
|
+
pad,
|
|
2631
|
+
padHex,
|
|
2632
|
+
padBytes,
|
|
1976
2633
|
isHex,
|
|
1977
2634
|
size,
|
|
1978
2635
|
trim,
|
|
1979
|
-
|
|
2636
|
+
toBytes,
|
|
2637
|
+
boolToBytes,
|
|
1980
2638
|
hexToBytes,
|
|
2639
|
+
numberToBytes,
|
|
1981
2640
|
stringToBytes,
|
|
1982
2641
|
assertSize,
|
|
2642
|
+
fromHex,
|
|
1983
2643
|
hexToBigInt,
|
|
1984
2644
|
hexToBool,
|
|
1985
2645
|
hexToNumber,
|
|
2646
|
+
hexToString,
|
|
1986
2647
|
toHex,
|
|
2648
|
+
boolToHex,
|
|
1987
2649
|
bytesToHex,
|
|
1988
2650
|
numberToHex,
|
|
1989
2651
|
stringToHex,
|
|
2652
|
+
formatBlockParameter,
|
|
1990
2653
|
LruMap,
|
|
1991
2654
|
InvalidAddressError,
|
|
1992
|
-
keccak_256,
|
|
1993
2655
|
keccak256,
|
|
1994
2656
|
checksumAddress,
|
|
1995
2657
|
getAddress,
|
|
1996
2658
|
isAddress,
|
|
1997
2659
|
concat,
|
|
2660
|
+
concatBytes,
|
|
1998
2661
|
concatHex,
|
|
1999
2662
|
PositionOutOfBoundsError,
|
|
2000
2663
|
createCursor,
|
|
2664
|
+
etherUnits,
|
|
2665
|
+
gweiUnits,
|
|
2666
|
+
weiUnits,
|
|
2001
2667
|
formatUnits,
|
|
2002
2668
|
formatEther,
|
|
2003
2669
|
formatGwei,
|
|
2004
2670
|
prettyPrint,
|
|
2671
|
+
FeeConflictError,
|
|
2005
2672
|
InvalidLegacyVError,
|
|
2673
|
+
InvalidYParityError,
|
|
2006
2674
|
InvalidSerializableTransactionError,
|
|
2675
|
+
InvalidSerializedTransactionTypeError,
|
|
2676
|
+
InvalidSerializedTransactionError,
|
|
2007
2677
|
InvalidStorageKeySizeError,
|
|
2008
2678
|
TransactionExecutionError,
|
|
2009
2679
|
TransactionNotFoundError,
|
|
2010
2680
|
TransactionReceiptNotFoundError,
|
|
2011
2681
|
TransactionReceiptRevertedError,
|
|
2012
2682
|
WaitForTransactionReceiptTimeoutError,
|
|
2683
|
+
maxInt8,
|
|
2684
|
+
maxInt16,
|
|
2685
|
+
maxInt24,
|
|
2686
|
+
maxInt32,
|
|
2687
|
+
maxInt40,
|
|
2688
|
+
maxInt48,
|
|
2689
|
+
maxInt56,
|
|
2690
|
+
maxInt64,
|
|
2691
|
+
maxInt72,
|
|
2692
|
+
maxInt80,
|
|
2693
|
+
maxInt88,
|
|
2694
|
+
maxInt96,
|
|
2695
|
+
maxInt104,
|
|
2696
|
+
maxInt112,
|
|
2697
|
+
maxInt120,
|
|
2698
|
+
maxInt128,
|
|
2699
|
+
maxInt136,
|
|
2700
|
+
maxInt144,
|
|
2701
|
+
maxInt152,
|
|
2702
|
+
maxInt160,
|
|
2703
|
+
maxInt168,
|
|
2704
|
+
maxInt176,
|
|
2705
|
+
maxInt184,
|
|
2706
|
+
maxInt192,
|
|
2707
|
+
maxInt200,
|
|
2708
|
+
maxInt208,
|
|
2709
|
+
maxInt216,
|
|
2710
|
+
maxInt224,
|
|
2711
|
+
maxInt232,
|
|
2712
|
+
maxInt240,
|
|
2713
|
+
maxInt248,
|
|
2714
|
+
maxInt256,
|
|
2715
|
+
minInt8,
|
|
2716
|
+
minInt16,
|
|
2717
|
+
minInt24,
|
|
2718
|
+
minInt32,
|
|
2719
|
+
minInt40,
|
|
2720
|
+
minInt48,
|
|
2721
|
+
minInt56,
|
|
2722
|
+
minInt64,
|
|
2723
|
+
minInt72,
|
|
2724
|
+
minInt80,
|
|
2725
|
+
minInt88,
|
|
2726
|
+
minInt96,
|
|
2727
|
+
minInt104,
|
|
2728
|
+
minInt112,
|
|
2729
|
+
minInt120,
|
|
2730
|
+
minInt128,
|
|
2731
|
+
minInt136,
|
|
2732
|
+
minInt144,
|
|
2733
|
+
minInt152,
|
|
2734
|
+
minInt160,
|
|
2735
|
+
minInt168,
|
|
2736
|
+
minInt176,
|
|
2737
|
+
minInt184,
|
|
2738
|
+
minInt192,
|
|
2739
|
+
minInt200,
|
|
2740
|
+
minInt208,
|
|
2741
|
+
minInt216,
|
|
2742
|
+
minInt224,
|
|
2743
|
+
minInt232,
|
|
2744
|
+
minInt240,
|
|
2745
|
+
minInt248,
|
|
2746
|
+
minInt256,
|
|
2747
|
+
maxUint8,
|
|
2748
|
+
maxUint16,
|
|
2749
|
+
maxUint24,
|
|
2750
|
+
maxUint32,
|
|
2751
|
+
maxUint40,
|
|
2752
|
+
maxUint48,
|
|
2753
|
+
maxUint56,
|
|
2754
|
+
maxUint64,
|
|
2755
|
+
maxUint72,
|
|
2756
|
+
maxUint80,
|
|
2757
|
+
maxUint88,
|
|
2758
|
+
maxUint96,
|
|
2759
|
+
maxUint104,
|
|
2760
|
+
maxUint112,
|
|
2761
|
+
maxUint120,
|
|
2762
|
+
maxUint128,
|
|
2763
|
+
maxUint136,
|
|
2764
|
+
maxUint144,
|
|
2765
|
+
maxUint152,
|
|
2766
|
+
maxUint160,
|
|
2767
|
+
maxUint168,
|
|
2768
|
+
maxUint176,
|
|
2769
|
+
maxUint184,
|
|
2770
|
+
maxUint192,
|
|
2771
|
+
maxUint200,
|
|
2772
|
+
maxUint208,
|
|
2773
|
+
maxUint216,
|
|
2774
|
+
maxUint224,
|
|
2775
|
+
maxUint232,
|
|
2776
|
+
maxUint240,
|
|
2777
|
+
maxUint248,
|
|
2013
2778
|
maxUint256,
|
|
2014
2779
|
ChainDoesNotSupportContract,
|
|
2780
|
+
ChainMismatchError,
|
|
2781
|
+
ChainNotFoundError,
|
|
2015
2782
|
ClientChainNotConfiguredError,
|
|
2016
2783
|
InvalidChainIdError,
|
|
2017
2784
|
ExecutionRevertedError,
|
|
@@ -2028,11 +2795,16 @@ export {
|
|
|
2028
2795
|
UnknownNodeError,
|
|
2029
2796
|
slice,
|
|
2030
2797
|
sliceBytes,
|
|
2798
|
+
sliceHex,
|
|
2031
2799
|
formatAbiItem,
|
|
2032
2800
|
AbiConstructorNotFoundError,
|
|
2033
2801
|
AbiConstructorParamsNotFoundError,
|
|
2802
|
+
AbiDecodingDataSizeInvalidError,
|
|
2034
2803
|
AbiDecodingDataSizeTooSmallError,
|
|
2035
2804
|
AbiDecodingZeroDataError,
|
|
2805
|
+
AbiEncodingArrayLengthMismatchError,
|
|
2806
|
+
AbiEncodingBytesSizeMismatchError,
|
|
2807
|
+
AbiEncodingLengthMismatchError,
|
|
2036
2808
|
AbiErrorInputsNotFoundError,
|
|
2037
2809
|
AbiErrorNotFoundError,
|
|
2038
2810
|
AbiErrorSignatureNotFoundError,
|
|
@@ -2046,13 +2818,48 @@ export {
|
|
|
2046
2818
|
BytesSizeMismatchError,
|
|
2047
2819
|
DecodeLogDataMismatch,
|
|
2048
2820
|
DecodeLogTopicsMismatch,
|
|
2821
|
+
InvalidAbiEncodingTypeError,
|
|
2049
2822
|
InvalidAbiDecodingTypeError,
|
|
2050
2823
|
InvalidArrayError,
|
|
2824
|
+
InvalidDefinitionTypeError,
|
|
2825
|
+
UnsupportedPackedAbiType,
|
|
2826
|
+
arrayRegex,
|
|
2051
2827
|
bytesRegex,
|
|
2052
2828
|
integerRegex,
|
|
2053
2829
|
encodeAbiParameters,
|
|
2054
2830
|
getArrayComponents,
|
|
2055
2831
|
stringify,
|
|
2056
|
-
parseAccount
|
|
2057
|
-
|
|
2058
|
-
|
|
2832
|
+
parseAccount,
|
|
2833
|
+
BaseError2,
|
|
2834
|
+
stringify2,
|
|
2835
|
+
concat3 as concat2,
|
|
2836
|
+
from2 as from,
|
|
2837
|
+
fromBoolean,
|
|
2838
|
+
fromBytes,
|
|
2839
|
+
fromNumber,
|
|
2840
|
+
fromString2 as fromString,
|
|
2841
|
+
padLeft,
|
|
2842
|
+
padRight,
|
|
2843
|
+
slice3 as slice2,
|
|
2844
|
+
size3 as size2,
|
|
2845
|
+
trimLeft2 as trimLeft,
|
|
2846
|
+
toNumber,
|
|
2847
|
+
validate2 as validate,
|
|
2848
|
+
IntegerOutOfRangeError2,
|
|
2849
|
+
concat2 as concat3,
|
|
2850
|
+
from as from2,
|
|
2851
|
+
fromHex2,
|
|
2852
|
+
fromString as fromString2,
|
|
2853
|
+
isEqual,
|
|
2854
|
+
random,
|
|
2855
|
+
size2 as size3,
|
|
2856
|
+
slice2 as slice3,
|
|
2857
|
+
toBigInt2 as toBigInt,
|
|
2858
|
+
toBoolean,
|
|
2859
|
+
toHex2,
|
|
2860
|
+
toNumber2,
|
|
2861
|
+
toString,
|
|
2862
|
+
trimLeft as trimLeft2,
|
|
2863
|
+
validate as validate2
|
|
2864
|
+
};
|
|
2865
|
+
//# sourceMappingURL=chunk-YALGASEU.js.map
|