@farcaster/create-mini-app 0.0.7 → 0.0.8
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 +7 -0
- 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 +3 -1
- package/templates/default/README.md +19 -0
- 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,1936 +0,0 @@
|
|
|
1
|
-
import "./chunk-OOB7NECH.js";
|
|
2
|
-
import {
|
|
3
|
-
BaseError,
|
|
4
|
-
ChainDisconnectedError,
|
|
5
|
-
Hash,
|
|
6
|
-
HttpRequestError,
|
|
7
|
-
InternalRpcError,
|
|
8
|
-
InvalidInputRpcError,
|
|
9
|
-
InvalidParamsRpcError,
|
|
10
|
-
InvalidRequestRpcError,
|
|
11
|
-
JsonRpcVersionUnsupportedError,
|
|
12
|
-
LimitExceededRpcError,
|
|
13
|
-
LruMap,
|
|
14
|
-
MethodNotFoundRpcError,
|
|
15
|
-
MethodNotSupportedRpcError,
|
|
16
|
-
ParseRpcError,
|
|
17
|
-
ProviderDisconnectedError,
|
|
18
|
-
ResourceNotFoundRpcError,
|
|
19
|
-
ResourceUnavailableRpcError,
|
|
20
|
-
RpcRequestError,
|
|
21
|
-
SwitchChainError,
|
|
22
|
-
TimeoutError,
|
|
23
|
-
TransactionRejectedRpcError,
|
|
24
|
-
UnauthorizedProviderError,
|
|
25
|
-
UnknownRpcError,
|
|
26
|
-
UnsupportedProviderMethodError,
|
|
27
|
-
UserRejectedRequestError,
|
|
28
|
-
aexists,
|
|
29
|
-
aoutput,
|
|
30
|
-
createView,
|
|
31
|
-
defineFormatter,
|
|
32
|
-
fromHex,
|
|
33
|
-
getAddress,
|
|
34
|
-
hexToNumber,
|
|
35
|
-
keccak256,
|
|
36
|
-
numberToHex,
|
|
37
|
-
rotl,
|
|
38
|
-
rotr,
|
|
39
|
-
stringToHex,
|
|
40
|
-
stringify,
|
|
41
|
-
toBytes,
|
|
42
|
-
wrapConstructor
|
|
43
|
-
} from "./chunk-PK65EOOR.js";
|
|
44
|
-
import {
|
|
45
|
-
dist_default
|
|
46
|
-
} from "./chunk-PPRY4ZGR.js";
|
|
47
|
-
import "./chunk-PH77EFIP.js";
|
|
48
|
-
import "./chunk-2KW72IQL.js";
|
|
49
|
-
import "./chunk-HP7M7ER3.js";
|
|
50
|
-
import "./chunk-2ULAEEW3.js";
|
|
51
|
-
import "./chunk-P2SCV6N5.js";
|
|
52
|
-
import "./chunk-OYL52S4H.js";
|
|
53
|
-
import "./chunk-WOOG5QLI.js";
|
|
54
|
-
|
|
55
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/formatters/transaction.js
|
|
56
|
-
var transactionType = {
|
|
57
|
-
"0x0": "legacy",
|
|
58
|
-
"0x1": "eip2930",
|
|
59
|
-
"0x2": "eip1559",
|
|
60
|
-
"0x3": "eip4844",
|
|
61
|
-
"0x4": "eip7702"
|
|
62
|
-
};
|
|
63
|
-
function formatTransaction(transaction) {
|
|
64
|
-
const transaction_ = {
|
|
65
|
-
...transaction,
|
|
66
|
-
blockHash: transaction.blockHash ? transaction.blockHash : null,
|
|
67
|
-
blockNumber: transaction.blockNumber ? BigInt(transaction.blockNumber) : null,
|
|
68
|
-
chainId: transaction.chainId ? hexToNumber(transaction.chainId) : void 0,
|
|
69
|
-
gas: transaction.gas ? BigInt(transaction.gas) : void 0,
|
|
70
|
-
gasPrice: transaction.gasPrice ? BigInt(transaction.gasPrice) : void 0,
|
|
71
|
-
maxFeePerBlobGas: transaction.maxFeePerBlobGas ? BigInt(transaction.maxFeePerBlobGas) : void 0,
|
|
72
|
-
maxFeePerGas: transaction.maxFeePerGas ? BigInt(transaction.maxFeePerGas) : void 0,
|
|
73
|
-
maxPriorityFeePerGas: transaction.maxPriorityFeePerGas ? BigInt(transaction.maxPriorityFeePerGas) : void 0,
|
|
74
|
-
nonce: transaction.nonce ? hexToNumber(transaction.nonce) : void 0,
|
|
75
|
-
to: transaction.to ? transaction.to : null,
|
|
76
|
-
transactionIndex: transaction.transactionIndex ? Number(transaction.transactionIndex) : null,
|
|
77
|
-
type: transaction.type ? transactionType[transaction.type] : void 0,
|
|
78
|
-
typeHex: transaction.type ? transaction.type : void 0,
|
|
79
|
-
value: transaction.value ? BigInt(transaction.value) : void 0,
|
|
80
|
-
v: transaction.v ? BigInt(transaction.v) : void 0
|
|
81
|
-
};
|
|
82
|
-
if (transaction.authorizationList)
|
|
83
|
-
transaction_.authorizationList = formatAuthorizationList(transaction.authorizationList);
|
|
84
|
-
transaction_.yParity = (() => {
|
|
85
|
-
if (transaction.yParity)
|
|
86
|
-
return Number(transaction.yParity);
|
|
87
|
-
if (typeof transaction_.v === "bigint") {
|
|
88
|
-
if (transaction_.v === 0n || transaction_.v === 27n)
|
|
89
|
-
return 0;
|
|
90
|
-
if (transaction_.v === 1n || transaction_.v === 28n)
|
|
91
|
-
return 1;
|
|
92
|
-
if (transaction_.v >= 35n)
|
|
93
|
-
return transaction_.v % 2n === 0n ? 1 : 0;
|
|
94
|
-
}
|
|
95
|
-
return void 0;
|
|
96
|
-
})();
|
|
97
|
-
if (transaction_.type === "legacy") {
|
|
98
|
-
delete transaction_.accessList;
|
|
99
|
-
delete transaction_.maxFeePerBlobGas;
|
|
100
|
-
delete transaction_.maxFeePerGas;
|
|
101
|
-
delete transaction_.maxPriorityFeePerGas;
|
|
102
|
-
delete transaction_.yParity;
|
|
103
|
-
}
|
|
104
|
-
if (transaction_.type === "eip2930") {
|
|
105
|
-
delete transaction_.maxFeePerBlobGas;
|
|
106
|
-
delete transaction_.maxFeePerGas;
|
|
107
|
-
delete transaction_.maxPriorityFeePerGas;
|
|
108
|
-
}
|
|
109
|
-
if (transaction_.type === "eip1559") {
|
|
110
|
-
delete transaction_.maxFeePerBlobGas;
|
|
111
|
-
}
|
|
112
|
-
return transaction_;
|
|
113
|
-
}
|
|
114
|
-
var defineTransaction = defineFormatter("transaction", formatTransaction);
|
|
115
|
-
function formatAuthorizationList(authorizationList) {
|
|
116
|
-
return authorizationList.map((authorization) => ({
|
|
117
|
-
contractAddress: authorization.address,
|
|
118
|
-
chainId: Number(authorization.chainId),
|
|
119
|
-
nonce: Number(authorization.nonce),
|
|
120
|
-
r: authorization.r,
|
|
121
|
-
s: authorization.s,
|
|
122
|
-
yParity: Number(authorization.yParity)
|
|
123
|
-
}));
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/formatters/block.js
|
|
127
|
-
function formatBlock(block) {
|
|
128
|
-
const transactions = (block.transactions ?? []).map((transaction) => {
|
|
129
|
-
if (typeof transaction === "string")
|
|
130
|
-
return transaction;
|
|
131
|
-
return formatTransaction(transaction);
|
|
132
|
-
});
|
|
133
|
-
return {
|
|
134
|
-
...block,
|
|
135
|
-
baseFeePerGas: block.baseFeePerGas ? BigInt(block.baseFeePerGas) : null,
|
|
136
|
-
blobGasUsed: block.blobGasUsed ? BigInt(block.blobGasUsed) : void 0,
|
|
137
|
-
difficulty: block.difficulty ? BigInt(block.difficulty) : void 0,
|
|
138
|
-
excessBlobGas: block.excessBlobGas ? BigInt(block.excessBlobGas) : void 0,
|
|
139
|
-
gasLimit: block.gasLimit ? BigInt(block.gasLimit) : void 0,
|
|
140
|
-
gasUsed: block.gasUsed ? BigInt(block.gasUsed) : void 0,
|
|
141
|
-
hash: block.hash ? block.hash : null,
|
|
142
|
-
logsBloom: block.logsBloom ? block.logsBloom : null,
|
|
143
|
-
nonce: block.nonce ? block.nonce : null,
|
|
144
|
-
number: block.number ? BigInt(block.number) : null,
|
|
145
|
-
size: block.size ? BigInt(block.size) : void 0,
|
|
146
|
-
timestamp: block.timestamp ? BigInt(block.timestamp) : void 0,
|
|
147
|
-
transactions,
|
|
148
|
-
totalDifficulty: block.totalDifficulty ? BigInt(block.totalDifficulty) : null
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
var defineBlock = defineFormatter("block", formatBlock);
|
|
152
|
-
|
|
153
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/actions/public/getTransactionCount.js
|
|
154
|
-
async function getTransactionCount(client, { address, blockTag = "latest", blockNumber }) {
|
|
155
|
-
const count = await client.request({
|
|
156
|
-
method: "eth_getTransactionCount",
|
|
157
|
-
params: [address, blockNumber ? numberToHex(blockNumber) : blockTag]
|
|
158
|
-
}, { dedupe: Boolean(blockNumber) });
|
|
159
|
-
return hexToNumber(count);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// ../../../../node_modules/.pnpm/@noble+hashes@1.6.1/node_modules/@noble/hashes/esm/_md.js
|
|
163
|
-
function setBigUint64(view, byteOffset, value, isLE) {
|
|
164
|
-
if (typeof view.setBigUint64 === "function")
|
|
165
|
-
return view.setBigUint64(byteOffset, value, isLE);
|
|
166
|
-
const _32n = BigInt(32);
|
|
167
|
-
const _u32_max = BigInt(4294967295);
|
|
168
|
-
const wh = Number(value >> _32n & _u32_max);
|
|
169
|
-
const wl = Number(value & _u32_max);
|
|
170
|
-
const h = isLE ? 4 : 0;
|
|
171
|
-
const l = isLE ? 0 : 4;
|
|
172
|
-
view.setUint32(byteOffset + h, wh, isLE);
|
|
173
|
-
view.setUint32(byteOffset + l, wl, isLE);
|
|
174
|
-
}
|
|
175
|
-
var Chi = (a, b, c) => a & b ^ ~a & c;
|
|
176
|
-
var Maj = (a, b, c) => a & b ^ a & c ^ b & c;
|
|
177
|
-
var HashMD = class extends Hash {
|
|
178
|
-
constructor(blockLen, outputLen, padOffset, isLE) {
|
|
179
|
-
super();
|
|
180
|
-
this.blockLen = blockLen;
|
|
181
|
-
this.outputLen = outputLen;
|
|
182
|
-
this.padOffset = padOffset;
|
|
183
|
-
this.isLE = isLE;
|
|
184
|
-
this.finished = false;
|
|
185
|
-
this.length = 0;
|
|
186
|
-
this.pos = 0;
|
|
187
|
-
this.destroyed = false;
|
|
188
|
-
this.buffer = new Uint8Array(blockLen);
|
|
189
|
-
this.view = createView(this.buffer);
|
|
190
|
-
}
|
|
191
|
-
update(data) {
|
|
192
|
-
aexists(this);
|
|
193
|
-
const { view, buffer: buffer2, blockLen } = this;
|
|
194
|
-
data = toBytes(data);
|
|
195
|
-
const len = data.length;
|
|
196
|
-
for (let pos = 0; pos < len; ) {
|
|
197
|
-
const take = Math.min(blockLen - this.pos, len - pos);
|
|
198
|
-
if (take === blockLen) {
|
|
199
|
-
const dataView = createView(data);
|
|
200
|
-
for (; blockLen <= len - pos; pos += blockLen)
|
|
201
|
-
this.process(dataView, pos);
|
|
202
|
-
continue;
|
|
203
|
-
}
|
|
204
|
-
buffer2.set(data.subarray(pos, pos + take), this.pos);
|
|
205
|
-
this.pos += take;
|
|
206
|
-
pos += take;
|
|
207
|
-
if (this.pos === blockLen) {
|
|
208
|
-
this.process(view, 0);
|
|
209
|
-
this.pos = 0;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
this.length += data.length;
|
|
213
|
-
this.roundClean();
|
|
214
|
-
return this;
|
|
215
|
-
}
|
|
216
|
-
digestInto(out) {
|
|
217
|
-
aexists(this);
|
|
218
|
-
aoutput(out, this);
|
|
219
|
-
this.finished = true;
|
|
220
|
-
const { buffer: buffer2, view, blockLen, isLE } = this;
|
|
221
|
-
let { pos } = this;
|
|
222
|
-
buffer2[pos++] = 128;
|
|
223
|
-
this.buffer.subarray(pos).fill(0);
|
|
224
|
-
if (this.padOffset > blockLen - pos) {
|
|
225
|
-
this.process(view, 0);
|
|
226
|
-
pos = 0;
|
|
227
|
-
}
|
|
228
|
-
for (let i = pos; i < blockLen; i++)
|
|
229
|
-
buffer2[i] = 0;
|
|
230
|
-
setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);
|
|
231
|
-
this.process(view, 0);
|
|
232
|
-
const oview = createView(out);
|
|
233
|
-
const len = this.outputLen;
|
|
234
|
-
if (len % 4)
|
|
235
|
-
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
236
|
-
const outLen = len / 4;
|
|
237
|
-
const state = this.get();
|
|
238
|
-
if (outLen > state.length)
|
|
239
|
-
throw new Error("_sha2: outputLen bigger than state");
|
|
240
|
-
for (let i = 0; i < outLen; i++)
|
|
241
|
-
oview.setUint32(4 * i, state[i], isLE);
|
|
242
|
-
}
|
|
243
|
-
digest() {
|
|
244
|
-
const { buffer: buffer2, outputLen } = this;
|
|
245
|
-
this.digestInto(buffer2);
|
|
246
|
-
const res = buffer2.slice(0, outputLen);
|
|
247
|
-
this.destroy();
|
|
248
|
-
return res;
|
|
249
|
-
}
|
|
250
|
-
_cloneInto(to) {
|
|
251
|
-
to || (to = new this.constructor());
|
|
252
|
-
to.set(...this.get());
|
|
253
|
-
const { blockLen, buffer: buffer2, length, finished, destroyed, pos } = this;
|
|
254
|
-
to.length = length;
|
|
255
|
-
to.pos = pos;
|
|
256
|
-
to.finished = finished;
|
|
257
|
-
to.destroyed = destroyed;
|
|
258
|
-
if (length % blockLen)
|
|
259
|
-
to.buffer.set(buffer2);
|
|
260
|
-
return to;
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
// ../../../../node_modules/.pnpm/@noble+hashes@1.6.1/node_modules/@noble/hashes/esm/sha256.js
|
|
265
|
-
var SHA256_K = new Uint32Array([
|
|
266
|
-
1116352408,
|
|
267
|
-
1899447441,
|
|
268
|
-
3049323471,
|
|
269
|
-
3921009573,
|
|
270
|
-
961987163,
|
|
271
|
-
1508970993,
|
|
272
|
-
2453635748,
|
|
273
|
-
2870763221,
|
|
274
|
-
3624381080,
|
|
275
|
-
310598401,
|
|
276
|
-
607225278,
|
|
277
|
-
1426881987,
|
|
278
|
-
1925078388,
|
|
279
|
-
2162078206,
|
|
280
|
-
2614888103,
|
|
281
|
-
3248222580,
|
|
282
|
-
3835390401,
|
|
283
|
-
4022224774,
|
|
284
|
-
264347078,
|
|
285
|
-
604807628,
|
|
286
|
-
770255983,
|
|
287
|
-
1249150122,
|
|
288
|
-
1555081692,
|
|
289
|
-
1996064986,
|
|
290
|
-
2554220882,
|
|
291
|
-
2821834349,
|
|
292
|
-
2952996808,
|
|
293
|
-
3210313671,
|
|
294
|
-
3336571891,
|
|
295
|
-
3584528711,
|
|
296
|
-
113926993,
|
|
297
|
-
338241895,
|
|
298
|
-
666307205,
|
|
299
|
-
773529912,
|
|
300
|
-
1294757372,
|
|
301
|
-
1396182291,
|
|
302
|
-
1695183700,
|
|
303
|
-
1986661051,
|
|
304
|
-
2177026350,
|
|
305
|
-
2456956037,
|
|
306
|
-
2730485921,
|
|
307
|
-
2820302411,
|
|
308
|
-
3259730800,
|
|
309
|
-
3345764771,
|
|
310
|
-
3516065817,
|
|
311
|
-
3600352804,
|
|
312
|
-
4094571909,
|
|
313
|
-
275423344,
|
|
314
|
-
430227734,
|
|
315
|
-
506948616,
|
|
316
|
-
659060556,
|
|
317
|
-
883997877,
|
|
318
|
-
958139571,
|
|
319
|
-
1322822218,
|
|
320
|
-
1537002063,
|
|
321
|
-
1747873779,
|
|
322
|
-
1955562222,
|
|
323
|
-
2024104815,
|
|
324
|
-
2227730452,
|
|
325
|
-
2361852424,
|
|
326
|
-
2428436474,
|
|
327
|
-
2756734187,
|
|
328
|
-
3204031479,
|
|
329
|
-
3329325298
|
|
330
|
-
]);
|
|
331
|
-
var SHA256_IV = new Uint32Array([
|
|
332
|
-
1779033703,
|
|
333
|
-
3144134277,
|
|
334
|
-
1013904242,
|
|
335
|
-
2773480762,
|
|
336
|
-
1359893119,
|
|
337
|
-
2600822924,
|
|
338
|
-
528734635,
|
|
339
|
-
1541459225
|
|
340
|
-
]);
|
|
341
|
-
var SHA256_W = new Uint32Array(64);
|
|
342
|
-
var SHA256 = class extends HashMD {
|
|
343
|
-
constructor() {
|
|
344
|
-
super(64, 32, 8, false);
|
|
345
|
-
this.A = SHA256_IV[0] | 0;
|
|
346
|
-
this.B = SHA256_IV[1] | 0;
|
|
347
|
-
this.C = SHA256_IV[2] | 0;
|
|
348
|
-
this.D = SHA256_IV[3] | 0;
|
|
349
|
-
this.E = SHA256_IV[4] | 0;
|
|
350
|
-
this.F = SHA256_IV[5] | 0;
|
|
351
|
-
this.G = SHA256_IV[6] | 0;
|
|
352
|
-
this.H = SHA256_IV[7] | 0;
|
|
353
|
-
}
|
|
354
|
-
get() {
|
|
355
|
-
const { A, B, C, D, E, F, G, H } = this;
|
|
356
|
-
return [A, B, C, D, E, F, G, H];
|
|
357
|
-
}
|
|
358
|
-
// prettier-ignore
|
|
359
|
-
set(A, B, C, D, E, F, G, H) {
|
|
360
|
-
this.A = A | 0;
|
|
361
|
-
this.B = B | 0;
|
|
362
|
-
this.C = C | 0;
|
|
363
|
-
this.D = D | 0;
|
|
364
|
-
this.E = E | 0;
|
|
365
|
-
this.F = F | 0;
|
|
366
|
-
this.G = G | 0;
|
|
367
|
-
this.H = H | 0;
|
|
368
|
-
}
|
|
369
|
-
process(view, offset) {
|
|
370
|
-
for (let i = 0; i < 16; i++, offset += 4)
|
|
371
|
-
SHA256_W[i] = view.getUint32(offset, false);
|
|
372
|
-
for (let i = 16; i < 64; i++) {
|
|
373
|
-
const W15 = SHA256_W[i - 15];
|
|
374
|
-
const W2 = SHA256_W[i - 2];
|
|
375
|
-
const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
|
|
376
|
-
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
|
|
377
|
-
SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
|
|
378
|
-
}
|
|
379
|
-
let { A, B, C, D, E, F, G, H } = this;
|
|
380
|
-
for (let i = 0; i < 64; i++) {
|
|
381
|
-
const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
|
|
382
|
-
const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
|
|
383
|
-
const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);
|
|
384
|
-
const T2 = sigma0 + Maj(A, B, C) | 0;
|
|
385
|
-
H = G;
|
|
386
|
-
G = F;
|
|
387
|
-
F = E;
|
|
388
|
-
E = D + T1 | 0;
|
|
389
|
-
D = C;
|
|
390
|
-
C = B;
|
|
391
|
-
B = A;
|
|
392
|
-
A = T1 + T2 | 0;
|
|
393
|
-
}
|
|
394
|
-
A = A + this.A | 0;
|
|
395
|
-
B = B + this.B | 0;
|
|
396
|
-
C = C + this.C | 0;
|
|
397
|
-
D = D + this.D | 0;
|
|
398
|
-
E = E + this.E | 0;
|
|
399
|
-
F = F + this.F | 0;
|
|
400
|
-
G = G + this.G | 0;
|
|
401
|
-
H = H + this.H | 0;
|
|
402
|
-
this.set(A, B, C, D, E, F, G, H);
|
|
403
|
-
}
|
|
404
|
-
roundClean() {
|
|
405
|
-
SHA256_W.fill(0);
|
|
406
|
-
}
|
|
407
|
-
destroy() {
|
|
408
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
|
409
|
-
this.buffer.fill(0);
|
|
410
|
-
}
|
|
411
|
-
};
|
|
412
|
-
var SHA224 = class extends SHA256 {
|
|
413
|
-
constructor() {
|
|
414
|
-
super();
|
|
415
|
-
this.A = 3238371032 | 0;
|
|
416
|
-
this.B = 914150663 | 0;
|
|
417
|
-
this.C = 812702999 | 0;
|
|
418
|
-
this.D = 4144912697 | 0;
|
|
419
|
-
this.E = 4290775857 | 0;
|
|
420
|
-
this.F = 1750603025 | 0;
|
|
421
|
-
this.G = 1694076839 | 0;
|
|
422
|
-
this.H = 3204075428 | 0;
|
|
423
|
-
this.outputLen = 28;
|
|
424
|
-
}
|
|
425
|
-
};
|
|
426
|
-
var sha256 = wrapConstructor(() => new SHA256());
|
|
427
|
-
var sha224 = wrapConstructor(() => new SHA224());
|
|
428
|
-
|
|
429
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/constants/blob.js
|
|
430
|
-
var blobsPerTransaction = 6;
|
|
431
|
-
var bytesPerFieldElement = 32;
|
|
432
|
-
var fieldElementsPerBlob = 4096;
|
|
433
|
-
var bytesPerBlob = bytesPerFieldElement * fieldElementsPerBlob;
|
|
434
|
-
var maxBytesPerTransaction = bytesPerBlob * blobsPerTransaction - // terminator byte (0x80).
|
|
435
|
-
1 - // zero byte (0x00) appended to each field element.
|
|
436
|
-
1 * fieldElementsPerBlob * blobsPerTransaction;
|
|
437
|
-
|
|
438
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/actions/wallet/sendTransaction.js
|
|
439
|
-
var supportsWalletNamespace = new LruMap(128);
|
|
440
|
-
|
|
441
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/formatters/log.js
|
|
442
|
-
function formatLog(log, { args, eventName } = {}) {
|
|
443
|
-
return {
|
|
444
|
-
...log,
|
|
445
|
-
blockHash: log.blockHash ? log.blockHash : null,
|
|
446
|
-
blockNumber: log.blockNumber ? BigInt(log.blockNumber) : null,
|
|
447
|
-
logIndex: log.logIndex ? Number(log.logIndex) : null,
|
|
448
|
-
transactionHash: log.transactionHash ? log.transactionHash : null,
|
|
449
|
-
transactionIndex: log.transactionIndex ? Number(log.transactionIndex) : null,
|
|
450
|
-
...eventName ? { args, eventName } : {}
|
|
451
|
-
};
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/formatters/transactionReceipt.js
|
|
455
|
-
var receiptStatuses = {
|
|
456
|
-
"0x0": "reverted",
|
|
457
|
-
"0x1": "success"
|
|
458
|
-
};
|
|
459
|
-
function formatTransactionReceipt(transactionReceipt) {
|
|
460
|
-
const receipt = {
|
|
461
|
-
...transactionReceipt,
|
|
462
|
-
blockNumber: transactionReceipt.blockNumber ? BigInt(transactionReceipt.blockNumber) : null,
|
|
463
|
-
contractAddress: transactionReceipt.contractAddress ? transactionReceipt.contractAddress : null,
|
|
464
|
-
cumulativeGasUsed: transactionReceipt.cumulativeGasUsed ? BigInt(transactionReceipt.cumulativeGasUsed) : null,
|
|
465
|
-
effectiveGasPrice: transactionReceipt.effectiveGasPrice ? BigInt(transactionReceipt.effectiveGasPrice) : null,
|
|
466
|
-
gasUsed: transactionReceipt.gasUsed ? BigInt(transactionReceipt.gasUsed) : null,
|
|
467
|
-
logs: transactionReceipt.logs ? transactionReceipt.logs.map((log) => formatLog(log)) : null,
|
|
468
|
-
to: transactionReceipt.to ? transactionReceipt.to : null,
|
|
469
|
-
transactionIndex: transactionReceipt.transactionIndex ? hexToNumber(transactionReceipt.transactionIndex) : null,
|
|
470
|
-
status: transactionReceipt.status ? receiptStatuses[transactionReceipt.status] : null,
|
|
471
|
-
type: transactionReceipt.type ? transactionType[transactionReceipt.type] || transactionReceipt.type : null
|
|
472
|
-
};
|
|
473
|
-
if (transactionReceipt.blobGasPrice)
|
|
474
|
-
receipt.blobGasPrice = BigInt(transactionReceipt.blobGasPrice);
|
|
475
|
-
if (transactionReceipt.blobGasUsed)
|
|
476
|
-
receipt.blobGasUsed = BigInt(transactionReceipt.blobGasUsed);
|
|
477
|
-
return receipt;
|
|
478
|
-
}
|
|
479
|
-
var defineTransactionReceipt = defineFormatter("transactionReceipt", formatTransactionReceipt);
|
|
480
|
-
|
|
481
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/wait.js
|
|
482
|
-
async function wait(time) {
|
|
483
|
-
return new Promise((res) => setTimeout(res, time));
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/promise/withDedupe.js
|
|
487
|
-
var promiseCache = new LruMap(8192);
|
|
488
|
-
function withDedupe(fn, { enabled = true, id }) {
|
|
489
|
-
if (!enabled || !id)
|
|
490
|
-
return fn();
|
|
491
|
-
if (promiseCache.get(id))
|
|
492
|
-
return promiseCache.get(id);
|
|
493
|
-
const promise = fn().finally(() => promiseCache.delete(id));
|
|
494
|
-
promiseCache.set(id, promise);
|
|
495
|
-
return promise;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/promise/withRetry.js
|
|
499
|
-
function withRetry(fn, { delay: delay_ = 100, retryCount = 2, shouldRetry: shouldRetry2 = () => true } = {}) {
|
|
500
|
-
return new Promise((resolve, reject) => {
|
|
501
|
-
const attemptRetry = async ({ count = 0 } = {}) => {
|
|
502
|
-
const retry = async ({ error }) => {
|
|
503
|
-
const delay = typeof delay_ === "function" ? delay_({ count, error }) : delay_;
|
|
504
|
-
if (delay)
|
|
505
|
-
await wait(delay);
|
|
506
|
-
attemptRetry({ count: count + 1 });
|
|
507
|
-
};
|
|
508
|
-
try {
|
|
509
|
-
const data = await fn();
|
|
510
|
-
resolve(data);
|
|
511
|
-
} catch (err) {
|
|
512
|
-
if (count < retryCount && await shouldRetry2({ count, error: err }))
|
|
513
|
-
return retry({ error: err });
|
|
514
|
-
reject(err);
|
|
515
|
-
}
|
|
516
|
-
};
|
|
517
|
-
attemptRetry();
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/buildRequest.js
|
|
522
|
-
function buildRequest(request, options = {}) {
|
|
523
|
-
return async (args, overrideOptions = {}) => {
|
|
524
|
-
const { dedupe = false, retryDelay = 150, retryCount = 3, uid: uid3 } = {
|
|
525
|
-
...options,
|
|
526
|
-
...overrideOptions
|
|
527
|
-
};
|
|
528
|
-
const requestId = dedupe ? keccak256(stringToHex(`${uid3}.${stringify(args)}`)) : void 0;
|
|
529
|
-
return withDedupe(() => withRetry(async () => {
|
|
530
|
-
try {
|
|
531
|
-
return await request(args);
|
|
532
|
-
} catch (err_) {
|
|
533
|
-
const err = err_;
|
|
534
|
-
switch (err.code) {
|
|
535
|
-
case ParseRpcError.code:
|
|
536
|
-
throw new ParseRpcError(err);
|
|
537
|
-
case InvalidRequestRpcError.code:
|
|
538
|
-
throw new InvalidRequestRpcError(err);
|
|
539
|
-
case MethodNotFoundRpcError.code:
|
|
540
|
-
throw new MethodNotFoundRpcError(err, { method: args.method });
|
|
541
|
-
case InvalidParamsRpcError.code:
|
|
542
|
-
throw new InvalidParamsRpcError(err);
|
|
543
|
-
case InternalRpcError.code:
|
|
544
|
-
throw new InternalRpcError(err);
|
|
545
|
-
case InvalidInputRpcError.code:
|
|
546
|
-
throw new InvalidInputRpcError(err);
|
|
547
|
-
case ResourceNotFoundRpcError.code:
|
|
548
|
-
throw new ResourceNotFoundRpcError(err);
|
|
549
|
-
case ResourceUnavailableRpcError.code:
|
|
550
|
-
throw new ResourceUnavailableRpcError(err);
|
|
551
|
-
case TransactionRejectedRpcError.code:
|
|
552
|
-
throw new TransactionRejectedRpcError(err);
|
|
553
|
-
case MethodNotSupportedRpcError.code:
|
|
554
|
-
throw new MethodNotSupportedRpcError(err, {
|
|
555
|
-
method: args.method
|
|
556
|
-
});
|
|
557
|
-
case LimitExceededRpcError.code:
|
|
558
|
-
throw new LimitExceededRpcError(err);
|
|
559
|
-
case JsonRpcVersionUnsupportedError.code:
|
|
560
|
-
throw new JsonRpcVersionUnsupportedError(err);
|
|
561
|
-
case UserRejectedRequestError.code:
|
|
562
|
-
throw new UserRejectedRequestError(err);
|
|
563
|
-
case UnauthorizedProviderError.code:
|
|
564
|
-
throw new UnauthorizedProviderError(err);
|
|
565
|
-
case UnsupportedProviderMethodError.code:
|
|
566
|
-
throw new UnsupportedProviderMethodError(err);
|
|
567
|
-
case ProviderDisconnectedError.code:
|
|
568
|
-
throw new ProviderDisconnectedError(err);
|
|
569
|
-
case ChainDisconnectedError.code:
|
|
570
|
-
throw new ChainDisconnectedError(err);
|
|
571
|
-
case SwitchChainError.code:
|
|
572
|
-
throw new SwitchChainError(err);
|
|
573
|
-
case 5e3:
|
|
574
|
-
throw new UserRejectedRequestError(err);
|
|
575
|
-
default:
|
|
576
|
-
if (err_ instanceof BaseError)
|
|
577
|
-
throw err_;
|
|
578
|
-
throw new UnknownRpcError(err);
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
}, {
|
|
582
|
-
delay: ({ count, error }) => {
|
|
583
|
-
var _a;
|
|
584
|
-
if (error && error instanceof HttpRequestError) {
|
|
585
|
-
const retryAfter = (_a = error == null ? void 0 : error.headers) == null ? void 0 : _a.get("Retry-After");
|
|
586
|
-
if (retryAfter == null ? void 0 : retryAfter.match(/\d/))
|
|
587
|
-
return Number.parseInt(retryAfter) * 1e3;
|
|
588
|
-
}
|
|
589
|
-
return ~~(1 << count) * retryDelay;
|
|
590
|
-
},
|
|
591
|
-
retryCount,
|
|
592
|
-
shouldRetry: ({ error }) => shouldRetry(error)
|
|
593
|
-
}), { enabled: dedupe, id: requestId });
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
function shouldRetry(error) {
|
|
597
|
-
if ("code" in error && typeof error.code === "number") {
|
|
598
|
-
if (error.code === -1)
|
|
599
|
-
return true;
|
|
600
|
-
if (error.code === LimitExceededRpcError.code)
|
|
601
|
-
return true;
|
|
602
|
-
if (error.code === InternalRpcError.code)
|
|
603
|
-
return true;
|
|
604
|
-
return false;
|
|
605
|
-
}
|
|
606
|
-
if (error instanceof HttpRequestError && error.status) {
|
|
607
|
-
if (error.status === 403)
|
|
608
|
-
return true;
|
|
609
|
-
if (error.status === 408)
|
|
610
|
-
return true;
|
|
611
|
-
if (error.status === 413)
|
|
612
|
-
return true;
|
|
613
|
-
if (error.status === 429)
|
|
614
|
-
return true;
|
|
615
|
-
if (error.status === 500)
|
|
616
|
-
return true;
|
|
617
|
-
if (error.status === 502)
|
|
618
|
-
return true;
|
|
619
|
-
if (error.status === 503)
|
|
620
|
-
return true;
|
|
621
|
-
if (error.status === 504)
|
|
622
|
-
return true;
|
|
623
|
-
return false;
|
|
624
|
-
}
|
|
625
|
-
return true;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/promise/withTimeout.js
|
|
629
|
-
function withTimeout(fn, { errorInstance = new Error("timed out"), timeout, signal }) {
|
|
630
|
-
return new Promise((resolve, reject) => {
|
|
631
|
-
;
|
|
632
|
-
(async () => {
|
|
633
|
-
let timeoutId;
|
|
634
|
-
try {
|
|
635
|
-
const controller = new AbortController();
|
|
636
|
-
if (timeout > 0) {
|
|
637
|
-
timeoutId = setTimeout(() => {
|
|
638
|
-
if (signal) {
|
|
639
|
-
controller.abort();
|
|
640
|
-
} else {
|
|
641
|
-
reject(errorInstance);
|
|
642
|
-
}
|
|
643
|
-
}, timeout);
|
|
644
|
-
}
|
|
645
|
-
resolve(await fn({ signal: (controller == null ? void 0 : controller.signal) || null }));
|
|
646
|
-
} catch (err) {
|
|
647
|
-
if ((err == null ? void 0 : err.name) === "AbortError")
|
|
648
|
-
reject(errorInstance);
|
|
649
|
-
reject(err);
|
|
650
|
-
} finally {
|
|
651
|
-
clearTimeout(timeoutId);
|
|
652
|
-
}
|
|
653
|
-
})();
|
|
654
|
-
});
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/rpc/id.js
|
|
658
|
-
function createIdStore() {
|
|
659
|
-
return {
|
|
660
|
-
current: 0,
|
|
661
|
-
take() {
|
|
662
|
-
return this.current++;
|
|
663
|
-
},
|
|
664
|
-
reset() {
|
|
665
|
-
this.current = 0;
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
}
|
|
669
|
-
var idCache = createIdStore();
|
|
670
|
-
|
|
671
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/rpc/http.js
|
|
672
|
-
function getHttpRpcClient(url, options = {}) {
|
|
673
|
-
return {
|
|
674
|
-
async request(params) {
|
|
675
|
-
var _a;
|
|
676
|
-
const { body, onRequest = options.onRequest, onResponse = options.onResponse, timeout = options.timeout ?? 1e4 } = params;
|
|
677
|
-
const fetchOptions = {
|
|
678
|
-
...options.fetchOptions ?? {},
|
|
679
|
-
...params.fetchOptions ?? {}
|
|
680
|
-
};
|
|
681
|
-
const { headers, method, signal: signal_ } = fetchOptions;
|
|
682
|
-
try {
|
|
683
|
-
const response = await withTimeout(async ({ signal }) => {
|
|
684
|
-
const init = {
|
|
685
|
-
...fetchOptions,
|
|
686
|
-
body: Array.isArray(body) ? stringify(body.map((body2) => ({
|
|
687
|
-
jsonrpc: "2.0",
|
|
688
|
-
id: body2.id ?? idCache.take(),
|
|
689
|
-
...body2
|
|
690
|
-
}))) : stringify({
|
|
691
|
-
jsonrpc: "2.0",
|
|
692
|
-
id: body.id ?? idCache.take(),
|
|
693
|
-
...body
|
|
694
|
-
}),
|
|
695
|
-
headers: {
|
|
696
|
-
"Content-Type": "application/json",
|
|
697
|
-
...headers
|
|
698
|
-
},
|
|
699
|
-
method: method || "POST",
|
|
700
|
-
signal: signal_ || (timeout > 0 ? signal : null)
|
|
701
|
-
};
|
|
702
|
-
const request = new Request(url, init);
|
|
703
|
-
const args = await (onRequest == null ? void 0 : onRequest(request, init)) ?? { ...init, url };
|
|
704
|
-
const response2 = await fetch(args.url ?? url, args);
|
|
705
|
-
return response2;
|
|
706
|
-
}, {
|
|
707
|
-
errorInstance: new TimeoutError({ body, url }),
|
|
708
|
-
timeout,
|
|
709
|
-
signal: true
|
|
710
|
-
});
|
|
711
|
-
if (onResponse)
|
|
712
|
-
await onResponse(response);
|
|
713
|
-
let data;
|
|
714
|
-
if ((_a = response.headers.get("Content-Type")) == null ? void 0 : _a.startsWith("application/json"))
|
|
715
|
-
data = await response.json();
|
|
716
|
-
else {
|
|
717
|
-
data = await response.text();
|
|
718
|
-
try {
|
|
719
|
-
data = JSON.parse(data || "{}");
|
|
720
|
-
} catch (err) {
|
|
721
|
-
if (response.ok)
|
|
722
|
-
throw err;
|
|
723
|
-
data = { error: data };
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
if (!response.ok) {
|
|
727
|
-
throw new HttpRequestError({
|
|
728
|
-
body,
|
|
729
|
-
details: stringify(data.error) || response.statusText,
|
|
730
|
-
headers: response.headers,
|
|
731
|
-
status: response.status,
|
|
732
|
-
url
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
return data;
|
|
736
|
-
} catch (err) {
|
|
737
|
-
if (err instanceof HttpRequestError)
|
|
738
|
-
throw err;
|
|
739
|
-
if (err instanceof TimeoutError)
|
|
740
|
-
throw err;
|
|
741
|
-
throw new HttpRequestError({
|
|
742
|
-
body,
|
|
743
|
-
cause: err,
|
|
744
|
-
url
|
|
745
|
-
});
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
};
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/rpc/compat.js
|
|
752
|
-
function webSocket(socketClient, { body, onError, onResponse }) {
|
|
753
|
-
socketClient.request({
|
|
754
|
-
body,
|
|
755
|
-
onError,
|
|
756
|
-
onResponse
|
|
757
|
-
});
|
|
758
|
-
return socketClient;
|
|
759
|
-
}
|
|
760
|
-
async function webSocketAsync(socketClient, { body, timeout = 1e4 }) {
|
|
761
|
-
return socketClient.requestAsync({
|
|
762
|
-
body,
|
|
763
|
-
timeout
|
|
764
|
-
});
|
|
765
|
-
}
|
|
766
|
-
var rpc = {
|
|
767
|
-
/**
|
|
768
|
-
* @deprecated use `getHttpRpcClient` instead.
|
|
769
|
-
*
|
|
770
|
-
* ```diff
|
|
771
|
-
* -import { rpc } from 'viem/utils'
|
|
772
|
-
* +import { getHttpRpcClient } from 'viem/utils'
|
|
773
|
-
*
|
|
774
|
-
* -rpc.http(url, params)
|
|
775
|
-
* +const httpClient = getHttpRpcClient(url)
|
|
776
|
-
* +httpClient.request(params)
|
|
777
|
-
* ```
|
|
778
|
-
*/
|
|
779
|
-
http(url, params) {
|
|
780
|
-
return getHttpRpcClient(url).request(params);
|
|
781
|
-
},
|
|
782
|
-
/**
|
|
783
|
-
* @deprecated use `getWebSocketRpcClient` instead.
|
|
784
|
-
*
|
|
785
|
-
* ```diff
|
|
786
|
-
* -import { rpc } from 'viem/utils'
|
|
787
|
-
* +import { getWebSocketRpcClient } from 'viem/utils'
|
|
788
|
-
*
|
|
789
|
-
* -rpc.webSocket(url, params)
|
|
790
|
-
* +const webSocketClient = getWebSocketRpcClient(url)
|
|
791
|
-
* +webSocketClient.request(params)
|
|
792
|
-
* ```
|
|
793
|
-
*/
|
|
794
|
-
webSocket,
|
|
795
|
-
/**
|
|
796
|
-
* @deprecated use `getWebSocketRpcClient` instead.
|
|
797
|
-
*
|
|
798
|
-
* ```diff
|
|
799
|
-
* -import { rpc } from 'viem/utils'
|
|
800
|
-
* +import { getWebSocketRpcClient } from 'viem/utils'
|
|
801
|
-
*
|
|
802
|
-
* -const response = await rpc.webSocketAsync(url, params)
|
|
803
|
-
* +const webSocketClient = getWebSocketRpcClient(url)
|
|
804
|
-
* +const response = await webSocketClient.requestAsync(params)
|
|
805
|
-
* ```
|
|
806
|
-
*/
|
|
807
|
-
webSocketAsync
|
|
808
|
-
};
|
|
809
|
-
|
|
810
|
-
// ../../../../node_modules/.pnpm/@noble+hashes@1.6.1/node_modules/@noble/hashes/esm/ripemd160.js
|
|
811
|
-
var Rho = new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]);
|
|
812
|
-
var Id = new Uint8Array(new Array(16).fill(0).map((_, i) => i));
|
|
813
|
-
var Pi = Id.map((i) => (9 * i + 5) % 16);
|
|
814
|
-
var idxL = [Id];
|
|
815
|
-
var idxR = [Pi];
|
|
816
|
-
for (let i = 0; i < 4; i++)
|
|
817
|
-
for (let j of [idxL, idxR])
|
|
818
|
-
j.push(j[i].map((k) => Rho[k]));
|
|
819
|
-
var shifts = [
|
|
820
|
-
[11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
|
|
821
|
-
[12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
|
|
822
|
-
[13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
|
|
823
|
-
[14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
|
|
824
|
-
[15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
|
|
825
|
-
].map((i) => new Uint8Array(i));
|
|
826
|
-
var shiftsL = idxL.map((idx, i) => idx.map((j) => shifts[i][j]));
|
|
827
|
-
var shiftsR = idxR.map((idx, i) => idx.map((j) => shifts[i][j]));
|
|
828
|
-
var Kl = new Uint32Array([
|
|
829
|
-
0,
|
|
830
|
-
1518500249,
|
|
831
|
-
1859775393,
|
|
832
|
-
2400959708,
|
|
833
|
-
2840853838
|
|
834
|
-
]);
|
|
835
|
-
var Kr = new Uint32Array([
|
|
836
|
-
1352829926,
|
|
837
|
-
1548603684,
|
|
838
|
-
1836072691,
|
|
839
|
-
2053994217,
|
|
840
|
-
0
|
|
841
|
-
]);
|
|
842
|
-
function f(group, x, y, z) {
|
|
843
|
-
if (group === 0)
|
|
844
|
-
return x ^ y ^ z;
|
|
845
|
-
else if (group === 1)
|
|
846
|
-
return x & y | ~x & z;
|
|
847
|
-
else if (group === 2)
|
|
848
|
-
return (x | ~y) ^ z;
|
|
849
|
-
else if (group === 3)
|
|
850
|
-
return x & z | y & ~z;
|
|
851
|
-
else
|
|
852
|
-
return x ^ (y | ~z);
|
|
853
|
-
}
|
|
854
|
-
var R_BUF = new Uint32Array(16);
|
|
855
|
-
var RIPEMD160 = class extends HashMD {
|
|
856
|
-
constructor() {
|
|
857
|
-
super(64, 20, 8, true);
|
|
858
|
-
this.h0 = 1732584193 | 0;
|
|
859
|
-
this.h1 = 4023233417 | 0;
|
|
860
|
-
this.h2 = 2562383102 | 0;
|
|
861
|
-
this.h3 = 271733878 | 0;
|
|
862
|
-
this.h4 = 3285377520 | 0;
|
|
863
|
-
}
|
|
864
|
-
get() {
|
|
865
|
-
const { h0, h1, h2, h3, h4 } = this;
|
|
866
|
-
return [h0, h1, h2, h3, h4];
|
|
867
|
-
}
|
|
868
|
-
set(h0, h1, h2, h3, h4) {
|
|
869
|
-
this.h0 = h0 | 0;
|
|
870
|
-
this.h1 = h1 | 0;
|
|
871
|
-
this.h2 = h2 | 0;
|
|
872
|
-
this.h3 = h3 | 0;
|
|
873
|
-
this.h4 = h4 | 0;
|
|
874
|
-
}
|
|
875
|
-
process(view, offset) {
|
|
876
|
-
for (let i = 0; i < 16; i++, offset += 4)
|
|
877
|
-
R_BUF[i] = view.getUint32(offset, true);
|
|
878
|
-
let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;
|
|
879
|
-
for (let group = 0; group < 5; group++) {
|
|
880
|
-
const rGroup = 4 - group;
|
|
881
|
-
const hbl = Kl[group], hbr = Kr[group];
|
|
882
|
-
const rl = idxL[group], rr = idxR[group];
|
|
883
|
-
const sl = shiftsL[group], sr = shiftsR[group];
|
|
884
|
-
for (let i = 0; i < 16; i++) {
|
|
885
|
-
const tl = rotl(al + f(group, bl, cl, dl) + R_BUF[rl[i]] + hbl, sl[i]) + el | 0;
|
|
886
|
-
al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl;
|
|
887
|
-
}
|
|
888
|
-
for (let i = 0; i < 16; i++) {
|
|
889
|
-
const tr = rotl(ar + f(rGroup, br, cr, dr) + R_BUF[rr[i]] + hbr, sr[i]) + er | 0;
|
|
890
|
-
ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr;
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
this.set(this.h1 + cl + dr | 0, this.h2 + dl + er | 0, this.h3 + el + ar | 0, this.h4 + al + br | 0, this.h0 + bl + cr | 0);
|
|
894
|
-
}
|
|
895
|
-
roundClean() {
|
|
896
|
-
R_BUF.fill(0);
|
|
897
|
-
}
|
|
898
|
-
destroy() {
|
|
899
|
-
this.destroyed = true;
|
|
900
|
-
this.buffer.fill(0);
|
|
901
|
-
this.set(0, 0, 0, 0, 0);
|
|
902
|
-
}
|
|
903
|
-
};
|
|
904
|
-
var ripemd160 = wrapConstructor(() => new RIPEMD160());
|
|
905
|
-
|
|
906
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/nonceManager.js
|
|
907
|
-
function createNonceManager(parameters) {
|
|
908
|
-
const { source } = parameters;
|
|
909
|
-
const deltaMap = /* @__PURE__ */ new Map();
|
|
910
|
-
const nonceMap = new LruMap(8192);
|
|
911
|
-
const promiseMap = /* @__PURE__ */ new Map();
|
|
912
|
-
const getKey = ({ address, chainId }) => `${address}.${chainId}`;
|
|
913
|
-
return {
|
|
914
|
-
async consume({ address, chainId, client }) {
|
|
915
|
-
const key = getKey({ address, chainId });
|
|
916
|
-
const promise = this.get({ address, chainId, client });
|
|
917
|
-
this.increment({ address, chainId });
|
|
918
|
-
const nonce = await promise;
|
|
919
|
-
await source.set({ address, chainId }, nonce);
|
|
920
|
-
nonceMap.set(key, nonce);
|
|
921
|
-
return nonce;
|
|
922
|
-
},
|
|
923
|
-
async increment({ address, chainId }) {
|
|
924
|
-
const key = getKey({ address, chainId });
|
|
925
|
-
const delta = deltaMap.get(key) ?? 0;
|
|
926
|
-
deltaMap.set(key, delta + 1);
|
|
927
|
-
},
|
|
928
|
-
async get({ address, chainId, client }) {
|
|
929
|
-
const key = getKey({ address, chainId });
|
|
930
|
-
let promise = promiseMap.get(key);
|
|
931
|
-
if (!promise) {
|
|
932
|
-
promise = (async () => {
|
|
933
|
-
try {
|
|
934
|
-
const nonce = await source.get({ address, chainId, client });
|
|
935
|
-
const previousNonce = nonceMap.get(key) ?? 0;
|
|
936
|
-
if (previousNonce > 0 && nonce <= previousNonce)
|
|
937
|
-
return previousNonce + 1;
|
|
938
|
-
nonceMap.delete(key);
|
|
939
|
-
return nonce;
|
|
940
|
-
} finally {
|
|
941
|
-
this.reset({ address, chainId });
|
|
942
|
-
}
|
|
943
|
-
})();
|
|
944
|
-
promiseMap.set(key, promise);
|
|
945
|
-
}
|
|
946
|
-
const delta = deltaMap.get(key) ?? 0;
|
|
947
|
-
return delta + await promise;
|
|
948
|
-
},
|
|
949
|
-
reset({ address, chainId }) {
|
|
950
|
-
const key = getKey({ address, chainId });
|
|
951
|
-
deltaMap.delete(key);
|
|
952
|
-
promiseMap.delete(key);
|
|
953
|
-
}
|
|
954
|
-
};
|
|
955
|
-
}
|
|
956
|
-
function jsonRpc() {
|
|
957
|
-
return {
|
|
958
|
-
async get(parameters) {
|
|
959
|
-
const { address, client } = parameters;
|
|
960
|
-
return getTransactionCount(client, {
|
|
961
|
-
address,
|
|
962
|
-
blockTag: "pending"
|
|
963
|
-
});
|
|
964
|
-
},
|
|
965
|
-
set() {
|
|
966
|
-
}
|
|
967
|
-
};
|
|
968
|
-
}
|
|
969
|
-
var nonceManager = createNonceManager({
|
|
970
|
-
source: jsonRpc()
|
|
971
|
-
});
|
|
972
|
-
|
|
973
|
-
// ../../../../node_modules/.pnpm/@wagmi+core@2.16.5_@tanstack+query-core@5.66.4_@types+react@19.0.12_react@19.0.0_typescript@5_oeltxj7l7uytirmunypreij5lm/node_modules/@wagmi/core/dist/esm/version.js
|
|
974
|
-
var version = "2.16.5";
|
|
975
|
-
|
|
976
|
-
// ../../../../node_modules/.pnpm/@wagmi+core@2.16.5_@tanstack+query-core@5.66.4_@types+react@19.0.12_react@19.0.0_typescript@5_oeltxj7l7uytirmunypreij5lm/node_modules/@wagmi/core/dist/esm/utils/getVersion.js
|
|
977
|
-
var getVersion = () => `@wagmi/core@${version}`;
|
|
978
|
-
|
|
979
|
-
// ../../../../node_modules/.pnpm/@wagmi+core@2.16.5_@tanstack+query-core@5.66.4_@types+react@19.0.12_react@19.0.0_typescript@5_oeltxj7l7uytirmunypreij5lm/node_modules/@wagmi/core/dist/esm/errors/base.js
|
|
980
|
-
var __classPrivateFieldGet = function(receiver, state, kind, f2) {
|
|
981
|
-
if (kind === "a" && !f2) throw new TypeError("Private accessor was defined without a getter");
|
|
982
|
-
if (typeof state === "function" ? receiver !== state || !f2 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
983
|
-
return kind === "m" ? f2 : kind === "a" ? f2.call(receiver) : f2 ? f2.value : state.get(receiver);
|
|
984
|
-
};
|
|
985
|
-
var _BaseError_instances;
|
|
986
|
-
var _BaseError_walk;
|
|
987
|
-
var BaseError2 = class _BaseError extends Error {
|
|
988
|
-
get docsBaseUrl() {
|
|
989
|
-
return "https://wagmi.sh/core";
|
|
990
|
-
}
|
|
991
|
-
get version() {
|
|
992
|
-
return getVersion();
|
|
993
|
-
}
|
|
994
|
-
constructor(shortMessage, options = {}) {
|
|
995
|
-
var _a;
|
|
996
|
-
super();
|
|
997
|
-
_BaseError_instances.add(this);
|
|
998
|
-
Object.defineProperty(this, "details", {
|
|
999
|
-
enumerable: true,
|
|
1000
|
-
configurable: true,
|
|
1001
|
-
writable: true,
|
|
1002
|
-
value: void 0
|
|
1003
|
-
});
|
|
1004
|
-
Object.defineProperty(this, "docsPath", {
|
|
1005
|
-
enumerable: true,
|
|
1006
|
-
configurable: true,
|
|
1007
|
-
writable: true,
|
|
1008
|
-
value: void 0
|
|
1009
|
-
});
|
|
1010
|
-
Object.defineProperty(this, "metaMessages", {
|
|
1011
|
-
enumerable: true,
|
|
1012
|
-
configurable: true,
|
|
1013
|
-
writable: true,
|
|
1014
|
-
value: void 0
|
|
1015
|
-
});
|
|
1016
|
-
Object.defineProperty(this, "shortMessage", {
|
|
1017
|
-
enumerable: true,
|
|
1018
|
-
configurable: true,
|
|
1019
|
-
writable: true,
|
|
1020
|
-
value: void 0
|
|
1021
|
-
});
|
|
1022
|
-
Object.defineProperty(this, "name", {
|
|
1023
|
-
enumerable: true,
|
|
1024
|
-
configurable: true,
|
|
1025
|
-
writable: true,
|
|
1026
|
-
value: "WagmiCoreError"
|
|
1027
|
-
});
|
|
1028
|
-
const details = options.cause instanceof _BaseError ? options.cause.details : ((_a = options.cause) == null ? void 0 : _a.message) ? options.cause.message : options.details;
|
|
1029
|
-
const docsPath = options.cause instanceof _BaseError ? options.cause.docsPath || options.docsPath : options.docsPath;
|
|
1030
|
-
this.message = [
|
|
1031
|
-
shortMessage || "An error occurred.",
|
|
1032
|
-
"",
|
|
1033
|
-
...options.metaMessages ? [...options.metaMessages, ""] : [],
|
|
1034
|
-
...docsPath ? [
|
|
1035
|
-
`Docs: ${this.docsBaseUrl}${docsPath}.html${options.docsSlug ? `#${options.docsSlug}` : ""}`
|
|
1036
|
-
] : [],
|
|
1037
|
-
...details ? [`Details: ${details}`] : [],
|
|
1038
|
-
`Version: ${this.version}`
|
|
1039
|
-
].join("\n");
|
|
1040
|
-
if (options.cause)
|
|
1041
|
-
this.cause = options.cause;
|
|
1042
|
-
this.details = details;
|
|
1043
|
-
this.docsPath = docsPath;
|
|
1044
|
-
this.metaMessages = options.metaMessages;
|
|
1045
|
-
this.shortMessage = shortMessage;
|
|
1046
|
-
}
|
|
1047
|
-
walk(fn) {
|
|
1048
|
-
return __classPrivateFieldGet(this, _BaseError_instances, "m", _BaseError_walk).call(this, this, fn);
|
|
1049
|
-
}
|
|
1050
|
-
};
|
|
1051
|
-
_BaseError_instances = /* @__PURE__ */ new WeakSet(), _BaseError_walk = function _BaseError_walk2(err, fn) {
|
|
1052
|
-
if (fn == null ? void 0 : fn(err))
|
|
1053
|
-
return err;
|
|
1054
|
-
if (err.cause)
|
|
1055
|
-
return __classPrivateFieldGet(this, _BaseError_instances, "m", _BaseError_walk2).call(this, err.cause, fn);
|
|
1056
|
-
return err;
|
|
1057
|
-
};
|
|
1058
|
-
|
|
1059
|
-
// ../../../../node_modules/.pnpm/@wagmi+core@2.16.5_@tanstack+query-core@5.66.4_@types+react@19.0.12_react@19.0.0_typescript@5_oeltxj7l7uytirmunypreij5lm/node_modules/@wagmi/core/dist/esm/errors/config.js
|
|
1060
|
-
var ChainNotConfiguredError = class extends BaseError2 {
|
|
1061
|
-
constructor() {
|
|
1062
|
-
super("Chain not configured.");
|
|
1063
|
-
Object.defineProperty(this, "name", {
|
|
1064
|
-
enumerable: true,
|
|
1065
|
-
configurable: true,
|
|
1066
|
-
writable: true,
|
|
1067
|
-
value: "ChainNotConfiguredError"
|
|
1068
|
-
});
|
|
1069
|
-
}
|
|
1070
|
-
};
|
|
1071
|
-
var ConnectorNotConnectedError = class extends BaseError2 {
|
|
1072
|
-
constructor() {
|
|
1073
|
-
super("Connector not connected.");
|
|
1074
|
-
Object.defineProperty(this, "name", {
|
|
1075
|
-
enumerable: true,
|
|
1076
|
-
configurable: true,
|
|
1077
|
-
writable: true,
|
|
1078
|
-
value: "ConnectorNotConnectedError"
|
|
1079
|
-
});
|
|
1080
|
-
}
|
|
1081
|
-
};
|
|
1082
|
-
|
|
1083
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/uid.js
|
|
1084
|
-
var size2 = 256;
|
|
1085
|
-
var index = size2;
|
|
1086
|
-
var buffer;
|
|
1087
|
-
function uid(length = 11) {
|
|
1088
|
-
if (!buffer || index + length > size2 * 2) {
|
|
1089
|
-
buffer = "";
|
|
1090
|
-
index = 0;
|
|
1091
|
-
for (let i = 0; i < size2; i++) {
|
|
1092
|
-
buffer += (256 + Math.random() * 256 | 0).toString(16).substring(1);
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
return buffer.substring(index, index++ + length);
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/clients/transports/createTransport.js
|
|
1099
|
-
function createTransport({ key, name, request, retryCount = 3, retryDelay = 150, timeout, type }, value) {
|
|
1100
|
-
const uid3 = uid();
|
|
1101
|
-
return {
|
|
1102
|
-
config: {
|
|
1103
|
-
key,
|
|
1104
|
-
name,
|
|
1105
|
-
request,
|
|
1106
|
-
retryCount,
|
|
1107
|
-
retryDelay,
|
|
1108
|
-
timeout,
|
|
1109
|
-
type
|
|
1110
|
-
},
|
|
1111
|
-
request: buildRequest(request, { retryCount, retryDelay, uid: uid3 }),
|
|
1112
|
-
value
|
|
1113
|
-
};
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
// ../../../../node_modules/.pnpm/viem@2.21.57_bufferutil@4.0.9_typescript@5.8.2_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/clients/transports/custom.js
|
|
1117
|
-
function custom(provider, config = {}) {
|
|
1118
|
-
const { key = "custom", name = "Custom Provider", retryDelay } = config;
|
|
1119
|
-
return ({ retryCount: defaultRetryCount }) => createTransport({
|
|
1120
|
-
key,
|
|
1121
|
-
name,
|
|
1122
|
-
request: provider.request.bind(provider),
|
|
1123
|
-
retryCount: config.retryCount ?? defaultRetryCount,
|
|
1124
|
-
retryDelay,
|
|
1125
|
-
type: "custom"
|
|
1126
|
-
});
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
// ../../../../node_modules/.pnpm/@wagmi+core@2.16.5_@tanstack+query-core@5.66.4_@types+react@19.0.12_react@19.0.0_typescript@5_oeltxj7l7uytirmunypreij5lm/node_modules/@wagmi/core/dist/esm/errors/connector.js
|
|
1130
|
-
var ProviderNotFoundError = class extends BaseError2 {
|
|
1131
|
-
constructor() {
|
|
1132
|
-
super("Provider not found.");
|
|
1133
|
-
Object.defineProperty(this, "name", {
|
|
1134
|
-
enumerable: true,
|
|
1135
|
-
configurable: true,
|
|
1136
|
-
writable: true,
|
|
1137
|
-
value: "ProviderNotFoundError"
|
|
1138
|
-
});
|
|
1139
|
-
}
|
|
1140
|
-
};
|
|
1141
|
-
|
|
1142
|
-
// ../../../../node_modules/.pnpm/@wagmi+core@2.16.5_@tanstack+query-core@5.66.4_@types+react@19.0.12_react@19.0.0_typescript@5_oeltxj7l7uytirmunypreij5lm/node_modules/@wagmi/core/dist/esm/connectors/createConnector.js
|
|
1143
|
-
function createConnector(createConnectorFn) {
|
|
1144
|
-
return createConnectorFn;
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
// ../../../../node_modules/.pnpm/@wagmi+core@2.16.5_@tanstack+query-core@5.66.4_@types+react@19.0.12_react@19.0.0_typescript@5_oeltxj7l7uytirmunypreij5lm/node_modules/@wagmi/core/dist/esm/connectors/injected.js
|
|
1148
|
-
injected.type = "injected";
|
|
1149
|
-
function injected(parameters = {}) {
|
|
1150
|
-
const { shimDisconnect = true, unstable_shimAsyncInject } = parameters;
|
|
1151
|
-
function getTarget() {
|
|
1152
|
-
const target = parameters.target;
|
|
1153
|
-
if (typeof target === "function") {
|
|
1154
|
-
const result = target();
|
|
1155
|
-
if (result)
|
|
1156
|
-
return result;
|
|
1157
|
-
}
|
|
1158
|
-
if (typeof target === "object")
|
|
1159
|
-
return target;
|
|
1160
|
-
if (typeof target === "string")
|
|
1161
|
-
return {
|
|
1162
|
-
...targetMap[target] ?? {
|
|
1163
|
-
id: target,
|
|
1164
|
-
name: `${target[0].toUpperCase()}${target.slice(1)}`,
|
|
1165
|
-
provider: `is${target[0].toUpperCase()}${target.slice(1)}`
|
|
1166
|
-
}
|
|
1167
|
-
};
|
|
1168
|
-
return {
|
|
1169
|
-
id: "injected",
|
|
1170
|
-
name: "Injected",
|
|
1171
|
-
provider(window2) {
|
|
1172
|
-
return window2 == null ? void 0 : window2.ethereum;
|
|
1173
|
-
}
|
|
1174
|
-
};
|
|
1175
|
-
}
|
|
1176
|
-
let accountsChanged2;
|
|
1177
|
-
let chainChanged2;
|
|
1178
|
-
let connect2;
|
|
1179
|
-
let disconnect3;
|
|
1180
|
-
return createConnector((config) => ({
|
|
1181
|
-
get icon() {
|
|
1182
|
-
return getTarget().icon;
|
|
1183
|
-
},
|
|
1184
|
-
get id() {
|
|
1185
|
-
return getTarget().id;
|
|
1186
|
-
},
|
|
1187
|
-
get name() {
|
|
1188
|
-
return getTarget().name;
|
|
1189
|
-
},
|
|
1190
|
-
/** @deprecated */
|
|
1191
|
-
get supportsSimulation() {
|
|
1192
|
-
return true;
|
|
1193
|
-
},
|
|
1194
|
-
type: injected.type,
|
|
1195
|
-
async setup() {
|
|
1196
|
-
const provider = await this.getProvider();
|
|
1197
|
-
if ((provider == null ? void 0 : provider.on) && parameters.target) {
|
|
1198
|
-
if (!connect2) {
|
|
1199
|
-
connect2 = this.onConnect.bind(this);
|
|
1200
|
-
provider.on("connect", connect2);
|
|
1201
|
-
}
|
|
1202
|
-
if (!accountsChanged2) {
|
|
1203
|
-
accountsChanged2 = this.onAccountsChanged.bind(this);
|
|
1204
|
-
provider.on("accountsChanged", accountsChanged2);
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
},
|
|
1208
|
-
async connect({ chainId, isReconnecting } = {}) {
|
|
1209
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1210
|
-
const provider = await this.getProvider();
|
|
1211
|
-
if (!provider)
|
|
1212
|
-
throw new ProviderNotFoundError();
|
|
1213
|
-
let accounts = [];
|
|
1214
|
-
if (isReconnecting)
|
|
1215
|
-
accounts = await this.getAccounts().catch(() => []);
|
|
1216
|
-
else if (shimDisconnect) {
|
|
1217
|
-
try {
|
|
1218
|
-
const permissions = await provider.request({
|
|
1219
|
-
method: "wallet_requestPermissions",
|
|
1220
|
-
params: [{ eth_accounts: {} }]
|
|
1221
|
-
});
|
|
1222
|
-
accounts = (_d = (_c = (_b = (_a = permissions[0]) == null ? void 0 : _a.caveats) == null ? void 0 : _b[0]) == null ? void 0 : _c.value) == null ? void 0 : _d.map((x) => getAddress(x));
|
|
1223
|
-
if (accounts.length > 0) {
|
|
1224
|
-
const sortedAccounts = await this.getAccounts();
|
|
1225
|
-
accounts = sortedAccounts;
|
|
1226
|
-
}
|
|
1227
|
-
} catch (err) {
|
|
1228
|
-
const error = err;
|
|
1229
|
-
if (error.code === UserRejectedRequestError.code)
|
|
1230
|
-
throw new UserRejectedRequestError(error);
|
|
1231
|
-
if (error.code === ResourceUnavailableRpcError.code)
|
|
1232
|
-
throw error;
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
try {
|
|
1236
|
-
if (!(accounts == null ? void 0 : accounts.length) && !isReconnecting) {
|
|
1237
|
-
const requestedAccounts = await provider.request({
|
|
1238
|
-
method: "eth_requestAccounts"
|
|
1239
|
-
});
|
|
1240
|
-
accounts = requestedAccounts.map((x) => getAddress(x));
|
|
1241
|
-
}
|
|
1242
|
-
if (connect2) {
|
|
1243
|
-
provider.removeListener("connect", connect2);
|
|
1244
|
-
connect2 = void 0;
|
|
1245
|
-
}
|
|
1246
|
-
if (!accountsChanged2) {
|
|
1247
|
-
accountsChanged2 = this.onAccountsChanged.bind(this);
|
|
1248
|
-
provider.on("accountsChanged", accountsChanged2);
|
|
1249
|
-
}
|
|
1250
|
-
if (!chainChanged2) {
|
|
1251
|
-
chainChanged2 = this.onChainChanged.bind(this);
|
|
1252
|
-
provider.on("chainChanged", chainChanged2);
|
|
1253
|
-
}
|
|
1254
|
-
if (!disconnect3) {
|
|
1255
|
-
disconnect3 = this.onDisconnect.bind(this);
|
|
1256
|
-
provider.on("disconnect", disconnect3);
|
|
1257
|
-
}
|
|
1258
|
-
let currentChainId = await this.getChainId();
|
|
1259
|
-
if (chainId && currentChainId !== chainId) {
|
|
1260
|
-
const chain = await this.switchChain({ chainId }).catch((error) => {
|
|
1261
|
-
if (error.code === UserRejectedRequestError.code)
|
|
1262
|
-
throw error;
|
|
1263
|
-
return { id: currentChainId };
|
|
1264
|
-
});
|
|
1265
|
-
currentChainId = (chain == null ? void 0 : chain.id) ?? currentChainId;
|
|
1266
|
-
}
|
|
1267
|
-
if (shimDisconnect)
|
|
1268
|
-
await ((_e = config.storage) == null ? void 0 : _e.removeItem(`${this.id}.disconnected`));
|
|
1269
|
-
if (!parameters.target)
|
|
1270
|
-
await ((_f = config.storage) == null ? void 0 : _f.setItem("injected.connected", true));
|
|
1271
|
-
return { accounts, chainId: currentChainId };
|
|
1272
|
-
} catch (err) {
|
|
1273
|
-
const error = err;
|
|
1274
|
-
if (error.code === UserRejectedRequestError.code)
|
|
1275
|
-
throw new UserRejectedRequestError(error);
|
|
1276
|
-
if (error.code === ResourceUnavailableRpcError.code)
|
|
1277
|
-
throw new ResourceUnavailableRpcError(error);
|
|
1278
|
-
throw error;
|
|
1279
|
-
}
|
|
1280
|
-
},
|
|
1281
|
-
async disconnect() {
|
|
1282
|
-
var _a, _b;
|
|
1283
|
-
const provider = await this.getProvider();
|
|
1284
|
-
if (!provider)
|
|
1285
|
-
throw new ProviderNotFoundError();
|
|
1286
|
-
if (chainChanged2) {
|
|
1287
|
-
provider.removeListener("chainChanged", chainChanged2);
|
|
1288
|
-
chainChanged2 = void 0;
|
|
1289
|
-
}
|
|
1290
|
-
if (disconnect3) {
|
|
1291
|
-
provider.removeListener("disconnect", disconnect3);
|
|
1292
|
-
disconnect3 = void 0;
|
|
1293
|
-
}
|
|
1294
|
-
if (!connect2) {
|
|
1295
|
-
connect2 = this.onConnect.bind(this);
|
|
1296
|
-
provider.on("connect", connect2);
|
|
1297
|
-
}
|
|
1298
|
-
try {
|
|
1299
|
-
await withTimeout(() => (
|
|
1300
|
-
// TODO: Remove explicit type for viem@3
|
|
1301
|
-
provider.request({
|
|
1302
|
-
// `'wallet_revokePermissions'` added in `viem@2.10.3`
|
|
1303
|
-
method: "wallet_revokePermissions",
|
|
1304
|
-
params: [{ eth_accounts: {} }]
|
|
1305
|
-
})
|
|
1306
|
-
), { timeout: 100 });
|
|
1307
|
-
} catch {
|
|
1308
|
-
}
|
|
1309
|
-
if (shimDisconnect) {
|
|
1310
|
-
await ((_a = config.storage) == null ? void 0 : _a.setItem(`${this.id}.disconnected`, true));
|
|
1311
|
-
}
|
|
1312
|
-
if (!parameters.target)
|
|
1313
|
-
await ((_b = config.storage) == null ? void 0 : _b.removeItem("injected.connected"));
|
|
1314
|
-
},
|
|
1315
|
-
async getAccounts() {
|
|
1316
|
-
const provider = await this.getProvider();
|
|
1317
|
-
if (!provider)
|
|
1318
|
-
throw new ProviderNotFoundError();
|
|
1319
|
-
const accounts = await provider.request({ method: "eth_accounts" });
|
|
1320
|
-
return accounts.map((x) => getAddress(x));
|
|
1321
|
-
},
|
|
1322
|
-
async getChainId() {
|
|
1323
|
-
const provider = await this.getProvider();
|
|
1324
|
-
if (!provider)
|
|
1325
|
-
throw new ProviderNotFoundError();
|
|
1326
|
-
const hexChainId = await provider.request({ method: "eth_chainId" });
|
|
1327
|
-
return Number(hexChainId);
|
|
1328
|
-
},
|
|
1329
|
-
async getProvider() {
|
|
1330
|
-
if (typeof window === "undefined")
|
|
1331
|
-
return void 0;
|
|
1332
|
-
let provider;
|
|
1333
|
-
const target = getTarget();
|
|
1334
|
-
if (typeof target.provider === "function")
|
|
1335
|
-
provider = target.provider(window);
|
|
1336
|
-
else if (typeof target.provider === "string")
|
|
1337
|
-
provider = findProvider(window, target.provider);
|
|
1338
|
-
else
|
|
1339
|
-
provider = target.provider;
|
|
1340
|
-
if (provider && !provider.removeListener) {
|
|
1341
|
-
if ("off" in provider && typeof provider.off === "function")
|
|
1342
|
-
provider.removeListener = provider.off;
|
|
1343
|
-
else
|
|
1344
|
-
provider.removeListener = () => {
|
|
1345
|
-
};
|
|
1346
|
-
}
|
|
1347
|
-
return provider;
|
|
1348
|
-
},
|
|
1349
|
-
async isAuthorized() {
|
|
1350
|
-
var _a, _b;
|
|
1351
|
-
try {
|
|
1352
|
-
const isDisconnected = shimDisconnect && // If shim exists in storage, connector is disconnected
|
|
1353
|
-
await ((_a = config.storage) == null ? void 0 : _a.getItem(`${this.id}.disconnected`));
|
|
1354
|
-
if (isDisconnected)
|
|
1355
|
-
return false;
|
|
1356
|
-
if (!parameters.target) {
|
|
1357
|
-
const connected = await ((_b = config.storage) == null ? void 0 : _b.getItem("injected.connected"));
|
|
1358
|
-
if (!connected)
|
|
1359
|
-
return false;
|
|
1360
|
-
}
|
|
1361
|
-
const provider = await this.getProvider();
|
|
1362
|
-
if (!provider) {
|
|
1363
|
-
if (unstable_shimAsyncInject !== void 0 && unstable_shimAsyncInject !== false) {
|
|
1364
|
-
const handleEthereum = async () => {
|
|
1365
|
-
if (typeof window !== "undefined")
|
|
1366
|
-
window.removeEventListener("ethereum#initialized", handleEthereum);
|
|
1367
|
-
const provider2 = await this.getProvider();
|
|
1368
|
-
return !!provider2;
|
|
1369
|
-
};
|
|
1370
|
-
const timeout = typeof unstable_shimAsyncInject === "number" ? unstable_shimAsyncInject : 1e3;
|
|
1371
|
-
const res = await Promise.race([
|
|
1372
|
-
...typeof window !== "undefined" ? [
|
|
1373
|
-
new Promise((resolve) => window.addEventListener("ethereum#initialized", () => resolve(handleEthereum()), { once: true }))
|
|
1374
|
-
] : [],
|
|
1375
|
-
new Promise((resolve) => setTimeout(() => resolve(handleEthereum()), timeout))
|
|
1376
|
-
]);
|
|
1377
|
-
if (res)
|
|
1378
|
-
return true;
|
|
1379
|
-
}
|
|
1380
|
-
throw new ProviderNotFoundError();
|
|
1381
|
-
}
|
|
1382
|
-
const accounts = await withRetry(() => this.getAccounts());
|
|
1383
|
-
return !!accounts.length;
|
|
1384
|
-
} catch {
|
|
1385
|
-
return false;
|
|
1386
|
-
}
|
|
1387
|
-
},
|
|
1388
|
-
async switchChain({ addEthereumChainParameter, chainId }) {
|
|
1389
|
-
var _a, _b, _c, _d;
|
|
1390
|
-
const provider = await this.getProvider();
|
|
1391
|
-
if (!provider)
|
|
1392
|
-
throw new ProviderNotFoundError();
|
|
1393
|
-
const chain = config.chains.find((x) => x.id === chainId);
|
|
1394
|
-
if (!chain)
|
|
1395
|
-
throw new SwitchChainError(new ChainNotConfiguredError());
|
|
1396
|
-
const promise = new Promise((resolve) => {
|
|
1397
|
-
const listener = (data) => {
|
|
1398
|
-
if ("chainId" in data && data.chainId === chainId) {
|
|
1399
|
-
config.emitter.off("change", listener);
|
|
1400
|
-
resolve();
|
|
1401
|
-
}
|
|
1402
|
-
};
|
|
1403
|
-
config.emitter.on("change", listener);
|
|
1404
|
-
});
|
|
1405
|
-
try {
|
|
1406
|
-
await Promise.all([
|
|
1407
|
-
provider.request({
|
|
1408
|
-
method: "wallet_switchEthereumChain",
|
|
1409
|
-
params: [{ chainId: numberToHex(chainId) }]
|
|
1410
|
-
}).then(async () => {
|
|
1411
|
-
const currentChainId = await this.getChainId();
|
|
1412
|
-
if (currentChainId === chainId)
|
|
1413
|
-
config.emitter.emit("change", { chainId });
|
|
1414
|
-
}),
|
|
1415
|
-
promise
|
|
1416
|
-
]);
|
|
1417
|
-
return chain;
|
|
1418
|
-
} catch (err) {
|
|
1419
|
-
const error = err;
|
|
1420
|
-
if (error.code === 4902 || // Unwrapping for MetaMask Mobile
|
|
1421
|
-
// https://github.com/MetaMask/metamask-mobile/issues/2944#issuecomment-976988719
|
|
1422
|
-
((_b = (_a = error == null ? void 0 : error.data) == null ? void 0 : _a.originalError) == null ? void 0 : _b.code) === 4902) {
|
|
1423
|
-
try {
|
|
1424
|
-
const { default: blockExplorer, ...blockExplorers } = chain.blockExplorers ?? {};
|
|
1425
|
-
let blockExplorerUrls;
|
|
1426
|
-
if (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.blockExplorerUrls)
|
|
1427
|
-
blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls;
|
|
1428
|
-
else if (blockExplorer)
|
|
1429
|
-
blockExplorerUrls = [
|
|
1430
|
-
blockExplorer.url,
|
|
1431
|
-
...Object.values(blockExplorers).map((x) => x.url)
|
|
1432
|
-
];
|
|
1433
|
-
let rpcUrls;
|
|
1434
|
-
if ((_c = addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.rpcUrls) == null ? void 0 : _c.length)
|
|
1435
|
-
rpcUrls = addEthereumChainParameter.rpcUrls;
|
|
1436
|
-
else
|
|
1437
|
-
rpcUrls = [((_d = chain.rpcUrls.default) == null ? void 0 : _d.http[0]) ?? ""];
|
|
1438
|
-
const addEthereumChain = {
|
|
1439
|
-
blockExplorerUrls,
|
|
1440
|
-
chainId: numberToHex(chainId),
|
|
1441
|
-
chainName: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.chainName) ?? chain.name,
|
|
1442
|
-
iconUrls: addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.iconUrls,
|
|
1443
|
-
nativeCurrency: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.nativeCurrency) ?? chain.nativeCurrency,
|
|
1444
|
-
rpcUrls
|
|
1445
|
-
};
|
|
1446
|
-
await Promise.all([
|
|
1447
|
-
provider.request({
|
|
1448
|
-
method: "wallet_addEthereumChain",
|
|
1449
|
-
params: [addEthereumChain]
|
|
1450
|
-
}).then(async () => {
|
|
1451
|
-
const currentChainId = await this.getChainId();
|
|
1452
|
-
if (currentChainId === chainId)
|
|
1453
|
-
config.emitter.emit("change", { chainId });
|
|
1454
|
-
else
|
|
1455
|
-
throw new UserRejectedRequestError(new Error("User rejected switch after adding network."));
|
|
1456
|
-
}),
|
|
1457
|
-
promise
|
|
1458
|
-
]);
|
|
1459
|
-
return chain;
|
|
1460
|
-
} catch (error2) {
|
|
1461
|
-
throw new UserRejectedRequestError(error2);
|
|
1462
|
-
}
|
|
1463
|
-
}
|
|
1464
|
-
if (error.code === UserRejectedRequestError.code)
|
|
1465
|
-
throw new UserRejectedRequestError(error);
|
|
1466
|
-
throw new SwitchChainError(error);
|
|
1467
|
-
}
|
|
1468
|
-
},
|
|
1469
|
-
async onAccountsChanged(accounts) {
|
|
1470
|
-
var _a;
|
|
1471
|
-
if (accounts.length === 0)
|
|
1472
|
-
this.onDisconnect();
|
|
1473
|
-
else if (config.emitter.listenerCount("connect")) {
|
|
1474
|
-
const chainId = (await this.getChainId()).toString();
|
|
1475
|
-
this.onConnect({ chainId });
|
|
1476
|
-
if (shimDisconnect)
|
|
1477
|
-
await ((_a = config.storage) == null ? void 0 : _a.removeItem(`${this.id}.disconnected`));
|
|
1478
|
-
} else
|
|
1479
|
-
config.emitter.emit("change", {
|
|
1480
|
-
accounts: accounts.map((x) => getAddress(x))
|
|
1481
|
-
});
|
|
1482
|
-
},
|
|
1483
|
-
onChainChanged(chain) {
|
|
1484
|
-
const chainId = Number(chain);
|
|
1485
|
-
config.emitter.emit("change", { chainId });
|
|
1486
|
-
},
|
|
1487
|
-
async onConnect(connectInfo) {
|
|
1488
|
-
const accounts = await this.getAccounts();
|
|
1489
|
-
if (accounts.length === 0)
|
|
1490
|
-
return;
|
|
1491
|
-
const chainId = Number(connectInfo.chainId);
|
|
1492
|
-
config.emitter.emit("connect", { accounts, chainId });
|
|
1493
|
-
const provider = await this.getProvider();
|
|
1494
|
-
if (provider) {
|
|
1495
|
-
if (connect2) {
|
|
1496
|
-
provider.removeListener("connect", connect2);
|
|
1497
|
-
connect2 = void 0;
|
|
1498
|
-
}
|
|
1499
|
-
if (!accountsChanged2) {
|
|
1500
|
-
accountsChanged2 = this.onAccountsChanged.bind(this);
|
|
1501
|
-
provider.on("accountsChanged", accountsChanged2);
|
|
1502
|
-
}
|
|
1503
|
-
if (!chainChanged2) {
|
|
1504
|
-
chainChanged2 = this.onChainChanged.bind(this);
|
|
1505
|
-
provider.on("chainChanged", chainChanged2);
|
|
1506
|
-
}
|
|
1507
|
-
if (!disconnect3) {
|
|
1508
|
-
disconnect3 = this.onDisconnect.bind(this);
|
|
1509
|
-
provider.on("disconnect", disconnect3);
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
},
|
|
1513
|
-
async onDisconnect(error) {
|
|
1514
|
-
const provider = await this.getProvider();
|
|
1515
|
-
if (error && error.code === 1013) {
|
|
1516
|
-
if (provider && !!(await this.getAccounts()).length)
|
|
1517
|
-
return;
|
|
1518
|
-
}
|
|
1519
|
-
config.emitter.emit("disconnect");
|
|
1520
|
-
if (provider) {
|
|
1521
|
-
if (chainChanged2) {
|
|
1522
|
-
provider.removeListener("chainChanged", chainChanged2);
|
|
1523
|
-
chainChanged2 = void 0;
|
|
1524
|
-
}
|
|
1525
|
-
if (disconnect3) {
|
|
1526
|
-
provider.removeListener("disconnect", disconnect3);
|
|
1527
|
-
disconnect3 = void 0;
|
|
1528
|
-
}
|
|
1529
|
-
if (!connect2) {
|
|
1530
|
-
connect2 = this.onConnect.bind(this);
|
|
1531
|
-
provider.on("connect", connect2);
|
|
1532
|
-
}
|
|
1533
|
-
}
|
|
1534
|
-
}
|
|
1535
|
-
}));
|
|
1536
|
-
}
|
|
1537
|
-
var targetMap = {
|
|
1538
|
-
coinbaseWallet: {
|
|
1539
|
-
id: "coinbaseWallet",
|
|
1540
|
-
name: "Coinbase Wallet",
|
|
1541
|
-
provider(window2) {
|
|
1542
|
-
if (window2 == null ? void 0 : window2.coinbaseWalletExtension)
|
|
1543
|
-
return window2.coinbaseWalletExtension;
|
|
1544
|
-
return findProvider(window2, "isCoinbaseWallet");
|
|
1545
|
-
}
|
|
1546
|
-
},
|
|
1547
|
-
metaMask: {
|
|
1548
|
-
id: "metaMask",
|
|
1549
|
-
name: "MetaMask",
|
|
1550
|
-
provider(window2) {
|
|
1551
|
-
return findProvider(window2, (provider) => {
|
|
1552
|
-
if (!provider.isMetaMask)
|
|
1553
|
-
return false;
|
|
1554
|
-
if (provider.isBraveWallet && !provider._events && !provider._state)
|
|
1555
|
-
return false;
|
|
1556
|
-
const flags = [
|
|
1557
|
-
"isApexWallet",
|
|
1558
|
-
"isAvalanche",
|
|
1559
|
-
"isBitKeep",
|
|
1560
|
-
"isBlockWallet",
|
|
1561
|
-
"isKuCoinWallet",
|
|
1562
|
-
"isMathWallet",
|
|
1563
|
-
"isOkxWallet",
|
|
1564
|
-
"isOKExWallet",
|
|
1565
|
-
"isOneInchIOSWallet",
|
|
1566
|
-
"isOneInchAndroidWallet",
|
|
1567
|
-
"isOpera",
|
|
1568
|
-
"isPhantom",
|
|
1569
|
-
"isPortal",
|
|
1570
|
-
"isRabby",
|
|
1571
|
-
"isTokenPocket",
|
|
1572
|
-
"isTokenary",
|
|
1573
|
-
"isUniswapWallet",
|
|
1574
|
-
"isZerion"
|
|
1575
|
-
];
|
|
1576
|
-
for (const flag of flags)
|
|
1577
|
-
if (provider[flag])
|
|
1578
|
-
return false;
|
|
1579
|
-
return true;
|
|
1580
|
-
});
|
|
1581
|
-
}
|
|
1582
|
-
},
|
|
1583
|
-
phantom: {
|
|
1584
|
-
id: "phantom",
|
|
1585
|
-
name: "Phantom",
|
|
1586
|
-
provider(window2) {
|
|
1587
|
-
var _a, _b;
|
|
1588
|
-
if ((_a = window2 == null ? void 0 : window2.phantom) == null ? void 0 : _a.ethereum)
|
|
1589
|
-
return (_b = window2.phantom) == null ? void 0 : _b.ethereum;
|
|
1590
|
-
return findProvider(window2, "isPhantom");
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
|
-
};
|
|
1594
|
-
function findProvider(window2, select) {
|
|
1595
|
-
function isProvider(provider) {
|
|
1596
|
-
if (typeof select === "function")
|
|
1597
|
-
return select(provider);
|
|
1598
|
-
if (typeof select === "string")
|
|
1599
|
-
return provider[select];
|
|
1600
|
-
return true;
|
|
1601
|
-
}
|
|
1602
|
-
const ethereum = window2.ethereum;
|
|
1603
|
-
if (ethereum == null ? void 0 : ethereum.providers)
|
|
1604
|
-
return ethereum.providers.find((provider) => isProvider(provider));
|
|
1605
|
-
if (ethereum && isProvider(ethereum))
|
|
1606
|
-
return ethereum;
|
|
1607
|
-
return void 0;
|
|
1608
|
-
}
|
|
1609
|
-
|
|
1610
|
-
// ../../../../node_modules/.pnpm/@wagmi+core@2.16.5_@tanstack+query-core@5.66.4_@types+react@19.0.12_react@19.0.0_typescript@5_oeltxj7l7uytirmunypreij5lm/node_modules/@wagmi/core/dist/esm/connectors/mock.js
|
|
1611
|
-
mock.type = "mock";
|
|
1612
|
-
function mock(parameters) {
|
|
1613
|
-
const transactionCache = /* @__PURE__ */ new Map();
|
|
1614
|
-
const features = parameters.features ?? { defaultConnected: false };
|
|
1615
|
-
let connected = features.defaultConnected;
|
|
1616
|
-
let connectedChainId;
|
|
1617
|
-
return createConnector((config) => ({
|
|
1618
|
-
id: "mock",
|
|
1619
|
-
name: "Mock Connector",
|
|
1620
|
-
type: mock.type,
|
|
1621
|
-
async setup() {
|
|
1622
|
-
connectedChainId = config.chains[0].id;
|
|
1623
|
-
},
|
|
1624
|
-
async connect({ chainId } = {}) {
|
|
1625
|
-
if (features.connectError) {
|
|
1626
|
-
if (typeof features.connectError === "boolean")
|
|
1627
|
-
throw new UserRejectedRequestError(new Error("Failed to connect."));
|
|
1628
|
-
throw features.connectError;
|
|
1629
|
-
}
|
|
1630
|
-
const provider = await this.getProvider();
|
|
1631
|
-
const accounts = await provider.request({
|
|
1632
|
-
method: "eth_requestAccounts"
|
|
1633
|
-
});
|
|
1634
|
-
let currentChainId = await this.getChainId();
|
|
1635
|
-
if (chainId && currentChainId !== chainId) {
|
|
1636
|
-
const chain = await this.switchChain({ chainId });
|
|
1637
|
-
currentChainId = chain.id;
|
|
1638
|
-
}
|
|
1639
|
-
connected = true;
|
|
1640
|
-
return {
|
|
1641
|
-
accounts: accounts.map((x) => getAddress(x)),
|
|
1642
|
-
chainId: currentChainId
|
|
1643
|
-
};
|
|
1644
|
-
},
|
|
1645
|
-
async disconnect() {
|
|
1646
|
-
connected = false;
|
|
1647
|
-
},
|
|
1648
|
-
async getAccounts() {
|
|
1649
|
-
if (!connected)
|
|
1650
|
-
throw new ConnectorNotConnectedError();
|
|
1651
|
-
const provider = await this.getProvider();
|
|
1652
|
-
const accounts = await provider.request({ method: "eth_accounts" });
|
|
1653
|
-
return accounts.map((x) => getAddress(x));
|
|
1654
|
-
},
|
|
1655
|
-
async getChainId() {
|
|
1656
|
-
const provider = await this.getProvider();
|
|
1657
|
-
const hexChainId = await provider.request({ method: "eth_chainId" });
|
|
1658
|
-
return fromHex(hexChainId, "number");
|
|
1659
|
-
},
|
|
1660
|
-
async isAuthorized() {
|
|
1661
|
-
if (!features.reconnect)
|
|
1662
|
-
return false;
|
|
1663
|
-
if (!connected)
|
|
1664
|
-
return false;
|
|
1665
|
-
const accounts = await this.getAccounts();
|
|
1666
|
-
return !!accounts.length;
|
|
1667
|
-
},
|
|
1668
|
-
async switchChain({ chainId }) {
|
|
1669
|
-
const provider = await this.getProvider();
|
|
1670
|
-
const chain = config.chains.find((x) => x.id === chainId);
|
|
1671
|
-
if (!chain)
|
|
1672
|
-
throw new SwitchChainError(new ChainNotConfiguredError());
|
|
1673
|
-
await provider.request({
|
|
1674
|
-
method: "wallet_switchEthereumChain",
|
|
1675
|
-
params: [{ chainId: numberToHex(chainId) }]
|
|
1676
|
-
});
|
|
1677
|
-
return chain;
|
|
1678
|
-
},
|
|
1679
|
-
onAccountsChanged(accounts) {
|
|
1680
|
-
if (accounts.length === 0)
|
|
1681
|
-
this.onDisconnect();
|
|
1682
|
-
else
|
|
1683
|
-
config.emitter.emit("change", {
|
|
1684
|
-
accounts: accounts.map((x) => getAddress(x))
|
|
1685
|
-
});
|
|
1686
|
-
},
|
|
1687
|
-
onChainChanged(chain) {
|
|
1688
|
-
const chainId = Number(chain);
|
|
1689
|
-
config.emitter.emit("change", { chainId });
|
|
1690
|
-
},
|
|
1691
|
-
async onDisconnect(_error) {
|
|
1692
|
-
config.emitter.emit("disconnect");
|
|
1693
|
-
connected = false;
|
|
1694
|
-
},
|
|
1695
|
-
async getProvider({ chainId } = {}) {
|
|
1696
|
-
const chain = config.chains.find((x) => x.id === chainId) ?? config.chains[0];
|
|
1697
|
-
const url = chain.rpcUrls.default.http[0];
|
|
1698
|
-
const request = async ({ method, params }) => {
|
|
1699
|
-
if (method === "eth_chainId")
|
|
1700
|
-
return numberToHex(connectedChainId);
|
|
1701
|
-
if (method === "eth_requestAccounts")
|
|
1702
|
-
return parameters.accounts;
|
|
1703
|
-
if (method === "eth_signTypedData_v4") {
|
|
1704
|
-
if (features.signTypedDataError) {
|
|
1705
|
-
if (typeof features.signTypedDataError === "boolean")
|
|
1706
|
-
throw new UserRejectedRequestError(new Error("Failed to sign typed data."));
|
|
1707
|
-
throw features.signTypedDataError;
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1710
|
-
if (method === "wallet_switchEthereumChain") {
|
|
1711
|
-
if (features.switchChainError) {
|
|
1712
|
-
if (typeof features.switchChainError === "boolean")
|
|
1713
|
-
throw new UserRejectedRequestError(new Error("Failed to switch chain."));
|
|
1714
|
-
throw features.switchChainError;
|
|
1715
|
-
}
|
|
1716
|
-
connectedChainId = fromHex(params[0].chainId, "number");
|
|
1717
|
-
this.onChainChanged(connectedChainId.toString());
|
|
1718
|
-
return;
|
|
1719
|
-
}
|
|
1720
|
-
if (method === "wallet_watchAsset") {
|
|
1721
|
-
if (features.watchAssetError) {
|
|
1722
|
-
if (typeof features.watchAssetError === "boolean")
|
|
1723
|
-
throw new UserRejectedRequestError(new Error("Failed to switch chain."));
|
|
1724
|
-
throw features.watchAssetError;
|
|
1725
|
-
}
|
|
1726
|
-
return connected;
|
|
1727
|
-
}
|
|
1728
|
-
if (method === "wallet_getCapabilities")
|
|
1729
|
-
return {
|
|
1730
|
-
"0x2105": {
|
|
1731
|
-
paymasterService: {
|
|
1732
|
-
supported: params[0] === "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
|
|
1733
|
-
},
|
|
1734
|
-
sessionKeys: {
|
|
1735
|
-
supported: true
|
|
1736
|
-
}
|
|
1737
|
-
},
|
|
1738
|
-
"0x14A34": {
|
|
1739
|
-
paymasterService: {
|
|
1740
|
-
supported: params[0] === "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
|
|
1741
|
-
}
|
|
1742
|
-
}
|
|
1743
|
-
};
|
|
1744
|
-
if (method === "wallet_sendCalls") {
|
|
1745
|
-
const hashes = [];
|
|
1746
|
-
const calls = params[0].calls;
|
|
1747
|
-
for (const call3 of calls) {
|
|
1748
|
-
const { result: result2, error: error2 } = await rpc.http(url, {
|
|
1749
|
-
body: {
|
|
1750
|
-
method: "eth_sendTransaction",
|
|
1751
|
-
params: [call3]
|
|
1752
|
-
}
|
|
1753
|
-
});
|
|
1754
|
-
if (error2)
|
|
1755
|
-
throw new RpcRequestError({
|
|
1756
|
-
body: { method, params },
|
|
1757
|
-
error: error2,
|
|
1758
|
-
url
|
|
1759
|
-
});
|
|
1760
|
-
hashes.push(result2);
|
|
1761
|
-
}
|
|
1762
|
-
const id = keccak256(stringToHex(JSON.stringify(calls)));
|
|
1763
|
-
transactionCache.set(id, hashes);
|
|
1764
|
-
return id;
|
|
1765
|
-
}
|
|
1766
|
-
if (method === "wallet_getCallsStatus") {
|
|
1767
|
-
const hashes = transactionCache.get(params[0]);
|
|
1768
|
-
if (!hashes)
|
|
1769
|
-
return null;
|
|
1770
|
-
const receipts = await Promise.all(hashes.map(async (hash) => {
|
|
1771
|
-
const { result: result2, error: error2 } = await rpc.http(url, {
|
|
1772
|
-
body: {
|
|
1773
|
-
method: "eth_getTransactionReceipt",
|
|
1774
|
-
params: [hash],
|
|
1775
|
-
id: 0
|
|
1776
|
-
}
|
|
1777
|
-
});
|
|
1778
|
-
if (error2)
|
|
1779
|
-
throw new RpcRequestError({
|
|
1780
|
-
body: { method, params },
|
|
1781
|
-
error: error2,
|
|
1782
|
-
url
|
|
1783
|
-
});
|
|
1784
|
-
if (!result2)
|
|
1785
|
-
return null;
|
|
1786
|
-
return {
|
|
1787
|
-
blockHash: result2.blockHash,
|
|
1788
|
-
blockNumber: result2.blockNumber,
|
|
1789
|
-
gasUsed: result2.gasUsed,
|
|
1790
|
-
logs: result2.logs,
|
|
1791
|
-
status: result2.status,
|
|
1792
|
-
transactionHash: result2.transactionHash
|
|
1793
|
-
};
|
|
1794
|
-
}));
|
|
1795
|
-
if (receipts.some((x) => !x))
|
|
1796
|
-
return { status: "PENDING", receipts: [] };
|
|
1797
|
-
return { status: "CONFIRMED", receipts };
|
|
1798
|
-
}
|
|
1799
|
-
if (method === "wallet_showCallsStatus")
|
|
1800
|
-
return;
|
|
1801
|
-
if (method === "personal_sign") {
|
|
1802
|
-
if (features.signMessageError) {
|
|
1803
|
-
if (typeof features.signMessageError === "boolean")
|
|
1804
|
-
throw new UserRejectedRequestError(new Error("Failed to sign message."));
|
|
1805
|
-
throw features.signMessageError;
|
|
1806
|
-
}
|
|
1807
|
-
method = "eth_sign";
|
|
1808
|
-
params = [params[1], params[0]];
|
|
1809
|
-
}
|
|
1810
|
-
const body = { method, params };
|
|
1811
|
-
const { error, result } = await rpc.http(url, { body });
|
|
1812
|
-
if (error)
|
|
1813
|
-
throw new RpcRequestError({ body, error, url });
|
|
1814
|
-
return result;
|
|
1815
|
-
};
|
|
1816
|
-
return custom({ request })({ retryCount: 0 });
|
|
1817
|
-
}
|
|
1818
|
-
}));
|
|
1819
|
-
}
|
|
1820
|
-
|
|
1821
|
-
// ../../../../node_modules/.pnpm/@farcaster+frame-wagmi-connector@0.0.19_@farcaster+frame-sdk@0.0.31_typescript@5.8.2_zod@3.24_ps6issxtipow5lfjnigaydw7xu/node_modules/@farcaster/frame-wagmi-connector/dist/connector.js
|
|
1822
|
-
farcasterFrame.type = "farcasterFrame";
|
|
1823
|
-
var accountsChanged;
|
|
1824
|
-
var chainChanged;
|
|
1825
|
-
var disconnect2;
|
|
1826
|
-
function farcasterFrame() {
|
|
1827
|
-
return createConnector((config) => ({
|
|
1828
|
-
id: "farcaster",
|
|
1829
|
-
name: "Farcaster Frame",
|
|
1830
|
-
rdns: "xyz.farcaster",
|
|
1831
|
-
icon: "https://imagedelivery.net/BXluQx4ige9GuW0Ia56BHw/055c25d6-7fe7-4a49-abf9-49772021cf00/original",
|
|
1832
|
-
type: farcasterFrame.type,
|
|
1833
|
-
async connect({ chainId } = {}) {
|
|
1834
|
-
const provider = await this.getProvider();
|
|
1835
|
-
const accounts = await provider.request({
|
|
1836
|
-
method: "eth_requestAccounts"
|
|
1837
|
-
});
|
|
1838
|
-
if (!accountsChanged) {
|
|
1839
|
-
accountsChanged = this.onAccountsChanged.bind(this);
|
|
1840
|
-
provider.on("accountsChanged", accountsChanged);
|
|
1841
|
-
}
|
|
1842
|
-
if (!chainChanged) {
|
|
1843
|
-
chainChanged = this.onChainChanged.bind(this);
|
|
1844
|
-
provider.on("chainChanged", chainChanged);
|
|
1845
|
-
}
|
|
1846
|
-
if (!disconnect2) {
|
|
1847
|
-
disconnect2 = this.onDisconnect.bind(this);
|
|
1848
|
-
provider.on("disconnect", disconnect2);
|
|
1849
|
-
}
|
|
1850
|
-
let currentChainId = await this.getChainId();
|
|
1851
|
-
if (chainId && currentChainId !== chainId) {
|
|
1852
|
-
const chain = await this.switchChain({ chainId });
|
|
1853
|
-
currentChainId = chain.id;
|
|
1854
|
-
}
|
|
1855
|
-
return {
|
|
1856
|
-
accounts: accounts.map((x) => getAddress(x)),
|
|
1857
|
-
chainId: currentChainId
|
|
1858
|
-
};
|
|
1859
|
-
},
|
|
1860
|
-
async disconnect() {
|
|
1861
|
-
const provider = await this.getProvider();
|
|
1862
|
-
if (accountsChanged) {
|
|
1863
|
-
provider.removeListener("accountsChanged", accountsChanged);
|
|
1864
|
-
accountsChanged = void 0;
|
|
1865
|
-
}
|
|
1866
|
-
if (chainChanged) {
|
|
1867
|
-
provider.removeListener("chainChanged", chainChanged);
|
|
1868
|
-
chainChanged = void 0;
|
|
1869
|
-
}
|
|
1870
|
-
if (disconnect2) {
|
|
1871
|
-
provider.removeListener("disconnect", disconnect2);
|
|
1872
|
-
disconnect2 = void 0;
|
|
1873
|
-
}
|
|
1874
|
-
},
|
|
1875
|
-
async getAccounts() {
|
|
1876
|
-
const provider = await this.getProvider();
|
|
1877
|
-
const accounts = await provider.request({
|
|
1878
|
-
method: "eth_accounts"
|
|
1879
|
-
});
|
|
1880
|
-
return accounts.map((x) => getAddress(x));
|
|
1881
|
-
},
|
|
1882
|
-
async getChainId() {
|
|
1883
|
-
const provider = await this.getProvider();
|
|
1884
|
-
const hexChainId = await provider.request({ method: "eth_chainId" });
|
|
1885
|
-
return fromHex(hexChainId, "number");
|
|
1886
|
-
},
|
|
1887
|
-
async isAuthorized() {
|
|
1888
|
-
try {
|
|
1889
|
-
const accounts = await this.getAccounts();
|
|
1890
|
-
return !!accounts.length;
|
|
1891
|
-
} catch {
|
|
1892
|
-
return false;
|
|
1893
|
-
}
|
|
1894
|
-
},
|
|
1895
|
-
async switchChain({ chainId }) {
|
|
1896
|
-
const provider = await this.getProvider();
|
|
1897
|
-
const chain = config.chains.find((x) => x.id === chainId);
|
|
1898
|
-
if (!chain) {
|
|
1899
|
-
throw new SwitchChainError(new ChainNotConfiguredError());
|
|
1900
|
-
}
|
|
1901
|
-
await provider.request({
|
|
1902
|
-
method: "wallet_switchEthereumChain",
|
|
1903
|
-
params: [{ chainId: numberToHex(chainId) }]
|
|
1904
|
-
});
|
|
1905
|
-
config.emitter.emit("change", { chainId });
|
|
1906
|
-
return chain;
|
|
1907
|
-
},
|
|
1908
|
-
onAccountsChanged(accounts) {
|
|
1909
|
-
if (accounts.length === 0) {
|
|
1910
|
-
this.onDisconnect();
|
|
1911
|
-
} else {
|
|
1912
|
-
config.emitter.emit("change", {
|
|
1913
|
-
accounts: accounts.map((x) => getAddress(x))
|
|
1914
|
-
});
|
|
1915
|
-
}
|
|
1916
|
-
},
|
|
1917
|
-
onChainChanged(chain) {
|
|
1918
|
-
const chainId = Number(chain);
|
|
1919
|
-
config.emitter.emit("change", { chainId });
|
|
1920
|
-
},
|
|
1921
|
-
async onDisconnect() {
|
|
1922
|
-
config.emitter.emit("disconnect");
|
|
1923
|
-
},
|
|
1924
|
-
async getProvider() {
|
|
1925
|
-
return dist_default.wallet.ethProvider;
|
|
1926
|
-
}
|
|
1927
|
-
}));
|
|
1928
|
-
}
|
|
1929
|
-
|
|
1930
|
-
// ../../../../node_modules/.pnpm/@farcaster+frame-wagmi-connector@0.0.19_@farcaster+frame-sdk@0.0.31_typescript@5.8.2_zod@3.24_ps6issxtipow5lfjnigaydw7xu/node_modules/@farcaster/frame-wagmi-connector/dist/index.js
|
|
1931
|
-
var dist_default2 = farcasterFrame;
|
|
1932
|
-
export {
|
|
1933
|
-
dist_default2 as default,
|
|
1934
|
-
farcasterFrame
|
|
1935
|
-
};
|
|
1936
|
-
//# sourceMappingURL=@farcaster_frame-wagmi-connector.js.map
|