viem 0.0.1-alpha.29 → 0.0.1-alpha.30
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/dist/{chain-4d46a747.d.ts → chain-00b37e4e.d.ts} +19 -19
- package/dist/{chain-c7c44165.d.ts → chain-38182d92.d.ts} +1 -1
- package/dist/chains.d.ts +3 -3
- package/dist/chains.js +46 -46
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-Q67VUTW3.mjs → chunk-23UHN6UC.mjs} +3 -3
- package/dist/{chunk-Q67VUTW3.mjs.map → chunk-23UHN6UC.mjs.map} +0 -0
- package/dist/{chunk-RR4MGS6O.mjs → chunk-25AJVKAT.mjs} +502 -93
- package/dist/chunk-25AJVKAT.mjs.map +1 -0
- package/dist/{chunk-S252SZEL.mjs → chunk-AO7KQBK3.mjs} +2 -2
- package/dist/{chunk-S252SZEL.mjs.map → chunk-AO7KQBK3.mjs.map} +0 -0
- package/dist/{chunk-OJ7H3CQF.js → chunk-BHMSFL4W.js} +14 -14
- package/dist/{chunk-OJ7H3CQF.js.map → chunk-BHMSFL4W.js.map} +0 -0
- package/dist/{chunk-EYORBAD4.js → chunk-EAD66IDC.js} +521 -112
- package/dist/chunk-EAD66IDC.js.map +1 -0
- package/dist/{chunk-TQC7KZ24.mjs → chunk-EYRMK2SV.mjs} +107 -89
- package/dist/chunk-EYRMK2SV.mjs.map +1 -0
- package/dist/{chunk-HPUQL3IM.mjs → chunk-IP3NSE7H.mjs} +49 -44
- package/dist/chunk-IP3NSE7H.mjs.map +1 -0
- package/dist/{chunk-SEIPUKZE.js → chunk-NPFW67BV.js} +22 -22
- package/dist/{chunk-SEIPUKZE.js.map → chunk-NPFW67BV.js.map} +0 -0
- package/dist/{chunk-CKYH337I.js → chunk-VOK5ALIT.js} +56 -51
- package/dist/chunk-VOK5ALIT.js.map +1 -0
- package/dist/{chunk-4VQKZYE2.js → chunk-ZX4U6QKQ.js} +167 -149
- package/dist/chunk-ZX4U6QKQ.js.map +1 -0
- package/dist/contract.d.ts +7 -9
- package/dist/contract.js +4 -4
- package/dist/contract.mjs +3 -3
- package/dist/{createClient-5d5c14d6.d.ts → createClient-5258d590.d.ts} +2 -2
- package/dist/{createPublicClient-2b4afeac.d.ts → createPublicClient-99be385b.d.ts} +94 -73
- package/dist/{eip1193-f09a55af.d.ts → eip1193-fcdeee04.d.ts} +1 -1
- package/dist/ens.d.ts +5 -7
- package/dist/ens.js +4 -4
- package/dist/ens.mjs +3 -3
- package/dist/{formatAbiItem-d231fef2.d.ts → formatAbiItem-50cb39d8.d.ts} +1 -1
- package/dist/{getAbiItem-0e085959.d.ts → getAbiItem-6d4f64d2.d.ts} +2 -2
- package/dist/index.d.ts +35 -42
- package/dist/index.js +126 -90
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -7
- package/dist/index.mjs.map +1 -1
- package/dist/{parseGwei-4d0b0d73.d.ts → parseGwei-e299cf13.d.ts} +229 -67
- package/dist/public.d.ts +6 -8
- package/dist/public.js +3 -3
- package/dist/public.mjs +2 -2
- package/dist/{test-b9208949.d.ts → test-79ec416c.d.ts} +3 -3
- package/dist/test.d.ts +5 -5
- package/dist/test.js +3 -3
- package/dist/test.mjs +2 -2
- package/dist/utils/index.d.ts +33 -9
- package/dist/utils/index.js +14 -2
- package/dist/utils/index.mjs +13 -1
- package/dist/{wallet-9b1c6905.d.ts → wallet-cf5c8351.d.ts} +17 -6
- package/dist/wallet.d.ts +4 -5
- package/dist/wallet.js +3 -3
- package/dist/wallet.mjs +2 -2
- package/dist/window.d.ts +2 -2
- package/package.json +1 -1
- package/dist/chunk-4VQKZYE2.js.map +0 -1
- package/dist/chunk-CKYH337I.js.map +0 -1
- package/dist/chunk-EYORBAD4.js.map +0 -1
- package/dist/chunk-HPUQL3IM.mjs.map +0 -1
- package/dist/chunk-RR4MGS6O.mjs.map +0 -1
- package/dist/chunk-TQC7KZ24.mjs.map +0 -1
- package/dist/transactionReceipt-84fc92e1.d.ts +0 -26
- package/dist/transactionRequest-44c539b4.d.ts +0 -15
@@ -26,54 +26,63 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
-
|
29
|
+
|
30
|
+
|
31
|
+
var _chunkEAD66IDCjs = require('./chunk-EAD66IDC.js');
|
30
32
|
|
31
33
|
// src/actions/public/call.ts
|
32
|
-
async function call(client, {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
34
|
+
async function call(client, args) {
|
35
|
+
const {
|
36
|
+
blockNumber,
|
37
|
+
blockTag = "latest",
|
38
|
+
from,
|
39
|
+
accessList,
|
40
|
+
data,
|
41
|
+
gas,
|
42
|
+
gasPrice,
|
43
|
+
maxFeePerGas,
|
44
|
+
maxPriorityFeePerGas,
|
45
|
+
nonce,
|
46
|
+
to,
|
47
|
+
value,
|
48
|
+
...rest
|
49
|
+
} = args;
|
50
|
+
try {
|
51
|
+
_chunkEAD66IDCjs.assertRequest.call(void 0, args);
|
52
|
+
const blockNumberHex = blockNumber ? _chunkEAD66IDCjs.numberToHex.call(void 0, blockNumber) : void 0;
|
53
|
+
const formatter = _optionalChain([client, 'access', _ => _.chain, 'optionalAccess', _2 => _2.formatters, 'optionalAccess', _3 => _3.transactionRequest]);
|
54
|
+
const request_ = _chunkEAD66IDCjs.format.call(void 0,
|
55
|
+
{
|
56
|
+
from,
|
57
|
+
accessList,
|
58
|
+
data,
|
59
|
+
gas,
|
60
|
+
gasPrice,
|
61
|
+
maxFeePerGas,
|
62
|
+
maxPriorityFeePerGas,
|
63
|
+
nonce,
|
64
|
+
to,
|
65
|
+
value,
|
66
|
+
// Pick out extra data that might exist on the chain's transaction request type.
|
67
|
+
..._chunkEAD66IDCjs.extract.call(void 0, rest, { formatter })
|
68
|
+
},
|
69
|
+
{
|
70
|
+
formatter: formatter || _chunkEAD66IDCjs.formatTransactionRequest
|
71
|
+
}
|
72
|
+
);
|
73
|
+
const response = await client.request({
|
74
|
+
method: "eth_call",
|
75
|
+
params: [request_, blockNumberHex || blockTag]
|
76
|
+
});
|
77
|
+
if (response === "0x")
|
78
|
+
return { data: void 0 };
|
79
|
+
return { data: response };
|
80
|
+
} catch (err) {
|
81
|
+
throw _chunkEAD66IDCjs.getCallError.call(void 0, err, {
|
82
|
+
...args,
|
83
|
+
chain: client.chain
|
84
|
+
});
|
85
|
+
}
|
77
86
|
}
|
78
87
|
|
79
88
|
// src/actions/public/simulateContract.ts
|
@@ -84,7 +93,7 @@ async function simulateContract(client, {
|
|
84
93
|
functionName,
|
85
94
|
...callRequest
|
86
95
|
}) {
|
87
|
-
const calldata =
|
96
|
+
const calldata = _chunkEAD66IDCjs.encodeFunctionData.call(void 0, {
|
88
97
|
abi,
|
89
98
|
args,
|
90
99
|
functionName
|
@@ -95,7 +104,7 @@ async function simulateContract(client, {
|
|
95
104
|
to: address,
|
96
105
|
...callRequest
|
97
106
|
});
|
98
|
-
const result =
|
107
|
+
const result = _chunkEAD66IDCjs.decodeFunctionResult.call(void 0, {
|
99
108
|
abi,
|
100
109
|
args,
|
101
110
|
functionName,
|
@@ -112,7 +121,7 @@ async function simulateContract(client, {
|
|
112
121
|
}
|
113
122
|
};
|
114
123
|
} catch (err) {
|
115
|
-
throw
|
124
|
+
throw _chunkEAD66IDCjs.getContractError.call(void 0, err, {
|
116
125
|
abi,
|
117
126
|
address,
|
118
127
|
args,
|
@@ -149,7 +158,7 @@ async function createEventFilter(client, {
|
|
149
158
|
} = {}) {
|
150
159
|
let topics = [];
|
151
160
|
if (event)
|
152
|
-
topics =
|
161
|
+
topics = _chunkEAD66IDCjs.encodeEventTopics.call(void 0, {
|
153
162
|
abi: [event],
|
154
163
|
eventName: event.name,
|
155
164
|
args
|
@@ -159,8 +168,8 @@ async function createEventFilter(client, {
|
|
159
168
|
params: [
|
160
169
|
{
|
161
170
|
address,
|
162
|
-
fromBlock: typeof fromBlock === "bigint" ?
|
163
|
-
toBlock: typeof toBlock === "bigint" ?
|
171
|
+
fromBlock: typeof fromBlock === "bigint" ? _chunkEAD66IDCjs.numberToHex.call(void 0, fromBlock) : fromBlock,
|
172
|
+
toBlock: typeof toBlock === "bigint" ? _chunkEAD66IDCjs.numberToHex.call(void 0, toBlock) : toBlock,
|
164
173
|
...topics.length ? { topics } : {}
|
165
174
|
}
|
166
175
|
]
|
@@ -183,7 +192,7 @@ async function createContractEventFilter(client, {
|
|
183
192
|
fromBlock,
|
184
193
|
toBlock
|
185
194
|
}) {
|
186
|
-
const topics = eventName ?
|
195
|
+
const topics = eventName ? _chunkEAD66IDCjs.encodeEventTopics.call(void 0, {
|
187
196
|
abi,
|
188
197
|
args,
|
189
198
|
eventName
|
@@ -193,8 +202,8 @@ async function createContractEventFilter(client, {
|
|
193
202
|
params: [
|
194
203
|
{
|
195
204
|
address,
|
196
|
-
fromBlock: typeof fromBlock === "bigint" ?
|
197
|
-
toBlock: typeof toBlock === "bigint" ?
|
205
|
+
fromBlock: typeof fromBlock === "bigint" ? _chunkEAD66IDCjs.numberToHex.call(void 0, fromBlock) : fromBlock,
|
206
|
+
toBlock: typeof toBlock === "bigint" ? _chunkEAD66IDCjs.numberToHex.call(void 0, toBlock) : toBlock,
|
198
207
|
topics
|
199
208
|
}
|
200
209
|
]
|
@@ -209,47 +218,56 @@ async function createContractEventFilter(client, {
|
|
209
218
|
}
|
210
219
|
|
211
220
|
// src/actions/public/estimateGas.ts
|
212
|
-
async function estimateGas(client, {
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
221
|
+
async function estimateGas(client, args) {
|
222
|
+
const {
|
223
|
+
accessList,
|
224
|
+
blockNumber,
|
225
|
+
blockTag = "latest",
|
226
|
+
data,
|
227
|
+
from,
|
228
|
+
gas,
|
229
|
+
gasPrice,
|
230
|
+
maxFeePerGas,
|
231
|
+
maxPriorityFeePerGas,
|
232
|
+
nonce,
|
233
|
+
to,
|
234
|
+
value,
|
235
|
+
...rest
|
236
|
+
} = args;
|
237
|
+
try {
|
238
|
+
_chunkEAD66IDCjs.assertRequest.call(void 0, args);
|
239
|
+
const blockNumberHex = blockNumber ? _chunkEAD66IDCjs.numberToHex.call(void 0, blockNumber) : void 0;
|
240
|
+
const formatter = _optionalChain([client, 'access', _4 => _4.chain, 'optionalAccess', _5 => _5.formatters, 'optionalAccess', _6 => _6.transactionRequest]);
|
241
|
+
const request_ = _chunkEAD66IDCjs.format.call(void 0,
|
242
|
+
{
|
243
|
+
from,
|
244
|
+
accessList,
|
245
|
+
data,
|
246
|
+
gas,
|
247
|
+
gasPrice,
|
248
|
+
maxFeePerGas,
|
249
|
+
maxPriorityFeePerGas,
|
250
|
+
nonce,
|
251
|
+
to,
|
252
|
+
value,
|
253
|
+
// Pick out extra data that might exist on the chain's transaction request type.
|
254
|
+
..._chunkEAD66IDCjs.extract.call(void 0, rest, { formatter })
|
255
|
+
},
|
256
|
+
{
|
257
|
+
formatter: formatter || _chunkEAD66IDCjs.formatTransactionRequest
|
258
|
+
}
|
259
|
+
);
|
260
|
+
const balance = await client.request({
|
261
|
+
method: "eth_estimateGas",
|
262
|
+
params: [request_, blockNumberHex || blockTag]
|
263
|
+
});
|
264
|
+
return BigInt(balance);
|
265
|
+
} catch (err) {
|
266
|
+
throw _chunkEAD66IDCjs.getEstimateGasError.call(void 0, err, {
|
267
|
+
...args,
|
268
|
+
chain: client.chain
|
269
|
+
});
|
270
|
+
}
|
253
271
|
}
|
254
272
|
|
255
273
|
// src/actions/public/estimateContractGas.ts
|
@@ -260,7 +278,7 @@ async function estimateContractGas(client, {
|
|
260
278
|
functionName,
|
261
279
|
...request
|
262
280
|
}) {
|
263
|
-
const data =
|
281
|
+
const data = _chunkEAD66IDCjs.encodeFunctionData.call(void 0, {
|
264
282
|
abi,
|
265
283
|
args,
|
266
284
|
functionName
|
@@ -273,7 +291,7 @@ async function estimateContractGas(client, {
|
|
273
291
|
});
|
274
292
|
return gas;
|
275
293
|
} catch (err) {
|
276
|
-
throw
|
294
|
+
throw _chunkEAD66IDCjs.getContractError.call(void 0, err, {
|
277
295
|
abi,
|
278
296
|
address,
|
279
297
|
args,
|
@@ -286,7 +304,7 @@ async function estimateContractGas(client, {
|
|
286
304
|
|
287
305
|
// src/actions/public/getBalance.ts
|
288
306
|
async function getBalance(client, { address, blockNumber, blockTag = "latest" }) {
|
289
|
-
const blockNumberHex = blockNumber ?
|
307
|
+
const blockNumberHex = blockNumber ? _chunkEAD66IDCjs.numberToHex.call(void 0, blockNumber) : void 0;
|
290
308
|
const balance = await client.request({
|
291
309
|
method: "eth_getBalance",
|
292
310
|
params: [address, blockNumberHex || blockTag]
|
@@ -301,7 +319,7 @@ async function getBlock(client, {
|
|
301
319
|
blockTag = "latest",
|
302
320
|
includeTransactions = false
|
303
321
|
} = {}) {
|
304
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
322
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunkEAD66IDCjs.numberToHex.call(void 0, blockNumber) : void 0;
|
305
323
|
let block = null;
|
306
324
|
if (blockHash) {
|
307
325
|
block = await client.request({
|
@@ -315,19 +333,19 @@ async function getBlock(client, {
|
|
315
333
|
});
|
316
334
|
}
|
317
335
|
if (!block)
|
318
|
-
throw new (0,
|
319
|
-
return
|
320
|
-
formatter: _optionalChain([client, 'access', _7 => _7.chain, 'optionalAccess', _8 => _8.formatters, 'optionalAccess', _9 => _9.block]) ||
|
336
|
+
throw new (0, _chunkEAD66IDCjs.BlockNotFoundError)({ blockHash, blockNumber });
|
337
|
+
return _chunkEAD66IDCjs.format.call(void 0, block, {
|
338
|
+
formatter: _optionalChain([client, 'access', _7 => _7.chain, 'optionalAccess', _8 => _8.formatters, 'optionalAccess', _9 => _9.block]) || _chunkEAD66IDCjs.formatBlock
|
321
339
|
});
|
322
340
|
}
|
323
341
|
|
324
342
|
// src/actions/public/getBlockNumber.ts
|
325
343
|
var cacheKey = (id) => `blockNumber.${id}`;
|
326
344
|
function getBlockNumberCache(id) {
|
327
|
-
return
|
345
|
+
return _chunkEAD66IDCjs.getCache.call(void 0, cacheKey(id));
|
328
346
|
}
|
329
347
|
async function getBlockNumber(client, { maxAge = client.pollingInterval } = {}) {
|
330
|
-
const blockNumberHex = await
|
348
|
+
const blockNumberHex = await _chunkEAD66IDCjs.withCache.call(void 0,
|
331
349
|
() => client.request({
|
332
350
|
method: "eth_blockNumber"
|
333
351
|
}),
|
@@ -342,7 +360,7 @@ async function getBlockTransactionCount(client, {
|
|
342
360
|
blockNumber,
|
343
361
|
blockTag = "latest"
|
344
362
|
} = {}) {
|
345
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
363
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunkEAD66IDCjs.numberToHex.call(void 0, blockNumber) : void 0;
|
346
364
|
let count = null;
|
347
365
|
if (blockHash) {
|
348
366
|
count = await client.request({
|
@@ -355,12 +373,12 @@ async function getBlockTransactionCount(client, {
|
|
355
373
|
params: [blockNumberHex || blockTag]
|
356
374
|
});
|
357
375
|
}
|
358
|
-
return
|
376
|
+
return _chunkEAD66IDCjs.hexToNumber.call(void 0, count);
|
359
377
|
}
|
360
378
|
|
361
379
|
// src/actions/public/getBytecode.ts
|
362
380
|
async function getBytecode(client, { address, blockNumber, blockTag = "latest" }) {
|
363
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
381
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunkEAD66IDCjs.numberToHex.call(void 0, blockNumber) : void 0;
|
364
382
|
const hex = await client.request({
|
365
383
|
method: "eth_getCode",
|
366
384
|
params: [address, blockNumberHex || blockTag]
|
@@ -373,7 +391,7 @@ async function getBytecode(client, { address, blockNumber, blockTag = "latest" }
|
|
373
391
|
// src/actions/public/getChainId.ts
|
374
392
|
async function getChainId(client) {
|
375
393
|
const chainIdHex = await client.request({ method: "eth_chainId" });
|
376
|
-
return
|
394
|
+
return _chunkEAD66IDCjs.hexToNumber.call(void 0, chainIdHex);
|
377
395
|
}
|
378
396
|
|
379
397
|
// src/actions/public/getFeeHistory.ts
|
@@ -383,16 +401,16 @@ async function getFeeHistory(client, {
|
|
383
401
|
blockTag = "latest",
|
384
402
|
rewardPercentiles
|
385
403
|
}) {
|
386
|
-
const blockNumberHex = blockNumber ?
|
404
|
+
const blockNumberHex = blockNumber ? _chunkEAD66IDCjs.numberToHex.call(void 0, blockNumber) : void 0;
|
387
405
|
const feeHistory = await client.request({
|
388
406
|
method: "eth_feeHistory",
|
389
407
|
params: [
|
390
|
-
|
408
|
+
_chunkEAD66IDCjs.numberToHex.call(void 0, blockCount),
|
391
409
|
blockNumberHex || blockTag,
|
392
410
|
rewardPercentiles
|
393
411
|
]
|
394
412
|
});
|
395
|
-
return
|
413
|
+
return _chunkEAD66IDCjs.formatFeeHistory.call(void 0, feeHistory);
|
396
414
|
}
|
397
415
|
|
398
416
|
// src/actions/public/getFilterChanges.ts
|
@@ -404,12 +422,12 @@ async function getFilterChanges(client, { filter }) {
|
|
404
422
|
return logs.map((log) => {
|
405
423
|
if (typeof log === "string")
|
406
424
|
return log;
|
407
|
-
const { eventName, args } = "abi" in filter && filter.abi ?
|
425
|
+
const { eventName, args } = "abi" in filter && filter.abi ? _chunkEAD66IDCjs.decodeEventLog.call(void 0, {
|
408
426
|
abi: filter.abi,
|
409
427
|
data: log.data,
|
410
428
|
topics: log.topics
|
411
429
|
}) : { eventName: void 0, args: void 0 };
|
412
|
-
return
|
430
|
+
return _chunkEAD66IDCjs.formatLog.call(void 0, log, { args, eventName });
|
413
431
|
});
|
414
432
|
}
|
415
433
|
|
@@ -420,12 +438,12 @@ async function getFilterLogs(client, { filter }) {
|
|
420
438
|
params: [filter.id]
|
421
439
|
});
|
422
440
|
return logs.map((log) => {
|
423
|
-
const { eventName, args } = "abi" in filter && filter.abi ?
|
441
|
+
const { eventName, args } = "abi" in filter && filter.abi ? _chunkEAD66IDCjs.decodeEventLog.call(void 0, {
|
424
442
|
abi: filter.abi,
|
425
443
|
data: log.data,
|
426
444
|
topics: log.topics
|
427
445
|
}) : { eventName: void 0, args: void 0 };
|
428
|
-
return
|
446
|
+
return _chunkEAD66IDCjs.formatLog.call(void 0, log, { args, eventName });
|
429
447
|
});
|
430
448
|
}
|
431
449
|
|
@@ -448,7 +466,7 @@ async function getLogs(client, {
|
|
448
466
|
} = {}) {
|
449
467
|
let topics = [];
|
450
468
|
if (event)
|
451
|
-
topics =
|
469
|
+
topics = _chunkEAD66IDCjs.encodeEventTopics.call(void 0, {
|
452
470
|
abi: [event],
|
453
471
|
eventName: event.name,
|
454
472
|
args
|
@@ -466,25 +484,25 @@ async function getLogs(client, {
|
|
466
484
|
{
|
467
485
|
address,
|
468
486
|
topics,
|
469
|
-
fromBlock: typeof fromBlock === "bigint" ?
|
470
|
-
toBlock: typeof toBlock === "bigint" ?
|
487
|
+
fromBlock: typeof fromBlock === "bigint" ? _chunkEAD66IDCjs.numberToHex.call(void 0, fromBlock) : fromBlock,
|
488
|
+
toBlock: typeof toBlock === "bigint" ? _chunkEAD66IDCjs.numberToHex.call(void 0, toBlock) : toBlock
|
471
489
|
}
|
472
490
|
]
|
473
491
|
});
|
474
492
|
}
|
475
493
|
return logs.map((log) => {
|
476
|
-
const { eventName, args: args2 } = event ?
|
494
|
+
const { eventName, args: args2 } = event ? _chunkEAD66IDCjs.decodeEventLog.call(void 0, {
|
477
495
|
abi: [event],
|
478
496
|
data: log.data,
|
479
497
|
topics: log.topics
|
480
498
|
}) : { eventName: void 0, args: void 0 };
|
481
|
-
return
|
499
|
+
return _chunkEAD66IDCjs.formatLog.call(void 0, log, { args: args2, eventName });
|
482
500
|
});
|
483
501
|
}
|
484
502
|
|
485
503
|
// src/actions/public/getStorageAt.ts
|
486
504
|
async function getStorageAt(client, { address, blockNumber, blockTag = "latest", slot }) {
|
487
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
505
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunkEAD66IDCjs.numberToHex.call(void 0, blockNumber) : void 0;
|
488
506
|
const data = await client.request({
|
489
507
|
method: "eth_getStorageAt",
|
490
508
|
params: [address, slot, blockNumberHex || blockTag]
|
@@ -500,7 +518,7 @@ async function getTransaction(client, {
|
|
500
518
|
hash,
|
501
519
|
index
|
502
520
|
}) {
|
503
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
521
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunkEAD66IDCjs.numberToHex.call(void 0, blockNumber) : void 0;
|
504
522
|
let transaction = null;
|
505
523
|
if (hash) {
|
506
524
|
transaction = await client.request({
|
@@ -510,24 +528,24 @@ async function getTransaction(client, {
|
|
510
528
|
} else if (blockHash) {
|
511
529
|
transaction = await client.request({
|
512
530
|
method: "eth_getTransactionByBlockHashAndIndex",
|
513
|
-
params: [blockHash,
|
531
|
+
params: [blockHash, _chunkEAD66IDCjs.numberToHex.call(void 0, index)]
|
514
532
|
});
|
515
533
|
} else if (blockNumberHex || blockTag) {
|
516
534
|
transaction = await client.request({
|
517
535
|
method: "eth_getTransactionByBlockNumberAndIndex",
|
518
|
-
params: [blockNumberHex || blockTag,
|
536
|
+
params: [blockNumberHex || blockTag, _chunkEAD66IDCjs.numberToHex.call(void 0, index)]
|
519
537
|
});
|
520
538
|
}
|
521
539
|
if (!transaction)
|
522
|
-
throw new (0,
|
540
|
+
throw new (0, _chunkEAD66IDCjs.TransactionNotFoundError)({
|
523
541
|
blockHash,
|
524
542
|
blockNumber,
|
525
543
|
blockTag,
|
526
544
|
hash,
|
527
545
|
index
|
528
546
|
});
|
529
|
-
return
|
530
|
-
formatter: _optionalChain([client, 'access', _10 => _10.chain, 'optionalAccess', _11 => _11.formatters, 'optionalAccess', _12 => _12.transaction]) ||
|
547
|
+
return _chunkEAD66IDCjs.format.call(void 0, transaction, {
|
548
|
+
formatter: _optionalChain([client, 'access', _10 => _10.chain, 'optionalAccess', _11 => _11.formatters, 'optionalAccess', _12 => _12.transaction]) || _chunkEAD66IDCjs.formatTransaction
|
531
549
|
});
|
532
550
|
}
|
533
551
|
|
@@ -547,9 +565,9 @@ async function getTransactionConfirmations(client, { hash, transactionReceipt })
|
|
547
565
|
async function getTransactionCount(client, { address, blockTag = "latest", blockNumber }) {
|
548
566
|
const count = await client.request({
|
549
567
|
method: "eth_getTransactionCount",
|
550
|
-
params: [address, blockNumber ?
|
568
|
+
params: [address, blockNumber ? _chunkEAD66IDCjs.numberToHex.call(void 0, blockNumber) : blockTag]
|
551
569
|
});
|
552
|
-
return
|
570
|
+
return _chunkEAD66IDCjs.hexToNumber.call(void 0, count);
|
553
571
|
}
|
554
572
|
|
555
573
|
// src/actions/public/getTransactionReceipt.ts
|
@@ -559,9 +577,9 @@ async function getTransactionReceipt(client, { hash }) {
|
|
559
577
|
params: [hash]
|
560
578
|
});
|
561
579
|
if (!receipt)
|
562
|
-
throw new (0,
|
563
|
-
return
|
564
|
-
formatter: _optionalChain([client, 'access', _15 => _15.chain, 'optionalAccess', _16 => _16.formatters, 'optionalAccess', _17 => _17.transactionReceipt]) ||
|
580
|
+
throw new (0, _chunkEAD66IDCjs.TransactionReceiptNotFoundError)({ hash });
|
581
|
+
return _chunkEAD66IDCjs.format.call(void 0, receipt, {
|
582
|
+
formatter: _optionalChain([client, 'access', _15 => _15.chain, 'optionalAccess', _16 => _16.formatters, 'optionalAccess', _17 => _17.transactionReceipt]) || _chunkEAD66IDCjs.formatTransactionReceipt
|
565
583
|
});
|
566
584
|
}
|
567
585
|
|
@@ -573,7 +591,7 @@ async function readContract(client, {
|
|
573
591
|
functionName,
|
574
592
|
...callRequest
|
575
593
|
}) {
|
576
|
-
const calldata =
|
594
|
+
const calldata = _chunkEAD66IDCjs.encodeFunctionData.call(void 0, {
|
577
595
|
abi,
|
578
596
|
args,
|
579
597
|
functionName
|
@@ -584,14 +602,14 @@ async function readContract(client, {
|
|
584
602
|
to: address,
|
585
603
|
...callRequest
|
586
604
|
});
|
587
|
-
return
|
605
|
+
return _chunkEAD66IDCjs.decodeFunctionResult.call(void 0, {
|
588
606
|
abi,
|
589
607
|
args,
|
590
608
|
functionName,
|
591
609
|
data: data || "0x"
|
592
610
|
});
|
593
611
|
} catch (err) {
|
594
|
-
throw
|
612
|
+
throw _chunkEAD66IDCjs.getContractError.call(void 0, err, {
|
595
613
|
abi,
|
596
614
|
address,
|
597
615
|
args,
|
@@ -612,7 +630,7 @@ async function multicall(client, args) {
|
|
612
630
|
} = args;
|
613
631
|
const calls = contracts.map(({ abi, address, args: args2, functionName }) => {
|
614
632
|
try {
|
615
|
-
const callData =
|
633
|
+
const callData = _chunkEAD66IDCjs.encodeFunctionData.call(void 0, {
|
616
634
|
abi,
|
617
635
|
args: args2,
|
618
636
|
functionName
|
@@ -623,7 +641,7 @@ async function multicall(client, args) {
|
|
623
641
|
target: address
|
624
642
|
};
|
625
643
|
} catch (err) {
|
626
|
-
const error =
|
644
|
+
const error = _chunkEAD66IDCjs.getContractError.call(void 0, err, {
|
627
645
|
abi,
|
628
646
|
address,
|
629
647
|
args: args2,
|
@@ -640,7 +658,7 @@ async function multicall(client, args) {
|
|
640
658
|
}
|
641
659
|
});
|
642
660
|
const results = await readContract(client, {
|
643
|
-
abi:
|
661
|
+
abi: _chunkEAD66IDCjs.multicall3Abi,
|
644
662
|
address: multicallAddress,
|
645
663
|
args: [calls],
|
646
664
|
blockNumber,
|
@@ -652,17 +670,17 @@ async function multicall(client, args) {
|
|
652
670
|
const { abi, address, functionName, args: args2 } = contracts[i];
|
653
671
|
try {
|
654
672
|
if (callData === "0x")
|
655
|
-
throw new (0,
|
673
|
+
throw new (0, _chunkEAD66IDCjs.AbiDecodingZeroDataError)();
|
656
674
|
if (!success)
|
657
|
-
throw new (0,
|
658
|
-
const result =
|
675
|
+
throw new (0, _chunkEAD66IDCjs.RawContractError)({ data: returnData });
|
676
|
+
const result = _chunkEAD66IDCjs.decodeFunctionResult.call(void 0, {
|
659
677
|
abi,
|
660
678
|
data: returnData,
|
661
679
|
functionName
|
662
680
|
});
|
663
681
|
return { result, status: "success" };
|
664
682
|
} catch (err) {
|
665
|
-
const error =
|
683
|
+
const error = _chunkEAD66IDCjs.getContractError.call(void 0, err, {
|
666
684
|
abi,
|
667
685
|
address,
|
668
686
|
args: args2,
|
@@ -735,12 +753,12 @@ function poll(fn, { emitOnBegin, initialWaitTime, interval }) {
|
|
735
753
|
if (emitOnBegin)
|
736
754
|
data = await fn({ unpoll: unwatch });
|
737
755
|
const initialWait = await _asyncNullishCoalesce(await _optionalChain([initialWaitTime, 'optionalCall', _21 => _21(data)]), async () => ( interval));
|
738
|
-
await
|
756
|
+
await _chunkEAD66IDCjs.wait.call(void 0, initialWait);
|
739
757
|
const poll2 = async () => {
|
740
758
|
if (!active)
|
741
759
|
return;
|
742
760
|
await fn({ unpoll: unwatch });
|
743
|
-
await
|
761
|
+
await _chunkEAD66IDCjs.wait.call(void 0, interval);
|
744
762
|
poll2();
|
745
763
|
};
|
746
764
|
poll2();
|
@@ -904,7 +922,7 @@ function watchContractEvent(client, {
|
|
904
922
|
args,
|
905
923
|
fromBlock: blockNumber,
|
906
924
|
toBlock: blockNumber,
|
907
|
-
event:
|
925
|
+
event: _chunkEAD66IDCjs.getAbiItem.call(void 0, {
|
908
926
|
abi,
|
909
927
|
name: eventName
|
910
928
|
})
|
@@ -1086,7 +1104,7 @@ async function waitForTransactionReceipt(client, {
|
|
1086
1104
|
return new Promise((resolve, reject) => {
|
1087
1105
|
if (timeout)
|
1088
1106
|
setTimeout(
|
1089
|
-
() => reject(new (0,
|
1107
|
+
() => reject(new (0, _chunkEAD66IDCjs.WaitForTransactionReceiptTimeoutError)({ hash })),
|
1090
1108
|
timeout
|
1091
1109
|
);
|
1092
1110
|
const unobserve = observe(
|
@@ -1116,7 +1134,7 @@ async function waitForTransactionReceipt(client, {
|
|
1116
1134
|
return;
|
1117
1135
|
done(() => emit.resolve(receipt));
|
1118
1136
|
} catch (err) {
|
1119
|
-
if (transaction && (err instanceof
|
1137
|
+
if (transaction && (err instanceof _chunkEAD66IDCjs.TransactionNotFoundError || err instanceof _chunkEAD66IDCjs.TransactionReceiptNotFoundError)) {
|
1120
1138
|
replacedTransaction = transaction;
|
1121
1139
|
const block = await getBlock(client, {
|
1122
1140
|
blockNumber,
|
@@ -1195,4 +1213,4 @@ async function waitForTransactionReceipt(client, {
|
|
1195
1213
|
|
1196
1214
|
|
1197
1215
|
exports.call = call; exports.simulateContract = simulateContract; exports.createPendingTransactionFilter = createPendingTransactionFilter; exports.createBlockFilter = createBlockFilter; exports.createEventFilter = createEventFilter; exports.createContractEventFilter = createContractEventFilter; exports.estimateGas = estimateGas; exports.estimateContractGas = estimateContractGas; exports.getBalance = getBalance; exports.getBlock = getBlock; exports.getBlockNumberCache = getBlockNumberCache; exports.getBlockNumber = getBlockNumber; exports.getBlockTransactionCount = getBlockTransactionCount; exports.getBytecode = getBytecode; exports.getChainId = getChainId; exports.getFeeHistory = getFeeHistory; exports.getFilterChanges = getFilterChanges; exports.getFilterLogs = getFilterLogs; exports.getGasPrice = getGasPrice; exports.getLogs = getLogs; exports.getStorageAt = getStorageAt; exports.getTransaction = getTransaction; exports.getTransactionConfirmations = getTransactionConfirmations; exports.getTransactionCount = getTransactionCount; exports.getTransactionReceipt = getTransactionReceipt; exports.readContract = readContract; exports.multicall = multicall; exports.uninstallFilter = uninstallFilter; exports.waitForTransactionReceipt = waitForTransactionReceipt; exports.watchBlockNumber = watchBlockNumber; exports.watchBlocks = watchBlocks; exports.watchContractEvent = watchContractEvent; exports.watchEvent = watchEvent; exports.watchPendingTransactions = watchPendingTransactions;
|
1198
|
-
//# sourceMappingURL=chunk-
|
1216
|
+
//# sourceMappingURL=chunk-ZX4U6QKQ.js.map
|