@farcaster/create-mini-app 0.0.4 → 0.0.6
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 +12 -0
- package/bin.ts +2 -0
- package/dist/bin.js +6 -6
- package/dist/bin.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/init.js +21 -27
- package/dist/init.js.map +1 -1
- package/index.ts +1 -1
- package/init.ts +1 -1
- package/package.json +2 -2
- package/templates/default/_env.local +1 -0
- package/templates/default/_gitignore +24 -0
- package/templates/default/_npmrc +1 -0
- package/templates/default/node_modules/.bin/biome +17 -0
- package/templates/default/node_modules/.bin/browserslist +17 -0
- package/templates/default/node_modules/.bin/esbuild +17 -0
- package/templates/default/node_modules/.bin/terser +17 -0
- package/templates/default/node_modules/.bin/tsc +17 -0
- package/templates/default/node_modules/.bin/tsserver +17 -0
- package/templates/default/node_modules/.bin/vite +17 -0
- package/templates/default/node_modules/.bin/wagmi +17 -0
- package/templates/default/node_modules/.vite/deps/@farcaster_frame-sdk.js +84 -0
- package/templates/default/node_modules/.vite/deps/@farcaster_frame-sdk.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/@farcaster_frame-wagmi-connector.js +1936 -0
- package/templates/default/node_modules/.vite/deps/@farcaster_frame-wagmi-connector.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/@tanstack_react-query.js +96 -0
- package/templates/default/node_modules/.vite/deps/@tanstack_react-query.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/_metadata.json +139 -0
- package/templates/default/node_modules/.vite/deps/ccip-JTEXJDV5.js +17 -0
- package/templates/default/node_modules/.vite/deps/ccip-JTEXJDV5.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/ccip-LLOJAQYN.js +14 -0
- package/templates/default/node_modules/.vite/deps/ccip-LLOJAQYN.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-2KW72IQL.js +2601 -0
- package/templates/default/node_modules/.vite/deps/chunk-2KW72IQL.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-2ULAEEW3.js +286 -0
- package/templates/default/node_modules/.vite/deps/chunk-2ULAEEW3.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-3MMZATWV.js +1906 -0
- package/templates/default/node_modules/.vite/deps/chunk-3MMZATWV.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-6WYSWNQJ.js +3183 -0
- package/templates/default/node_modules/.vite/deps/chunk-6WYSWNQJ.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-AJPHOYQK.js +21628 -0
- package/templates/default/node_modules/.vite/deps/chunk-AJPHOYQK.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-HP7M7ER3.js +2221 -0
- package/templates/default/node_modules/.vite/deps/chunk-HP7M7ER3.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-JDAHWTZP.js +928 -0
- package/templates/default/node_modules/.vite/deps/chunk-JDAHWTZP.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-OOB7NECH.js +58 -0
- package/templates/default/node_modules/.vite/deps/chunk-OOB7NECH.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-OYL52S4H.js +190 -0
- package/templates/default/node_modules/.vite/deps/chunk-OYL52S4H.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-P2SCV6N5.js +1085 -0
- package/templates/default/node_modules/.vite/deps/chunk-P2SCV6N5.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-P727YSDY.js +3246 -0
- package/templates/default/node_modules/.vite/deps/chunk-P727YSDY.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-PH77EFIP.js +278 -0
- package/templates/default/node_modules/.vite/deps/chunk-PH77EFIP.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-PK65EOOR.js +4416 -0
- package/templates/default/node_modules/.vite/deps/chunk-PK65EOOR.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-PPRY4ZGR.js +36187 -0
- package/templates/default/node_modules/.vite/deps/chunk-PPRY4ZGR.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-Q3UTC4SW.js +832 -0
- package/templates/default/node_modules/.vite/deps/chunk-Q3UTC4SW.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-R2PSY44V.js +815 -0
- package/templates/default/node_modules/.vite/deps/chunk-R2PSY44V.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/chunk-WOOG5QLI.js +60 -0
- package/templates/default/node_modules/.vite/deps/chunk-WOOG5QLI.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/native-J7PVLWWX.js +21 -0
- package/templates/default/node_modules/.vite/deps/native-J7PVLWWX.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/native-UTGEKOTD.js +21 -0
- package/templates/default/node_modules/.vite/deps/native-UTGEKOTD.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/package.json +3 -0
- package/templates/default/node_modules/.vite/deps/react-dom.js +7 -0
- package/templates/default/node_modules/.vite/deps/react-dom.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/react-dom_client.js +39 -0
- package/templates/default/node_modules/.vite/deps/react-dom_client.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/react.js +6 -0
- package/templates/default/node_modules/.vite/deps/react.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/react_jsx-dev-runtime.js +913 -0
- package/templates/default/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/react_jsx-runtime.js +7 -0
- package/templates/default/node_modules/.vite/deps/react_jsx-runtime.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/secp256k1-HB6OVCEM.js +14 -0
- package/templates/default/node_modules/.vite/deps/secp256k1-HB6OVCEM.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/secp256k1-YI5SRKAE.js +16 -0
- package/templates/default/node_modules/.vite/deps/secp256k1-YI5SRKAE.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/wagmi.js +12147 -0
- package/templates/default/node_modules/.vite/deps/wagmi.js.map +7 -0
- package/templates/default/node_modules/.vite/deps/wagmi_chains.js +16355 -0
- package/templates/default/node_modules/.vite/deps/wagmi_chains.js.map +7 -0
- package/templates/default/package.json +1 -1
- package/templates/default/src/main.tsx +1 -1
|
@@ -0,0 +1,1085 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Hash,
|
|
3
|
+
abytes,
|
|
4
|
+
aexists,
|
|
5
|
+
anumber,
|
|
6
|
+
aoutput,
|
|
7
|
+
byteSwap32,
|
|
8
|
+
isLE,
|
|
9
|
+
toBytes,
|
|
10
|
+
u32,
|
|
11
|
+
wrapConstructor,
|
|
12
|
+
wrapXOFConstructorWithOpts
|
|
13
|
+
} from "./chunk-OYL52S4H.js";
|
|
14
|
+
|
|
15
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/version.js
|
|
16
|
+
var version = "1.0.8";
|
|
17
|
+
|
|
18
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/errors.js
|
|
19
|
+
var BaseError = class _BaseError extends Error {
|
|
20
|
+
constructor(shortMessage, args = {}) {
|
|
21
|
+
var _a;
|
|
22
|
+
const details = args.cause instanceof _BaseError ? args.cause.details : ((_a = args.cause) == null ? void 0 : _a.message) ? args.cause.message : args.details;
|
|
23
|
+
const docsPath = args.cause instanceof _BaseError ? args.cause.docsPath || args.docsPath : args.docsPath;
|
|
24
|
+
const message = [
|
|
25
|
+
shortMessage || "An error occurred.",
|
|
26
|
+
"",
|
|
27
|
+
...args.metaMessages ? [...args.metaMessages, ""] : [],
|
|
28
|
+
...docsPath ? [`Docs: https://abitype.dev${docsPath}`] : [],
|
|
29
|
+
...details ? [`Details: ${details}`] : [],
|
|
30
|
+
`Version: abitype@${version}`
|
|
31
|
+
].join("\n");
|
|
32
|
+
super(message);
|
|
33
|
+
Object.defineProperty(this, "details", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true,
|
|
37
|
+
value: void 0
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(this, "docsPath", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true,
|
|
42
|
+
writable: true,
|
|
43
|
+
value: void 0
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(this, "metaMessages", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
configurable: true,
|
|
48
|
+
writable: true,
|
|
49
|
+
value: void 0
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(this, "shortMessage", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
configurable: true,
|
|
54
|
+
writable: true,
|
|
55
|
+
value: void 0
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(this, "name", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
configurable: true,
|
|
60
|
+
writable: true,
|
|
61
|
+
value: "AbiTypeError"
|
|
62
|
+
});
|
|
63
|
+
if (args.cause)
|
|
64
|
+
this.cause = args.cause;
|
|
65
|
+
this.details = details;
|
|
66
|
+
this.docsPath = docsPath;
|
|
67
|
+
this.metaMessages = args.metaMessages;
|
|
68
|
+
this.shortMessage = shortMessage;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/errors/abiItem.js
|
|
73
|
+
var InvalidAbiItemError = class extends BaseError {
|
|
74
|
+
constructor({ signature }) {
|
|
75
|
+
super("Failed to parse ABI item.", {
|
|
76
|
+
details: `parseAbiItem(${JSON.stringify(signature, null, 2)})`,
|
|
77
|
+
docsPath: "/api/human#parseabiitem-1"
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(this, "name", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
configurable: true,
|
|
82
|
+
writable: true,
|
|
83
|
+
value: "InvalidAbiItemError"
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var UnknownTypeError = class extends BaseError {
|
|
88
|
+
constructor({ type }) {
|
|
89
|
+
super("Unknown type.", {
|
|
90
|
+
metaMessages: [
|
|
91
|
+
`Type "${type}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(this, "name", {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
configurable: true,
|
|
97
|
+
writable: true,
|
|
98
|
+
value: "UnknownTypeError"
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
var UnknownSolidityTypeError = class extends BaseError {
|
|
103
|
+
constructor({ type }) {
|
|
104
|
+
super("Unknown type.", {
|
|
105
|
+
metaMessages: [`Type "${type}" is not a valid ABI type.`]
|
|
106
|
+
});
|
|
107
|
+
Object.defineProperty(this, "name", {
|
|
108
|
+
enumerable: true,
|
|
109
|
+
configurable: true,
|
|
110
|
+
writable: true,
|
|
111
|
+
value: "UnknownSolidityTypeError"
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/errors/abiParameter.js
|
|
117
|
+
var InvalidAbiParametersError = class extends BaseError {
|
|
118
|
+
constructor({ params }) {
|
|
119
|
+
super("Failed to parse ABI parameters.", {
|
|
120
|
+
details: `parseAbiParameters(${JSON.stringify(params, null, 2)})`,
|
|
121
|
+
docsPath: "/api/human#parseabiparameters-1"
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(this, "name", {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
configurable: true,
|
|
126
|
+
writable: true,
|
|
127
|
+
value: "InvalidAbiParametersError"
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
var InvalidParameterError = class extends BaseError {
|
|
132
|
+
constructor({ param }) {
|
|
133
|
+
super("Invalid ABI parameter.", {
|
|
134
|
+
details: param
|
|
135
|
+
});
|
|
136
|
+
Object.defineProperty(this, "name", {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
configurable: true,
|
|
139
|
+
writable: true,
|
|
140
|
+
value: "InvalidParameterError"
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
var SolidityProtectedKeywordError = class extends BaseError {
|
|
145
|
+
constructor({ param, name }) {
|
|
146
|
+
super("Invalid ABI parameter.", {
|
|
147
|
+
details: param,
|
|
148
|
+
metaMessages: [
|
|
149
|
+
`"${name}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`
|
|
150
|
+
]
|
|
151
|
+
});
|
|
152
|
+
Object.defineProperty(this, "name", {
|
|
153
|
+
enumerable: true,
|
|
154
|
+
configurable: true,
|
|
155
|
+
writable: true,
|
|
156
|
+
value: "SolidityProtectedKeywordError"
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
var InvalidModifierError = class extends BaseError {
|
|
161
|
+
constructor({ param, type, modifier }) {
|
|
162
|
+
super("Invalid ABI parameter.", {
|
|
163
|
+
details: param,
|
|
164
|
+
metaMessages: [
|
|
165
|
+
`Modifier "${modifier}" not allowed${type ? ` in "${type}" type` : ""}.`
|
|
166
|
+
]
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(this, "name", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
configurable: true,
|
|
171
|
+
writable: true,
|
|
172
|
+
value: "InvalidModifierError"
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
var InvalidFunctionModifierError = class extends BaseError {
|
|
177
|
+
constructor({ param, type, modifier }) {
|
|
178
|
+
super("Invalid ABI parameter.", {
|
|
179
|
+
details: param,
|
|
180
|
+
metaMessages: [
|
|
181
|
+
`Modifier "${modifier}" not allowed${type ? ` in "${type}" type` : ""}.`,
|
|
182
|
+
`Data location can only be specified for array, struct, or mapping types, but "${modifier}" was given.`
|
|
183
|
+
]
|
|
184
|
+
});
|
|
185
|
+
Object.defineProperty(this, "name", {
|
|
186
|
+
enumerable: true,
|
|
187
|
+
configurable: true,
|
|
188
|
+
writable: true,
|
|
189
|
+
value: "InvalidFunctionModifierError"
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
var InvalidAbiTypeParameterError = class extends BaseError {
|
|
194
|
+
constructor({ abiParameter }) {
|
|
195
|
+
super("Invalid ABI parameter.", {
|
|
196
|
+
details: JSON.stringify(abiParameter, null, 2),
|
|
197
|
+
metaMessages: ["ABI parameter type is invalid."]
|
|
198
|
+
});
|
|
199
|
+
Object.defineProperty(this, "name", {
|
|
200
|
+
enumerable: true,
|
|
201
|
+
configurable: true,
|
|
202
|
+
writable: true,
|
|
203
|
+
value: "InvalidAbiTypeParameterError"
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/errors/signature.js
|
|
209
|
+
var InvalidSignatureError = class extends BaseError {
|
|
210
|
+
constructor({ signature, type }) {
|
|
211
|
+
super(`Invalid ${type} signature.`, {
|
|
212
|
+
details: signature
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(this, "name", {
|
|
215
|
+
enumerable: true,
|
|
216
|
+
configurable: true,
|
|
217
|
+
writable: true,
|
|
218
|
+
value: "InvalidSignatureError"
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
var UnknownSignatureError = class extends BaseError {
|
|
223
|
+
constructor({ signature }) {
|
|
224
|
+
super("Unknown signature.", {
|
|
225
|
+
details: signature
|
|
226
|
+
});
|
|
227
|
+
Object.defineProperty(this, "name", {
|
|
228
|
+
enumerable: true,
|
|
229
|
+
configurable: true,
|
|
230
|
+
writable: true,
|
|
231
|
+
value: "UnknownSignatureError"
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
var InvalidStructSignatureError = class extends BaseError {
|
|
236
|
+
constructor({ signature }) {
|
|
237
|
+
super("Invalid struct signature.", {
|
|
238
|
+
details: signature,
|
|
239
|
+
metaMessages: ["No properties exist."]
|
|
240
|
+
});
|
|
241
|
+
Object.defineProperty(this, "name", {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
configurable: true,
|
|
244
|
+
writable: true,
|
|
245
|
+
value: "InvalidStructSignatureError"
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/errors/struct.js
|
|
251
|
+
var CircularReferenceError = class extends BaseError {
|
|
252
|
+
constructor({ type }) {
|
|
253
|
+
super("Circular reference detected.", {
|
|
254
|
+
metaMessages: [`Struct "${type}" is a circular reference.`]
|
|
255
|
+
});
|
|
256
|
+
Object.defineProperty(this, "name", {
|
|
257
|
+
enumerable: true,
|
|
258
|
+
configurable: true,
|
|
259
|
+
writable: true,
|
|
260
|
+
value: "CircularReferenceError"
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/errors/splitParameters.js
|
|
266
|
+
var InvalidParenthesisError = class extends BaseError {
|
|
267
|
+
constructor({ current, depth }) {
|
|
268
|
+
super("Unbalanced parentheses.", {
|
|
269
|
+
metaMessages: [
|
|
270
|
+
`"${current.trim()}" has too many ${depth > 0 ? "opening" : "closing"} parentheses.`
|
|
271
|
+
],
|
|
272
|
+
details: `Depth "${depth}"`
|
|
273
|
+
});
|
|
274
|
+
Object.defineProperty(this, "name", {
|
|
275
|
+
enumerable: true,
|
|
276
|
+
configurable: true,
|
|
277
|
+
writable: true,
|
|
278
|
+
value: "InvalidParenthesisError"
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/regex.js
|
|
284
|
+
function execTyped(regex, string) {
|
|
285
|
+
const match = regex.exec(string);
|
|
286
|
+
return match == null ? void 0 : match.groups;
|
|
287
|
+
}
|
|
288
|
+
var bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
|
|
289
|
+
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)?$/;
|
|
290
|
+
var isTupleRegex = /^\(.+?\).*?$/;
|
|
291
|
+
|
|
292
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/runtime/signatures.js
|
|
293
|
+
var errorSignatureRegex = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
294
|
+
function isErrorSignature(signature) {
|
|
295
|
+
return errorSignatureRegex.test(signature);
|
|
296
|
+
}
|
|
297
|
+
function execErrorSignature(signature) {
|
|
298
|
+
return execTyped(errorSignatureRegex, signature);
|
|
299
|
+
}
|
|
300
|
+
var eventSignatureRegex = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
301
|
+
function isEventSignature(signature) {
|
|
302
|
+
return eventSignatureRegex.test(signature);
|
|
303
|
+
}
|
|
304
|
+
function execEventSignature(signature) {
|
|
305
|
+
return execTyped(eventSignatureRegex, signature);
|
|
306
|
+
}
|
|
307
|
+
var functionSignatureRegex = /^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;
|
|
308
|
+
function isFunctionSignature(signature) {
|
|
309
|
+
return functionSignatureRegex.test(signature);
|
|
310
|
+
}
|
|
311
|
+
function execFunctionSignature(signature) {
|
|
312
|
+
return execTyped(functionSignatureRegex, signature);
|
|
313
|
+
}
|
|
314
|
+
var structSignatureRegex = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;
|
|
315
|
+
function isStructSignature(signature) {
|
|
316
|
+
return structSignatureRegex.test(signature);
|
|
317
|
+
}
|
|
318
|
+
function execStructSignature(signature) {
|
|
319
|
+
return execTyped(structSignatureRegex, signature);
|
|
320
|
+
}
|
|
321
|
+
var constructorSignatureRegex = /^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;
|
|
322
|
+
function isConstructorSignature(signature) {
|
|
323
|
+
return constructorSignatureRegex.test(signature);
|
|
324
|
+
}
|
|
325
|
+
function execConstructorSignature(signature) {
|
|
326
|
+
return execTyped(constructorSignatureRegex, signature);
|
|
327
|
+
}
|
|
328
|
+
var fallbackSignatureRegex = /^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;
|
|
329
|
+
function isFallbackSignature(signature) {
|
|
330
|
+
return fallbackSignatureRegex.test(signature);
|
|
331
|
+
}
|
|
332
|
+
function execFallbackSignature(signature) {
|
|
333
|
+
return execTyped(fallbackSignatureRegex, signature);
|
|
334
|
+
}
|
|
335
|
+
var receiveSignatureRegex = /^receive\(\) external payable$/;
|
|
336
|
+
function isReceiveSignature(signature) {
|
|
337
|
+
return receiveSignatureRegex.test(signature);
|
|
338
|
+
}
|
|
339
|
+
var modifiers = /* @__PURE__ */ new Set([
|
|
340
|
+
"memory",
|
|
341
|
+
"indexed",
|
|
342
|
+
"storage",
|
|
343
|
+
"calldata"
|
|
344
|
+
]);
|
|
345
|
+
var eventModifiers = /* @__PURE__ */ new Set(["indexed"]);
|
|
346
|
+
var functionModifiers = /* @__PURE__ */ new Set([
|
|
347
|
+
"calldata",
|
|
348
|
+
"memory",
|
|
349
|
+
"storage"
|
|
350
|
+
]);
|
|
351
|
+
|
|
352
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/runtime/cache.js
|
|
353
|
+
function getParameterCacheKey(param, type, structs) {
|
|
354
|
+
let structKey = "";
|
|
355
|
+
if (structs)
|
|
356
|
+
for (const struct of Object.entries(structs)) {
|
|
357
|
+
if (!struct)
|
|
358
|
+
continue;
|
|
359
|
+
let propertyKey = "";
|
|
360
|
+
for (const property of struct[1]) {
|
|
361
|
+
propertyKey += `[${property.type}${property.name ? `:${property.name}` : ""}]`;
|
|
362
|
+
}
|
|
363
|
+
structKey += `(${struct[0]}{${propertyKey}})`;
|
|
364
|
+
}
|
|
365
|
+
if (type)
|
|
366
|
+
return `${type}:${param}${structKey}`;
|
|
367
|
+
return param;
|
|
368
|
+
}
|
|
369
|
+
var parameterCache = /* @__PURE__ */ new Map([
|
|
370
|
+
// Unnamed
|
|
371
|
+
["address", { type: "address" }],
|
|
372
|
+
["bool", { type: "bool" }],
|
|
373
|
+
["bytes", { type: "bytes" }],
|
|
374
|
+
["bytes32", { type: "bytes32" }],
|
|
375
|
+
["int", { type: "int256" }],
|
|
376
|
+
["int256", { type: "int256" }],
|
|
377
|
+
["string", { type: "string" }],
|
|
378
|
+
["uint", { type: "uint256" }],
|
|
379
|
+
["uint8", { type: "uint8" }],
|
|
380
|
+
["uint16", { type: "uint16" }],
|
|
381
|
+
["uint24", { type: "uint24" }],
|
|
382
|
+
["uint32", { type: "uint32" }],
|
|
383
|
+
["uint64", { type: "uint64" }],
|
|
384
|
+
["uint96", { type: "uint96" }],
|
|
385
|
+
["uint112", { type: "uint112" }],
|
|
386
|
+
["uint160", { type: "uint160" }],
|
|
387
|
+
["uint192", { type: "uint192" }],
|
|
388
|
+
["uint256", { type: "uint256" }],
|
|
389
|
+
// Named
|
|
390
|
+
["address owner", { type: "address", name: "owner" }],
|
|
391
|
+
["address to", { type: "address", name: "to" }],
|
|
392
|
+
["bool approved", { type: "bool", name: "approved" }],
|
|
393
|
+
["bytes _data", { type: "bytes", name: "_data" }],
|
|
394
|
+
["bytes data", { type: "bytes", name: "data" }],
|
|
395
|
+
["bytes signature", { type: "bytes", name: "signature" }],
|
|
396
|
+
["bytes32 hash", { type: "bytes32", name: "hash" }],
|
|
397
|
+
["bytes32 r", { type: "bytes32", name: "r" }],
|
|
398
|
+
["bytes32 root", { type: "bytes32", name: "root" }],
|
|
399
|
+
["bytes32 s", { type: "bytes32", name: "s" }],
|
|
400
|
+
["string name", { type: "string", name: "name" }],
|
|
401
|
+
["string symbol", { type: "string", name: "symbol" }],
|
|
402
|
+
["string tokenURI", { type: "string", name: "tokenURI" }],
|
|
403
|
+
["uint tokenId", { type: "uint256", name: "tokenId" }],
|
|
404
|
+
["uint8 v", { type: "uint8", name: "v" }],
|
|
405
|
+
["uint256 balance", { type: "uint256", name: "balance" }],
|
|
406
|
+
["uint256 tokenId", { type: "uint256", name: "tokenId" }],
|
|
407
|
+
["uint256 value", { type: "uint256", name: "value" }],
|
|
408
|
+
// Indexed
|
|
409
|
+
[
|
|
410
|
+
"event:address indexed from",
|
|
411
|
+
{ type: "address", name: "from", indexed: true }
|
|
412
|
+
],
|
|
413
|
+
["event:address indexed to", { type: "address", name: "to", indexed: true }],
|
|
414
|
+
[
|
|
415
|
+
"event:uint indexed tokenId",
|
|
416
|
+
{ type: "uint256", name: "tokenId", indexed: true }
|
|
417
|
+
],
|
|
418
|
+
[
|
|
419
|
+
"event:uint256 indexed tokenId",
|
|
420
|
+
{ type: "uint256", name: "tokenId", indexed: true }
|
|
421
|
+
]
|
|
422
|
+
]);
|
|
423
|
+
|
|
424
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/runtime/utils.js
|
|
425
|
+
function parseSignature(signature, structs = {}) {
|
|
426
|
+
if (isFunctionSignature(signature))
|
|
427
|
+
return parseFunctionSignature(signature, structs);
|
|
428
|
+
if (isEventSignature(signature))
|
|
429
|
+
return parseEventSignature(signature, structs);
|
|
430
|
+
if (isErrorSignature(signature))
|
|
431
|
+
return parseErrorSignature(signature, structs);
|
|
432
|
+
if (isConstructorSignature(signature))
|
|
433
|
+
return parseConstructorSignature(signature, structs);
|
|
434
|
+
if (isFallbackSignature(signature))
|
|
435
|
+
return parseFallbackSignature(signature);
|
|
436
|
+
if (isReceiveSignature(signature))
|
|
437
|
+
return {
|
|
438
|
+
type: "receive",
|
|
439
|
+
stateMutability: "payable"
|
|
440
|
+
};
|
|
441
|
+
throw new UnknownSignatureError({ signature });
|
|
442
|
+
}
|
|
443
|
+
function parseFunctionSignature(signature, structs = {}) {
|
|
444
|
+
const match = execFunctionSignature(signature);
|
|
445
|
+
if (!match)
|
|
446
|
+
throw new InvalidSignatureError({ signature, type: "function" });
|
|
447
|
+
const inputParams = splitParameters(match.parameters);
|
|
448
|
+
const inputs = [];
|
|
449
|
+
const inputLength = inputParams.length;
|
|
450
|
+
for (let i = 0; i < inputLength; i++) {
|
|
451
|
+
inputs.push(parseAbiParameter(inputParams[i], {
|
|
452
|
+
modifiers: functionModifiers,
|
|
453
|
+
structs,
|
|
454
|
+
type: "function"
|
|
455
|
+
}));
|
|
456
|
+
}
|
|
457
|
+
const outputs = [];
|
|
458
|
+
if (match.returns) {
|
|
459
|
+
const outputParams = splitParameters(match.returns);
|
|
460
|
+
const outputLength = outputParams.length;
|
|
461
|
+
for (let i = 0; i < outputLength; i++) {
|
|
462
|
+
outputs.push(parseAbiParameter(outputParams[i], {
|
|
463
|
+
modifiers: functionModifiers,
|
|
464
|
+
structs,
|
|
465
|
+
type: "function"
|
|
466
|
+
}));
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
return {
|
|
470
|
+
name: match.name,
|
|
471
|
+
type: "function",
|
|
472
|
+
stateMutability: match.stateMutability ?? "nonpayable",
|
|
473
|
+
inputs,
|
|
474
|
+
outputs
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
function parseEventSignature(signature, structs = {}) {
|
|
478
|
+
const match = execEventSignature(signature);
|
|
479
|
+
if (!match)
|
|
480
|
+
throw new InvalidSignatureError({ signature, type: "event" });
|
|
481
|
+
const params = splitParameters(match.parameters);
|
|
482
|
+
const abiParameters = [];
|
|
483
|
+
const length = params.length;
|
|
484
|
+
for (let i = 0; i < length; i++)
|
|
485
|
+
abiParameters.push(parseAbiParameter(params[i], {
|
|
486
|
+
modifiers: eventModifiers,
|
|
487
|
+
structs,
|
|
488
|
+
type: "event"
|
|
489
|
+
}));
|
|
490
|
+
return { name: match.name, type: "event", inputs: abiParameters };
|
|
491
|
+
}
|
|
492
|
+
function parseErrorSignature(signature, structs = {}) {
|
|
493
|
+
const match = execErrorSignature(signature);
|
|
494
|
+
if (!match)
|
|
495
|
+
throw new InvalidSignatureError({ signature, type: "error" });
|
|
496
|
+
const params = splitParameters(match.parameters);
|
|
497
|
+
const abiParameters = [];
|
|
498
|
+
const length = params.length;
|
|
499
|
+
for (let i = 0; i < length; i++)
|
|
500
|
+
abiParameters.push(parseAbiParameter(params[i], { structs, type: "error" }));
|
|
501
|
+
return { name: match.name, type: "error", inputs: abiParameters };
|
|
502
|
+
}
|
|
503
|
+
function parseConstructorSignature(signature, structs = {}) {
|
|
504
|
+
const match = execConstructorSignature(signature);
|
|
505
|
+
if (!match)
|
|
506
|
+
throw new InvalidSignatureError({ signature, type: "constructor" });
|
|
507
|
+
const params = splitParameters(match.parameters);
|
|
508
|
+
const abiParameters = [];
|
|
509
|
+
const length = params.length;
|
|
510
|
+
for (let i = 0; i < length; i++)
|
|
511
|
+
abiParameters.push(parseAbiParameter(params[i], { structs, type: "constructor" }));
|
|
512
|
+
return {
|
|
513
|
+
type: "constructor",
|
|
514
|
+
stateMutability: match.stateMutability ?? "nonpayable",
|
|
515
|
+
inputs: abiParameters
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
function parseFallbackSignature(signature) {
|
|
519
|
+
const match = execFallbackSignature(signature);
|
|
520
|
+
if (!match)
|
|
521
|
+
throw new InvalidSignatureError({ signature, type: "fallback" });
|
|
522
|
+
return {
|
|
523
|
+
type: "fallback",
|
|
524
|
+
stateMutability: match.stateMutability ?? "nonpayable"
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
var abiParameterWithoutTupleRegex = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;
|
|
528
|
+
var abiParameterWithTupleRegex = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;
|
|
529
|
+
var dynamicIntegerRegex = /^u?int$/;
|
|
530
|
+
function parseAbiParameter(param, options) {
|
|
531
|
+
var _a, _b;
|
|
532
|
+
const parameterCacheKey = getParameterCacheKey(param, options == null ? void 0 : options.type, options == null ? void 0 : options.structs);
|
|
533
|
+
if (parameterCache.has(parameterCacheKey))
|
|
534
|
+
return parameterCache.get(parameterCacheKey);
|
|
535
|
+
const isTuple = isTupleRegex.test(param);
|
|
536
|
+
const match = execTyped(isTuple ? abiParameterWithTupleRegex : abiParameterWithoutTupleRegex, param);
|
|
537
|
+
if (!match)
|
|
538
|
+
throw new InvalidParameterError({ param });
|
|
539
|
+
if (match.name && isSolidityKeyword(match.name))
|
|
540
|
+
throw new SolidityProtectedKeywordError({ param, name: match.name });
|
|
541
|
+
const name = match.name ? { name: match.name } : {};
|
|
542
|
+
const indexed = match.modifier === "indexed" ? { indexed: true } : {};
|
|
543
|
+
const structs = (options == null ? void 0 : options.structs) ?? {};
|
|
544
|
+
let type;
|
|
545
|
+
let components = {};
|
|
546
|
+
if (isTuple) {
|
|
547
|
+
type = "tuple";
|
|
548
|
+
const params = splitParameters(match.type);
|
|
549
|
+
const components_ = [];
|
|
550
|
+
const length = params.length;
|
|
551
|
+
for (let i = 0; i < length; i++) {
|
|
552
|
+
components_.push(parseAbiParameter(params[i], { structs }));
|
|
553
|
+
}
|
|
554
|
+
components = { components: components_ };
|
|
555
|
+
} else if (match.type in structs) {
|
|
556
|
+
type = "tuple";
|
|
557
|
+
components = { components: structs[match.type] };
|
|
558
|
+
} else if (dynamicIntegerRegex.test(match.type)) {
|
|
559
|
+
type = `${match.type}256`;
|
|
560
|
+
} else {
|
|
561
|
+
type = match.type;
|
|
562
|
+
if (!((options == null ? void 0 : options.type) === "struct") && !isSolidityType(type))
|
|
563
|
+
throw new UnknownSolidityTypeError({ type });
|
|
564
|
+
}
|
|
565
|
+
if (match.modifier) {
|
|
566
|
+
if (!((_b = (_a = options == null ? void 0 : options.modifiers) == null ? void 0 : _a.has) == null ? void 0 : _b.call(_a, match.modifier)))
|
|
567
|
+
throw new InvalidModifierError({
|
|
568
|
+
param,
|
|
569
|
+
type: options == null ? void 0 : options.type,
|
|
570
|
+
modifier: match.modifier
|
|
571
|
+
});
|
|
572
|
+
if (functionModifiers.has(match.modifier) && !isValidDataLocation(type, !!match.array))
|
|
573
|
+
throw new InvalidFunctionModifierError({
|
|
574
|
+
param,
|
|
575
|
+
type: options == null ? void 0 : options.type,
|
|
576
|
+
modifier: match.modifier
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
const abiParameter = {
|
|
580
|
+
type: `${type}${match.array ?? ""}`,
|
|
581
|
+
...name,
|
|
582
|
+
...indexed,
|
|
583
|
+
...components
|
|
584
|
+
};
|
|
585
|
+
parameterCache.set(parameterCacheKey, abiParameter);
|
|
586
|
+
return abiParameter;
|
|
587
|
+
}
|
|
588
|
+
function splitParameters(params, result = [], current = "", depth = 0) {
|
|
589
|
+
const length = params.trim().length;
|
|
590
|
+
for (let i = 0; i < length; i++) {
|
|
591
|
+
const char = params[i];
|
|
592
|
+
const tail = params.slice(i + 1);
|
|
593
|
+
switch (char) {
|
|
594
|
+
case ",":
|
|
595
|
+
return depth === 0 ? splitParameters(tail, [...result, current.trim()]) : splitParameters(tail, result, `${current}${char}`, depth);
|
|
596
|
+
case "(":
|
|
597
|
+
return splitParameters(tail, result, `${current}${char}`, depth + 1);
|
|
598
|
+
case ")":
|
|
599
|
+
return splitParameters(tail, result, `${current}${char}`, depth - 1);
|
|
600
|
+
default:
|
|
601
|
+
return splitParameters(tail, result, `${current}${char}`, depth);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
if (current === "")
|
|
605
|
+
return result;
|
|
606
|
+
if (depth !== 0)
|
|
607
|
+
throw new InvalidParenthesisError({ current, depth });
|
|
608
|
+
result.push(current.trim());
|
|
609
|
+
return result;
|
|
610
|
+
}
|
|
611
|
+
function isSolidityType(type) {
|
|
612
|
+
return type === "address" || type === "bool" || type === "function" || type === "string" || bytesRegex.test(type) || integerRegex.test(type);
|
|
613
|
+
}
|
|
614
|
+
var protectedKeywordsRegex = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;
|
|
615
|
+
function isSolidityKeyword(name) {
|
|
616
|
+
return name === "address" || name === "bool" || name === "function" || name === "string" || name === "tuple" || bytesRegex.test(name) || integerRegex.test(name) || protectedKeywordsRegex.test(name);
|
|
617
|
+
}
|
|
618
|
+
function isValidDataLocation(type, isArray) {
|
|
619
|
+
return isArray || type === "bytes" || type === "string" || type === "tuple";
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/runtime/structs.js
|
|
623
|
+
function parseStructs(signatures) {
|
|
624
|
+
const shallowStructs = {};
|
|
625
|
+
const signaturesLength = signatures.length;
|
|
626
|
+
for (let i = 0; i < signaturesLength; i++) {
|
|
627
|
+
const signature = signatures[i];
|
|
628
|
+
if (!isStructSignature(signature))
|
|
629
|
+
continue;
|
|
630
|
+
const match = execStructSignature(signature);
|
|
631
|
+
if (!match)
|
|
632
|
+
throw new InvalidSignatureError({ signature, type: "struct" });
|
|
633
|
+
const properties = match.properties.split(";");
|
|
634
|
+
const components = [];
|
|
635
|
+
const propertiesLength = properties.length;
|
|
636
|
+
for (let k = 0; k < propertiesLength; k++) {
|
|
637
|
+
const property = properties[k];
|
|
638
|
+
const trimmed = property.trim();
|
|
639
|
+
if (!trimmed)
|
|
640
|
+
continue;
|
|
641
|
+
const abiParameter = parseAbiParameter(trimmed, {
|
|
642
|
+
type: "struct"
|
|
643
|
+
});
|
|
644
|
+
components.push(abiParameter);
|
|
645
|
+
}
|
|
646
|
+
if (!components.length)
|
|
647
|
+
throw new InvalidStructSignatureError({ signature });
|
|
648
|
+
shallowStructs[match.name] = components;
|
|
649
|
+
}
|
|
650
|
+
const resolvedStructs = {};
|
|
651
|
+
const entries = Object.entries(shallowStructs);
|
|
652
|
+
const entriesLength = entries.length;
|
|
653
|
+
for (let i = 0; i < entriesLength; i++) {
|
|
654
|
+
const [name, parameters] = entries[i];
|
|
655
|
+
resolvedStructs[name] = resolveStructs(parameters, shallowStructs);
|
|
656
|
+
}
|
|
657
|
+
return resolvedStructs;
|
|
658
|
+
}
|
|
659
|
+
var typeWithoutTupleRegex = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;
|
|
660
|
+
function resolveStructs(abiParameters, structs, ancestors = /* @__PURE__ */ new Set()) {
|
|
661
|
+
const components = [];
|
|
662
|
+
const length = abiParameters.length;
|
|
663
|
+
for (let i = 0; i < length; i++) {
|
|
664
|
+
const abiParameter = abiParameters[i];
|
|
665
|
+
const isTuple = isTupleRegex.test(abiParameter.type);
|
|
666
|
+
if (isTuple)
|
|
667
|
+
components.push(abiParameter);
|
|
668
|
+
else {
|
|
669
|
+
const match = execTyped(typeWithoutTupleRegex, abiParameter.type);
|
|
670
|
+
if (!(match == null ? void 0 : match.type))
|
|
671
|
+
throw new InvalidAbiTypeParameterError({ abiParameter });
|
|
672
|
+
const { array, type } = match;
|
|
673
|
+
if (type in structs) {
|
|
674
|
+
if (ancestors.has(type))
|
|
675
|
+
throw new CircularReferenceError({ type });
|
|
676
|
+
components.push({
|
|
677
|
+
...abiParameter,
|
|
678
|
+
type: `tuple${array ?? ""}`,
|
|
679
|
+
components: resolveStructs(structs[type] ?? [], structs, /* @__PURE__ */ new Set([...ancestors, type]))
|
|
680
|
+
});
|
|
681
|
+
} else {
|
|
682
|
+
if (isSolidityType(type))
|
|
683
|
+
components.push(abiParameter);
|
|
684
|
+
else
|
|
685
|
+
throw new UnknownTypeError({ type });
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
return components;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/parseAbi.js
|
|
693
|
+
function parseAbi(signatures) {
|
|
694
|
+
const structs = parseStructs(signatures);
|
|
695
|
+
const abi = [];
|
|
696
|
+
const length = signatures.length;
|
|
697
|
+
for (let i = 0; i < length; i++) {
|
|
698
|
+
const signature = signatures[i];
|
|
699
|
+
if (isStructSignature(signature))
|
|
700
|
+
continue;
|
|
701
|
+
abi.push(parseSignature(signature, structs));
|
|
702
|
+
}
|
|
703
|
+
return abi;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/parseAbiItem.js
|
|
707
|
+
function parseAbiItem(signature) {
|
|
708
|
+
let abiItem;
|
|
709
|
+
if (typeof signature === "string")
|
|
710
|
+
abiItem = parseSignature(signature);
|
|
711
|
+
else {
|
|
712
|
+
const structs = parseStructs(signature);
|
|
713
|
+
const length = signature.length;
|
|
714
|
+
for (let i = 0; i < length; i++) {
|
|
715
|
+
const signature_ = signature[i];
|
|
716
|
+
if (isStructSignature(signature_))
|
|
717
|
+
continue;
|
|
718
|
+
abiItem = parseSignature(signature_, structs);
|
|
719
|
+
break;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
if (!abiItem)
|
|
723
|
+
throw new InvalidAbiItemError({ signature });
|
|
724
|
+
return abiItem;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/parseAbiParameters.js
|
|
728
|
+
function parseAbiParameters(params) {
|
|
729
|
+
const abiParameters = [];
|
|
730
|
+
if (typeof params === "string") {
|
|
731
|
+
const parameters = splitParameters(params);
|
|
732
|
+
const length = parameters.length;
|
|
733
|
+
for (let i = 0; i < length; i++) {
|
|
734
|
+
abiParameters.push(parseAbiParameter(parameters[i], { modifiers }));
|
|
735
|
+
}
|
|
736
|
+
} else {
|
|
737
|
+
const structs = parseStructs(params);
|
|
738
|
+
const length = params.length;
|
|
739
|
+
for (let i = 0; i < length; i++) {
|
|
740
|
+
const signature = params[i];
|
|
741
|
+
if (isStructSignature(signature))
|
|
742
|
+
continue;
|
|
743
|
+
const parameters = splitParameters(signature);
|
|
744
|
+
const length2 = parameters.length;
|
|
745
|
+
for (let k = 0; k < length2; k++) {
|
|
746
|
+
abiParameters.push(parseAbiParameter(parameters[k], { modifiers, structs }));
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
if (abiParameters.length === 0)
|
|
751
|
+
throw new InvalidAbiParametersError({ params });
|
|
752
|
+
return abiParameters;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js
|
|
756
|
+
var tupleRegex = /^tuple(?<array>(\[(\d*)\])*)$/;
|
|
757
|
+
function formatAbiParameter(abiParameter) {
|
|
758
|
+
let type = abiParameter.type;
|
|
759
|
+
if (tupleRegex.test(abiParameter.type) && "components" in abiParameter) {
|
|
760
|
+
type = "(";
|
|
761
|
+
const length = abiParameter.components.length;
|
|
762
|
+
for (let i = 0; i < length; i++) {
|
|
763
|
+
const component = abiParameter.components[i];
|
|
764
|
+
type += formatAbiParameter(component);
|
|
765
|
+
if (i < length - 1)
|
|
766
|
+
type += ", ";
|
|
767
|
+
}
|
|
768
|
+
const result = execTyped(tupleRegex, abiParameter.type);
|
|
769
|
+
type += `)${(result == null ? void 0 : result.array) ?? ""}`;
|
|
770
|
+
return formatAbiParameter({
|
|
771
|
+
...abiParameter,
|
|
772
|
+
type
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
if ("indexed" in abiParameter && abiParameter.indexed)
|
|
776
|
+
type = `${type} indexed`;
|
|
777
|
+
if (abiParameter.name)
|
|
778
|
+
return `${type} ${abiParameter.name}`;
|
|
779
|
+
return type;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js
|
|
783
|
+
function formatAbiParameters(abiParameters) {
|
|
784
|
+
let params = "";
|
|
785
|
+
const length = abiParameters.length;
|
|
786
|
+
for (let i = 0; i < length; i++) {
|
|
787
|
+
const abiParameter = abiParameters[i];
|
|
788
|
+
params += formatAbiParameter(abiParameter);
|
|
789
|
+
if (i !== length - 1)
|
|
790
|
+
params += ", ";
|
|
791
|
+
}
|
|
792
|
+
return params;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/formatAbiItem.js
|
|
796
|
+
function formatAbiItem(abiItem) {
|
|
797
|
+
var _a;
|
|
798
|
+
if (abiItem.type === "function")
|
|
799
|
+
return `function ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability && abiItem.stateMutability !== "nonpayable" ? ` ${abiItem.stateMutability}` : ""}${((_a = abiItem.outputs) == null ? void 0 : _a.length) ? ` returns (${formatAbiParameters(abiItem.outputs)})` : ""}`;
|
|
800
|
+
if (abiItem.type === "event")
|
|
801
|
+
return `event ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
|
|
802
|
+
if (abiItem.type === "error")
|
|
803
|
+
return `error ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
|
|
804
|
+
if (abiItem.type === "constructor")
|
|
805
|
+
return `constructor(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability === "payable" ? " payable" : ""}`;
|
|
806
|
+
if (abiItem.type === "fallback")
|
|
807
|
+
return `fallback() external${abiItem.stateMutability === "payable" ? " payable" : ""}`;
|
|
808
|
+
return "receive() external payable";
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
// ../../../../node_modules/.pnpm/abitype@1.0.8_typescript@5.8.2_zod@3.24.1/node_modules/abitype/dist/esm/human-readable/formatAbi.js
|
|
812
|
+
function formatAbi(abi) {
|
|
813
|
+
const signatures = [];
|
|
814
|
+
const length = abi.length;
|
|
815
|
+
for (let i = 0; i < length; i++) {
|
|
816
|
+
const abiItem = abi[i];
|
|
817
|
+
const signature = formatAbiItem(abiItem);
|
|
818
|
+
signatures.push(signature);
|
|
819
|
+
}
|
|
820
|
+
return signatures;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
// ../../../../node_modules/.pnpm/@noble+hashes@1.7.1/node_modules/@noble/hashes/esm/_u64.js
|
|
824
|
+
var U32_MASK64 = BigInt(2 ** 32 - 1);
|
|
825
|
+
var _32n = BigInt(32);
|
|
826
|
+
function fromBig(n, le = false) {
|
|
827
|
+
if (le)
|
|
828
|
+
return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
|
|
829
|
+
return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
|
830
|
+
}
|
|
831
|
+
function split(lst, le = false) {
|
|
832
|
+
let Ah = new Uint32Array(lst.length);
|
|
833
|
+
let Al = new Uint32Array(lst.length);
|
|
834
|
+
for (let i = 0; i < lst.length; i++) {
|
|
835
|
+
const { h, l } = fromBig(lst[i], le);
|
|
836
|
+
[Ah[i], Al[i]] = [h, l];
|
|
837
|
+
}
|
|
838
|
+
return [Ah, Al];
|
|
839
|
+
}
|
|
840
|
+
var toBig = (h, l) => BigInt(h >>> 0) << _32n | BigInt(l >>> 0);
|
|
841
|
+
var shrSH = (h, _l, s) => h >>> s;
|
|
842
|
+
var shrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
843
|
+
var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
|
|
844
|
+
var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
845
|
+
var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
|
|
846
|
+
var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
|
|
847
|
+
var rotr32H = (_h, l) => l;
|
|
848
|
+
var rotr32L = (h, _l) => h;
|
|
849
|
+
var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
|
|
850
|
+
var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
|
|
851
|
+
var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
|
|
852
|
+
var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
|
|
853
|
+
function add(Ah, Al, Bh, Bl) {
|
|
854
|
+
const l = (Al >>> 0) + (Bl >>> 0);
|
|
855
|
+
return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
|
|
856
|
+
}
|
|
857
|
+
var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
|
|
858
|
+
var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
|
|
859
|
+
var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
|
|
860
|
+
var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
|
|
861
|
+
var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
|
862
|
+
var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
|
|
863
|
+
var u64 = {
|
|
864
|
+
fromBig,
|
|
865
|
+
split,
|
|
866
|
+
toBig,
|
|
867
|
+
shrSH,
|
|
868
|
+
shrSL,
|
|
869
|
+
rotrSH,
|
|
870
|
+
rotrSL,
|
|
871
|
+
rotrBH,
|
|
872
|
+
rotrBL,
|
|
873
|
+
rotr32H,
|
|
874
|
+
rotr32L,
|
|
875
|
+
rotlSH,
|
|
876
|
+
rotlSL,
|
|
877
|
+
rotlBH,
|
|
878
|
+
rotlBL,
|
|
879
|
+
add,
|
|
880
|
+
add3L,
|
|
881
|
+
add3H,
|
|
882
|
+
add4L,
|
|
883
|
+
add4H,
|
|
884
|
+
add5H,
|
|
885
|
+
add5L
|
|
886
|
+
};
|
|
887
|
+
var u64_default = u64;
|
|
888
|
+
|
|
889
|
+
// ../../../../node_modules/.pnpm/@noble+hashes@1.7.1/node_modules/@noble/hashes/esm/sha3.js
|
|
890
|
+
var SHA3_PI = [];
|
|
891
|
+
var SHA3_ROTL = [];
|
|
892
|
+
var _SHA3_IOTA = [];
|
|
893
|
+
var _0n = BigInt(0);
|
|
894
|
+
var _1n = BigInt(1);
|
|
895
|
+
var _2n = BigInt(2);
|
|
896
|
+
var _7n = BigInt(7);
|
|
897
|
+
var _256n = BigInt(256);
|
|
898
|
+
var _0x71n = BigInt(113);
|
|
899
|
+
for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
|
|
900
|
+
[x, y] = [y, (2 * x + 3 * y) % 5];
|
|
901
|
+
SHA3_PI.push(2 * (5 * y + x));
|
|
902
|
+
SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
|
|
903
|
+
let t = _0n;
|
|
904
|
+
for (let j = 0; j < 7; j++) {
|
|
905
|
+
R = (R << _1n ^ (R >> _7n) * _0x71n) % _256n;
|
|
906
|
+
if (R & _2n)
|
|
907
|
+
t ^= _1n << (_1n << BigInt(j)) - _1n;
|
|
908
|
+
}
|
|
909
|
+
_SHA3_IOTA.push(t);
|
|
910
|
+
}
|
|
911
|
+
var [SHA3_IOTA_H, SHA3_IOTA_L] = split(_SHA3_IOTA, true);
|
|
912
|
+
var rotlH = (h, l, s) => s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s);
|
|
913
|
+
var rotlL = (h, l, s) => s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s);
|
|
914
|
+
function keccakP(s, rounds = 24) {
|
|
915
|
+
const B = new Uint32Array(5 * 2);
|
|
916
|
+
for (let round = 24 - rounds; round < 24; round++) {
|
|
917
|
+
for (let x = 0; x < 10; x++)
|
|
918
|
+
B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
|
|
919
|
+
for (let x = 0; x < 10; x += 2) {
|
|
920
|
+
const idx1 = (x + 8) % 10;
|
|
921
|
+
const idx0 = (x + 2) % 10;
|
|
922
|
+
const B0 = B[idx0];
|
|
923
|
+
const B1 = B[idx0 + 1];
|
|
924
|
+
const Th = rotlH(B0, B1, 1) ^ B[idx1];
|
|
925
|
+
const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
|
|
926
|
+
for (let y = 0; y < 50; y += 10) {
|
|
927
|
+
s[x + y] ^= Th;
|
|
928
|
+
s[x + y + 1] ^= Tl;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
let curH = s[2];
|
|
932
|
+
let curL = s[3];
|
|
933
|
+
for (let t = 0; t < 24; t++) {
|
|
934
|
+
const shift = SHA3_ROTL[t];
|
|
935
|
+
const Th = rotlH(curH, curL, shift);
|
|
936
|
+
const Tl = rotlL(curH, curL, shift);
|
|
937
|
+
const PI = SHA3_PI[t];
|
|
938
|
+
curH = s[PI];
|
|
939
|
+
curL = s[PI + 1];
|
|
940
|
+
s[PI] = Th;
|
|
941
|
+
s[PI + 1] = Tl;
|
|
942
|
+
}
|
|
943
|
+
for (let y = 0; y < 50; y += 10) {
|
|
944
|
+
for (let x = 0; x < 10; x++)
|
|
945
|
+
B[x] = s[y + x];
|
|
946
|
+
for (let x = 0; x < 10; x++)
|
|
947
|
+
s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
|
|
948
|
+
}
|
|
949
|
+
s[0] ^= SHA3_IOTA_H[round];
|
|
950
|
+
s[1] ^= SHA3_IOTA_L[round];
|
|
951
|
+
}
|
|
952
|
+
B.fill(0);
|
|
953
|
+
}
|
|
954
|
+
var Keccak = class _Keccak extends Hash {
|
|
955
|
+
// NOTE: we accept arguments in bytes instead of bits here.
|
|
956
|
+
constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
|
|
957
|
+
super();
|
|
958
|
+
this.blockLen = blockLen;
|
|
959
|
+
this.suffix = suffix;
|
|
960
|
+
this.outputLen = outputLen;
|
|
961
|
+
this.enableXOF = enableXOF;
|
|
962
|
+
this.rounds = rounds;
|
|
963
|
+
this.pos = 0;
|
|
964
|
+
this.posOut = 0;
|
|
965
|
+
this.finished = false;
|
|
966
|
+
this.destroyed = false;
|
|
967
|
+
anumber(outputLen);
|
|
968
|
+
if (0 >= this.blockLen || this.blockLen >= 200)
|
|
969
|
+
throw new Error("Sha3 supports only keccak-f1600 function");
|
|
970
|
+
this.state = new Uint8Array(200);
|
|
971
|
+
this.state32 = u32(this.state);
|
|
972
|
+
}
|
|
973
|
+
keccak() {
|
|
974
|
+
if (!isLE)
|
|
975
|
+
byteSwap32(this.state32);
|
|
976
|
+
keccakP(this.state32, this.rounds);
|
|
977
|
+
if (!isLE)
|
|
978
|
+
byteSwap32(this.state32);
|
|
979
|
+
this.posOut = 0;
|
|
980
|
+
this.pos = 0;
|
|
981
|
+
}
|
|
982
|
+
update(data) {
|
|
983
|
+
aexists(this);
|
|
984
|
+
const { blockLen, state } = this;
|
|
985
|
+
data = toBytes(data);
|
|
986
|
+
const len = data.length;
|
|
987
|
+
for (let pos = 0; pos < len; ) {
|
|
988
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
|
989
|
+
for (let i = 0; i < take; i++)
|
|
990
|
+
state[this.pos++] ^= data[pos++];
|
|
991
|
+
if (this.pos === blockLen)
|
|
992
|
+
this.keccak();
|
|
993
|
+
}
|
|
994
|
+
return this;
|
|
995
|
+
}
|
|
996
|
+
finish() {
|
|
997
|
+
if (this.finished)
|
|
998
|
+
return;
|
|
999
|
+
this.finished = true;
|
|
1000
|
+
const { state, suffix, pos, blockLen } = this;
|
|
1001
|
+
state[pos] ^= suffix;
|
|
1002
|
+
if ((suffix & 128) !== 0 && pos === blockLen - 1)
|
|
1003
|
+
this.keccak();
|
|
1004
|
+
state[blockLen - 1] ^= 128;
|
|
1005
|
+
this.keccak();
|
|
1006
|
+
}
|
|
1007
|
+
writeInto(out) {
|
|
1008
|
+
aexists(this, false);
|
|
1009
|
+
abytes(out);
|
|
1010
|
+
this.finish();
|
|
1011
|
+
const bufferOut = this.state;
|
|
1012
|
+
const { blockLen } = this;
|
|
1013
|
+
for (let pos = 0, len = out.length; pos < len; ) {
|
|
1014
|
+
if (this.posOut >= blockLen)
|
|
1015
|
+
this.keccak();
|
|
1016
|
+
const take = Math.min(blockLen - this.posOut, len - pos);
|
|
1017
|
+
out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
|
|
1018
|
+
this.posOut += take;
|
|
1019
|
+
pos += take;
|
|
1020
|
+
}
|
|
1021
|
+
return out;
|
|
1022
|
+
}
|
|
1023
|
+
xofInto(out) {
|
|
1024
|
+
if (!this.enableXOF)
|
|
1025
|
+
throw new Error("XOF is not possible for this instance");
|
|
1026
|
+
return this.writeInto(out);
|
|
1027
|
+
}
|
|
1028
|
+
xof(bytes) {
|
|
1029
|
+
anumber(bytes);
|
|
1030
|
+
return this.xofInto(new Uint8Array(bytes));
|
|
1031
|
+
}
|
|
1032
|
+
digestInto(out) {
|
|
1033
|
+
aoutput(out, this);
|
|
1034
|
+
if (this.finished)
|
|
1035
|
+
throw new Error("digest() was already called");
|
|
1036
|
+
this.writeInto(out);
|
|
1037
|
+
this.destroy();
|
|
1038
|
+
return out;
|
|
1039
|
+
}
|
|
1040
|
+
digest() {
|
|
1041
|
+
return this.digestInto(new Uint8Array(this.outputLen));
|
|
1042
|
+
}
|
|
1043
|
+
destroy() {
|
|
1044
|
+
this.destroyed = true;
|
|
1045
|
+
this.state.fill(0);
|
|
1046
|
+
}
|
|
1047
|
+
_cloneInto(to) {
|
|
1048
|
+
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
|
1049
|
+
to || (to = new _Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
|
|
1050
|
+
to.state32.set(this.state32);
|
|
1051
|
+
to.pos = this.pos;
|
|
1052
|
+
to.posOut = this.posOut;
|
|
1053
|
+
to.finished = this.finished;
|
|
1054
|
+
to.rounds = rounds;
|
|
1055
|
+
to.suffix = suffix;
|
|
1056
|
+
to.outputLen = outputLen;
|
|
1057
|
+
to.enableXOF = enableXOF;
|
|
1058
|
+
to.destroyed = this.destroyed;
|
|
1059
|
+
return to;
|
|
1060
|
+
}
|
|
1061
|
+
};
|
|
1062
|
+
var gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));
|
|
1063
|
+
var sha3_224 = gen(6, 144, 224 / 8);
|
|
1064
|
+
var sha3_256 = gen(6, 136, 256 / 8);
|
|
1065
|
+
var sha3_384 = gen(6, 104, 384 / 8);
|
|
1066
|
+
var sha3_512 = gen(6, 72, 512 / 8);
|
|
1067
|
+
var keccak_224 = gen(1, 144, 224 / 8);
|
|
1068
|
+
var keccak_256 = gen(1, 136, 256 / 8);
|
|
1069
|
+
var keccak_384 = gen(1, 104, 384 / 8);
|
|
1070
|
+
var keccak_512 = gen(1, 72, 512 / 8);
|
|
1071
|
+
var genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === void 0 ? outputLen : opts.dkLen, true));
|
|
1072
|
+
var shake128 = genShake(31, 168, 128 / 8);
|
|
1073
|
+
var shake256 = genShake(31, 136, 256 / 8);
|
|
1074
|
+
|
|
1075
|
+
export {
|
|
1076
|
+
formatAbiParameters,
|
|
1077
|
+
formatAbiItem,
|
|
1078
|
+
formatAbi,
|
|
1079
|
+
parseAbi,
|
|
1080
|
+
parseAbiItem,
|
|
1081
|
+
parseAbiParameters,
|
|
1082
|
+
u64_default,
|
|
1083
|
+
keccak_256
|
|
1084
|
+
};
|
|
1085
|
+
//# sourceMappingURL=chunk-P2SCV6N5.js.map
|