@farcaster/create-mini-app 0.0.7 → 0.1.0
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/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +17 -0
- package/README.md +2 -2
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +20 -2
- package/dist/init.js.map +1 -1
- package/init.ts +22 -2
- package/package.json +7 -2
- package/templates/default/README.md +23 -1
- package/templates/default/package.json +1 -1
- package/asd/README.md +0 -1
- package/asd/biome.json +0 -13
- package/asd/index.html +0 -12
- package/asd/package.json +0 -30
- package/asd/public/.well-known/farcaster.json +0 -1
- package/asd/src/App.tsx +0 -67
- package/asd/src/index.css +0 -21
- package/asd/src/main.tsx +0 -21
- package/asd/src/vite-env.d.ts +0 -1
- package/asd/src/wagmi.ts +0 -18
- package/asd/tsconfig.json +0 -25
- package/asd/tsconfig.node.json +0 -10
- package/asd/vite.config.ts +0 -10
- package/templates/default/node_modules/.bin/biome +0 -17
- package/templates/default/node_modules/.bin/browserslist +0 -17
- package/templates/default/node_modules/.bin/esbuild +0 -17
- package/templates/default/node_modules/.bin/terser +0 -17
- package/templates/default/node_modules/.bin/tsc +0 -17
- package/templates/default/node_modules/.bin/tsserver +0 -17
- package/templates/default/node_modules/.bin/vite +0 -17
- package/templates/default/node_modules/.bin/wagmi +0 -17
- package/templates/default/node_modules/.vite/deps/@farcaster_frame-sdk.js +0 -84
- package/templates/default/node_modules/.vite/deps/@farcaster_frame-sdk.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/@farcaster_frame-wagmi-connector.js +0 -1936
- package/templates/default/node_modules/.vite/deps/@farcaster_frame-wagmi-connector.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/@tanstack_react-query.js +0 -96
- package/templates/default/node_modules/.vite/deps/@tanstack_react-query.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/_metadata.json +0 -139
- package/templates/default/node_modules/.vite/deps/ccip-JTEXJDV5.js +0 -17
- package/templates/default/node_modules/.vite/deps/ccip-JTEXJDV5.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/ccip-LLOJAQYN.js +0 -14
- package/templates/default/node_modules/.vite/deps/ccip-LLOJAQYN.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-2KW72IQL.js +0 -2601
- package/templates/default/node_modules/.vite/deps/chunk-2KW72IQL.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-2ULAEEW3.js +0 -286
- package/templates/default/node_modules/.vite/deps/chunk-2ULAEEW3.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-3MMZATWV.js +0 -1906
- package/templates/default/node_modules/.vite/deps/chunk-3MMZATWV.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-6WYSWNQJ.js +0 -3183
- package/templates/default/node_modules/.vite/deps/chunk-6WYSWNQJ.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-AJPHOYQK.js +0 -21628
- package/templates/default/node_modules/.vite/deps/chunk-AJPHOYQK.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-HP7M7ER3.js +0 -2221
- package/templates/default/node_modules/.vite/deps/chunk-HP7M7ER3.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-JDAHWTZP.js +0 -928
- package/templates/default/node_modules/.vite/deps/chunk-JDAHWTZP.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-OOB7NECH.js +0 -58
- package/templates/default/node_modules/.vite/deps/chunk-OOB7NECH.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-OYL52S4H.js +0 -190
- package/templates/default/node_modules/.vite/deps/chunk-OYL52S4H.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-P2SCV6N5.js +0 -1085
- package/templates/default/node_modules/.vite/deps/chunk-P2SCV6N5.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-P727YSDY.js +0 -3246
- package/templates/default/node_modules/.vite/deps/chunk-P727YSDY.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-PH77EFIP.js +0 -278
- package/templates/default/node_modules/.vite/deps/chunk-PH77EFIP.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-PK65EOOR.js +0 -4416
- package/templates/default/node_modules/.vite/deps/chunk-PK65EOOR.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-PPRY4ZGR.js +0 -36187
- package/templates/default/node_modules/.vite/deps/chunk-PPRY4ZGR.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-Q3UTC4SW.js +0 -832
- package/templates/default/node_modules/.vite/deps/chunk-Q3UTC4SW.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-R2PSY44V.js +0 -815
- package/templates/default/node_modules/.vite/deps/chunk-R2PSY44V.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/chunk-WOOG5QLI.js +0 -60
- package/templates/default/node_modules/.vite/deps/chunk-WOOG5QLI.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/native-J7PVLWWX.js +0 -21
- package/templates/default/node_modules/.vite/deps/native-J7PVLWWX.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/native-UTGEKOTD.js +0 -21
- package/templates/default/node_modules/.vite/deps/native-UTGEKOTD.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/package.json +0 -3
- package/templates/default/node_modules/.vite/deps/react-dom.js +0 -7
- package/templates/default/node_modules/.vite/deps/react-dom.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/react-dom_client.js +0 -39
- package/templates/default/node_modules/.vite/deps/react-dom_client.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/react.js +0 -6
- package/templates/default/node_modules/.vite/deps/react.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/react_jsx-dev-runtime.js +0 -913
- package/templates/default/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/react_jsx-runtime.js +0 -7
- package/templates/default/node_modules/.vite/deps/react_jsx-runtime.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/secp256k1-HB6OVCEM.js +0 -14
- package/templates/default/node_modules/.vite/deps/secp256k1-HB6OVCEM.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/secp256k1-YI5SRKAE.js +0 -16
- package/templates/default/node_modules/.vite/deps/secp256k1-YI5SRKAE.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/wagmi.js +0 -12147
- package/templates/default/node_modules/.vite/deps/wagmi.js.map +0 -7
- package/templates/default/node_modules/.vite/deps/wagmi_chains.js +0 -16355
- package/templates/default/node_modules/.vite/deps/wagmi_chains.js.map +0 -7
|
@@ -1,3246 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
formatAbiItem,
|
|
3
|
-
keccak_256
|
|
4
|
-
} from "./chunk-P2SCV6N5.js";
|
|
5
|
-
|
|
6
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/data/isHex.js
|
|
7
|
-
function isHex(value, { strict = true } = {}) {
|
|
8
|
-
if (!value)
|
|
9
|
-
return false;
|
|
10
|
-
if (typeof value !== "string")
|
|
11
|
-
return false;
|
|
12
|
-
return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/data/concat.js
|
|
16
|
-
function concat(values) {
|
|
17
|
-
if (typeof values[0] === "string")
|
|
18
|
-
return concatHex(values);
|
|
19
|
-
return concatBytes(values);
|
|
20
|
-
}
|
|
21
|
-
function concatBytes(values) {
|
|
22
|
-
let length = 0;
|
|
23
|
-
for (const arr of values) {
|
|
24
|
-
length += arr.length;
|
|
25
|
-
}
|
|
26
|
-
const result = new Uint8Array(length);
|
|
27
|
-
let offset = 0;
|
|
28
|
-
for (const arr of values) {
|
|
29
|
-
result.set(arr, offset);
|
|
30
|
-
offset += arr.length;
|
|
31
|
-
}
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
function concatHex(values) {
|
|
35
|
-
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/abi/formatAbiItem.js
|
|
39
|
-
function formatAbiItem2(abiItem, { includeName = false } = {}) {
|
|
40
|
-
if (abiItem.type !== "function" && abiItem.type !== "event" && abiItem.type !== "error")
|
|
41
|
-
throw new InvalidDefinitionTypeError(abiItem.type);
|
|
42
|
-
return `${abiItem.name}(${formatAbiParams(abiItem.inputs, { includeName })})`;
|
|
43
|
-
}
|
|
44
|
-
function formatAbiParams(params, { includeName = false } = {}) {
|
|
45
|
-
if (!params)
|
|
46
|
-
return "";
|
|
47
|
-
return params.map((param) => formatAbiParam(param, { includeName })).join(includeName ? ", " : ",");
|
|
48
|
-
}
|
|
49
|
-
function formatAbiParam(param, { includeName }) {
|
|
50
|
-
if (param.type.startsWith("tuple")) {
|
|
51
|
-
return `(${formatAbiParams(param.components, { includeName })})${param.type.slice("tuple".length)}`;
|
|
52
|
-
}
|
|
53
|
-
return param.type + (includeName && param.name ? ` ${param.name}` : "");
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/data/size.js
|
|
57
|
-
function size(value) {
|
|
58
|
-
if (isHex(value, { strict: false }))
|
|
59
|
-
return Math.ceil((value.length - 2) / 2);
|
|
60
|
-
return value.length;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/version.js
|
|
64
|
-
var version = "2.23.15";
|
|
65
|
-
|
|
66
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/base.js
|
|
67
|
-
var errorConfig = {
|
|
68
|
-
getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : void 0,
|
|
69
|
-
version: `viem@${version}`
|
|
70
|
-
};
|
|
71
|
-
var BaseError = class _BaseError extends Error {
|
|
72
|
-
constructor(shortMessage, args = {}) {
|
|
73
|
-
var _a;
|
|
74
|
-
const details = (() => {
|
|
75
|
-
var _a2;
|
|
76
|
-
if (args.cause instanceof _BaseError)
|
|
77
|
-
return args.cause.details;
|
|
78
|
-
if ((_a2 = args.cause) == null ? void 0 : _a2.message)
|
|
79
|
-
return args.cause.message;
|
|
80
|
-
return args.details;
|
|
81
|
-
})();
|
|
82
|
-
const docsPath = (() => {
|
|
83
|
-
if (args.cause instanceof _BaseError)
|
|
84
|
-
return args.cause.docsPath || args.docsPath;
|
|
85
|
-
return args.docsPath;
|
|
86
|
-
})();
|
|
87
|
-
const docsUrl = (_a = errorConfig.getDocsUrl) == null ? void 0 : _a.call(errorConfig, { ...args, docsPath });
|
|
88
|
-
const message = [
|
|
89
|
-
shortMessage || "An error occurred.",
|
|
90
|
-
"",
|
|
91
|
-
...args.metaMessages ? [...args.metaMessages, ""] : [],
|
|
92
|
-
...docsUrl ? [`Docs: ${docsUrl}`] : [],
|
|
93
|
-
...details ? [`Details: ${details}`] : [],
|
|
94
|
-
...errorConfig.version ? [`Version: ${errorConfig.version}`] : []
|
|
95
|
-
].join("\n");
|
|
96
|
-
super(message, args.cause ? { cause: args.cause } : void 0);
|
|
97
|
-
Object.defineProperty(this, "details", {
|
|
98
|
-
enumerable: true,
|
|
99
|
-
configurable: true,
|
|
100
|
-
writable: true,
|
|
101
|
-
value: void 0
|
|
102
|
-
});
|
|
103
|
-
Object.defineProperty(this, "docsPath", {
|
|
104
|
-
enumerable: true,
|
|
105
|
-
configurable: true,
|
|
106
|
-
writable: true,
|
|
107
|
-
value: void 0
|
|
108
|
-
});
|
|
109
|
-
Object.defineProperty(this, "metaMessages", {
|
|
110
|
-
enumerable: true,
|
|
111
|
-
configurable: true,
|
|
112
|
-
writable: true,
|
|
113
|
-
value: void 0
|
|
114
|
-
});
|
|
115
|
-
Object.defineProperty(this, "shortMessage", {
|
|
116
|
-
enumerable: true,
|
|
117
|
-
configurable: true,
|
|
118
|
-
writable: true,
|
|
119
|
-
value: void 0
|
|
120
|
-
});
|
|
121
|
-
Object.defineProperty(this, "version", {
|
|
122
|
-
enumerable: true,
|
|
123
|
-
configurable: true,
|
|
124
|
-
writable: true,
|
|
125
|
-
value: void 0
|
|
126
|
-
});
|
|
127
|
-
Object.defineProperty(this, "name", {
|
|
128
|
-
enumerable: true,
|
|
129
|
-
configurable: true,
|
|
130
|
-
writable: true,
|
|
131
|
-
value: "BaseError"
|
|
132
|
-
});
|
|
133
|
-
this.details = details;
|
|
134
|
-
this.docsPath = docsPath;
|
|
135
|
-
this.metaMessages = args.metaMessages;
|
|
136
|
-
this.name = args.name ?? this.name;
|
|
137
|
-
this.shortMessage = shortMessage;
|
|
138
|
-
this.version = version;
|
|
139
|
-
}
|
|
140
|
-
walk(fn) {
|
|
141
|
-
return walk(this, fn);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
function walk(err, fn) {
|
|
145
|
-
if (fn == null ? void 0 : fn(err))
|
|
146
|
-
return err;
|
|
147
|
-
if (err && typeof err === "object" && "cause" in err && err.cause !== void 0)
|
|
148
|
-
return walk(err.cause, fn);
|
|
149
|
-
return fn ? null : err;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/abi.js
|
|
153
|
-
var AbiConstructorNotFoundError = class extends BaseError {
|
|
154
|
-
constructor({ docsPath }) {
|
|
155
|
-
super([
|
|
156
|
-
"A constructor was not found on the ABI.",
|
|
157
|
-
"Make sure you are using the correct ABI and that the constructor exists on it."
|
|
158
|
-
].join("\n"), {
|
|
159
|
-
docsPath,
|
|
160
|
-
name: "AbiConstructorNotFoundError"
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
var AbiConstructorParamsNotFoundError = class extends BaseError {
|
|
165
|
-
constructor({ docsPath }) {
|
|
166
|
-
super([
|
|
167
|
-
"Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.",
|
|
168
|
-
"Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."
|
|
169
|
-
].join("\n"), {
|
|
170
|
-
docsPath,
|
|
171
|
-
name: "AbiConstructorParamsNotFoundError"
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
var AbiDecodingDataSizeTooSmallError = class extends BaseError {
|
|
176
|
-
constructor({ data, params, size: size2 }) {
|
|
177
|
-
super([`Data size of ${size2} bytes is too small for given parameters.`].join("\n"), {
|
|
178
|
-
metaMessages: [
|
|
179
|
-
`Params: (${formatAbiParams(params, { includeName: true })})`,
|
|
180
|
-
`Data: ${data} (${size2} bytes)`
|
|
181
|
-
],
|
|
182
|
-
name: "AbiDecodingDataSizeTooSmallError"
|
|
183
|
-
});
|
|
184
|
-
Object.defineProperty(this, "data", {
|
|
185
|
-
enumerable: true,
|
|
186
|
-
configurable: true,
|
|
187
|
-
writable: true,
|
|
188
|
-
value: void 0
|
|
189
|
-
});
|
|
190
|
-
Object.defineProperty(this, "params", {
|
|
191
|
-
enumerable: true,
|
|
192
|
-
configurable: true,
|
|
193
|
-
writable: true,
|
|
194
|
-
value: void 0
|
|
195
|
-
});
|
|
196
|
-
Object.defineProperty(this, "size", {
|
|
197
|
-
enumerable: true,
|
|
198
|
-
configurable: true,
|
|
199
|
-
writable: true,
|
|
200
|
-
value: void 0
|
|
201
|
-
});
|
|
202
|
-
this.data = data;
|
|
203
|
-
this.params = params;
|
|
204
|
-
this.size = size2;
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
var AbiDecodingZeroDataError = class extends BaseError {
|
|
208
|
-
constructor() {
|
|
209
|
-
super('Cannot decode zero data ("0x") with ABI parameters.', {
|
|
210
|
-
name: "AbiDecodingZeroDataError"
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
var AbiEncodingArrayLengthMismatchError = class extends BaseError {
|
|
215
|
-
constructor({ expectedLength, givenLength, type }) {
|
|
216
|
-
super([
|
|
217
|
-
`ABI encoding array length mismatch for type ${type}.`,
|
|
218
|
-
`Expected length: ${expectedLength}`,
|
|
219
|
-
`Given length: ${givenLength}`
|
|
220
|
-
].join("\n"), { name: "AbiEncodingArrayLengthMismatchError" });
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
var AbiEncodingBytesSizeMismatchError = class extends BaseError {
|
|
224
|
-
constructor({ expectedSize, value }) {
|
|
225
|
-
super(`Size of bytes "${value}" (bytes${size(value)}) does not match expected size (bytes${expectedSize}).`, { name: "AbiEncodingBytesSizeMismatchError" });
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
var AbiEncodingLengthMismatchError = class extends BaseError {
|
|
229
|
-
constructor({ expectedLength, givenLength }) {
|
|
230
|
-
super([
|
|
231
|
-
"ABI encoding params/values length mismatch.",
|
|
232
|
-
`Expected length (params): ${expectedLength}`,
|
|
233
|
-
`Given length (values): ${givenLength}`
|
|
234
|
-
].join("\n"), { name: "AbiEncodingLengthMismatchError" });
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
var AbiErrorSignatureNotFoundError = class extends BaseError {
|
|
238
|
-
constructor(signature, { docsPath }) {
|
|
239
|
-
super([
|
|
240
|
-
`Encoded error signature "${signature}" not found on ABI.`,
|
|
241
|
-
"Make sure you are using the correct ABI and that the error exists on it.",
|
|
242
|
-
`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${signature}.`
|
|
243
|
-
].join("\n"), {
|
|
244
|
-
docsPath,
|
|
245
|
-
name: "AbiErrorSignatureNotFoundError"
|
|
246
|
-
});
|
|
247
|
-
Object.defineProperty(this, "signature", {
|
|
248
|
-
enumerable: true,
|
|
249
|
-
configurable: true,
|
|
250
|
-
writable: true,
|
|
251
|
-
value: void 0
|
|
252
|
-
});
|
|
253
|
-
this.signature = signature;
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
var AbiEventSignatureEmptyTopicsError = class extends BaseError {
|
|
257
|
-
constructor({ docsPath }) {
|
|
258
|
-
super("Cannot extract event signature from empty topics.", {
|
|
259
|
-
docsPath,
|
|
260
|
-
name: "AbiEventSignatureEmptyTopicsError"
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
var AbiEventSignatureNotFoundError = class extends BaseError {
|
|
265
|
-
constructor(signature, { docsPath }) {
|
|
266
|
-
super([
|
|
267
|
-
`Encoded event signature "${signature}" not found on ABI.`,
|
|
268
|
-
"Make sure you are using the correct ABI and that the event exists on it.",
|
|
269
|
-
`You can look up the signature here: https://openchain.xyz/signatures?query=${signature}.`
|
|
270
|
-
].join("\n"), {
|
|
271
|
-
docsPath,
|
|
272
|
-
name: "AbiEventSignatureNotFoundError"
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
var AbiEventNotFoundError = class extends BaseError {
|
|
277
|
-
constructor(eventName, { docsPath } = {}) {
|
|
278
|
-
super([
|
|
279
|
-
`Event ${eventName ? `"${eventName}" ` : ""}not found on ABI.`,
|
|
280
|
-
"Make sure you are using the correct ABI and that the event exists on it."
|
|
281
|
-
].join("\n"), {
|
|
282
|
-
docsPath,
|
|
283
|
-
name: "AbiEventNotFoundError"
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
var AbiFunctionNotFoundError = class extends BaseError {
|
|
288
|
-
constructor(functionName, { docsPath } = {}) {
|
|
289
|
-
super([
|
|
290
|
-
`Function ${functionName ? `"${functionName}" ` : ""}not found on ABI.`,
|
|
291
|
-
"Make sure you are using the correct ABI and that the function exists on it."
|
|
292
|
-
].join("\n"), {
|
|
293
|
-
docsPath,
|
|
294
|
-
name: "AbiFunctionNotFoundError"
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
var AbiFunctionOutputsNotFoundError = class extends BaseError {
|
|
299
|
-
constructor(functionName, { docsPath }) {
|
|
300
|
-
super([
|
|
301
|
-
`Function "${functionName}" does not contain any \`outputs\` on ABI.`,
|
|
302
|
-
"Cannot decode function result without knowing what the parameter types are.",
|
|
303
|
-
"Make sure you are using the correct ABI and that the function exists on it."
|
|
304
|
-
].join("\n"), {
|
|
305
|
-
docsPath,
|
|
306
|
-
name: "AbiFunctionOutputsNotFoundError"
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
};
|
|
310
|
-
var AbiItemAmbiguityError = class extends BaseError {
|
|
311
|
-
constructor(x, y) {
|
|
312
|
-
super("Found ambiguous types in overloaded ABI items.", {
|
|
313
|
-
metaMessages: [
|
|
314
|
-
`\`${x.type}\` in \`${formatAbiItem2(x.abiItem)}\`, and`,
|
|
315
|
-
`\`${y.type}\` in \`${formatAbiItem2(y.abiItem)}\``,
|
|
316
|
-
"",
|
|
317
|
-
"These types encode differently and cannot be distinguished at runtime.",
|
|
318
|
-
"Remove one of the ambiguous items in the ABI."
|
|
319
|
-
],
|
|
320
|
-
name: "AbiItemAmbiguityError"
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
};
|
|
324
|
-
var BytesSizeMismatchError = class extends BaseError {
|
|
325
|
-
constructor({ expectedSize, givenSize }) {
|
|
326
|
-
super(`Expected bytes${expectedSize}, got bytes${givenSize}.`, {
|
|
327
|
-
name: "BytesSizeMismatchError"
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
var DecodeLogDataMismatch = class extends BaseError {
|
|
332
|
-
constructor({ abiItem, data, params, size: size2 }) {
|
|
333
|
-
super([
|
|
334
|
-
`Data size of ${size2} bytes is too small for non-indexed event parameters.`
|
|
335
|
-
].join("\n"), {
|
|
336
|
-
metaMessages: [
|
|
337
|
-
`Params: (${formatAbiParams(params, { includeName: true })})`,
|
|
338
|
-
`Data: ${data} (${size2} bytes)`
|
|
339
|
-
],
|
|
340
|
-
name: "DecodeLogDataMismatch"
|
|
341
|
-
});
|
|
342
|
-
Object.defineProperty(this, "abiItem", {
|
|
343
|
-
enumerable: true,
|
|
344
|
-
configurable: true,
|
|
345
|
-
writable: true,
|
|
346
|
-
value: void 0
|
|
347
|
-
});
|
|
348
|
-
Object.defineProperty(this, "data", {
|
|
349
|
-
enumerable: true,
|
|
350
|
-
configurable: true,
|
|
351
|
-
writable: true,
|
|
352
|
-
value: void 0
|
|
353
|
-
});
|
|
354
|
-
Object.defineProperty(this, "params", {
|
|
355
|
-
enumerable: true,
|
|
356
|
-
configurable: true,
|
|
357
|
-
writable: true,
|
|
358
|
-
value: void 0
|
|
359
|
-
});
|
|
360
|
-
Object.defineProperty(this, "size", {
|
|
361
|
-
enumerable: true,
|
|
362
|
-
configurable: true,
|
|
363
|
-
writable: true,
|
|
364
|
-
value: void 0
|
|
365
|
-
});
|
|
366
|
-
this.abiItem = abiItem;
|
|
367
|
-
this.data = data;
|
|
368
|
-
this.params = params;
|
|
369
|
-
this.size = size2;
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
var DecodeLogTopicsMismatch = class extends BaseError {
|
|
373
|
-
constructor({ abiItem, param }) {
|
|
374
|
-
super([
|
|
375
|
-
`Expected a topic for indexed event parameter${param.name ? ` "${param.name}"` : ""} on event "${formatAbiItem2(abiItem, { includeName: true })}".`
|
|
376
|
-
].join("\n"), { name: "DecodeLogTopicsMismatch" });
|
|
377
|
-
Object.defineProperty(this, "abiItem", {
|
|
378
|
-
enumerable: true,
|
|
379
|
-
configurable: true,
|
|
380
|
-
writable: true,
|
|
381
|
-
value: void 0
|
|
382
|
-
});
|
|
383
|
-
this.abiItem = abiItem;
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
var InvalidAbiEncodingTypeError = class extends BaseError {
|
|
387
|
-
constructor(type, { docsPath }) {
|
|
388
|
-
super([
|
|
389
|
-
`Type "${type}" is not a valid encoding type.`,
|
|
390
|
-
"Please provide a valid ABI type."
|
|
391
|
-
].join("\n"), { docsPath, name: "InvalidAbiEncodingType" });
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
var InvalidAbiDecodingTypeError = class extends BaseError {
|
|
395
|
-
constructor(type, { docsPath }) {
|
|
396
|
-
super([
|
|
397
|
-
`Type "${type}" is not a valid decoding type.`,
|
|
398
|
-
"Please provide a valid ABI type."
|
|
399
|
-
].join("\n"), { docsPath, name: "InvalidAbiDecodingType" });
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
var InvalidArrayError = class extends BaseError {
|
|
403
|
-
constructor(value) {
|
|
404
|
-
super([`Value "${value}" is not a valid array.`].join("\n"), {
|
|
405
|
-
name: "InvalidArrayError"
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
};
|
|
409
|
-
var InvalidDefinitionTypeError = class extends BaseError {
|
|
410
|
-
constructor(type) {
|
|
411
|
-
super([
|
|
412
|
-
`"${type}" is not a valid definition type.`,
|
|
413
|
-
'Valid types: "function", "event", "error"'
|
|
414
|
-
].join("\n"), { name: "InvalidDefinitionTypeError" });
|
|
415
|
-
}
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/address.js
|
|
419
|
-
var InvalidAddressError = class extends BaseError {
|
|
420
|
-
constructor({ address }) {
|
|
421
|
-
super(`Address "${address}" is invalid.`, {
|
|
422
|
-
metaMessages: [
|
|
423
|
-
"- Address must be a hex value of 20 bytes (40 hex characters).",
|
|
424
|
-
"- Address must match its checksum counterpart."
|
|
425
|
-
],
|
|
426
|
-
name: "InvalidAddressError"
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/encoding.js
|
|
432
|
-
var IntegerOutOfRangeError = class extends BaseError {
|
|
433
|
-
constructor({ max, min, signed, size: size2, value }) {
|
|
434
|
-
super(`Number "${value}" is not in safe ${size2 ? `${size2 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
var InvalidBytesBooleanError = class extends BaseError {
|
|
438
|
-
constructor(bytes) {
|
|
439
|
-
super(`Bytes value "${bytes}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {
|
|
440
|
-
name: "InvalidBytesBooleanError"
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
var InvalidHexBooleanError = class extends BaseError {
|
|
445
|
-
constructor(hex) {
|
|
446
|
-
super(`Hex value "${hex}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`, { name: "InvalidHexBooleanError" });
|
|
447
|
-
}
|
|
448
|
-
};
|
|
449
|
-
var SizeOverflowError = class extends BaseError {
|
|
450
|
-
constructor({ givenSize, maxSize }) {
|
|
451
|
-
super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: "SizeOverflowError" });
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
|
|
455
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/lru.js
|
|
456
|
-
var LruMap = class extends Map {
|
|
457
|
-
constructor(size2) {
|
|
458
|
-
super();
|
|
459
|
-
Object.defineProperty(this, "maxSize", {
|
|
460
|
-
enumerable: true,
|
|
461
|
-
configurable: true,
|
|
462
|
-
writable: true,
|
|
463
|
-
value: void 0
|
|
464
|
-
});
|
|
465
|
-
this.maxSize = size2;
|
|
466
|
-
}
|
|
467
|
-
get(key) {
|
|
468
|
-
const value = super.get(key);
|
|
469
|
-
if (super.has(key) && value !== void 0) {
|
|
470
|
-
this.delete(key);
|
|
471
|
-
super.set(key, value);
|
|
472
|
-
}
|
|
473
|
-
return value;
|
|
474
|
-
}
|
|
475
|
-
set(key, value) {
|
|
476
|
-
super.set(key, value);
|
|
477
|
-
if (this.maxSize && this.size > this.maxSize) {
|
|
478
|
-
const firstKey = this.keys().next().value;
|
|
479
|
-
if (firstKey)
|
|
480
|
-
this.delete(firstKey);
|
|
481
|
-
}
|
|
482
|
-
return this;
|
|
483
|
-
}
|
|
484
|
-
};
|
|
485
|
-
|
|
486
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/data.js
|
|
487
|
-
var SliceOffsetOutOfBoundsError = class extends BaseError {
|
|
488
|
-
constructor({ offset, position, size: size2 }) {
|
|
489
|
-
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size2}).`, { name: "SliceOffsetOutOfBoundsError" });
|
|
490
|
-
}
|
|
491
|
-
};
|
|
492
|
-
var SizeExceedsPaddingSizeError = class extends BaseError {
|
|
493
|
-
constructor({ size: size2, targetSize, type }) {
|
|
494
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${size2}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
495
|
-
}
|
|
496
|
-
};
|
|
497
|
-
var InvalidBytesLengthError = class extends BaseError {
|
|
498
|
-
constructor({ size: size2, targetSize, type }) {
|
|
499
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${size2} ${type} long.`, { name: "InvalidBytesLengthError" });
|
|
500
|
-
}
|
|
501
|
-
};
|
|
502
|
-
|
|
503
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/data/pad.js
|
|
504
|
-
function pad(hexOrBytes, { dir, size: size2 = 32 } = {}) {
|
|
505
|
-
if (typeof hexOrBytes === "string")
|
|
506
|
-
return padHex(hexOrBytes, { dir, size: size2 });
|
|
507
|
-
return padBytes(hexOrBytes, { dir, size: size2 });
|
|
508
|
-
}
|
|
509
|
-
function padHex(hex_, { dir, size: size2 = 32 } = {}) {
|
|
510
|
-
if (size2 === null)
|
|
511
|
-
return hex_;
|
|
512
|
-
const hex = hex_.replace("0x", "");
|
|
513
|
-
if (hex.length > size2 * 2)
|
|
514
|
-
throw new SizeExceedsPaddingSizeError({
|
|
515
|
-
size: Math.ceil(hex.length / 2),
|
|
516
|
-
targetSize: size2,
|
|
517
|
-
type: "hex"
|
|
518
|
-
});
|
|
519
|
-
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size2 * 2, "0")}`;
|
|
520
|
-
}
|
|
521
|
-
function padBytes(bytes, { dir, size: size2 = 32 } = {}) {
|
|
522
|
-
if (size2 === null)
|
|
523
|
-
return bytes;
|
|
524
|
-
if (bytes.length > size2)
|
|
525
|
-
throw new SizeExceedsPaddingSizeError({
|
|
526
|
-
size: bytes.length,
|
|
527
|
-
targetSize: size2,
|
|
528
|
-
type: "bytes"
|
|
529
|
-
});
|
|
530
|
-
const paddedBytes = new Uint8Array(size2);
|
|
531
|
-
for (let i = 0; i < size2; i++) {
|
|
532
|
-
const padEnd = dir === "right";
|
|
533
|
-
paddedBytes[padEnd ? i : size2 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
|
|
534
|
-
}
|
|
535
|
-
return paddedBytes;
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/data/trim.js
|
|
539
|
-
function trim(hexOrBytes, { dir = "left" } = {}) {
|
|
540
|
-
let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
|
|
541
|
-
let sliceLength = 0;
|
|
542
|
-
for (let i = 0; i < data.length - 1; i++) {
|
|
543
|
-
if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
|
|
544
|
-
sliceLength++;
|
|
545
|
-
else
|
|
546
|
-
break;
|
|
547
|
-
}
|
|
548
|
-
data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
|
|
549
|
-
if (typeof hexOrBytes === "string") {
|
|
550
|
-
if (data.length === 1 && dir === "right")
|
|
551
|
-
data = `${data}0`;
|
|
552
|
-
return `0x${data.length % 2 === 1 ? `0${data}` : data}`;
|
|
553
|
-
}
|
|
554
|
-
return data;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/encoding/fromHex.js
|
|
558
|
-
function assertSize(hexOrBytes, { size: size2 }) {
|
|
559
|
-
if (size(hexOrBytes) > size2)
|
|
560
|
-
throw new SizeOverflowError({
|
|
561
|
-
givenSize: size(hexOrBytes),
|
|
562
|
-
maxSize: size2
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
function fromHex(hex, toOrOpts) {
|
|
566
|
-
const opts = typeof toOrOpts === "string" ? { to: toOrOpts } : toOrOpts;
|
|
567
|
-
const to = opts.to;
|
|
568
|
-
if (to === "number")
|
|
569
|
-
return hexToNumber(hex, opts);
|
|
570
|
-
if (to === "bigint")
|
|
571
|
-
return hexToBigInt(hex, opts);
|
|
572
|
-
if (to === "string")
|
|
573
|
-
return hexToString(hex, opts);
|
|
574
|
-
if (to === "boolean")
|
|
575
|
-
return hexToBool(hex, opts);
|
|
576
|
-
return hexToBytes(hex, opts);
|
|
577
|
-
}
|
|
578
|
-
function hexToBigInt(hex, opts = {}) {
|
|
579
|
-
const { signed } = opts;
|
|
580
|
-
if (opts.size)
|
|
581
|
-
assertSize(hex, { size: opts.size });
|
|
582
|
-
const value = BigInt(hex);
|
|
583
|
-
if (!signed)
|
|
584
|
-
return value;
|
|
585
|
-
const size2 = (hex.length - 2) / 2;
|
|
586
|
-
const max = (1n << BigInt(size2) * 8n - 1n) - 1n;
|
|
587
|
-
if (value <= max)
|
|
588
|
-
return value;
|
|
589
|
-
return value - BigInt(`0x${"f".padStart(size2 * 2, "f")}`) - 1n;
|
|
590
|
-
}
|
|
591
|
-
function hexToBool(hex_, opts = {}) {
|
|
592
|
-
let hex = hex_;
|
|
593
|
-
if (opts.size) {
|
|
594
|
-
assertSize(hex, { size: opts.size });
|
|
595
|
-
hex = trim(hex);
|
|
596
|
-
}
|
|
597
|
-
if (trim(hex) === "0x00")
|
|
598
|
-
return false;
|
|
599
|
-
if (trim(hex) === "0x01")
|
|
600
|
-
return true;
|
|
601
|
-
throw new InvalidHexBooleanError(hex);
|
|
602
|
-
}
|
|
603
|
-
function hexToNumber(hex, opts = {}) {
|
|
604
|
-
return Number(hexToBigInt(hex, opts));
|
|
605
|
-
}
|
|
606
|
-
function hexToString(hex, opts = {}) {
|
|
607
|
-
let bytes = hexToBytes(hex);
|
|
608
|
-
if (opts.size) {
|
|
609
|
-
assertSize(bytes, { size: opts.size });
|
|
610
|
-
bytes = trim(bytes, { dir: "right" });
|
|
611
|
-
}
|
|
612
|
-
return new TextDecoder().decode(bytes);
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/encoding/toHex.js
|
|
616
|
-
var hexes = Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
617
|
-
function toHex(value, opts = {}) {
|
|
618
|
-
if (typeof value === "number" || typeof value === "bigint")
|
|
619
|
-
return numberToHex(value, opts);
|
|
620
|
-
if (typeof value === "string") {
|
|
621
|
-
return stringToHex(value, opts);
|
|
622
|
-
}
|
|
623
|
-
if (typeof value === "boolean")
|
|
624
|
-
return boolToHex(value, opts);
|
|
625
|
-
return bytesToHex(value, opts);
|
|
626
|
-
}
|
|
627
|
-
function boolToHex(value, opts = {}) {
|
|
628
|
-
const hex = `0x${Number(value)}`;
|
|
629
|
-
if (typeof opts.size === "number") {
|
|
630
|
-
assertSize(hex, { size: opts.size });
|
|
631
|
-
return pad(hex, { size: opts.size });
|
|
632
|
-
}
|
|
633
|
-
return hex;
|
|
634
|
-
}
|
|
635
|
-
function bytesToHex(value, opts = {}) {
|
|
636
|
-
let string = "";
|
|
637
|
-
for (let i = 0; i < value.length; i++) {
|
|
638
|
-
string += hexes[value[i]];
|
|
639
|
-
}
|
|
640
|
-
const hex = `0x${string}`;
|
|
641
|
-
if (typeof opts.size === "number") {
|
|
642
|
-
assertSize(hex, { size: opts.size });
|
|
643
|
-
return pad(hex, { dir: "right", size: opts.size });
|
|
644
|
-
}
|
|
645
|
-
return hex;
|
|
646
|
-
}
|
|
647
|
-
function numberToHex(value_, opts = {}) {
|
|
648
|
-
const { signed, size: size2 } = opts;
|
|
649
|
-
const value = BigInt(value_);
|
|
650
|
-
let maxValue;
|
|
651
|
-
if (size2) {
|
|
652
|
-
if (signed)
|
|
653
|
-
maxValue = (1n << BigInt(size2) * 8n - 1n) - 1n;
|
|
654
|
-
else
|
|
655
|
-
maxValue = 2n ** (BigInt(size2) * 8n) - 1n;
|
|
656
|
-
} else if (typeof value_ === "number") {
|
|
657
|
-
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
658
|
-
}
|
|
659
|
-
const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
|
|
660
|
-
if (maxValue && value > maxValue || value < minValue) {
|
|
661
|
-
const suffix = typeof value_ === "bigint" ? "n" : "";
|
|
662
|
-
throw new IntegerOutOfRangeError({
|
|
663
|
-
max: maxValue ? `${maxValue}${suffix}` : void 0,
|
|
664
|
-
min: `${minValue}${suffix}`,
|
|
665
|
-
signed,
|
|
666
|
-
size: size2,
|
|
667
|
-
value: `${value_}${suffix}`
|
|
668
|
-
});
|
|
669
|
-
}
|
|
670
|
-
const hex = `0x${(signed && value < 0 ? (1n << BigInt(size2 * 8)) + BigInt(value) : value).toString(16)}`;
|
|
671
|
-
if (size2)
|
|
672
|
-
return pad(hex, { size: size2 });
|
|
673
|
-
return hex;
|
|
674
|
-
}
|
|
675
|
-
var encoder = new TextEncoder();
|
|
676
|
-
function stringToHex(value_, opts = {}) {
|
|
677
|
-
const value = encoder.encode(value_);
|
|
678
|
-
return bytesToHex(value, opts);
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/encoding/toBytes.js
|
|
682
|
-
var encoder2 = new TextEncoder();
|
|
683
|
-
function toBytes(value, opts = {}) {
|
|
684
|
-
if (typeof value === "number" || typeof value === "bigint")
|
|
685
|
-
return numberToBytes(value, opts);
|
|
686
|
-
if (typeof value === "boolean")
|
|
687
|
-
return boolToBytes(value, opts);
|
|
688
|
-
if (isHex(value))
|
|
689
|
-
return hexToBytes(value, opts);
|
|
690
|
-
return stringToBytes(value, opts);
|
|
691
|
-
}
|
|
692
|
-
function boolToBytes(value, opts = {}) {
|
|
693
|
-
const bytes = new Uint8Array(1);
|
|
694
|
-
bytes[0] = Number(value);
|
|
695
|
-
if (typeof opts.size === "number") {
|
|
696
|
-
assertSize(bytes, { size: opts.size });
|
|
697
|
-
return pad(bytes, { size: opts.size });
|
|
698
|
-
}
|
|
699
|
-
return bytes;
|
|
700
|
-
}
|
|
701
|
-
var charCodeMap = {
|
|
702
|
-
zero: 48,
|
|
703
|
-
nine: 57,
|
|
704
|
-
A: 65,
|
|
705
|
-
F: 70,
|
|
706
|
-
a: 97,
|
|
707
|
-
f: 102
|
|
708
|
-
};
|
|
709
|
-
function charCodeToBase16(char) {
|
|
710
|
-
if (char >= charCodeMap.zero && char <= charCodeMap.nine)
|
|
711
|
-
return char - charCodeMap.zero;
|
|
712
|
-
if (char >= charCodeMap.A && char <= charCodeMap.F)
|
|
713
|
-
return char - (charCodeMap.A - 10);
|
|
714
|
-
if (char >= charCodeMap.a && char <= charCodeMap.f)
|
|
715
|
-
return char - (charCodeMap.a - 10);
|
|
716
|
-
return void 0;
|
|
717
|
-
}
|
|
718
|
-
function hexToBytes(hex_, opts = {}) {
|
|
719
|
-
let hex = hex_;
|
|
720
|
-
if (opts.size) {
|
|
721
|
-
assertSize(hex, { size: opts.size });
|
|
722
|
-
hex = pad(hex, { dir: "right", size: opts.size });
|
|
723
|
-
}
|
|
724
|
-
let hexString = hex.slice(2);
|
|
725
|
-
if (hexString.length % 2)
|
|
726
|
-
hexString = `0${hexString}`;
|
|
727
|
-
const length = hexString.length / 2;
|
|
728
|
-
const bytes = new Uint8Array(length);
|
|
729
|
-
for (let index = 0, j = 0; index < length; index++) {
|
|
730
|
-
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
|
|
731
|
-
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
|
|
732
|
-
if (nibbleLeft === void 0 || nibbleRight === void 0) {
|
|
733
|
-
throw new BaseError(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
|
|
734
|
-
}
|
|
735
|
-
bytes[index] = nibbleLeft * 16 + nibbleRight;
|
|
736
|
-
}
|
|
737
|
-
return bytes;
|
|
738
|
-
}
|
|
739
|
-
function numberToBytes(value, opts) {
|
|
740
|
-
const hex = numberToHex(value, opts);
|
|
741
|
-
return hexToBytes(hex);
|
|
742
|
-
}
|
|
743
|
-
function stringToBytes(value, opts = {}) {
|
|
744
|
-
const bytes = encoder2.encode(value);
|
|
745
|
-
if (typeof opts.size === "number") {
|
|
746
|
-
assertSize(bytes, { size: opts.size });
|
|
747
|
-
return pad(bytes, { dir: "right", size: opts.size });
|
|
748
|
-
}
|
|
749
|
-
return bytes;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/hash/keccak256.js
|
|
753
|
-
function keccak256(value, to_) {
|
|
754
|
-
const to = to_ || "hex";
|
|
755
|
-
const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);
|
|
756
|
-
if (to === "bytes")
|
|
757
|
-
return bytes;
|
|
758
|
-
return toHex(bytes);
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/address/getAddress.js
|
|
762
|
-
var checksumAddressCache = new LruMap(8192);
|
|
763
|
-
function checksumAddress(address_, chainId) {
|
|
764
|
-
if (checksumAddressCache.has(`${address_}.${chainId}`))
|
|
765
|
-
return checksumAddressCache.get(`${address_}.${chainId}`);
|
|
766
|
-
const hexAddress = chainId ? `${chainId}${address_.toLowerCase()}` : address_.substring(2).toLowerCase();
|
|
767
|
-
const hash2 = keccak256(stringToBytes(hexAddress), "bytes");
|
|
768
|
-
const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split("");
|
|
769
|
-
for (let i = 0; i < 40; i += 2) {
|
|
770
|
-
if (hash2[i >> 1] >> 4 >= 8 && address[i]) {
|
|
771
|
-
address[i] = address[i].toUpperCase();
|
|
772
|
-
}
|
|
773
|
-
if ((hash2[i >> 1] & 15) >= 8 && address[i + 1]) {
|
|
774
|
-
address[i + 1] = address[i + 1].toUpperCase();
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
const result = `0x${address.join("")}`;
|
|
778
|
-
checksumAddressCache.set(`${address_}.${chainId}`, result);
|
|
779
|
-
return result;
|
|
780
|
-
}
|
|
781
|
-
function getAddress(address, chainId) {
|
|
782
|
-
if (!isAddress(address, { strict: false }))
|
|
783
|
-
throw new InvalidAddressError({ address });
|
|
784
|
-
return checksumAddress(address, chainId);
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/address/isAddress.js
|
|
788
|
-
var addressRegex = /^0x[a-fA-F0-9]{40}$/;
|
|
789
|
-
var isAddressCache = new LruMap(8192);
|
|
790
|
-
function isAddress(address, options) {
|
|
791
|
-
const { strict = true } = options ?? {};
|
|
792
|
-
const cacheKey = `${address}.${strict}`;
|
|
793
|
-
if (isAddressCache.has(cacheKey))
|
|
794
|
-
return isAddressCache.get(cacheKey);
|
|
795
|
-
const result = (() => {
|
|
796
|
-
if (!addressRegex.test(address))
|
|
797
|
-
return false;
|
|
798
|
-
if (address.toLowerCase() === address)
|
|
799
|
-
return true;
|
|
800
|
-
if (strict)
|
|
801
|
-
return checksumAddress(address) === address;
|
|
802
|
-
return true;
|
|
803
|
-
})();
|
|
804
|
-
isAddressCache.set(cacheKey, result);
|
|
805
|
-
return result;
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/data/slice.js
|
|
809
|
-
function slice(value, start, end, { strict } = {}) {
|
|
810
|
-
if (isHex(value, { strict: false }))
|
|
811
|
-
return sliceHex(value, start, end, {
|
|
812
|
-
strict
|
|
813
|
-
});
|
|
814
|
-
return sliceBytes(value, start, end, {
|
|
815
|
-
strict
|
|
816
|
-
});
|
|
817
|
-
}
|
|
818
|
-
function assertStartOffset(value, start) {
|
|
819
|
-
if (typeof start === "number" && start > 0 && start > size(value) - 1)
|
|
820
|
-
throw new SliceOffsetOutOfBoundsError({
|
|
821
|
-
offset: start,
|
|
822
|
-
position: "start",
|
|
823
|
-
size: size(value)
|
|
824
|
-
});
|
|
825
|
-
}
|
|
826
|
-
function assertEndOffset(value, start, end) {
|
|
827
|
-
if (typeof start === "number" && typeof end === "number" && size(value) !== end - start) {
|
|
828
|
-
throw new SliceOffsetOutOfBoundsError({
|
|
829
|
-
offset: end,
|
|
830
|
-
position: "end",
|
|
831
|
-
size: size(value)
|
|
832
|
-
});
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
function sliceBytes(value_, start, end, { strict } = {}) {
|
|
836
|
-
assertStartOffset(value_, start);
|
|
837
|
-
const value = value_.slice(start, end);
|
|
838
|
-
if (strict)
|
|
839
|
-
assertEndOffset(value, start, end);
|
|
840
|
-
return value;
|
|
841
|
-
}
|
|
842
|
-
function sliceHex(value_, start, end, { strict } = {}) {
|
|
843
|
-
assertStartOffset(value_, start);
|
|
844
|
-
const value = `0x${value_.replace("0x", "").slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;
|
|
845
|
-
if (strict)
|
|
846
|
-
assertEndOffset(value, start, end);
|
|
847
|
-
return value;
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/regex.js
|
|
851
|
-
var bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
|
|
852
|
-
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)?$/;
|
|
853
|
-
|
|
854
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
|
|
855
|
-
function encodeAbiParameters(params, values) {
|
|
856
|
-
if (params.length !== values.length)
|
|
857
|
-
throw new AbiEncodingLengthMismatchError({
|
|
858
|
-
expectedLength: params.length,
|
|
859
|
-
givenLength: values.length
|
|
860
|
-
});
|
|
861
|
-
const preparedParams = prepareParams({
|
|
862
|
-
params,
|
|
863
|
-
values
|
|
864
|
-
});
|
|
865
|
-
const data = encodeParams(preparedParams);
|
|
866
|
-
if (data.length === 0)
|
|
867
|
-
return "0x";
|
|
868
|
-
return data;
|
|
869
|
-
}
|
|
870
|
-
function prepareParams({ params, values }) {
|
|
871
|
-
const preparedParams = [];
|
|
872
|
-
for (let i = 0; i < params.length; i++) {
|
|
873
|
-
preparedParams.push(prepareParam({ param: params[i], value: values[i] }));
|
|
874
|
-
}
|
|
875
|
-
return preparedParams;
|
|
876
|
-
}
|
|
877
|
-
function prepareParam({ param, value }) {
|
|
878
|
-
const arrayComponents = getArrayComponents(param.type);
|
|
879
|
-
if (arrayComponents) {
|
|
880
|
-
const [length, type] = arrayComponents;
|
|
881
|
-
return encodeArray(value, { length, param: { ...param, type } });
|
|
882
|
-
}
|
|
883
|
-
if (param.type === "tuple") {
|
|
884
|
-
return encodeTuple(value, {
|
|
885
|
-
param
|
|
886
|
-
});
|
|
887
|
-
}
|
|
888
|
-
if (param.type === "address") {
|
|
889
|
-
return encodeAddress(value);
|
|
890
|
-
}
|
|
891
|
-
if (param.type === "bool") {
|
|
892
|
-
return encodeBool(value);
|
|
893
|
-
}
|
|
894
|
-
if (param.type.startsWith("uint") || param.type.startsWith("int")) {
|
|
895
|
-
const signed = param.type.startsWith("int");
|
|
896
|
-
const [, , size2 = "256"] = integerRegex.exec(param.type) ?? [];
|
|
897
|
-
return encodeNumber(value, {
|
|
898
|
-
signed,
|
|
899
|
-
size: Number(size2)
|
|
900
|
-
});
|
|
901
|
-
}
|
|
902
|
-
if (param.type.startsWith("bytes")) {
|
|
903
|
-
return encodeBytes(value, { param });
|
|
904
|
-
}
|
|
905
|
-
if (param.type === "string") {
|
|
906
|
-
return encodeString(value);
|
|
907
|
-
}
|
|
908
|
-
throw new InvalidAbiEncodingTypeError(param.type, {
|
|
909
|
-
docsPath: "/docs/contract/encodeAbiParameters"
|
|
910
|
-
});
|
|
911
|
-
}
|
|
912
|
-
function encodeParams(preparedParams) {
|
|
913
|
-
let staticSize = 0;
|
|
914
|
-
for (let i = 0; i < preparedParams.length; i++) {
|
|
915
|
-
const { dynamic, encoded } = preparedParams[i];
|
|
916
|
-
if (dynamic)
|
|
917
|
-
staticSize += 32;
|
|
918
|
-
else
|
|
919
|
-
staticSize += size(encoded);
|
|
920
|
-
}
|
|
921
|
-
const staticParams = [];
|
|
922
|
-
const dynamicParams = [];
|
|
923
|
-
let dynamicSize = 0;
|
|
924
|
-
for (let i = 0; i < preparedParams.length; i++) {
|
|
925
|
-
const { dynamic, encoded } = preparedParams[i];
|
|
926
|
-
if (dynamic) {
|
|
927
|
-
staticParams.push(numberToHex(staticSize + dynamicSize, { size: 32 }));
|
|
928
|
-
dynamicParams.push(encoded);
|
|
929
|
-
dynamicSize += size(encoded);
|
|
930
|
-
} else {
|
|
931
|
-
staticParams.push(encoded);
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
return concat([...staticParams, ...dynamicParams]);
|
|
935
|
-
}
|
|
936
|
-
function encodeAddress(value) {
|
|
937
|
-
if (!isAddress(value))
|
|
938
|
-
throw new InvalidAddressError({ address: value });
|
|
939
|
-
return { dynamic: false, encoded: padHex(value.toLowerCase()) };
|
|
940
|
-
}
|
|
941
|
-
function encodeArray(value, { length, param }) {
|
|
942
|
-
const dynamic = length === null;
|
|
943
|
-
if (!Array.isArray(value))
|
|
944
|
-
throw new InvalidArrayError(value);
|
|
945
|
-
if (!dynamic && value.length !== length)
|
|
946
|
-
throw new AbiEncodingArrayLengthMismatchError({
|
|
947
|
-
expectedLength: length,
|
|
948
|
-
givenLength: value.length,
|
|
949
|
-
type: `${param.type}[${length}]`
|
|
950
|
-
});
|
|
951
|
-
let dynamicChild = false;
|
|
952
|
-
const preparedParams = [];
|
|
953
|
-
for (let i = 0; i < value.length; i++) {
|
|
954
|
-
const preparedParam = prepareParam({ param, value: value[i] });
|
|
955
|
-
if (preparedParam.dynamic)
|
|
956
|
-
dynamicChild = true;
|
|
957
|
-
preparedParams.push(preparedParam);
|
|
958
|
-
}
|
|
959
|
-
if (dynamic || dynamicChild) {
|
|
960
|
-
const data = encodeParams(preparedParams);
|
|
961
|
-
if (dynamic) {
|
|
962
|
-
const length2 = numberToHex(preparedParams.length, { size: 32 });
|
|
963
|
-
return {
|
|
964
|
-
dynamic: true,
|
|
965
|
-
encoded: preparedParams.length > 0 ? concat([length2, data]) : length2
|
|
966
|
-
};
|
|
967
|
-
}
|
|
968
|
-
if (dynamicChild)
|
|
969
|
-
return { dynamic: true, encoded: data };
|
|
970
|
-
}
|
|
971
|
-
return {
|
|
972
|
-
dynamic: false,
|
|
973
|
-
encoded: concat(preparedParams.map(({ encoded }) => encoded))
|
|
974
|
-
};
|
|
975
|
-
}
|
|
976
|
-
function encodeBytes(value, { param }) {
|
|
977
|
-
const [, paramSize] = param.type.split("bytes");
|
|
978
|
-
const bytesSize = size(value);
|
|
979
|
-
if (!paramSize) {
|
|
980
|
-
let value_ = value;
|
|
981
|
-
if (bytesSize % 32 !== 0)
|
|
982
|
-
value_ = padHex(value_, {
|
|
983
|
-
dir: "right",
|
|
984
|
-
size: Math.ceil((value.length - 2) / 2 / 32) * 32
|
|
985
|
-
});
|
|
986
|
-
return {
|
|
987
|
-
dynamic: true,
|
|
988
|
-
encoded: concat([padHex(numberToHex(bytesSize, { size: 32 })), value_])
|
|
989
|
-
};
|
|
990
|
-
}
|
|
991
|
-
if (bytesSize !== Number.parseInt(paramSize))
|
|
992
|
-
throw new AbiEncodingBytesSizeMismatchError({
|
|
993
|
-
expectedSize: Number.parseInt(paramSize),
|
|
994
|
-
value
|
|
995
|
-
});
|
|
996
|
-
return { dynamic: false, encoded: padHex(value, { dir: "right" }) };
|
|
997
|
-
}
|
|
998
|
-
function encodeBool(value) {
|
|
999
|
-
if (typeof value !== "boolean")
|
|
1000
|
-
throw new BaseError(`Invalid boolean value: "${value}" (type: ${typeof value}). Expected: \`true\` or \`false\`.`);
|
|
1001
|
-
return { dynamic: false, encoded: padHex(boolToHex(value)) };
|
|
1002
|
-
}
|
|
1003
|
-
function encodeNumber(value, { signed, size: size2 = 256 }) {
|
|
1004
|
-
if (typeof size2 === "number") {
|
|
1005
|
-
const max = 2n ** (BigInt(size2) - (signed ? 1n : 0n)) - 1n;
|
|
1006
|
-
const min = signed ? -max - 1n : 0n;
|
|
1007
|
-
if (value > max || value < min)
|
|
1008
|
-
throw new IntegerOutOfRangeError({
|
|
1009
|
-
max: max.toString(),
|
|
1010
|
-
min: min.toString(),
|
|
1011
|
-
signed,
|
|
1012
|
-
size: size2 / 8,
|
|
1013
|
-
value: value.toString()
|
|
1014
|
-
});
|
|
1015
|
-
}
|
|
1016
|
-
return {
|
|
1017
|
-
dynamic: false,
|
|
1018
|
-
encoded: numberToHex(value, {
|
|
1019
|
-
size: 32,
|
|
1020
|
-
signed
|
|
1021
|
-
})
|
|
1022
|
-
};
|
|
1023
|
-
}
|
|
1024
|
-
function encodeString(value) {
|
|
1025
|
-
const hexValue = stringToHex(value);
|
|
1026
|
-
const partsLength = Math.ceil(size(hexValue) / 32);
|
|
1027
|
-
const parts = [];
|
|
1028
|
-
for (let i = 0; i < partsLength; i++) {
|
|
1029
|
-
parts.push(padHex(slice(hexValue, i * 32, (i + 1) * 32), {
|
|
1030
|
-
dir: "right"
|
|
1031
|
-
}));
|
|
1032
|
-
}
|
|
1033
|
-
return {
|
|
1034
|
-
dynamic: true,
|
|
1035
|
-
encoded: concat([
|
|
1036
|
-
padHex(numberToHex(size(hexValue), { size: 32 })),
|
|
1037
|
-
...parts
|
|
1038
|
-
])
|
|
1039
|
-
};
|
|
1040
|
-
}
|
|
1041
|
-
function encodeTuple(value, { param }) {
|
|
1042
|
-
let dynamic = false;
|
|
1043
|
-
const preparedParams = [];
|
|
1044
|
-
for (let i = 0; i < param.components.length; i++) {
|
|
1045
|
-
const param_ = param.components[i];
|
|
1046
|
-
const index = Array.isArray(value) ? i : param_.name;
|
|
1047
|
-
const preparedParam = prepareParam({
|
|
1048
|
-
param: param_,
|
|
1049
|
-
value: value[index]
|
|
1050
|
-
});
|
|
1051
|
-
preparedParams.push(preparedParam);
|
|
1052
|
-
if (preparedParam.dynamic)
|
|
1053
|
-
dynamic = true;
|
|
1054
|
-
}
|
|
1055
|
-
return {
|
|
1056
|
-
dynamic,
|
|
1057
|
-
encoded: dynamic ? encodeParams(preparedParams) : concat(preparedParams.map(({ encoded }) => encoded))
|
|
1058
|
-
};
|
|
1059
|
-
}
|
|
1060
|
-
function getArrayComponents(type) {
|
|
1061
|
-
const matches = type.match(/^(.*)\[(\d+)?\]$/);
|
|
1062
|
-
return matches ? (
|
|
1063
|
-
// Return `null` if the array is dynamic.
|
|
1064
|
-
[matches[2] ? Number(matches[2]) : null, matches[1]]
|
|
1065
|
-
) : void 0;
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/stringify.js
|
|
1069
|
-
var stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {
|
|
1070
|
-
const value2 = typeof value_ === "bigint" ? value_.toString() : value_;
|
|
1071
|
-
return typeof replacer === "function" ? replacer(key, value2) : value2;
|
|
1072
|
-
}, space);
|
|
1073
|
-
|
|
1074
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/utils.js
|
|
1075
|
-
var getContractAddress = (address) => address;
|
|
1076
|
-
var getUrl = (url) => url;
|
|
1077
|
-
|
|
1078
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/request.js
|
|
1079
|
-
var HttpRequestError = class extends BaseError {
|
|
1080
|
-
constructor({ body, cause, details, headers, status, url }) {
|
|
1081
|
-
super("HTTP request failed.", {
|
|
1082
|
-
cause,
|
|
1083
|
-
details,
|
|
1084
|
-
metaMessages: [
|
|
1085
|
-
status && `Status: ${status}`,
|
|
1086
|
-
`URL: ${getUrl(url)}`,
|
|
1087
|
-
body && `Request body: ${stringify(body)}`
|
|
1088
|
-
].filter(Boolean),
|
|
1089
|
-
name: "HttpRequestError"
|
|
1090
|
-
});
|
|
1091
|
-
Object.defineProperty(this, "body", {
|
|
1092
|
-
enumerable: true,
|
|
1093
|
-
configurable: true,
|
|
1094
|
-
writable: true,
|
|
1095
|
-
value: void 0
|
|
1096
|
-
});
|
|
1097
|
-
Object.defineProperty(this, "headers", {
|
|
1098
|
-
enumerable: true,
|
|
1099
|
-
configurable: true,
|
|
1100
|
-
writable: true,
|
|
1101
|
-
value: void 0
|
|
1102
|
-
});
|
|
1103
|
-
Object.defineProperty(this, "status", {
|
|
1104
|
-
enumerable: true,
|
|
1105
|
-
configurable: true,
|
|
1106
|
-
writable: true,
|
|
1107
|
-
value: void 0
|
|
1108
|
-
});
|
|
1109
|
-
Object.defineProperty(this, "url", {
|
|
1110
|
-
enumerable: true,
|
|
1111
|
-
configurable: true,
|
|
1112
|
-
writable: true,
|
|
1113
|
-
value: void 0
|
|
1114
|
-
});
|
|
1115
|
-
this.body = body;
|
|
1116
|
-
this.headers = headers;
|
|
1117
|
-
this.status = status;
|
|
1118
|
-
this.url = url;
|
|
1119
|
-
}
|
|
1120
|
-
};
|
|
1121
|
-
var WebSocketRequestError = class extends BaseError {
|
|
1122
|
-
constructor({ body, cause, details, url }) {
|
|
1123
|
-
super("WebSocket request failed.", {
|
|
1124
|
-
cause,
|
|
1125
|
-
details,
|
|
1126
|
-
metaMessages: [
|
|
1127
|
-
`URL: ${getUrl(url)}`,
|
|
1128
|
-
body && `Request body: ${stringify(body)}`
|
|
1129
|
-
].filter(Boolean),
|
|
1130
|
-
name: "WebSocketRequestError"
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
};
|
|
1134
|
-
var RpcRequestError = class extends BaseError {
|
|
1135
|
-
constructor({ body, error, url }) {
|
|
1136
|
-
super("RPC Request failed.", {
|
|
1137
|
-
cause: error,
|
|
1138
|
-
details: error.message,
|
|
1139
|
-
metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],
|
|
1140
|
-
name: "RpcRequestError"
|
|
1141
|
-
});
|
|
1142
|
-
Object.defineProperty(this, "code", {
|
|
1143
|
-
enumerable: true,
|
|
1144
|
-
configurable: true,
|
|
1145
|
-
writable: true,
|
|
1146
|
-
value: void 0
|
|
1147
|
-
});
|
|
1148
|
-
Object.defineProperty(this, "data", {
|
|
1149
|
-
enumerable: true,
|
|
1150
|
-
configurable: true,
|
|
1151
|
-
writable: true,
|
|
1152
|
-
value: void 0
|
|
1153
|
-
});
|
|
1154
|
-
this.code = error.code;
|
|
1155
|
-
this.data = error.data;
|
|
1156
|
-
}
|
|
1157
|
-
};
|
|
1158
|
-
var SocketClosedError = class extends BaseError {
|
|
1159
|
-
constructor({ url } = {}) {
|
|
1160
|
-
super("The socket has been closed.", {
|
|
1161
|
-
metaMessages: [url && `URL: ${getUrl(url)}`].filter(Boolean),
|
|
1162
|
-
name: "SocketClosedError"
|
|
1163
|
-
});
|
|
1164
|
-
}
|
|
1165
|
-
};
|
|
1166
|
-
var TimeoutError = class extends BaseError {
|
|
1167
|
-
constructor({ body, url }) {
|
|
1168
|
-
super("The request took too long to respond.", {
|
|
1169
|
-
details: "The request timed out.",
|
|
1170
|
-
metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],
|
|
1171
|
-
name: "TimeoutError"
|
|
1172
|
-
});
|
|
1173
|
-
}
|
|
1174
|
-
};
|
|
1175
|
-
|
|
1176
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/constants/solidity.js
|
|
1177
|
-
var panicReasons = {
|
|
1178
|
-
1: "An `assert` condition failed.",
|
|
1179
|
-
17: "Arithmetic operation resulted in underflow or overflow.",
|
|
1180
|
-
18: "Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",
|
|
1181
|
-
33: "Attempted to convert to an invalid type.",
|
|
1182
|
-
34: "Attempted to access a storage byte array that is incorrectly encoded.",
|
|
1183
|
-
49: "Performed `.pop()` on an empty array",
|
|
1184
|
-
50: "Array index is out of bounds.",
|
|
1185
|
-
65: "Allocated too much memory or created an array which is too large.",
|
|
1186
|
-
81: "Attempted to call a zero-initialized variable of internal function type."
|
|
1187
|
-
};
|
|
1188
|
-
var solidityError = {
|
|
1189
|
-
inputs: [
|
|
1190
|
-
{
|
|
1191
|
-
name: "message",
|
|
1192
|
-
type: "string"
|
|
1193
|
-
}
|
|
1194
|
-
],
|
|
1195
|
-
name: "Error",
|
|
1196
|
-
type: "error"
|
|
1197
|
-
};
|
|
1198
|
-
var solidityPanic = {
|
|
1199
|
-
inputs: [
|
|
1200
|
-
{
|
|
1201
|
-
name: "reason",
|
|
1202
|
-
type: "uint256"
|
|
1203
|
-
}
|
|
1204
|
-
],
|
|
1205
|
-
name: "Panic",
|
|
1206
|
-
type: "error"
|
|
1207
|
-
};
|
|
1208
|
-
|
|
1209
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/hash/hashSignature.js
|
|
1210
|
-
var hash = (value) => keccak256(toBytes(value));
|
|
1211
|
-
function hashSignature(sig) {
|
|
1212
|
-
return hash(sig);
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/hash/normalizeSignature.js
|
|
1216
|
-
function normalizeSignature(signature) {
|
|
1217
|
-
let active = true;
|
|
1218
|
-
let current = "";
|
|
1219
|
-
let level = 0;
|
|
1220
|
-
let result = "";
|
|
1221
|
-
let valid = false;
|
|
1222
|
-
for (let i = 0; i < signature.length; i++) {
|
|
1223
|
-
const char = signature[i];
|
|
1224
|
-
if (["(", ")", ","].includes(char))
|
|
1225
|
-
active = true;
|
|
1226
|
-
if (char === "(")
|
|
1227
|
-
level++;
|
|
1228
|
-
if (char === ")")
|
|
1229
|
-
level--;
|
|
1230
|
-
if (!active)
|
|
1231
|
-
continue;
|
|
1232
|
-
if (level === 0) {
|
|
1233
|
-
if (char === " " && ["event", "function", ""].includes(result))
|
|
1234
|
-
result = "";
|
|
1235
|
-
else {
|
|
1236
|
-
result += char;
|
|
1237
|
-
if (char === ")") {
|
|
1238
|
-
valid = true;
|
|
1239
|
-
break;
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
continue;
|
|
1243
|
-
}
|
|
1244
|
-
if (char === " ") {
|
|
1245
|
-
if (signature[i - 1] !== "," && current !== "," && current !== ",(") {
|
|
1246
|
-
current = "";
|
|
1247
|
-
active = false;
|
|
1248
|
-
}
|
|
1249
|
-
continue;
|
|
1250
|
-
}
|
|
1251
|
-
result += char;
|
|
1252
|
-
current += char;
|
|
1253
|
-
}
|
|
1254
|
-
if (!valid)
|
|
1255
|
-
throw new BaseError("Unable to normalize signature.");
|
|
1256
|
-
return result;
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/hash/toSignature.js
|
|
1260
|
-
var toSignature = (def) => {
|
|
1261
|
-
const def_ = (() => {
|
|
1262
|
-
if (typeof def === "string")
|
|
1263
|
-
return def;
|
|
1264
|
-
return formatAbiItem(def);
|
|
1265
|
-
})();
|
|
1266
|
-
return normalizeSignature(def_);
|
|
1267
|
-
};
|
|
1268
|
-
|
|
1269
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/hash/toSignatureHash.js
|
|
1270
|
-
function toSignatureHash(fn) {
|
|
1271
|
-
return hashSignature(toSignature(fn));
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1274
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/hash/toFunctionSelector.js
|
|
1275
|
-
var toFunctionSelector = (fn) => slice(toSignatureHash(fn), 0, 4);
|
|
1276
|
-
|
|
1277
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/cursor.js
|
|
1278
|
-
var NegativeOffsetError = class extends BaseError {
|
|
1279
|
-
constructor({ offset }) {
|
|
1280
|
-
super(`Offset \`${offset}\` cannot be negative.`, {
|
|
1281
|
-
name: "NegativeOffsetError"
|
|
1282
|
-
});
|
|
1283
|
-
}
|
|
1284
|
-
};
|
|
1285
|
-
var PositionOutOfBoundsError = class extends BaseError {
|
|
1286
|
-
constructor({ length, position }) {
|
|
1287
|
-
super(`Position \`${position}\` is out of bounds (\`0 < position < ${length}\`).`, { name: "PositionOutOfBoundsError" });
|
|
1288
|
-
}
|
|
1289
|
-
};
|
|
1290
|
-
var RecursiveReadLimitExceededError = class extends BaseError {
|
|
1291
|
-
constructor({ count, limit }) {
|
|
1292
|
-
super(`Recursive read limit of \`${limit}\` exceeded (recursive read count: \`${count}\`).`, { name: "RecursiveReadLimitExceededError" });
|
|
1293
|
-
}
|
|
1294
|
-
};
|
|
1295
|
-
|
|
1296
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/cursor.js
|
|
1297
|
-
var staticCursor = {
|
|
1298
|
-
bytes: new Uint8Array(),
|
|
1299
|
-
dataView: new DataView(new ArrayBuffer(0)),
|
|
1300
|
-
position: 0,
|
|
1301
|
-
positionReadCount: /* @__PURE__ */ new Map(),
|
|
1302
|
-
recursiveReadCount: 0,
|
|
1303
|
-
recursiveReadLimit: Number.POSITIVE_INFINITY,
|
|
1304
|
-
assertReadLimit() {
|
|
1305
|
-
if (this.recursiveReadCount >= this.recursiveReadLimit)
|
|
1306
|
-
throw new RecursiveReadLimitExceededError({
|
|
1307
|
-
count: this.recursiveReadCount + 1,
|
|
1308
|
-
limit: this.recursiveReadLimit
|
|
1309
|
-
});
|
|
1310
|
-
},
|
|
1311
|
-
assertPosition(position) {
|
|
1312
|
-
if (position < 0 || position > this.bytes.length - 1)
|
|
1313
|
-
throw new PositionOutOfBoundsError({
|
|
1314
|
-
length: this.bytes.length,
|
|
1315
|
-
position
|
|
1316
|
-
});
|
|
1317
|
-
},
|
|
1318
|
-
decrementPosition(offset) {
|
|
1319
|
-
if (offset < 0)
|
|
1320
|
-
throw new NegativeOffsetError({ offset });
|
|
1321
|
-
const position = this.position - offset;
|
|
1322
|
-
this.assertPosition(position);
|
|
1323
|
-
this.position = position;
|
|
1324
|
-
},
|
|
1325
|
-
getReadCount(position) {
|
|
1326
|
-
return this.positionReadCount.get(position || this.position) || 0;
|
|
1327
|
-
},
|
|
1328
|
-
incrementPosition(offset) {
|
|
1329
|
-
if (offset < 0)
|
|
1330
|
-
throw new NegativeOffsetError({ offset });
|
|
1331
|
-
const position = this.position + offset;
|
|
1332
|
-
this.assertPosition(position);
|
|
1333
|
-
this.position = position;
|
|
1334
|
-
},
|
|
1335
|
-
inspectByte(position_) {
|
|
1336
|
-
const position = position_ ?? this.position;
|
|
1337
|
-
this.assertPosition(position);
|
|
1338
|
-
return this.bytes[position];
|
|
1339
|
-
},
|
|
1340
|
-
inspectBytes(length, position_) {
|
|
1341
|
-
const position = position_ ?? this.position;
|
|
1342
|
-
this.assertPosition(position + length - 1);
|
|
1343
|
-
return this.bytes.subarray(position, position + length);
|
|
1344
|
-
},
|
|
1345
|
-
inspectUint8(position_) {
|
|
1346
|
-
const position = position_ ?? this.position;
|
|
1347
|
-
this.assertPosition(position);
|
|
1348
|
-
return this.bytes[position];
|
|
1349
|
-
},
|
|
1350
|
-
inspectUint16(position_) {
|
|
1351
|
-
const position = position_ ?? this.position;
|
|
1352
|
-
this.assertPosition(position + 1);
|
|
1353
|
-
return this.dataView.getUint16(position);
|
|
1354
|
-
},
|
|
1355
|
-
inspectUint24(position_) {
|
|
1356
|
-
const position = position_ ?? this.position;
|
|
1357
|
-
this.assertPosition(position + 2);
|
|
1358
|
-
return (this.dataView.getUint16(position) << 8) + this.dataView.getUint8(position + 2);
|
|
1359
|
-
},
|
|
1360
|
-
inspectUint32(position_) {
|
|
1361
|
-
const position = position_ ?? this.position;
|
|
1362
|
-
this.assertPosition(position + 3);
|
|
1363
|
-
return this.dataView.getUint32(position);
|
|
1364
|
-
},
|
|
1365
|
-
pushByte(byte) {
|
|
1366
|
-
this.assertPosition(this.position);
|
|
1367
|
-
this.bytes[this.position] = byte;
|
|
1368
|
-
this.position++;
|
|
1369
|
-
},
|
|
1370
|
-
pushBytes(bytes) {
|
|
1371
|
-
this.assertPosition(this.position + bytes.length - 1);
|
|
1372
|
-
this.bytes.set(bytes, this.position);
|
|
1373
|
-
this.position += bytes.length;
|
|
1374
|
-
},
|
|
1375
|
-
pushUint8(value) {
|
|
1376
|
-
this.assertPosition(this.position);
|
|
1377
|
-
this.bytes[this.position] = value;
|
|
1378
|
-
this.position++;
|
|
1379
|
-
},
|
|
1380
|
-
pushUint16(value) {
|
|
1381
|
-
this.assertPosition(this.position + 1);
|
|
1382
|
-
this.dataView.setUint16(this.position, value);
|
|
1383
|
-
this.position += 2;
|
|
1384
|
-
},
|
|
1385
|
-
pushUint24(value) {
|
|
1386
|
-
this.assertPosition(this.position + 2);
|
|
1387
|
-
this.dataView.setUint16(this.position, value >> 8);
|
|
1388
|
-
this.dataView.setUint8(this.position + 2, value & ~4294967040);
|
|
1389
|
-
this.position += 3;
|
|
1390
|
-
},
|
|
1391
|
-
pushUint32(value) {
|
|
1392
|
-
this.assertPosition(this.position + 3);
|
|
1393
|
-
this.dataView.setUint32(this.position, value);
|
|
1394
|
-
this.position += 4;
|
|
1395
|
-
},
|
|
1396
|
-
readByte() {
|
|
1397
|
-
this.assertReadLimit();
|
|
1398
|
-
this._touch();
|
|
1399
|
-
const value = this.inspectByte();
|
|
1400
|
-
this.position++;
|
|
1401
|
-
return value;
|
|
1402
|
-
},
|
|
1403
|
-
readBytes(length, size2) {
|
|
1404
|
-
this.assertReadLimit();
|
|
1405
|
-
this._touch();
|
|
1406
|
-
const value = this.inspectBytes(length);
|
|
1407
|
-
this.position += size2 ?? length;
|
|
1408
|
-
return value;
|
|
1409
|
-
},
|
|
1410
|
-
readUint8() {
|
|
1411
|
-
this.assertReadLimit();
|
|
1412
|
-
this._touch();
|
|
1413
|
-
const value = this.inspectUint8();
|
|
1414
|
-
this.position += 1;
|
|
1415
|
-
return value;
|
|
1416
|
-
},
|
|
1417
|
-
readUint16() {
|
|
1418
|
-
this.assertReadLimit();
|
|
1419
|
-
this._touch();
|
|
1420
|
-
const value = this.inspectUint16();
|
|
1421
|
-
this.position += 2;
|
|
1422
|
-
return value;
|
|
1423
|
-
},
|
|
1424
|
-
readUint24() {
|
|
1425
|
-
this.assertReadLimit();
|
|
1426
|
-
this._touch();
|
|
1427
|
-
const value = this.inspectUint24();
|
|
1428
|
-
this.position += 3;
|
|
1429
|
-
return value;
|
|
1430
|
-
},
|
|
1431
|
-
readUint32() {
|
|
1432
|
-
this.assertReadLimit();
|
|
1433
|
-
this._touch();
|
|
1434
|
-
const value = this.inspectUint32();
|
|
1435
|
-
this.position += 4;
|
|
1436
|
-
return value;
|
|
1437
|
-
},
|
|
1438
|
-
get remaining() {
|
|
1439
|
-
return this.bytes.length - this.position;
|
|
1440
|
-
},
|
|
1441
|
-
setPosition(position) {
|
|
1442
|
-
const oldPosition = this.position;
|
|
1443
|
-
this.assertPosition(position);
|
|
1444
|
-
this.position = position;
|
|
1445
|
-
return () => this.position = oldPosition;
|
|
1446
|
-
},
|
|
1447
|
-
_touch() {
|
|
1448
|
-
if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)
|
|
1449
|
-
return;
|
|
1450
|
-
const count = this.getReadCount();
|
|
1451
|
-
this.positionReadCount.set(this.position, count + 1);
|
|
1452
|
-
if (count > 0)
|
|
1453
|
-
this.recursiveReadCount++;
|
|
1454
|
-
}
|
|
1455
|
-
};
|
|
1456
|
-
function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
|
|
1457
|
-
const cursor = Object.create(staticCursor);
|
|
1458
|
-
cursor.bytes = bytes;
|
|
1459
|
-
cursor.dataView = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
1460
|
-
cursor.positionReadCount = /* @__PURE__ */ new Map();
|
|
1461
|
-
cursor.recursiveReadLimit = recursiveReadLimit;
|
|
1462
|
-
return cursor;
|
|
1463
|
-
}
|
|
1464
|
-
|
|
1465
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/encoding/fromBytes.js
|
|
1466
|
-
function bytesToBigInt(bytes, opts = {}) {
|
|
1467
|
-
if (typeof opts.size !== "undefined")
|
|
1468
|
-
assertSize(bytes, { size: opts.size });
|
|
1469
|
-
const hex = bytesToHex(bytes, opts);
|
|
1470
|
-
return hexToBigInt(hex, opts);
|
|
1471
|
-
}
|
|
1472
|
-
function bytesToBool(bytes_, opts = {}) {
|
|
1473
|
-
let bytes = bytes_;
|
|
1474
|
-
if (typeof opts.size !== "undefined") {
|
|
1475
|
-
assertSize(bytes, { size: opts.size });
|
|
1476
|
-
bytes = trim(bytes);
|
|
1477
|
-
}
|
|
1478
|
-
if (bytes.length > 1 || bytes[0] > 1)
|
|
1479
|
-
throw new InvalidBytesBooleanError(bytes);
|
|
1480
|
-
return Boolean(bytes[0]);
|
|
1481
|
-
}
|
|
1482
|
-
function bytesToNumber(bytes, opts = {}) {
|
|
1483
|
-
if (typeof opts.size !== "undefined")
|
|
1484
|
-
assertSize(bytes, { size: opts.size });
|
|
1485
|
-
const hex = bytesToHex(bytes, opts);
|
|
1486
|
-
return hexToNumber(hex, opts);
|
|
1487
|
-
}
|
|
1488
|
-
function bytesToString(bytes_, opts = {}) {
|
|
1489
|
-
let bytes = bytes_;
|
|
1490
|
-
if (typeof opts.size !== "undefined") {
|
|
1491
|
-
assertSize(bytes, { size: opts.size });
|
|
1492
|
-
bytes = trim(bytes, { dir: "right" });
|
|
1493
|
-
}
|
|
1494
|
-
return new TextDecoder().decode(bytes);
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/abi/decodeAbiParameters.js
|
|
1498
|
-
function decodeAbiParameters(params, data) {
|
|
1499
|
-
const bytes = typeof data === "string" ? hexToBytes(data) : data;
|
|
1500
|
-
const cursor = createCursor(bytes);
|
|
1501
|
-
if (size(bytes) === 0 && params.length > 0)
|
|
1502
|
-
throw new AbiDecodingZeroDataError();
|
|
1503
|
-
if (size(data) && size(data) < 32)
|
|
1504
|
-
throw new AbiDecodingDataSizeTooSmallError({
|
|
1505
|
-
data: typeof data === "string" ? data : bytesToHex(data),
|
|
1506
|
-
params,
|
|
1507
|
-
size: size(data)
|
|
1508
|
-
});
|
|
1509
|
-
let consumed = 0;
|
|
1510
|
-
const values = [];
|
|
1511
|
-
for (let i = 0; i < params.length; ++i) {
|
|
1512
|
-
const param = params[i];
|
|
1513
|
-
cursor.setPosition(consumed);
|
|
1514
|
-
const [data2, consumed_] = decodeParameter(cursor, param, {
|
|
1515
|
-
staticPosition: 0
|
|
1516
|
-
});
|
|
1517
|
-
consumed += consumed_;
|
|
1518
|
-
values.push(data2);
|
|
1519
|
-
}
|
|
1520
|
-
return values;
|
|
1521
|
-
}
|
|
1522
|
-
function decodeParameter(cursor, param, { staticPosition }) {
|
|
1523
|
-
const arrayComponents = getArrayComponents(param.type);
|
|
1524
|
-
if (arrayComponents) {
|
|
1525
|
-
const [length, type] = arrayComponents;
|
|
1526
|
-
return decodeArray(cursor, { ...param, type }, { length, staticPosition });
|
|
1527
|
-
}
|
|
1528
|
-
if (param.type === "tuple")
|
|
1529
|
-
return decodeTuple(cursor, param, { staticPosition });
|
|
1530
|
-
if (param.type === "address")
|
|
1531
|
-
return decodeAddress(cursor);
|
|
1532
|
-
if (param.type === "bool")
|
|
1533
|
-
return decodeBool(cursor);
|
|
1534
|
-
if (param.type.startsWith("bytes"))
|
|
1535
|
-
return decodeBytes(cursor, param, { staticPosition });
|
|
1536
|
-
if (param.type.startsWith("uint") || param.type.startsWith("int"))
|
|
1537
|
-
return decodeNumber(cursor, param);
|
|
1538
|
-
if (param.type === "string")
|
|
1539
|
-
return decodeString(cursor, { staticPosition });
|
|
1540
|
-
throw new InvalidAbiDecodingTypeError(param.type, {
|
|
1541
|
-
docsPath: "/docs/contract/decodeAbiParameters"
|
|
1542
|
-
});
|
|
1543
|
-
}
|
|
1544
|
-
var sizeOfLength = 32;
|
|
1545
|
-
var sizeOfOffset = 32;
|
|
1546
|
-
function decodeAddress(cursor) {
|
|
1547
|
-
const value = cursor.readBytes(32);
|
|
1548
|
-
return [checksumAddress(bytesToHex(sliceBytes(value, -20))), 32];
|
|
1549
|
-
}
|
|
1550
|
-
function decodeArray(cursor, param, { length, staticPosition }) {
|
|
1551
|
-
if (!length) {
|
|
1552
|
-
const offset = bytesToNumber(cursor.readBytes(sizeOfOffset));
|
|
1553
|
-
const start = staticPosition + offset;
|
|
1554
|
-
const startOfData = start + sizeOfLength;
|
|
1555
|
-
cursor.setPosition(start);
|
|
1556
|
-
const length2 = bytesToNumber(cursor.readBytes(sizeOfLength));
|
|
1557
|
-
const dynamicChild = hasDynamicChild(param);
|
|
1558
|
-
let consumed2 = 0;
|
|
1559
|
-
const value2 = [];
|
|
1560
|
-
for (let i = 0; i < length2; ++i) {
|
|
1561
|
-
cursor.setPosition(startOfData + (dynamicChild ? i * 32 : consumed2));
|
|
1562
|
-
const [data, consumed_] = decodeParameter(cursor, param, {
|
|
1563
|
-
staticPosition: startOfData
|
|
1564
|
-
});
|
|
1565
|
-
consumed2 += consumed_;
|
|
1566
|
-
value2.push(data);
|
|
1567
|
-
}
|
|
1568
|
-
cursor.setPosition(staticPosition + 32);
|
|
1569
|
-
return [value2, 32];
|
|
1570
|
-
}
|
|
1571
|
-
if (hasDynamicChild(param)) {
|
|
1572
|
-
const offset = bytesToNumber(cursor.readBytes(sizeOfOffset));
|
|
1573
|
-
const start = staticPosition + offset;
|
|
1574
|
-
const value2 = [];
|
|
1575
|
-
for (let i = 0; i < length; ++i) {
|
|
1576
|
-
cursor.setPosition(start + i * 32);
|
|
1577
|
-
const [data] = decodeParameter(cursor, param, {
|
|
1578
|
-
staticPosition: start
|
|
1579
|
-
});
|
|
1580
|
-
value2.push(data);
|
|
1581
|
-
}
|
|
1582
|
-
cursor.setPosition(staticPosition + 32);
|
|
1583
|
-
return [value2, 32];
|
|
1584
|
-
}
|
|
1585
|
-
let consumed = 0;
|
|
1586
|
-
const value = [];
|
|
1587
|
-
for (let i = 0; i < length; ++i) {
|
|
1588
|
-
const [data, consumed_] = decodeParameter(cursor, param, {
|
|
1589
|
-
staticPosition: staticPosition + consumed
|
|
1590
|
-
});
|
|
1591
|
-
consumed += consumed_;
|
|
1592
|
-
value.push(data);
|
|
1593
|
-
}
|
|
1594
|
-
return [value, consumed];
|
|
1595
|
-
}
|
|
1596
|
-
function decodeBool(cursor) {
|
|
1597
|
-
return [bytesToBool(cursor.readBytes(32), { size: 32 }), 32];
|
|
1598
|
-
}
|
|
1599
|
-
function decodeBytes(cursor, param, { staticPosition }) {
|
|
1600
|
-
const [_, size2] = param.type.split("bytes");
|
|
1601
|
-
if (!size2) {
|
|
1602
|
-
const offset = bytesToNumber(cursor.readBytes(32));
|
|
1603
|
-
cursor.setPosition(staticPosition + offset);
|
|
1604
|
-
const length = bytesToNumber(cursor.readBytes(32));
|
|
1605
|
-
if (length === 0) {
|
|
1606
|
-
cursor.setPosition(staticPosition + 32);
|
|
1607
|
-
return ["0x", 32];
|
|
1608
|
-
}
|
|
1609
|
-
const data = cursor.readBytes(length);
|
|
1610
|
-
cursor.setPosition(staticPosition + 32);
|
|
1611
|
-
return [bytesToHex(data), 32];
|
|
1612
|
-
}
|
|
1613
|
-
const value = bytesToHex(cursor.readBytes(Number.parseInt(size2), 32));
|
|
1614
|
-
return [value, 32];
|
|
1615
|
-
}
|
|
1616
|
-
function decodeNumber(cursor, param) {
|
|
1617
|
-
const signed = param.type.startsWith("int");
|
|
1618
|
-
const size2 = Number.parseInt(param.type.split("int")[1] || "256");
|
|
1619
|
-
const value = cursor.readBytes(32);
|
|
1620
|
-
return [
|
|
1621
|
-
size2 > 48 ? bytesToBigInt(value, { signed }) : bytesToNumber(value, { signed }),
|
|
1622
|
-
32
|
|
1623
|
-
];
|
|
1624
|
-
}
|
|
1625
|
-
function decodeTuple(cursor, param, { staticPosition }) {
|
|
1626
|
-
const hasUnnamedChild = param.components.length === 0 || param.components.some(({ name }) => !name);
|
|
1627
|
-
const value = hasUnnamedChild ? [] : {};
|
|
1628
|
-
let consumed = 0;
|
|
1629
|
-
if (hasDynamicChild(param)) {
|
|
1630
|
-
const offset = bytesToNumber(cursor.readBytes(sizeOfOffset));
|
|
1631
|
-
const start = staticPosition + offset;
|
|
1632
|
-
for (let i = 0; i < param.components.length; ++i) {
|
|
1633
|
-
const component = param.components[i];
|
|
1634
|
-
cursor.setPosition(start + consumed);
|
|
1635
|
-
const [data, consumed_] = decodeParameter(cursor, component, {
|
|
1636
|
-
staticPosition: start
|
|
1637
|
-
});
|
|
1638
|
-
consumed += consumed_;
|
|
1639
|
-
value[hasUnnamedChild ? i : component == null ? void 0 : component.name] = data;
|
|
1640
|
-
}
|
|
1641
|
-
cursor.setPosition(staticPosition + 32);
|
|
1642
|
-
return [value, 32];
|
|
1643
|
-
}
|
|
1644
|
-
for (let i = 0; i < param.components.length; ++i) {
|
|
1645
|
-
const component = param.components[i];
|
|
1646
|
-
const [data, consumed_] = decodeParameter(cursor, component, {
|
|
1647
|
-
staticPosition
|
|
1648
|
-
});
|
|
1649
|
-
value[hasUnnamedChild ? i : component == null ? void 0 : component.name] = data;
|
|
1650
|
-
consumed += consumed_;
|
|
1651
|
-
}
|
|
1652
|
-
return [value, consumed];
|
|
1653
|
-
}
|
|
1654
|
-
function decodeString(cursor, { staticPosition }) {
|
|
1655
|
-
const offset = bytesToNumber(cursor.readBytes(32));
|
|
1656
|
-
const start = staticPosition + offset;
|
|
1657
|
-
cursor.setPosition(start);
|
|
1658
|
-
const length = bytesToNumber(cursor.readBytes(32));
|
|
1659
|
-
if (length === 0) {
|
|
1660
|
-
cursor.setPosition(staticPosition + 32);
|
|
1661
|
-
return ["", 32];
|
|
1662
|
-
}
|
|
1663
|
-
const data = cursor.readBytes(length, 32);
|
|
1664
|
-
const value = bytesToString(trim(data));
|
|
1665
|
-
cursor.setPosition(staticPosition + 32);
|
|
1666
|
-
return [value, 32];
|
|
1667
|
-
}
|
|
1668
|
-
function hasDynamicChild(param) {
|
|
1669
|
-
var _a;
|
|
1670
|
-
const { type } = param;
|
|
1671
|
-
if (type === "string")
|
|
1672
|
-
return true;
|
|
1673
|
-
if (type === "bytes")
|
|
1674
|
-
return true;
|
|
1675
|
-
if (type.endsWith("[]"))
|
|
1676
|
-
return true;
|
|
1677
|
-
if (type === "tuple")
|
|
1678
|
-
return (_a = param.components) == null ? void 0 : _a.some(hasDynamicChild);
|
|
1679
|
-
const arrayComponents = getArrayComponents(param.type);
|
|
1680
|
-
if (arrayComponents && hasDynamicChild({ ...param, type: arrayComponents[1] }))
|
|
1681
|
-
return true;
|
|
1682
|
-
return false;
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/abi/decodeErrorResult.js
|
|
1686
|
-
function decodeErrorResult(parameters) {
|
|
1687
|
-
const { abi, data } = parameters;
|
|
1688
|
-
const signature = slice(data, 0, 4);
|
|
1689
|
-
if (signature === "0x")
|
|
1690
|
-
throw new AbiDecodingZeroDataError();
|
|
1691
|
-
const abi_ = [...abi || [], solidityError, solidityPanic];
|
|
1692
|
-
const abiItem = abi_.find((x) => x.type === "error" && signature === toFunctionSelector(formatAbiItem2(x)));
|
|
1693
|
-
if (!abiItem)
|
|
1694
|
-
throw new AbiErrorSignatureNotFoundError(signature, {
|
|
1695
|
-
docsPath: "/docs/contract/decodeErrorResult"
|
|
1696
|
-
});
|
|
1697
|
-
return {
|
|
1698
|
-
abiItem,
|
|
1699
|
-
args: "inputs" in abiItem && abiItem.inputs && abiItem.inputs.length > 0 ? decodeAbiParameters(abiItem.inputs, slice(data, 4)) : void 0,
|
|
1700
|
-
errorName: abiItem.name
|
|
1701
|
-
};
|
|
1702
|
-
}
|
|
1703
|
-
|
|
1704
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/accounts/utils/parseAccount.js
|
|
1705
|
-
function parseAccount(account) {
|
|
1706
|
-
if (typeof account === "string")
|
|
1707
|
-
return { address: account, type: "json-rpc" };
|
|
1708
|
-
return account;
|
|
1709
|
-
}
|
|
1710
|
-
|
|
1711
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/chain.js
|
|
1712
|
-
var ChainDoesNotSupportContract = class extends BaseError {
|
|
1713
|
-
constructor({ blockNumber, chain, contract }) {
|
|
1714
|
-
super(`Chain "${chain.name}" does not support contract "${contract.name}".`, {
|
|
1715
|
-
metaMessages: [
|
|
1716
|
-
"This could be due to any of the following:",
|
|
1717
|
-
...blockNumber && contract.blockCreated && contract.blockCreated > blockNumber ? [
|
|
1718
|
-
`- The contract "${contract.name}" was not deployed until block ${contract.blockCreated} (current block ${blockNumber}).`
|
|
1719
|
-
] : [
|
|
1720
|
-
`- The chain does not have the contract "${contract.name}" configured.`
|
|
1721
|
-
]
|
|
1722
|
-
],
|
|
1723
|
-
name: "ChainDoesNotSupportContract"
|
|
1724
|
-
});
|
|
1725
|
-
}
|
|
1726
|
-
};
|
|
1727
|
-
var ChainMismatchError = class extends BaseError {
|
|
1728
|
-
constructor({ chain, currentChainId }) {
|
|
1729
|
-
super(`The current chain of the wallet (id: ${currentChainId}) does not match the target chain for the transaction (id: ${chain.id} – ${chain.name}).`, {
|
|
1730
|
-
metaMessages: [
|
|
1731
|
-
`Current Chain ID: ${currentChainId}`,
|
|
1732
|
-
`Expected Chain ID: ${chain.id} – ${chain.name}`
|
|
1733
|
-
],
|
|
1734
|
-
name: "ChainMismatchError"
|
|
1735
|
-
});
|
|
1736
|
-
}
|
|
1737
|
-
};
|
|
1738
|
-
var ChainNotFoundError = class extends BaseError {
|
|
1739
|
-
constructor() {
|
|
1740
|
-
super([
|
|
1741
|
-
"No chain was provided to the request.",
|
|
1742
|
-
"Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."
|
|
1743
|
-
].join("\n"), {
|
|
1744
|
-
name: "ChainNotFoundError"
|
|
1745
|
-
});
|
|
1746
|
-
}
|
|
1747
|
-
};
|
|
1748
|
-
var ClientChainNotConfiguredError = class extends BaseError {
|
|
1749
|
-
constructor() {
|
|
1750
|
-
super("No chain was provided to the Client.", {
|
|
1751
|
-
name: "ClientChainNotConfiguredError"
|
|
1752
|
-
});
|
|
1753
|
-
}
|
|
1754
|
-
};
|
|
1755
|
-
var InvalidChainIdError = class extends BaseError {
|
|
1756
|
-
constructor({ chainId }) {
|
|
1757
|
-
super(typeof chainId === "number" ? `Chain ID "${chainId}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
|
|
1758
|
-
}
|
|
1759
|
-
};
|
|
1760
|
-
|
|
1761
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/constants/unit.js
|
|
1762
|
-
var etherUnits = {
|
|
1763
|
-
gwei: 9,
|
|
1764
|
-
wei: 18
|
|
1765
|
-
};
|
|
1766
|
-
var gweiUnits = {
|
|
1767
|
-
ether: -9,
|
|
1768
|
-
wei: 9
|
|
1769
|
-
};
|
|
1770
|
-
var weiUnits = {
|
|
1771
|
-
ether: -18,
|
|
1772
|
-
gwei: -9
|
|
1773
|
-
};
|
|
1774
|
-
|
|
1775
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/unit/formatUnits.js
|
|
1776
|
-
function formatUnits(value, decimals) {
|
|
1777
|
-
let display = value.toString();
|
|
1778
|
-
const negative = display.startsWith("-");
|
|
1779
|
-
if (negative)
|
|
1780
|
-
display = display.slice(1);
|
|
1781
|
-
display = display.padStart(decimals, "0");
|
|
1782
|
-
let [integer, fraction] = [
|
|
1783
|
-
display.slice(0, display.length - decimals),
|
|
1784
|
-
display.slice(display.length - decimals)
|
|
1785
|
-
];
|
|
1786
|
-
fraction = fraction.replace(/(0+)$/, "");
|
|
1787
|
-
return `${negative ? "-" : ""}${integer || "0"}${fraction ? `.${fraction}` : ""}`;
|
|
1788
|
-
}
|
|
1789
|
-
|
|
1790
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/unit/formatGwei.js
|
|
1791
|
-
function formatGwei(wei, unit = "wei") {
|
|
1792
|
-
return formatUnits(wei, gweiUnits[unit]);
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/node.js
|
|
1796
|
-
var ExecutionRevertedError = class extends BaseError {
|
|
1797
|
-
constructor({ cause, message } = {}) {
|
|
1798
|
-
var _a;
|
|
1799
|
-
const reason = (_a = message == null ? void 0 : message.replace("execution reverted: ", "")) == null ? void 0 : _a.replace("execution reverted", "");
|
|
1800
|
-
super(`Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`, {
|
|
1801
|
-
cause,
|
|
1802
|
-
name: "ExecutionRevertedError"
|
|
1803
|
-
});
|
|
1804
|
-
}
|
|
1805
|
-
};
|
|
1806
|
-
Object.defineProperty(ExecutionRevertedError, "code", {
|
|
1807
|
-
enumerable: true,
|
|
1808
|
-
configurable: true,
|
|
1809
|
-
writable: true,
|
|
1810
|
-
value: 3
|
|
1811
|
-
});
|
|
1812
|
-
Object.defineProperty(ExecutionRevertedError, "nodeMessage", {
|
|
1813
|
-
enumerable: true,
|
|
1814
|
-
configurable: true,
|
|
1815
|
-
writable: true,
|
|
1816
|
-
value: /execution reverted/
|
|
1817
|
-
});
|
|
1818
|
-
var FeeCapTooHighError = class extends BaseError {
|
|
1819
|
-
constructor({ cause, maxFeePerGas } = {}) {
|
|
1820
|
-
super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
|
|
1821
|
-
cause,
|
|
1822
|
-
name: "FeeCapTooHighError"
|
|
1823
|
-
});
|
|
1824
|
-
}
|
|
1825
|
-
};
|
|
1826
|
-
Object.defineProperty(FeeCapTooHighError, "nodeMessage", {
|
|
1827
|
-
enumerable: true,
|
|
1828
|
-
configurable: true,
|
|
1829
|
-
writable: true,
|
|
1830
|
-
value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
|
|
1831
|
-
});
|
|
1832
|
-
var FeeCapTooLowError = class extends BaseError {
|
|
1833
|
-
constructor({ cause, maxFeePerGas } = {}) {
|
|
1834
|
-
super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ""} gwei) cannot be lower than the block base fee.`, {
|
|
1835
|
-
cause,
|
|
1836
|
-
name: "FeeCapTooLowError"
|
|
1837
|
-
});
|
|
1838
|
-
}
|
|
1839
|
-
};
|
|
1840
|
-
Object.defineProperty(FeeCapTooLowError, "nodeMessage", {
|
|
1841
|
-
enumerable: true,
|
|
1842
|
-
configurable: true,
|
|
1843
|
-
writable: true,
|
|
1844
|
-
value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/
|
|
1845
|
-
});
|
|
1846
|
-
var NonceTooHighError = class extends BaseError {
|
|
1847
|
-
constructor({ cause, nonce } = {}) {
|
|
1848
|
-
super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is higher than the next one expected.`, { cause, name: "NonceTooHighError" });
|
|
1849
|
-
}
|
|
1850
|
-
};
|
|
1851
|
-
Object.defineProperty(NonceTooHighError, "nodeMessage", {
|
|
1852
|
-
enumerable: true,
|
|
1853
|
-
configurable: true,
|
|
1854
|
-
writable: true,
|
|
1855
|
-
value: /nonce too high/
|
|
1856
|
-
});
|
|
1857
|
-
var NonceTooLowError = class extends BaseError {
|
|
1858
|
-
constructor({ cause, nonce } = {}) {
|
|
1859
|
-
super([
|
|
1860
|
-
`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is lower than the current nonce of the account.`,
|
|
1861
|
-
"Try increasing the nonce or find the latest nonce with `getTransactionCount`."
|
|
1862
|
-
].join("\n"), { cause, name: "NonceTooLowError" });
|
|
1863
|
-
}
|
|
1864
|
-
};
|
|
1865
|
-
Object.defineProperty(NonceTooLowError, "nodeMessage", {
|
|
1866
|
-
enumerable: true,
|
|
1867
|
-
configurable: true,
|
|
1868
|
-
writable: true,
|
|
1869
|
-
value: /nonce too low|transaction already imported|already known/
|
|
1870
|
-
});
|
|
1871
|
-
var NonceMaxValueError = class extends BaseError {
|
|
1872
|
-
constructor({ cause, nonce } = {}) {
|
|
1873
|
-
super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}exceeds the maximum allowed nonce.`, { cause, name: "NonceMaxValueError" });
|
|
1874
|
-
}
|
|
1875
|
-
};
|
|
1876
|
-
Object.defineProperty(NonceMaxValueError, "nodeMessage", {
|
|
1877
|
-
enumerable: true,
|
|
1878
|
-
configurable: true,
|
|
1879
|
-
writable: true,
|
|
1880
|
-
value: /nonce has max value/
|
|
1881
|
-
});
|
|
1882
|
-
var InsufficientFundsError = class extends BaseError {
|
|
1883
|
-
constructor({ cause } = {}) {
|
|
1884
|
-
super([
|
|
1885
|
-
"The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."
|
|
1886
|
-
].join("\n"), {
|
|
1887
|
-
cause,
|
|
1888
|
-
metaMessages: [
|
|
1889
|
-
"This error could arise when the account does not have enough funds to:",
|
|
1890
|
-
" - pay for the total gas fee,",
|
|
1891
|
-
" - pay for the value to send.",
|
|
1892
|
-
" ",
|
|
1893
|
-
"The cost of the transaction is calculated as `gas * gas fee + value`, where:",
|
|
1894
|
-
" - `gas` is the amount of gas needed for transaction to execute,",
|
|
1895
|
-
" - `gas fee` is the gas fee,",
|
|
1896
|
-
" - `value` is the amount of ether to send to the recipient."
|
|
1897
|
-
],
|
|
1898
|
-
name: "InsufficientFundsError"
|
|
1899
|
-
});
|
|
1900
|
-
}
|
|
1901
|
-
};
|
|
1902
|
-
Object.defineProperty(InsufficientFundsError, "nodeMessage", {
|
|
1903
|
-
enumerable: true,
|
|
1904
|
-
configurable: true,
|
|
1905
|
-
writable: true,
|
|
1906
|
-
value: /insufficient funds|exceeds transaction sender account balance/
|
|
1907
|
-
});
|
|
1908
|
-
var IntrinsicGasTooHighError = class extends BaseError {
|
|
1909
|
-
constructor({ cause, gas } = {}) {
|
|
1910
|
-
super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction exceeds the limit allowed for the block.`, {
|
|
1911
|
-
cause,
|
|
1912
|
-
name: "IntrinsicGasTooHighError"
|
|
1913
|
-
});
|
|
1914
|
-
}
|
|
1915
|
-
};
|
|
1916
|
-
Object.defineProperty(IntrinsicGasTooHighError, "nodeMessage", {
|
|
1917
|
-
enumerable: true,
|
|
1918
|
-
configurable: true,
|
|
1919
|
-
writable: true,
|
|
1920
|
-
value: /intrinsic gas too high|gas limit reached/
|
|
1921
|
-
});
|
|
1922
|
-
var IntrinsicGasTooLowError = class extends BaseError {
|
|
1923
|
-
constructor({ cause, gas } = {}) {
|
|
1924
|
-
super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction is too low.`, {
|
|
1925
|
-
cause,
|
|
1926
|
-
name: "IntrinsicGasTooLowError"
|
|
1927
|
-
});
|
|
1928
|
-
}
|
|
1929
|
-
};
|
|
1930
|
-
Object.defineProperty(IntrinsicGasTooLowError, "nodeMessage", {
|
|
1931
|
-
enumerable: true,
|
|
1932
|
-
configurable: true,
|
|
1933
|
-
writable: true,
|
|
1934
|
-
value: /intrinsic gas too low/
|
|
1935
|
-
});
|
|
1936
|
-
var TransactionTypeNotSupportedError = class extends BaseError {
|
|
1937
|
-
constructor({ cause }) {
|
|
1938
|
-
super("The transaction type is not supported for this chain.", {
|
|
1939
|
-
cause,
|
|
1940
|
-
name: "TransactionTypeNotSupportedError"
|
|
1941
|
-
});
|
|
1942
|
-
}
|
|
1943
|
-
};
|
|
1944
|
-
Object.defineProperty(TransactionTypeNotSupportedError, "nodeMessage", {
|
|
1945
|
-
enumerable: true,
|
|
1946
|
-
configurable: true,
|
|
1947
|
-
writable: true,
|
|
1948
|
-
value: /transaction type not valid/
|
|
1949
|
-
});
|
|
1950
|
-
var TipAboveFeeCapError = class extends BaseError {
|
|
1951
|
-
constructor({ cause, maxPriorityFeePerGas, maxFeePerGas } = {}) {
|
|
1952
|
-
super([
|
|
1953
|
-
`The provided tip (\`maxPriorityFeePerGas\`${maxPriorityFeePerGas ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}).`
|
|
1954
|
-
].join("\n"), {
|
|
1955
|
-
cause,
|
|
1956
|
-
name: "TipAboveFeeCapError"
|
|
1957
|
-
});
|
|
1958
|
-
}
|
|
1959
|
-
};
|
|
1960
|
-
Object.defineProperty(TipAboveFeeCapError, "nodeMessage", {
|
|
1961
|
-
enumerable: true,
|
|
1962
|
-
configurable: true,
|
|
1963
|
-
writable: true,
|
|
1964
|
-
value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
|
|
1965
|
-
});
|
|
1966
|
-
var UnknownNodeError = class extends BaseError {
|
|
1967
|
-
constructor({ cause }) {
|
|
1968
|
-
super(`An error occurred while executing: ${cause == null ? void 0 : cause.shortMessage}`, {
|
|
1969
|
-
cause,
|
|
1970
|
-
name: "UnknownNodeError"
|
|
1971
|
-
});
|
|
1972
|
-
}
|
|
1973
|
-
};
|
|
1974
|
-
|
|
1975
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/unit/formatEther.js
|
|
1976
|
-
function formatEther(wei, unit = "wei") {
|
|
1977
|
-
return formatUnits(wei, etherUnits[unit]);
|
|
1978
|
-
}
|
|
1979
|
-
|
|
1980
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/transaction.js
|
|
1981
|
-
function prettyPrint(args) {
|
|
1982
|
-
const entries = Object.entries(args).map(([key, value]) => {
|
|
1983
|
-
if (value === void 0 || value === false)
|
|
1984
|
-
return null;
|
|
1985
|
-
return [key, value];
|
|
1986
|
-
}).filter(Boolean);
|
|
1987
|
-
const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);
|
|
1988
|
-
return entries.map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`).join("\n");
|
|
1989
|
-
}
|
|
1990
|
-
var FeeConflictError = class extends BaseError {
|
|
1991
|
-
constructor() {
|
|
1992
|
-
super([
|
|
1993
|
-
"Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.",
|
|
1994
|
-
"Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."
|
|
1995
|
-
].join("\n"), { name: "FeeConflictError" });
|
|
1996
|
-
}
|
|
1997
|
-
};
|
|
1998
|
-
var InvalidLegacyVError = class extends BaseError {
|
|
1999
|
-
constructor({ v }) {
|
|
2000
|
-
super(`Invalid \`v\` value "${v}". Expected 27 or 28.`, {
|
|
2001
|
-
name: "InvalidLegacyVError"
|
|
2002
|
-
});
|
|
2003
|
-
}
|
|
2004
|
-
};
|
|
2005
|
-
var InvalidSerializableTransactionError = class extends BaseError {
|
|
2006
|
-
constructor({ transaction }) {
|
|
2007
|
-
super("Cannot infer a transaction type from provided transaction.", {
|
|
2008
|
-
metaMessages: [
|
|
2009
|
-
"Provided Transaction:",
|
|
2010
|
-
"{",
|
|
2011
|
-
prettyPrint(transaction),
|
|
2012
|
-
"}",
|
|
2013
|
-
"",
|
|
2014
|
-
"To infer the type, either provide:",
|
|
2015
|
-
"- a `type` to the Transaction, or",
|
|
2016
|
-
"- an EIP-1559 Transaction with `maxFeePerGas`, or",
|
|
2017
|
-
"- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
|
|
2018
|
-
"- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
|
|
2019
|
-
"- an EIP-7702 Transaction with `authorizationList`, or",
|
|
2020
|
-
"- a Legacy Transaction with `gasPrice`"
|
|
2021
|
-
],
|
|
2022
|
-
name: "InvalidSerializableTransactionError"
|
|
2023
|
-
});
|
|
2024
|
-
}
|
|
2025
|
-
};
|
|
2026
|
-
var InvalidStorageKeySizeError = class extends BaseError {
|
|
2027
|
-
constructor({ storageKey }) {
|
|
2028
|
-
super(`Size for storage key "${storageKey}" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
|
|
2029
|
-
}
|
|
2030
|
-
};
|
|
2031
|
-
var TransactionExecutionError = class extends BaseError {
|
|
2032
|
-
constructor(cause, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value }) {
|
|
2033
|
-
var _a;
|
|
2034
|
-
const prettyArgs = prettyPrint({
|
|
2035
|
-
chain: chain && `${chain == null ? void 0 : chain.name} (id: ${chain == null ? void 0 : chain.id})`,
|
|
2036
|
-
from: account == null ? void 0 : account.address,
|
|
2037
|
-
to,
|
|
2038
|
-
value: typeof value !== "undefined" && `${formatEther(value)} ${((_a = chain == null ? void 0 : chain.nativeCurrency) == null ? void 0 : _a.symbol) || "ETH"}`,
|
|
2039
|
-
data,
|
|
2040
|
-
gas,
|
|
2041
|
-
gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
|
|
2042
|
-
maxFeePerGas: typeof maxFeePerGas !== "undefined" && `${formatGwei(maxFeePerGas)} gwei`,
|
|
2043
|
-
maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== "undefined" && `${formatGwei(maxPriorityFeePerGas)} gwei`,
|
|
2044
|
-
nonce
|
|
2045
|
-
});
|
|
2046
|
-
super(cause.shortMessage, {
|
|
2047
|
-
cause,
|
|
2048
|
-
docsPath,
|
|
2049
|
-
metaMessages: [
|
|
2050
|
-
...cause.metaMessages ? [...cause.metaMessages, " "] : [],
|
|
2051
|
-
"Request Arguments:",
|
|
2052
|
-
prettyArgs
|
|
2053
|
-
].filter(Boolean),
|
|
2054
|
-
name: "TransactionExecutionError"
|
|
2055
|
-
});
|
|
2056
|
-
Object.defineProperty(this, "cause", {
|
|
2057
|
-
enumerable: true,
|
|
2058
|
-
configurable: true,
|
|
2059
|
-
writable: true,
|
|
2060
|
-
value: void 0
|
|
2061
|
-
});
|
|
2062
|
-
this.cause = cause;
|
|
2063
|
-
}
|
|
2064
|
-
};
|
|
2065
|
-
var TransactionNotFoundError = class extends BaseError {
|
|
2066
|
-
constructor({ blockHash, blockNumber, blockTag, hash: hash2, index }) {
|
|
2067
|
-
let identifier = "Transaction";
|
|
2068
|
-
if (blockTag && index !== void 0)
|
|
2069
|
-
identifier = `Transaction at block time "${blockTag}" at index "${index}"`;
|
|
2070
|
-
if (blockHash && index !== void 0)
|
|
2071
|
-
identifier = `Transaction at block hash "${blockHash}" at index "${index}"`;
|
|
2072
|
-
if (blockNumber && index !== void 0)
|
|
2073
|
-
identifier = `Transaction at block number "${blockNumber}" at index "${index}"`;
|
|
2074
|
-
if (hash2)
|
|
2075
|
-
identifier = `Transaction with hash "${hash2}"`;
|
|
2076
|
-
super(`${identifier} could not be found.`, {
|
|
2077
|
-
name: "TransactionNotFoundError"
|
|
2078
|
-
});
|
|
2079
|
-
}
|
|
2080
|
-
};
|
|
2081
|
-
var TransactionReceiptNotFoundError = class extends BaseError {
|
|
2082
|
-
constructor({ hash: hash2 }) {
|
|
2083
|
-
super(`Transaction receipt with hash "${hash2}" could not be found. The Transaction may not be processed on a block yet.`, {
|
|
2084
|
-
name: "TransactionReceiptNotFoundError"
|
|
2085
|
-
});
|
|
2086
|
-
}
|
|
2087
|
-
};
|
|
2088
|
-
var WaitForTransactionReceiptTimeoutError = class extends BaseError {
|
|
2089
|
-
constructor({ hash: hash2 }) {
|
|
2090
|
-
super(`Timed out while waiting for transaction with hash "${hash2}" to be confirmed.`, { name: "WaitForTransactionReceiptTimeoutError" });
|
|
2091
|
-
}
|
|
2092
|
-
};
|
|
2093
|
-
|
|
2094
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/rpc.js
|
|
2095
|
-
var unknownErrorCode = -1;
|
|
2096
|
-
var RpcError = class extends BaseError {
|
|
2097
|
-
constructor(cause, { code, docsPath, metaMessages, name, shortMessage }) {
|
|
2098
|
-
super(shortMessage, {
|
|
2099
|
-
cause,
|
|
2100
|
-
docsPath,
|
|
2101
|
-
metaMessages: metaMessages || (cause == null ? void 0 : cause.metaMessages),
|
|
2102
|
-
name: name || "RpcError"
|
|
2103
|
-
});
|
|
2104
|
-
Object.defineProperty(this, "code", {
|
|
2105
|
-
enumerable: true,
|
|
2106
|
-
configurable: true,
|
|
2107
|
-
writable: true,
|
|
2108
|
-
value: void 0
|
|
2109
|
-
});
|
|
2110
|
-
this.name = name || cause.name;
|
|
2111
|
-
this.code = cause instanceof RpcRequestError ? cause.code : code ?? unknownErrorCode;
|
|
2112
|
-
}
|
|
2113
|
-
};
|
|
2114
|
-
var ProviderRpcError = class extends RpcError {
|
|
2115
|
-
constructor(cause, options) {
|
|
2116
|
-
super(cause, options);
|
|
2117
|
-
Object.defineProperty(this, "data", {
|
|
2118
|
-
enumerable: true,
|
|
2119
|
-
configurable: true,
|
|
2120
|
-
writable: true,
|
|
2121
|
-
value: void 0
|
|
2122
|
-
});
|
|
2123
|
-
this.data = options.data;
|
|
2124
|
-
}
|
|
2125
|
-
};
|
|
2126
|
-
var ParseRpcError = class _ParseRpcError extends RpcError {
|
|
2127
|
-
constructor(cause) {
|
|
2128
|
-
super(cause, {
|
|
2129
|
-
code: _ParseRpcError.code,
|
|
2130
|
-
name: "ParseRpcError",
|
|
2131
|
-
shortMessage: "Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."
|
|
2132
|
-
});
|
|
2133
|
-
}
|
|
2134
|
-
};
|
|
2135
|
-
Object.defineProperty(ParseRpcError, "code", {
|
|
2136
|
-
enumerable: true,
|
|
2137
|
-
configurable: true,
|
|
2138
|
-
writable: true,
|
|
2139
|
-
value: -32700
|
|
2140
|
-
});
|
|
2141
|
-
var InvalidRequestRpcError = class _InvalidRequestRpcError extends RpcError {
|
|
2142
|
-
constructor(cause) {
|
|
2143
|
-
super(cause, {
|
|
2144
|
-
code: _InvalidRequestRpcError.code,
|
|
2145
|
-
name: "InvalidRequestRpcError",
|
|
2146
|
-
shortMessage: "JSON is not a valid request object."
|
|
2147
|
-
});
|
|
2148
|
-
}
|
|
2149
|
-
};
|
|
2150
|
-
Object.defineProperty(InvalidRequestRpcError, "code", {
|
|
2151
|
-
enumerable: true,
|
|
2152
|
-
configurable: true,
|
|
2153
|
-
writable: true,
|
|
2154
|
-
value: -32600
|
|
2155
|
-
});
|
|
2156
|
-
var MethodNotFoundRpcError = class _MethodNotFoundRpcError extends RpcError {
|
|
2157
|
-
constructor(cause, { method } = {}) {
|
|
2158
|
-
super(cause, {
|
|
2159
|
-
code: _MethodNotFoundRpcError.code,
|
|
2160
|
-
name: "MethodNotFoundRpcError",
|
|
2161
|
-
shortMessage: `The method${method ? ` "${method}"` : ""} does not exist / is not available.`
|
|
2162
|
-
});
|
|
2163
|
-
}
|
|
2164
|
-
};
|
|
2165
|
-
Object.defineProperty(MethodNotFoundRpcError, "code", {
|
|
2166
|
-
enumerable: true,
|
|
2167
|
-
configurable: true,
|
|
2168
|
-
writable: true,
|
|
2169
|
-
value: -32601
|
|
2170
|
-
});
|
|
2171
|
-
var InvalidParamsRpcError = class _InvalidParamsRpcError extends RpcError {
|
|
2172
|
-
constructor(cause) {
|
|
2173
|
-
super(cause, {
|
|
2174
|
-
code: _InvalidParamsRpcError.code,
|
|
2175
|
-
name: "InvalidParamsRpcError",
|
|
2176
|
-
shortMessage: [
|
|
2177
|
-
"Invalid parameters were provided to the RPC method.",
|
|
2178
|
-
"Double check you have provided the correct parameters."
|
|
2179
|
-
].join("\n")
|
|
2180
|
-
});
|
|
2181
|
-
}
|
|
2182
|
-
};
|
|
2183
|
-
Object.defineProperty(InvalidParamsRpcError, "code", {
|
|
2184
|
-
enumerable: true,
|
|
2185
|
-
configurable: true,
|
|
2186
|
-
writable: true,
|
|
2187
|
-
value: -32602
|
|
2188
|
-
});
|
|
2189
|
-
var InternalRpcError = class _InternalRpcError extends RpcError {
|
|
2190
|
-
constructor(cause) {
|
|
2191
|
-
super(cause, {
|
|
2192
|
-
code: _InternalRpcError.code,
|
|
2193
|
-
name: "InternalRpcError",
|
|
2194
|
-
shortMessage: "An internal error was received."
|
|
2195
|
-
});
|
|
2196
|
-
}
|
|
2197
|
-
};
|
|
2198
|
-
Object.defineProperty(InternalRpcError, "code", {
|
|
2199
|
-
enumerable: true,
|
|
2200
|
-
configurable: true,
|
|
2201
|
-
writable: true,
|
|
2202
|
-
value: -32603
|
|
2203
|
-
});
|
|
2204
|
-
var InvalidInputRpcError = class _InvalidInputRpcError extends RpcError {
|
|
2205
|
-
constructor(cause) {
|
|
2206
|
-
super(cause, {
|
|
2207
|
-
code: _InvalidInputRpcError.code,
|
|
2208
|
-
name: "InvalidInputRpcError",
|
|
2209
|
-
shortMessage: [
|
|
2210
|
-
"Missing or invalid parameters.",
|
|
2211
|
-
"Double check you have provided the correct parameters."
|
|
2212
|
-
].join("\n")
|
|
2213
|
-
});
|
|
2214
|
-
}
|
|
2215
|
-
};
|
|
2216
|
-
Object.defineProperty(InvalidInputRpcError, "code", {
|
|
2217
|
-
enumerable: true,
|
|
2218
|
-
configurable: true,
|
|
2219
|
-
writable: true,
|
|
2220
|
-
value: -32e3
|
|
2221
|
-
});
|
|
2222
|
-
var ResourceNotFoundRpcError = class _ResourceNotFoundRpcError extends RpcError {
|
|
2223
|
-
constructor(cause) {
|
|
2224
|
-
super(cause, {
|
|
2225
|
-
code: _ResourceNotFoundRpcError.code,
|
|
2226
|
-
name: "ResourceNotFoundRpcError",
|
|
2227
|
-
shortMessage: "Requested resource not found."
|
|
2228
|
-
});
|
|
2229
|
-
Object.defineProperty(this, "name", {
|
|
2230
|
-
enumerable: true,
|
|
2231
|
-
configurable: true,
|
|
2232
|
-
writable: true,
|
|
2233
|
-
value: "ResourceNotFoundRpcError"
|
|
2234
|
-
});
|
|
2235
|
-
}
|
|
2236
|
-
};
|
|
2237
|
-
Object.defineProperty(ResourceNotFoundRpcError, "code", {
|
|
2238
|
-
enumerable: true,
|
|
2239
|
-
configurable: true,
|
|
2240
|
-
writable: true,
|
|
2241
|
-
value: -32001
|
|
2242
|
-
});
|
|
2243
|
-
var ResourceUnavailableRpcError = class _ResourceUnavailableRpcError extends RpcError {
|
|
2244
|
-
constructor(cause) {
|
|
2245
|
-
super(cause, {
|
|
2246
|
-
code: _ResourceUnavailableRpcError.code,
|
|
2247
|
-
name: "ResourceUnavailableRpcError",
|
|
2248
|
-
shortMessage: "Requested resource not available."
|
|
2249
|
-
});
|
|
2250
|
-
}
|
|
2251
|
-
};
|
|
2252
|
-
Object.defineProperty(ResourceUnavailableRpcError, "code", {
|
|
2253
|
-
enumerable: true,
|
|
2254
|
-
configurable: true,
|
|
2255
|
-
writable: true,
|
|
2256
|
-
value: -32002
|
|
2257
|
-
});
|
|
2258
|
-
var TransactionRejectedRpcError = class _TransactionRejectedRpcError extends RpcError {
|
|
2259
|
-
constructor(cause) {
|
|
2260
|
-
super(cause, {
|
|
2261
|
-
code: _TransactionRejectedRpcError.code,
|
|
2262
|
-
name: "TransactionRejectedRpcError",
|
|
2263
|
-
shortMessage: "Transaction creation failed."
|
|
2264
|
-
});
|
|
2265
|
-
}
|
|
2266
|
-
};
|
|
2267
|
-
Object.defineProperty(TransactionRejectedRpcError, "code", {
|
|
2268
|
-
enumerable: true,
|
|
2269
|
-
configurable: true,
|
|
2270
|
-
writable: true,
|
|
2271
|
-
value: -32003
|
|
2272
|
-
});
|
|
2273
|
-
var MethodNotSupportedRpcError = class _MethodNotSupportedRpcError extends RpcError {
|
|
2274
|
-
constructor(cause, { method } = {}) {
|
|
2275
|
-
super(cause, {
|
|
2276
|
-
code: _MethodNotSupportedRpcError.code,
|
|
2277
|
-
name: "MethodNotSupportedRpcError",
|
|
2278
|
-
shortMessage: `Method${method ? ` "${method}"` : ""} is not supported.`
|
|
2279
|
-
});
|
|
2280
|
-
}
|
|
2281
|
-
};
|
|
2282
|
-
Object.defineProperty(MethodNotSupportedRpcError, "code", {
|
|
2283
|
-
enumerable: true,
|
|
2284
|
-
configurable: true,
|
|
2285
|
-
writable: true,
|
|
2286
|
-
value: -32004
|
|
2287
|
-
});
|
|
2288
|
-
var LimitExceededRpcError = class _LimitExceededRpcError extends RpcError {
|
|
2289
|
-
constructor(cause) {
|
|
2290
|
-
super(cause, {
|
|
2291
|
-
code: _LimitExceededRpcError.code,
|
|
2292
|
-
name: "LimitExceededRpcError",
|
|
2293
|
-
shortMessage: "Request exceeds defined limit."
|
|
2294
|
-
});
|
|
2295
|
-
}
|
|
2296
|
-
};
|
|
2297
|
-
Object.defineProperty(LimitExceededRpcError, "code", {
|
|
2298
|
-
enumerable: true,
|
|
2299
|
-
configurable: true,
|
|
2300
|
-
writable: true,
|
|
2301
|
-
value: -32005
|
|
2302
|
-
});
|
|
2303
|
-
var JsonRpcVersionUnsupportedError = class _JsonRpcVersionUnsupportedError extends RpcError {
|
|
2304
|
-
constructor(cause) {
|
|
2305
|
-
super(cause, {
|
|
2306
|
-
code: _JsonRpcVersionUnsupportedError.code,
|
|
2307
|
-
name: "JsonRpcVersionUnsupportedError",
|
|
2308
|
-
shortMessage: "Version of JSON-RPC protocol is not supported."
|
|
2309
|
-
});
|
|
2310
|
-
}
|
|
2311
|
-
};
|
|
2312
|
-
Object.defineProperty(JsonRpcVersionUnsupportedError, "code", {
|
|
2313
|
-
enumerable: true,
|
|
2314
|
-
configurable: true,
|
|
2315
|
-
writable: true,
|
|
2316
|
-
value: -32006
|
|
2317
|
-
});
|
|
2318
|
-
var UserRejectedRequestError = class _UserRejectedRequestError extends ProviderRpcError {
|
|
2319
|
-
constructor(cause) {
|
|
2320
|
-
super(cause, {
|
|
2321
|
-
code: _UserRejectedRequestError.code,
|
|
2322
|
-
name: "UserRejectedRequestError",
|
|
2323
|
-
shortMessage: "User rejected the request."
|
|
2324
|
-
});
|
|
2325
|
-
}
|
|
2326
|
-
};
|
|
2327
|
-
Object.defineProperty(UserRejectedRequestError, "code", {
|
|
2328
|
-
enumerable: true,
|
|
2329
|
-
configurable: true,
|
|
2330
|
-
writable: true,
|
|
2331
|
-
value: 4001
|
|
2332
|
-
});
|
|
2333
|
-
var UnauthorizedProviderError = class _UnauthorizedProviderError extends ProviderRpcError {
|
|
2334
|
-
constructor(cause) {
|
|
2335
|
-
super(cause, {
|
|
2336
|
-
code: _UnauthorizedProviderError.code,
|
|
2337
|
-
name: "UnauthorizedProviderError",
|
|
2338
|
-
shortMessage: "The requested method and/or account has not been authorized by the user."
|
|
2339
|
-
});
|
|
2340
|
-
}
|
|
2341
|
-
};
|
|
2342
|
-
Object.defineProperty(UnauthorizedProviderError, "code", {
|
|
2343
|
-
enumerable: true,
|
|
2344
|
-
configurable: true,
|
|
2345
|
-
writable: true,
|
|
2346
|
-
value: 4100
|
|
2347
|
-
});
|
|
2348
|
-
var UnsupportedProviderMethodError = class _UnsupportedProviderMethodError extends ProviderRpcError {
|
|
2349
|
-
constructor(cause, { method } = {}) {
|
|
2350
|
-
super(cause, {
|
|
2351
|
-
code: _UnsupportedProviderMethodError.code,
|
|
2352
|
-
name: "UnsupportedProviderMethodError",
|
|
2353
|
-
shortMessage: `The Provider does not support the requested method${method ? ` " ${method}"` : ""}.`
|
|
2354
|
-
});
|
|
2355
|
-
}
|
|
2356
|
-
};
|
|
2357
|
-
Object.defineProperty(UnsupportedProviderMethodError, "code", {
|
|
2358
|
-
enumerable: true,
|
|
2359
|
-
configurable: true,
|
|
2360
|
-
writable: true,
|
|
2361
|
-
value: 4200
|
|
2362
|
-
});
|
|
2363
|
-
var ProviderDisconnectedError = class _ProviderDisconnectedError extends ProviderRpcError {
|
|
2364
|
-
constructor(cause) {
|
|
2365
|
-
super(cause, {
|
|
2366
|
-
code: _ProviderDisconnectedError.code,
|
|
2367
|
-
name: "ProviderDisconnectedError",
|
|
2368
|
-
shortMessage: "The Provider is disconnected from all chains."
|
|
2369
|
-
});
|
|
2370
|
-
}
|
|
2371
|
-
};
|
|
2372
|
-
Object.defineProperty(ProviderDisconnectedError, "code", {
|
|
2373
|
-
enumerable: true,
|
|
2374
|
-
configurable: true,
|
|
2375
|
-
writable: true,
|
|
2376
|
-
value: 4900
|
|
2377
|
-
});
|
|
2378
|
-
var ChainDisconnectedError = class _ChainDisconnectedError extends ProviderRpcError {
|
|
2379
|
-
constructor(cause) {
|
|
2380
|
-
super(cause, {
|
|
2381
|
-
code: _ChainDisconnectedError.code,
|
|
2382
|
-
name: "ChainDisconnectedError",
|
|
2383
|
-
shortMessage: "The Provider is not connected to the requested chain."
|
|
2384
|
-
});
|
|
2385
|
-
}
|
|
2386
|
-
};
|
|
2387
|
-
Object.defineProperty(ChainDisconnectedError, "code", {
|
|
2388
|
-
enumerable: true,
|
|
2389
|
-
configurable: true,
|
|
2390
|
-
writable: true,
|
|
2391
|
-
value: 4901
|
|
2392
|
-
});
|
|
2393
|
-
var SwitchChainError = class _SwitchChainError extends ProviderRpcError {
|
|
2394
|
-
constructor(cause) {
|
|
2395
|
-
super(cause, {
|
|
2396
|
-
code: _SwitchChainError.code,
|
|
2397
|
-
name: "SwitchChainError",
|
|
2398
|
-
shortMessage: "An error occurred when attempting to switch chain."
|
|
2399
|
-
});
|
|
2400
|
-
}
|
|
2401
|
-
};
|
|
2402
|
-
Object.defineProperty(SwitchChainError, "code", {
|
|
2403
|
-
enumerable: true,
|
|
2404
|
-
configurable: true,
|
|
2405
|
-
writable: true,
|
|
2406
|
-
value: 4902
|
|
2407
|
-
});
|
|
2408
|
-
var UnknownRpcError = class extends RpcError {
|
|
2409
|
-
constructor(cause) {
|
|
2410
|
-
super(cause, {
|
|
2411
|
-
name: "UnknownRpcError",
|
|
2412
|
-
shortMessage: "An unknown RPC error occurred."
|
|
2413
|
-
});
|
|
2414
|
-
}
|
|
2415
|
-
};
|
|
2416
|
-
|
|
2417
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/formatters/extract.js
|
|
2418
|
-
function extract(value_, { format }) {
|
|
2419
|
-
if (!format)
|
|
2420
|
-
return {};
|
|
2421
|
-
const value = {};
|
|
2422
|
-
function extract_(formatted2) {
|
|
2423
|
-
const keys = Object.keys(formatted2);
|
|
2424
|
-
for (const key of keys) {
|
|
2425
|
-
if (key in value_)
|
|
2426
|
-
value[key] = value_[key];
|
|
2427
|
-
if (formatted2[key] && typeof formatted2[key] === "object" && !Array.isArray(formatted2[key]))
|
|
2428
|
-
extract_(formatted2[key]);
|
|
2429
|
-
}
|
|
2430
|
-
}
|
|
2431
|
-
const formatted = format(value_ || {});
|
|
2432
|
-
extract_(formatted);
|
|
2433
|
-
return value;
|
|
2434
|
-
}
|
|
2435
|
-
|
|
2436
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/formatters/formatter.js
|
|
2437
|
-
function defineFormatter(type, format) {
|
|
2438
|
-
return ({ exclude, format: overrides }) => {
|
|
2439
|
-
return {
|
|
2440
|
-
exclude,
|
|
2441
|
-
format: (args) => {
|
|
2442
|
-
const formatted = format(args);
|
|
2443
|
-
if (exclude) {
|
|
2444
|
-
for (const key of exclude) {
|
|
2445
|
-
delete formatted[key];
|
|
2446
|
-
}
|
|
2447
|
-
}
|
|
2448
|
-
return {
|
|
2449
|
-
...formatted,
|
|
2450
|
-
...overrides(args)
|
|
2451
|
-
};
|
|
2452
|
-
},
|
|
2453
|
-
type
|
|
2454
|
-
};
|
|
2455
|
-
};
|
|
2456
|
-
}
|
|
2457
|
-
|
|
2458
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/formatters/transactionRequest.js
|
|
2459
|
-
var rpcTransactionType = {
|
|
2460
|
-
legacy: "0x0",
|
|
2461
|
-
eip2930: "0x1",
|
|
2462
|
-
eip1559: "0x2",
|
|
2463
|
-
eip4844: "0x3",
|
|
2464
|
-
eip7702: "0x4"
|
|
2465
|
-
};
|
|
2466
|
-
function formatTransactionRequest(request) {
|
|
2467
|
-
const rpcRequest = {};
|
|
2468
|
-
if (typeof request.authorizationList !== "undefined")
|
|
2469
|
-
rpcRequest.authorizationList = formatAuthorizationList(request.authorizationList);
|
|
2470
|
-
if (typeof request.accessList !== "undefined")
|
|
2471
|
-
rpcRequest.accessList = request.accessList;
|
|
2472
|
-
if (typeof request.blobVersionedHashes !== "undefined")
|
|
2473
|
-
rpcRequest.blobVersionedHashes = request.blobVersionedHashes;
|
|
2474
|
-
if (typeof request.blobs !== "undefined") {
|
|
2475
|
-
if (typeof request.blobs[0] !== "string")
|
|
2476
|
-
rpcRequest.blobs = request.blobs.map((x) => bytesToHex(x));
|
|
2477
|
-
else
|
|
2478
|
-
rpcRequest.blobs = request.blobs;
|
|
2479
|
-
}
|
|
2480
|
-
if (typeof request.data !== "undefined")
|
|
2481
|
-
rpcRequest.data = request.data;
|
|
2482
|
-
if (typeof request.from !== "undefined")
|
|
2483
|
-
rpcRequest.from = request.from;
|
|
2484
|
-
if (typeof request.gas !== "undefined")
|
|
2485
|
-
rpcRequest.gas = numberToHex(request.gas);
|
|
2486
|
-
if (typeof request.gasPrice !== "undefined")
|
|
2487
|
-
rpcRequest.gasPrice = numberToHex(request.gasPrice);
|
|
2488
|
-
if (typeof request.maxFeePerBlobGas !== "undefined")
|
|
2489
|
-
rpcRequest.maxFeePerBlobGas = numberToHex(request.maxFeePerBlobGas);
|
|
2490
|
-
if (typeof request.maxFeePerGas !== "undefined")
|
|
2491
|
-
rpcRequest.maxFeePerGas = numberToHex(request.maxFeePerGas);
|
|
2492
|
-
if (typeof request.maxPriorityFeePerGas !== "undefined")
|
|
2493
|
-
rpcRequest.maxPriorityFeePerGas = numberToHex(request.maxPriorityFeePerGas);
|
|
2494
|
-
if (typeof request.nonce !== "undefined")
|
|
2495
|
-
rpcRequest.nonce = numberToHex(request.nonce);
|
|
2496
|
-
if (typeof request.to !== "undefined")
|
|
2497
|
-
rpcRequest.to = request.to;
|
|
2498
|
-
if (typeof request.type !== "undefined")
|
|
2499
|
-
rpcRequest.type = rpcTransactionType[request.type];
|
|
2500
|
-
if (typeof request.value !== "undefined")
|
|
2501
|
-
rpcRequest.value = numberToHex(request.value);
|
|
2502
|
-
return rpcRequest;
|
|
2503
|
-
}
|
|
2504
|
-
var defineTransactionRequest = defineFormatter("transactionRequest", formatTransactionRequest);
|
|
2505
|
-
function formatAuthorizationList(authorizationList) {
|
|
2506
|
-
return authorizationList.map((authorization) => ({
|
|
2507
|
-
address: authorization.contractAddress,
|
|
2508
|
-
r: authorization.r ? numberToHex(BigInt(authorization.r)) : authorization.r,
|
|
2509
|
-
s: authorization.s ? numberToHex(BigInt(authorization.s)) : authorization.s,
|
|
2510
|
-
chainId: numberToHex(authorization.chainId),
|
|
2511
|
-
nonce: numberToHex(authorization.nonce),
|
|
2512
|
-
...typeof authorization.yParity !== "undefined" ? { yParity: numberToHex(authorization.yParity) } : {},
|
|
2513
|
-
...typeof authorization.v !== "undefined" && typeof authorization.yParity === "undefined" ? { v: numberToHex(authorization.v) } : {}
|
|
2514
|
-
}));
|
|
2515
|
-
}
|
|
2516
|
-
|
|
2517
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/constants/number.js
|
|
2518
|
-
var maxInt8 = 2n ** (8n - 1n) - 1n;
|
|
2519
|
-
var maxInt16 = 2n ** (16n - 1n) - 1n;
|
|
2520
|
-
var maxInt24 = 2n ** (24n - 1n) - 1n;
|
|
2521
|
-
var maxInt32 = 2n ** (32n - 1n) - 1n;
|
|
2522
|
-
var maxInt40 = 2n ** (40n - 1n) - 1n;
|
|
2523
|
-
var maxInt48 = 2n ** (48n - 1n) - 1n;
|
|
2524
|
-
var maxInt56 = 2n ** (56n - 1n) - 1n;
|
|
2525
|
-
var maxInt64 = 2n ** (64n - 1n) - 1n;
|
|
2526
|
-
var maxInt72 = 2n ** (72n - 1n) - 1n;
|
|
2527
|
-
var maxInt80 = 2n ** (80n - 1n) - 1n;
|
|
2528
|
-
var maxInt88 = 2n ** (88n - 1n) - 1n;
|
|
2529
|
-
var maxInt96 = 2n ** (96n - 1n) - 1n;
|
|
2530
|
-
var maxInt104 = 2n ** (104n - 1n) - 1n;
|
|
2531
|
-
var maxInt112 = 2n ** (112n - 1n) - 1n;
|
|
2532
|
-
var maxInt120 = 2n ** (120n - 1n) - 1n;
|
|
2533
|
-
var maxInt128 = 2n ** (128n - 1n) - 1n;
|
|
2534
|
-
var maxInt136 = 2n ** (136n - 1n) - 1n;
|
|
2535
|
-
var maxInt144 = 2n ** (144n - 1n) - 1n;
|
|
2536
|
-
var maxInt152 = 2n ** (152n - 1n) - 1n;
|
|
2537
|
-
var maxInt160 = 2n ** (160n - 1n) - 1n;
|
|
2538
|
-
var maxInt168 = 2n ** (168n - 1n) - 1n;
|
|
2539
|
-
var maxInt176 = 2n ** (176n - 1n) - 1n;
|
|
2540
|
-
var maxInt184 = 2n ** (184n - 1n) - 1n;
|
|
2541
|
-
var maxInt192 = 2n ** (192n - 1n) - 1n;
|
|
2542
|
-
var maxInt200 = 2n ** (200n - 1n) - 1n;
|
|
2543
|
-
var maxInt208 = 2n ** (208n - 1n) - 1n;
|
|
2544
|
-
var maxInt216 = 2n ** (216n - 1n) - 1n;
|
|
2545
|
-
var maxInt224 = 2n ** (224n - 1n) - 1n;
|
|
2546
|
-
var maxInt232 = 2n ** (232n - 1n) - 1n;
|
|
2547
|
-
var maxInt240 = 2n ** (240n - 1n) - 1n;
|
|
2548
|
-
var maxInt248 = 2n ** (248n - 1n) - 1n;
|
|
2549
|
-
var maxInt256 = 2n ** (256n - 1n) - 1n;
|
|
2550
|
-
var minInt8 = -(2n ** (8n - 1n));
|
|
2551
|
-
var minInt16 = -(2n ** (16n - 1n));
|
|
2552
|
-
var minInt24 = -(2n ** (24n - 1n));
|
|
2553
|
-
var minInt32 = -(2n ** (32n - 1n));
|
|
2554
|
-
var minInt40 = -(2n ** (40n - 1n));
|
|
2555
|
-
var minInt48 = -(2n ** (48n - 1n));
|
|
2556
|
-
var minInt56 = -(2n ** (56n - 1n));
|
|
2557
|
-
var minInt64 = -(2n ** (64n - 1n));
|
|
2558
|
-
var minInt72 = -(2n ** (72n - 1n));
|
|
2559
|
-
var minInt80 = -(2n ** (80n - 1n));
|
|
2560
|
-
var minInt88 = -(2n ** (88n - 1n));
|
|
2561
|
-
var minInt96 = -(2n ** (96n - 1n));
|
|
2562
|
-
var minInt104 = -(2n ** (104n - 1n));
|
|
2563
|
-
var minInt112 = -(2n ** (112n - 1n));
|
|
2564
|
-
var minInt120 = -(2n ** (120n - 1n));
|
|
2565
|
-
var minInt128 = -(2n ** (128n - 1n));
|
|
2566
|
-
var minInt136 = -(2n ** (136n - 1n));
|
|
2567
|
-
var minInt144 = -(2n ** (144n - 1n));
|
|
2568
|
-
var minInt152 = -(2n ** (152n - 1n));
|
|
2569
|
-
var minInt160 = -(2n ** (160n - 1n));
|
|
2570
|
-
var minInt168 = -(2n ** (168n - 1n));
|
|
2571
|
-
var minInt176 = -(2n ** (176n - 1n));
|
|
2572
|
-
var minInt184 = -(2n ** (184n - 1n));
|
|
2573
|
-
var minInt192 = -(2n ** (192n - 1n));
|
|
2574
|
-
var minInt200 = -(2n ** (200n - 1n));
|
|
2575
|
-
var minInt208 = -(2n ** (208n - 1n));
|
|
2576
|
-
var minInt216 = -(2n ** (216n - 1n));
|
|
2577
|
-
var minInt224 = -(2n ** (224n - 1n));
|
|
2578
|
-
var minInt232 = -(2n ** (232n - 1n));
|
|
2579
|
-
var minInt240 = -(2n ** (240n - 1n));
|
|
2580
|
-
var minInt248 = -(2n ** (248n - 1n));
|
|
2581
|
-
var minInt256 = -(2n ** (256n - 1n));
|
|
2582
|
-
var maxUint8 = 2n ** 8n - 1n;
|
|
2583
|
-
var maxUint16 = 2n ** 16n - 1n;
|
|
2584
|
-
var maxUint24 = 2n ** 24n - 1n;
|
|
2585
|
-
var maxUint32 = 2n ** 32n - 1n;
|
|
2586
|
-
var maxUint40 = 2n ** 40n - 1n;
|
|
2587
|
-
var maxUint48 = 2n ** 48n - 1n;
|
|
2588
|
-
var maxUint56 = 2n ** 56n - 1n;
|
|
2589
|
-
var maxUint64 = 2n ** 64n - 1n;
|
|
2590
|
-
var maxUint72 = 2n ** 72n - 1n;
|
|
2591
|
-
var maxUint80 = 2n ** 80n - 1n;
|
|
2592
|
-
var maxUint88 = 2n ** 88n - 1n;
|
|
2593
|
-
var maxUint96 = 2n ** 96n - 1n;
|
|
2594
|
-
var maxUint104 = 2n ** 104n - 1n;
|
|
2595
|
-
var maxUint112 = 2n ** 112n - 1n;
|
|
2596
|
-
var maxUint120 = 2n ** 120n - 1n;
|
|
2597
|
-
var maxUint128 = 2n ** 128n - 1n;
|
|
2598
|
-
var maxUint136 = 2n ** 136n - 1n;
|
|
2599
|
-
var maxUint144 = 2n ** 144n - 1n;
|
|
2600
|
-
var maxUint152 = 2n ** 152n - 1n;
|
|
2601
|
-
var maxUint160 = 2n ** 160n - 1n;
|
|
2602
|
-
var maxUint168 = 2n ** 168n - 1n;
|
|
2603
|
-
var maxUint176 = 2n ** 176n - 1n;
|
|
2604
|
-
var maxUint184 = 2n ** 184n - 1n;
|
|
2605
|
-
var maxUint192 = 2n ** 192n - 1n;
|
|
2606
|
-
var maxUint200 = 2n ** 200n - 1n;
|
|
2607
|
-
var maxUint208 = 2n ** 208n - 1n;
|
|
2608
|
-
var maxUint216 = 2n ** 216n - 1n;
|
|
2609
|
-
var maxUint224 = 2n ** 224n - 1n;
|
|
2610
|
-
var maxUint232 = 2n ** 232n - 1n;
|
|
2611
|
-
var maxUint240 = 2n ** 240n - 1n;
|
|
2612
|
-
var maxUint248 = 2n ** 248n - 1n;
|
|
2613
|
-
var maxUint256 = 2n ** 256n - 1n;
|
|
2614
|
-
|
|
2615
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/transaction/assertRequest.js
|
|
2616
|
-
function assertRequest(args) {
|
|
2617
|
-
const { account: account_, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to } = args;
|
|
2618
|
-
const account = account_ ? parseAccount(account_) : void 0;
|
|
2619
|
-
if (account && !isAddress(account.address))
|
|
2620
|
-
throw new InvalidAddressError({ address: account.address });
|
|
2621
|
-
if (to && !isAddress(to))
|
|
2622
|
-
throw new InvalidAddressError({ address: to });
|
|
2623
|
-
if (typeof gasPrice !== "undefined" && (typeof maxFeePerGas !== "undefined" || typeof maxPriorityFeePerGas !== "undefined"))
|
|
2624
|
-
throw new FeeConflictError();
|
|
2625
|
-
if (maxFeePerGas && maxFeePerGas > maxUint256)
|
|
2626
|
-
throw new FeeCapTooHighError({ maxFeePerGas });
|
|
2627
|
-
if (maxPriorityFeePerGas && maxFeePerGas && maxPriorityFeePerGas > maxFeePerGas)
|
|
2628
|
-
throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
|
|
2629
|
-
}
|
|
2630
|
-
|
|
2631
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/stateOverride.js
|
|
2632
|
-
var AccountStateConflictError = class extends BaseError {
|
|
2633
|
-
constructor({ address }) {
|
|
2634
|
-
super(`State for account "${address}" is set multiple times.`, {
|
|
2635
|
-
name: "AccountStateConflictError"
|
|
2636
|
-
});
|
|
2637
|
-
}
|
|
2638
|
-
};
|
|
2639
|
-
var StateAssignmentConflictError = class extends BaseError {
|
|
2640
|
-
constructor() {
|
|
2641
|
-
super("state and stateDiff are set on the same account.", {
|
|
2642
|
-
name: "StateAssignmentConflictError"
|
|
2643
|
-
});
|
|
2644
|
-
}
|
|
2645
|
-
};
|
|
2646
|
-
function prettyStateMapping(stateMapping) {
|
|
2647
|
-
return stateMapping.reduce((pretty, { slot, value }) => {
|
|
2648
|
-
return `${pretty} ${slot}: ${value}
|
|
2649
|
-
`;
|
|
2650
|
-
}, "");
|
|
2651
|
-
}
|
|
2652
|
-
function prettyStateOverride(stateOverride) {
|
|
2653
|
-
return stateOverride.reduce((pretty, { address, ...state }) => {
|
|
2654
|
-
let val = `${pretty} ${address}:
|
|
2655
|
-
`;
|
|
2656
|
-
if (state.nonce)
|
|
2657
|
-
val += ` nonce: ${state.nonce}
|
|
2658
|
-
`;
|
|
2659
|
-
if (state.balance)
|
|
2660
|
-
val += ` balance: ${state.balance}
|
|
2661
|
-
`;
|
|
2662
|
-
if (state.code)
|
|
2663
|
-
val += ` code: ${state.code}
|
|
2664
|
-
`;
|
|
2665
|
-
if (state.state) {
|
|
2666
|
-
val += " state:\n";
|
|
2667
|
-
val += prettyStateMapping(state.state);
|
|
2668
|
-
}
|
|
2669
|
-
if (state.stateDiff) {
|
|
2670
|
-
val += " stateDiff:\n";
|
|
2671
|
-
val += prettyStateMapping(state.stateDiff);
|
|
2672
|
-
}
|
|
2673
|
-
return val;
|
|
2674
|
-
}, " State Override:\n").slice(0, -1);
|
|
2675
|
-
}
|
|
2676
|
-
|
|
2677
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/hash/toEventSelector.js
|
|
2678
|
-
var toEventSelector = toSignatureHash;
|
|
2679
|
-
|
|
2680
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/abi/getAbiItem.js
|
|
2681
|
-
function getAbiItem(parameters) {
|
|
2682
|
-
const { abi, args = [], name } = parameters;
|
|
2683
|
-
const isSelector = isHex(name, { strict: false });
|
|
2684
|
-
const abiItems = abi.filter((abiItem) => {
|
|
2685
|
-
if (isSelector) {
|
|
2686
|
-
if (abiItem.type === "function")
|
|
2687
|
-
return toFunctionSelector(abiItem) === name;
|
|
2688
|
-
if (abiItem.type === "event")
|
|
2689
|
-
return toEventSelector(abiItem) === name;
|
|
2690
|
-
return false;
|
|
2691
|
-
}
|
|
2692
|
-
return "name" in abiItem && abiItem.name === name;
|
|
2693
|
-
});
|
|
2694
|
-
if (abiItems.length === 0)
|
|
2695
|
-
return void 0;
|
|
2696
|
-
if (abiItems.length === 1)
|
|
2697
|
-
return abiItems[0];
|
|
2698
|
-
let matchedAbiItem = void 0;
|
|
2699
|
-
for (const abiItem of abiItems) {
|
|
2700
|
-
if (!("inputs" in abiItem))
|
|
2701
|
-
continue;
|
|
2702
|
-
if (!args || args.length === 0) {
|
|
2703
|
-
if (!abiItem.inputs || abiItem.inputs.length === 0)
|
|
2704
|
-
return abiItem;
|
|
2705
|
-
continue;
|
|
2706
|
-
}
|
|
2707
|
-
if (!abiItem.inputs)
|
|
2708
|
-
continue;
|
|
2709
|
-
if (abiItem.inputs.length === 0)
|
|
2710
|
-
continue;
|
|
2711
|
-
if (abiItem.inputs.length !== args.length)
|
|
2712
|
-
continue;
|
|
2713
|
-
const matched = args.every((arg, index) => {
|
|
2714
|
-
const abiParameter = "inputs" in abiItem && abiItem.inputs[index];
|
|
2715
|
-
if (!abiParameter)
|
|
2716
|
-
return false;
|
|
2717
|
-
return isArgOfType(arg, abiParameter);
|
|
2718
|
-
});
|
|
2719
|
-
if (matched) {
|
|
2720
|
-
if (matchedAbiItem && "inputs" in matchedAbiItem && matchedAbiItem.inputs) {
|
|
2721
|
-
const ambiguousTypes = getAmbiguousTypes(abiItem.inputs, matchedAbiItem.inputs, args);
|
|
2722
|
-
if (ambiguousTypes)
|
|
2723
|
-
throw new AbiItemAmbiguityError({
|
|
2724
|
-
abiItem,
|
|
2725
|
-
type: ambiguousTypes[0]
|
|
2726
|
-
}, {
|
|
2727
|
-
abiItem: matchedAbiItem,
|
|
2728
|
-
type: ambiguousTypes[1]
|
|
2729
|
-
});
|
|
2730
|
-
}
|
|
2731
|
-
matchedAbiItem = abiItem;
|
|
2732
|
-
}
|
|
2733
|
-
}
|
|
2734
|
-
if (matchedAbiItem)
|
|
2735
|
-
return matchedAbiItem;
|
|
2736
|
-
return abiItems[0];
|
|
2737
|
-
}
|
|
2738
|
-
function isArgOfType(arg, abiParameter) {
|
|
2739
|
-
const argType = typeof arg;
|
|
2740
|
-
const abiParameterType = abiParameter.type;
|
|
2741
|
-
switch (abiParameterType) {
|
|
2742
|
-
case "address":
|
|
2743
|
-
return isAddress(arg, { strict: false });
|
|
2744
|
-
case "bool":
|
|
2745
|
-
return argType === "boolean";
|
|
2746
|
-
case "function":
|
|
2747
|
-
return argType === "string";
|
|
2748
|
-
case "string":
|
|
2749
|
-
return argType === "string";
|
|
2750
|
-
default: {
|
|
2751
|
-
if (abiParameterType === "tuple" && "components" in abiParameter)
|
|
2752
|
-
return Object.values(abiParameter.components).every((component, index) => {
|
|
2753
|
-
return isArgOfType(Object.values(arg)[index], component);
|
|
2754
|
-
});
|
|
2755
|
-
if (/^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)?$/.test(abiParameterType))
|
|
2756
|
-
return argType === "number" || argType === "bigint";
|
|
2757
|
-
if (/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(abiParameterType))
|
|
2758
|
-
return argType === "string" || arg instanceof Uint8Array;
|
|
2759
|
-
if (/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(abiParameterType)) {
|
|
2760
|
-
return Array.isArray(arg) && arg.every((x) => isArgOfType(x, {
|
|
2761
|
-
...abiParameter,
|
|
2762
|
-
// Pop off `[]` or `[M]` from end of type
|
|
2763
|
-
type: abiParameterType.replace(/(\[[0-9]{0,}\])$/, "")
|
|
2764
|
-
}));
|
|
2765
|
-
}
|
|
2766
|
-
return false;
|
|
2767
|
-
}
|
|
2768
|
-
}
|
|
2769
|
-
}
|
|
2770
|
-
function getAmbiguousTypes(sourceParameters, targetParameters, args) {
|
|
2771
|
-
for (const parameterIndex in sourceParameters) {
|
|
2772
|
-
const sourceParameter = sourceParameters[parameterIndex];
|
|
2773
|
-
const targetParameter = targetParameters[parameterIndex];
|
|
2774
|
-
if (sourceParameter.type === "tuple" && targetParameter.type === "tuple" && "components" in sourceParameter && "components" in targetParameter)
|
|
2775
|
-
return getAmbiguousTypes(sourceParameter.components, targetParameter.components, args[parameterIndex]);
|
|
2776
|
-
const types = [sourceParameter.type, targetParameter.type];
|
|
2777
|
-
const ambiguous = (() => {
|
|
2778
|
-
if (types.includes("address") && types.includes("bytes20"))
|
|
2779
|
-
return true;
|
|
2780
|
-
if (types.includes("address") && types.includes("string"))
|
|
2781
|
-
return isAddress(args[parameterIndex], { strict: false });
|
|
2782
|
-
if (types.includes("address") && types.includes("bytes"))
|
|
2783
|
-
return isAddress(args[parameterIndex], { strict: false });
|
|
2784
|
-
return false;
|
|
2785
|
-
})();
|
|
2786
|
-
if (ambiguous)
|
|
2787
|
-
return types;
|
|
2788
|
-
}
|
|
2789
|
-
return;
|
|
2790
|
-
}
|
|
2791
|
-
|
|
2792
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/chain/getChainContractAddress.js
|
|
2793
|
-
function getChainContractAddress({ blockNumber, chain, contract: name }) {
|
|
2794
|
-
var _a;
|
|
2795
|
-
const contract = (_a = chain == null ? void 0 : chain.contracts) == null ? void 0 : _a[name];
|
|
2796
|
-
if (!contract)
|
|
2797
|
-
throw new ChainDoesNotSupportContract({
|
|
2798
|
-
chain,
|
|
2799
|
-
contract: { name }
|
|
2800
|
-
});
|
|
2801
|
-
if (blockNumber && contract.blockCreated && contract.blockCreated > blockNumber)
|
|
2802
|
-
throw new ChainDoesNotSupportContract({
|
|
2803
|
-
blockNumber,
|
|
2804
|
-
chain,
|
|
2805
|
-
contract: {
|
|
2806
|
-
name,
|
|
2807
|
-
blockCreated: contract.blockCreated
|
|
2808
|
-
}
|
|
2809
|
-
});
|
|
2810
|
-
return contract.address;
|
|
2811
|
-
}
|
|
2812
|
-
|
|
2813
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/abi/formatAbiItemWithArgs.js
|
|
2814
|
-
function formatAbiItemWithArgs({ abiItem, args, includeFunctionName = true, includeName = false }) {
|
|
2815
|
-
if (!("name" in abiItem))
|
|
2816
|
-
return;
|
|
2817
|
-
if (!("inputs" in abiItem))
|
|
2818
|
-
return;
|
|
2819
|
-
if (!abiItem.inputs)
|
|
2820
|
-
return;
|
|
2821
|
-
return `${includeFunctionName ? abiItem.name : ""}(${abiItem.inputs.map((input, i) => `${includeName && input.name ? `${input.name}: ` : ""}${typeof args[i] === "object" ? stringify(args[i]) : args[i]}`).join(", ")})`;
|
|
2822
|
-
}
|
|
2823
|
-
|
|
2824
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/contract.js
|
|
2825
|
-
var CallExecutionError = class extends BaseError {
|
|
2826
|
-
constructor(cause, { account: account_, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, stateOverride }) {
|
|
2827
|
-
var _a;
|
|
2828
|
-
const account = account_ ? parseAccount(account_) : void 0;
|
|
2829
|
-
let prettyArgs = prettyPrint({
|
|
2830
|
-
from: account == null ? void 0 : account.address,
|
|
2831
|
-
to,
|
|
2832
|
-
value: typeof value !== "undefined" && `${formatEther(value)} ${((_a = chain == null ? void 0 : chain.nativeCurrency) == null ? void 0 : _a.symbol) || "ETH"}`,
|
|
2833
|
-
data,
|
|
2834
|
-
gas,
|
|
2835
|
-
gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
|
|
2836
|
-
maxFeePerGas: typeof maxFeePerGas !== "undefined" && `${formatGwei(maxFeePerGas)} gwei`,
|
|
2837
|
-
maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== "undefined" && `${formatGwei(maxPriorityFeePerGas)} gwei`,
|
|
2838
|
-
nonce
|
|
2839
|
-
});
|
|
2840
|
-
if (stateOverride) {
|
|
2841
|
-
prettyArgs += `
|
|
2842
|
-
${prettyStateOverride(stateOverride)}`;
|
|
2843
|
-
}
|
|
2844
|
-
super(cause.shortMessage, {
|
|
2845
|
-
cause,
|
|
2846
|
-
docsPath,
|
|
2847
|
-
metaMessages: [
|
|
2848
|
-
...cause.metaMessages ? [...cause.metaMessages, " "] : [],
|
|
2849
|
-
"Raw Call Arguments:",
|
|
2850
|
-
prettyArgs
|
|
2851
|
-
].filter(Boolean),
|
|
2852
|
-
name: "CallExecutionError"
|
|
2853
|
-
});
|
|
2854
|
-
Object.defineProperty(this, "cause", {
|
|
2855
|
-
enumerable: true,
|
|
2856
|
-
configurable: true,
|
|
2857
|
-
writable: true,
|
|
2858
|
-
value: void 0
|
|
2859
|
-
});
|
|
2860
|
-
this.cause = cause;
|
|
2861
|
-
}
|
|
2862
|
-
};
|
|
2863
|
-
var ContractFunctionExecutionError = class extends BaseError {
|
|
2864
|
-
constructor(cause, { abi, args, contractAddress, docsPath, functionName, sender }) {
|
|
2865
|
-
const abiItem = getAbiItem({ abi, args, name: functionName });
|
|
2866
|
-
const formattedArgs = abiItem ? formatAbiItemWithArgs({
|
|
2867
|
-
abiItem,
|
|
2868
|
-
args,
|
|
2869
|
-
includeFunctionName: false,
|
|
2870
|
-
includeName: false
|
|
2871
|
-
}) : void 0;
|
|
2872
|
-
const functionWithParams = abiItem ? formatAbiItem2(abiItem, { includeName: true }) : void 0;
|
|
2873
|
-
const prettyArgs = prettyPrint({
|
|
2874
|
-
address: contractAddress && getContractAddress(contractAddress),
|
|
2875
|
-
function: functionWithParams,
|
|
2876
|
-
args: formattedArgs && formattedArgs !== "()" && `${[...Array((functionName == null ? void 0 : functionName.length) ?? 0).keys()].map(() => " ").join("")}${formattedArgs}`,
|
|
2877
|
-
sender
|
|
2878
|
-
});
|
|
2879
|
-
super(cause.shortMessage || `An unknown error occurred while executing the contract function "${functionName}".`, {
|
|
2880
|
-
cause,
|
|
2881
|
-
docsPath,
|
|
2882
|
-
metaMessages: [
|
|
2883
|
-
...cause.metaMessages ? [...cause.metaMessages, " "] : [],
|
|
2884
|
-
prettyArgs && "Contract Call:",
|
|
2885
|
-
prettyArgs
|
|
2886
|
-
].filter(Boolean),
|
|
2887
|
-
name: "ContractFunctionExecutionError"
|
|
2888
|
-
});
|
|
2889
|
-
Object.defineProperty(this, "abi", {
|
|
2890
|
-
enumerable: true,
|
|
2891
|
-
configurable: true,
|
|
2892
|
-
writable: true,
|
|
2893
|
-
value: void 0
|
|
2894
|
-
});
|
|
2895
|
-
Object.defineProperty(this, "args", {
|
|
2896
|
-
enumerable: true,
|
|
2897
|
-
configurable: true,
|
|
2898
|
-
writable: true,
|
|
2899
|
-
value: void 0
|
|
2900
|
-
});
|
|
2901
|
-
Object.defineProperty(this, "cause", {
|
|
2902
|
-
enumerable: true,
|
|
2903
|
-
configurable: true,
|
|
2904
|
-
writable: true,
|
|
2905
|
-
value: void 0
|
|
2906
|
-
});
|
|
2907
|
-
Object.defineProperty(this, "contractAddress", {
|
|
2908
|
-
enumerable: true,
|
|
2909
|
-
configurable: true,
|
|
2910
|
-
writable: true,
|
|
2911
|
-
value: void 0
|
|
2912
|
-
});
|
|
2913
|
-
Object.defineProperty(this, "formattedArgs", {
|
|
2914
|
-
enumerable: true,
|
|
2915
|
-
configurable: true,
|
|
2916
|
-
writable: true,
|
|
2917
|
-
value: void 0
|
|
2918
|
-
});
|
|
2919
|
-
Object.defineProperty(this, "functionName", {
|
|
2920
|
-
enumerable: true,
|
|
2921
|
-
configurable: true,
|
|
2922
|
-
writable: true,
|
|
2923
|
-
value: void 0
|
|
2924
|
-
});
|
|
2925
|
-
Object.defineProperty(this, "sender", {
|
|
2926
|
-
enumerable: true,
|
|
2927
|
-
configurable: true,
|
|
2928
|
-
writable: true,
|
|
2929
|
-
value: void 0
|
|
2930
|
-
});
|
|
2931
|
-
this.abi = abi;
|
|
2932
|
-
this.args = args;
|
|
2933
|
-
this.cause = cause;
|
|
2934
|
-
this.contractAddress = contractAddress;
|
|
2935
|
-
this.functionName = functionName;
|
|
2936
|
-
this.sender = sender;
|
|
2937
|
-
}
|
|
2938
|
-
};
|
|
2939
|
-
var ContractFunctionRevertedError = class extends BaseError {
|
|
2940
|
-
constructor({ abi, data, functionName, message }) {
|
|
2941
|
-
let cause;
|
|
2942
|
-
let decodedData = void 0;
|
|
2943
|
-
let metaMessages;
|
|
2944
|
-
let reason;
|
|
2945
|
-
if (data && data !== "0x") {
|
|
2946
|
-
try {
|
|
2947
|
-
decodedData = decodeErrorResult({ abi, data });
|
|
2948
|
-
const { abiItem, errorName, args: errorArgs } = decodedData;
|
|
2949
|
-
if (errorName === "Error") {
|
|
2950
|
-
reason = errorArgs[0];
|
|
2951
|
-
} else if (errorName === "Panic") {
|
|
2952
|
-
const [firstArg] = errorArgs;
|
|
2953
|
-
reason = panicReasons[firstArg];
|
|
2954
|
-
} else {
|
|
2955
|
-
const errorWithParams = abiItem ? formatAbiItem2(abiItem, { includeName: true }) : void 0;
|
|
2956
|
-
const formattedArgs = abiItem && errorArgs ? formatAbiItemWithArgs({
|
|
2957
|
-
abiItem,
|
|
2958
|
-
args: errorArgs,
|
|
2959
|
-
includeFunctionName: false,
|
|
2960
|
-
includeName: false
|
|
2961
|
-
}) : void 0;
|
|
2962
|
-
metaMessages = [
|
|
2963
|
-
errorWithParams ? `Error: ${errorWithParams}` : "",
|
|
2964
|
-
formattedArgs && formattedArgs !== "()" ? ` ${[...Array((errorName == null ? void 0 : errorName.length) ?? 0).keys()].map(() => " ").join("")}${formattedArgs}` : ""
|
|
2965
|
-
];
|
|
2966
|
-
}
|
|
2967
|
-
} catch (err) {
|
|
2968
|
-
cause = err;
|
|
2969
|
-
}
|
|
2970
|
-
} else if (message)
|
|
2971
|
-
reason = message;
|
|
2972
|
-
let signature;
|
|
2973
|
-
if (cause instanceof AbiErrorSignatureNotFoundError) {
|
|
2974
|
-
signature = cause.signature;
|
|
2975
|
-
metaMessages = [
|
|
2976
|
-
`Unable to decode signature "${signature}" as it was not found on the provided ABI.`,
|
|
2977
|
-
"Make sure you are using the correct ABI and that the error exists on it.",
|
|
2978
|
-
`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${signature}.`
|
|
2979
|
-
];
|
|
2980
|
-
}
|
|
2981
|
-
super(reason && reason !== "execution reverted" || signature ? [
|
|
2982
|
-
`The contract function "${functionName}" reverted with the following ${signature ? "signature" : "reason"}:`,
|
|
2983
|
-
reason || signature
|
|
2984
|
-
].join("\n") : `The contract function "${functionName}" reverted.`, {
|
|
2985
|
-
cause,
|
|
2986
|
-
metaMessages,
|
|
2987
|
-
name: "ContractFunctionRevertedError"
|
|
2988
|
-
});
|
|
2989
|
-
Object.defineProperty(this, "data", {
|
|
2990
|
-
enumerable: true,
|
|
2991
|
-
configurable: true,
|
|
2992
|
-
writable: true,
|
|
2993
|
-
value: void 0
|
|
2994
|
-
});
|
|
2995
|
-
Object.defineProperty(this, "raw", {
|
|
2996
|
-
enumerable: true,
|
|
2997
|
-
configurable: true,
|
|
2998
|
-
writable: true,
|
|
2999
|
-
value: void 0
|
|
3000
|
-
});
|
|
3001
|
-
Object.defineProperty(this, "reason", {
|
|
3002
|
-
enumerable: true,
|
|
3003
|
-
configurable: true,
|
|
3004
|
-
writable: true,
|
|
3005
|
-
value: void 0
|
|
3006
|
-
});
|
|
3007
|
-
Object.defineProperty(this, "signature", {
|
|
3008
|
-
enumerable: true,
|
|
3009
|
-
configurable: true,
|
|
3010
|
-
writable: true,
|
|
3011
|
-
value: void 0
|
|
3012
|
-
});
|
|
3013
|
-
this.data = decodedData;
|
|
3014
|
-
this.raw = data;
|
|
3015
|
-
this.reason = reason;
|
|
3016
|
-
this.signature = signature;
|
|
3017
|
-
}
|
|
3018
|
-
};
|
|
3019
|
-
var ContractFunctionZeroDataError = class extends BaseError {
|
|
3020
|
-
constructor({ functionName }) {
|
|
3021
|
-
super(`The contract function "${functionName}" returned no data ("0x").`, {
|
|
3022
|
-
metaMessages: [
|
|
3023
|
-
"This could be due to any of the following:",
|
|
3024
|
-
` - The contract does not have the function "${functionName}",`,
|
|
3025
|
-
" - The parameters passed to the contract function may be invalid, or",
|
|
3026
|
-
" - The address is not a contract."
|
|
3027
|
-
],
|
|
3028
|
-
name: "ContractFunctionZeroDataError"
|
|
3029
|
-
});
|
|
3030
|
-
}
|
|
3031
|
-
};
|
|
3032
|
-
var CounterfactualDeploymentFailedError = class extends BaseError {
|
|
3033
|
-
constructor({ factory }) {
|
|
3034
|
-
super(`Deployment for counterfactual contract call failed${factory ? ` for factory "${factory}".` : ""}`, {
|
|
3035
|
-
metaMessages: [
|
|
3036
|
-
"Please ensure:",
|
|
3037
|
-
"- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).",
|
|
3038
|
-
"- The `factoryData` is a valid encoded function call for contract deployment function on the factory."
|
|
3039
|
-
],
|
|
3040
|
-
name: "CounterfactualDeploymentFailedError"
|
|
3041
|
-
});
|
|
3042
|
-
}
|
|
3043
|
-
};
|
|
3044
|
-
var RawContractError = class extends BaseError {
|
|
3045
|
-
constructor({ data, message }) {
|
|
3046
|
-
super(message || "", { name: "RawContractError" });
|
|
3047
|
-
Object.defineProperty(this, "code", {
|
|
3048
|
-
enumerable: true,
|
|
3049
|
-
configurable: true,
|
|
3050
|
-
writable: true,
|
|
3051
|
-
value: 3
|
|
3052
|
-
});
|
|
3053
|
-
Object.defineProperty(this, "data", {
|
|
3054
|
-
enumerable: true,
|
|
3055
|
-
configurable: true,
|
|
3056
|
-
writable: true,
|
|
3057
|
-
value: void 0
|
|
3058
|
-
});
|
|
3059
|
-
this.data = data;
|
|
3060
|
-
}
|
|
3061
|
-
};
|
|
3062
|
-
|
|
3063
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/errors/getNodeError.js
|
|
3064
|
-
function getNodeError(err, args) {
|
|
3065
|
-
const message = (err.details || "").toLowerCase();
|
|
3066
|
-
const executionRevertedError = err instanceof BaseError ? err.walk((e) => (e == null ? void 0 : e.code) === ExecutionRevertedError.code) : err;
|
|
3067
|
-
if (executionRevertedError instanceof BaseError)
|
|
3068
|
-
return new ExecutionRevertedError({
|
|
3069
|
-
cause: err,
|
|
3070
|
-
message: executionRevertedError.details
|
|
3071
|
-
});
|
|
3072
|
-
if (ExecutionRevertedError.nodeMessage.test(message))
|
|
3073
|
-
return new ExecutionRevertedError({
|
|
3074
|
-
cause: err,
|
|
3075
|
-
message: err.details
|
|
3076
|
-
});
|
|
3077
|
-
if (FeeCapTooHighError.nodeMessage.test(message))
|
|
3078
|
-
return new FeeCapTooHighError({
|
|
3079
|
-
cause: err,
|
|
3080
|
-
maxFeePerGas: args == null ? void 0 : args.maxFeePerGas
|
|
3081
|
-
});
|
|
3082
|
-
if (FeeCapTooLowError.nodeMessage.test(message))
|
|
3083
|
-
return new FeeCapTooLowError({
|
|
3084
|
-
cause: err,
|
|
3085
|
-
maxFeePerGas: args == null ? void 0 : args.maxFeePerGas
|
|
3086
|
-
});
|
|
3087
|
-
if (NonceTooHighError.nodeMessage.test(message))
|
|
3088
|
-
return new NonceTooHighError({ cause: err, nonce: args == null ? void 0 : args.nonce });
|
|
3089
|
-
if (NonceTooLowError.nodeMessage.test(message))
|
|
3090
|
-
return new NonceTooLowError({ cause: err, nonce: args == null ? void 0 : args.nonce });
|
|
3091
|
-
if (NonceMaxValueError.nodeMessage.test(message))
|
|
3092
|
-
return new NonceMaxValueError({ cause: err, nonce: args == null ? void 0 : args.nonce });
|
|
3093
|
-
if (InsufficientFundsError.nodeMessage.test(message))
|
|
3094
|
-
return new InsufficientFundsError({ cause: err });
|
|
3095
|
-
if (IntrinsicGasTooHighError.nodeMessage.test(message))
|
|
3096
|
-
return new IntrinsicGasTooHighError({ cause: err, gas: args == null ? void 0 : args.gas });
|
|
3097
|
-
if (IntrinsicGasTooLowError.nodeMessage.test(message))
|
|
3098
|
-
return new IntrinsicGasTooLowError({ cause: err, gas: args == null ? void 0 : args.gas });
|
|
3099
|
-
if (TransactionTypeNotSupportedError.nodeMessage.test(message))
|
|
3100
|
-
return new TransactionTypeNotSupportedError({ cause: err });
|
|
3101
|
-
if (TipAboveFeeCapError.nodeMessage.test(message))
|
|
3102
|
-
return new TipAboveFeeCapError({
|
|
3103
|
-
cause: err,
|
|
3104
|
-
maxFeePerGas: args == null ? void 0 : args.maxFeePerGas,
|
|
3105
|
-
maxPriorityFeePerGas: args == null ? void 0 : args.maxPriorityFeePerGas
|
|
3106
|
-
});
|
|
3107
|
-
return new UnknownNodeError({
|
|
3108
|
-
cause: err
|
|
3109
|
-
});
|
|
3110
|
-
}
|
|
3111
|
-
|
|
3112
|
-
// ../../../../node_modules/.pnpm/viem@2.23.15_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/errors/getCallError.js
|
|
3113
|
-
function getCallError(err, { docsPath, ...args }) {
|
|
3114
|
-
const cause = (() => {
|
|
3115
|
-
const cause2 = getNodeError(err, args);
|
|
3116
|
-
if (cause2 instanceof UnknownNodeError)
|
|
3117
|
-
return err;
|
|
3118
|
-
return cause2;
|
|
3119
|
-
})();
|
|
3120
|
-
return new CallExecutionError(cause, {
|
|
3121
|
-
docsPath,
|
|
3122
|
-
...args
|
|
3123
|
-
});
|
|
3124
|
-
}
|
|
3125
|
-
|
|
3126
|
-
export {
|
|
3127
|
-
BaseError,
|
|
3128
|
-
InvalidBytesLengthError,
|
|
3129
|
-
pad,
|
|
3130
|
-
isHex,
|
|
3131
|
-
size,
|
|
3132
|
-
trim,
|
|
3133
|
-
toBytes,
|
|
3134
|
-
hexToBytes,
|
|
3135
|
-
stringToBytes,
|
|
3136
|
-
fromHex,
|
|
3137
|
-
hexToBigInt,
|
|
3138
|
-
hexToBool,
|
|
3139
|
-
hexToNumber,
|
|
3140
|
-
hexToString,
|
|
3141
|
-
toHex,
|
|
3142
|
-
bytesToHex,
|
|
3143
|
-
numberToHex,
|
|
3144
|
-
stringToHex,
|
|
3145
|
-
formatAbiItem2 as formatAbiItem,
|
|
3146
|
-
AbiConstructorNotFoundError,
|
|
3147
|
-
AbiConstructorParamsNotFoundError,
|
|
3148
|
-
AbiDecodingDataSizeTooSmallError,
|
|
3149
|
-
AbiDecodingZeroDataError,
|
|
3150
|
-
AbiEventSignatureEmptyTopicsError,
|
|
3151
|
-
AbiEventSignatureNotFoundError,
|
|
3152
|
-
AbiEventNotFoundError,
|
|
3153
|
-
AbiFunctionNotFoundError,
|
|
3154
|
-
AbiFunctionOutputsNotFoundError,
|
|
3155
|
-
BytesSizeMismatchError,
|
|
3156
|
-
DecodeLogDataMismatch,
|
|
3157
|
-
DecodeLogTopicsMismatch,
|
|
3158
|
-
concat,
|
|
3159
|
-
concatHex,
|
|
3160
|
-
InvalidAddressError,
|
|
3161
|
-
LruMap,
|
|
3162
|
-
keccak256,
|
|
3163
|
-
checksumAddress,
|
|
3164
|
-
getAddress,
|
|
3165
|
-
isAddress,
|
|
3166
|
-
slice,
|
|
3167
|
-
sliceHex,
|
|
3168
|
-
bytesRegex,
|
|
3169
|
-
integerRegex,
|
|
3170
|
-
encodeAbiParameters,
|
|
3171
|
-
parseAccount,
|
|
3172
|
-
PositionOutOfBoundsError,
|
|
3173
|
-
createCursor,
|
|
3174
|
-
ChainDoesNotSupportContract,
|
|
3175
|
-
ChainMismatchError,
|
|
3176
|
-
ChainNotFoundError,
|
|
3177
|
-
ClientChainNotConfiguredError,
|
|
3178
|
-
InvalidChainIdError,
|
|
3179
|
-
weiUnits,
|
|
3180
|
-
formatUnits,
|
|
3181
|
-
formatGwei,
|
|
3182
|
-
ExecutionRevertedError,
|
|
3183
|
-
FeeCapTooHighError,
|
|
3184
|
-
TipAboveFeeCapError,
|
|
3185
|
-
UnknownNodeError,
|
|
3186
|
-
formatEther,
|
|
3187
|
-
prettyPrint,
|
|
3188
|
-
InvalidLegacyVError,
|
|
3189
|
-
InvalidSerializableTransactionError,
|
|
3190
|
-
InvalidStorageKeySizeError,
|
|
3191
|
-
TransactionExecutionError,
|
|
3192
|
-
TransactionNotFoundError,
|
|
3193
|
-
TransactionReceiptNotFoundError,
|
|
3194
|
-
WaitForTransactionReceiptTimeoutError,
|
|
3195
|
-
stringify,
|
|
3196
|
-
getUrl,
|
|
3197
|
-
HttpRequestError,
|
|
3198
|
-
WebSocketRequestError,
|
|
3199
|
-
RpcRequestError,
|
|
3200
|
-
SocketClosedError,
|
|
3201
|
-
TimeoutError,
|
|
3202
|
-
ParseRpcError,
|
|
3203
|
-
InvalidRequestRpcError,
|
|
3204
|
-
MethodNotFoundRpcError,
|
|
3205
|
-
InvalidParamsRpcError,
|
|
3206
|
-
InternalRpcError,
|
|
3207
|
-
InvalidInputRpcError,
|
|
3208
|
-
ResourceNotFoundRpcError,
|
|
3209
|
-
ResourceUnavailableRpcError,
|
|
3210
|
-
TransactionRejectedRpcError,
|
|
3211
|
-
MethodNotSupportedRpcError,
|
|
3212
|
-
LimitExceededRpcError,
|
|
3213
|
-
JsonRpcVersionUnsupportedError,
|
|
3214
|
-
UserRejectedRequestError,
|
|
3215
|
-
UnauthorizedProviderError,
|
|
3216
|
-
UnsupportedProviderMethodError,
|
|
3217
|
-
ProviderDisconnectedError,
|
|
3218
|
-
ChainDisconnectedError,
|
|
3219
|
-
SwitchChainError,
|
|
3220
|
-
UnknownRpcError,
|
|
3221
|
-
getNodeError,
|
|
3222
|
-
extract,
|
|
3223
|
-
defineFormatter,
|
|
3224
|
-
formatTransactionRequest,
|
|
3225
|
-
defineTransactionRequest,
|
|
3226
|
-
maxUint16,
|
|
3227
|
-
maxUint256,
|
|
3228
|
-
assertRequest,
|
|
3229
|
-
AccountStateConflictError,
|
|
3230
|
-
StateAssignmentConflictError,
|
|
3231
|
-
decodeAbiParameters,
|
|
3232
|
-
toEventSelector,
|
|
3233
|
-
toFunctionSelector,
|
|
3234
|
-
getAbiItem,
|
|
3235
|
-
getChainContractAddress,
|
|
3236
|
-
panicReasons,
|
|
3237
|
-
decodeErrorResult,
|
|
3238
|
-
CallExecutionError,
|
|
3239
|
-
ContractFunctionExecutionError,
|
|
3240
|
-
ContractFunctionRevertedError,
|
|
3241
|
-
ContractFunctionZeroDataError,
|
|
3242
|
-
CounterfactualDeploymentFailedError,
|
|
3243
|
-
RawContractError,
|
|
3244
|
-
getCallError
|
|
3245
|
-
};
|
|
3246
|
-
//# sourceMappingURL=chunk-P727YSDY.js.map
|