viem 0.0.1-alpha.32 → 0.0.1-alpha.33
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-00b37e4e.d.ts → chain-4a0d4164.d.ts} +1 -1
- package/dist/{chain-38182d92.d.ts → chain-ce6e149c.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-K3Q7U5IY.js → chunk-3CEIPU6M.js} +15 -15
- package/dist/{chunk-NZUM6QVJ.js → chunk-BUCF6SRR.js} +22 -22
- package/dist/{chunk-4TDJALZ6.js → chunk-DHSIBSJL.js} +75 -75
- package/dist/{chunk-QPXAI2W5.mjs → chunk-DYALOQ44.mjs} +2 -2
- package/dist/{chunk-HJBIOX2W.mjs → chunk-HN7IYO7U.mjs} +2 -2
- package/dist/{chunk-P76FCR36.mjs → chunk-JB4TWW3U.mjs} +7 -3
- package/dist/{chunk-P76FCR36.mjs.map → chunk-JB4TWW3U.mjs.map} +1 -1
- package/dist/{chunk-ZIH5V7HU.mjs → chunk-KMBDF3HQ.mjs} +3 -3
- package/dist/{chunk-DEF2SWG2.js → chunk-R7MSY2BH.js} +7 -3
- package/dist/chunk-R7MSY2BH.js.map +1 -0
- package/dist/{chunk-S3HZ74MN.js → chunk-RNGEVZVH.js} +14 -14
- package/dist/{chunk-ZZWYDER3.mjs → chunk-VEAHSGOL.mjs} +2 -2
- package/dist/contract.d.ts +7 -7
- package/dist/contract.js +4 -4
- package/dist/contract.mjs +3 -3
- package/dist/{createClient-5258d590.d.ts → createClient-8a8b4bf4.d.ts} +2 -2
- package/dist/{createPublicClient-2187596f.d.ts → createPublicClient-b5afe6b8.d.ts} +4 -4
- package/dist/{eip1193-fcdeee04.d.ts → eip1193-8c021438.d.ts} +1 -1
- package/dist/ens.d.ts +5 -5
- package/dist/ens.js +4 -4
- package/dist/ens.mjs +3 -3
- package/dist/{formatAbiItem-50cb39d8.d.ts → formatAbiItem-6e00e5e6.d.ts} +1 -1
- package/dist/{getAbiItem-6d4f64d2.d.ts → getAbiItem-d7aa40b1.d.ts} +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.js +90 -90
- package/dist/index.mjs +5 -5
- package/dist/{parseGwei-308eada9.d.ts → parseGwei-ce3a9dfa.d.ts} +4 -4
- package/dist/public.d.ts +6 -6
- package/dist/public.js +3 -3
- package/dist/public.mjs +2 -2
- package/dist/{test-79ec416c.d.ts → test-5d5828c9.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 +14 -14
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/{wallet-cf5c8351.d.ts → wallet-5ab86528.d.ts} +3 -3
- package/dist/wallet.d.ts +4 -4
- 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-DEF2SWG2.js.map +0 -1
- /package/dist/{chunk-K3Q7U5IY.js.map → chunk-3CEIPU6M.js.map} +0 -0
- /package/dist/{chunk-NZUM6QVJ.js.map → chunk-BUCF6SRR.js.map} +0 -0
- /package/dist/{chunk-4TDJALZ6.js.map → chunk-DHSIBSJL.js.map} +0 -0
- /package/dist/{chunk-QPXAI2W5.mjs.map → chunk-DYALOQ44.mjs.map} +0 -0
- /package/dist/{chunk-HJBIOX2W.mjs.map → chunk-HN7IYO7U.mjs.map} +0 -0
- /package/dist/{chunk-ZIH5V7HU.mjs.map → chunk-KMBDF3HQ.mjs.map} +0 -0
- /package/dist/{chunk-S3HZ74MN.js.map → chunk-RNGEVZVH.js.map} +0 -0
- /package/dist/{chunk-ZZWYDER3.mjs.map → chunk-VEAHSGOL.mjs.map} +0 -0
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
|
30
30
|
|
31
|
-
var
|
31
|
+
var _chunkR7MSY2BHjs = require('./chunk-R7MSY2BH.js');
|
32
32
|
|
33
33
|
// src/actions/public/call.ts
|
34
34
|
async function call(client, args) {
|
@@ -48,10 +48,10 @@ async function call(client, args) {
|
|
48
48
|
...rest
|
49
49
|
} = args;
|
50
50
|
try {
|
51
|
-
|
52
|
-
const blockNumberHex = blockNumber ?
|
51
|
+
_chunkR7MSY2BHjs.assertRequest.call(void 0, args);
|
52
|
+
const blockNumberHex = blockNumber ? _chunkR7MSY2BHjs.numberToHex.call(void 0, blockNumber) : void 0;
|
53
53
|
const formatter = _optionalChain([client, 'access', _ => _.chain, 'optionalAccess', _2 => _2.formatters, 'optionalAccess', _3 => _3.transactionRequest]);
|
54
|
-
const request_ =
|
54
|
+
const request_ = _chunkR7MSY2BHjs.format.call(void 0,
|
55
55
|
{
|
56
56
|
from,
|
57
57
|
accessList,
|
@@ -64,10 +64,10 @@ async function call(client, args) {
|
|
64
64
|
to,
|
65
65
|
value,
|
66
66
|
// Pick out extra data that might exist on the chain's transaction request type.
|
67
|
-
...
|
67
|
+
..._chunkR7MSY2BHjs.extract.call(void 0, rest, { formatter })
|
68
68
|
},
|
69
69
|
{
|
70
|
-
formatter: formatter ||
|
70
|
+
formatter: formatter || _chunkR7MSY2BHjs.formatTransactionRequest
|
71
71
|
}
|
72
72
|
);
|
73
73
|
const response = await client.request({
|
@@ -78,7 +78,7 @@ async function call(client, args) {
|
|
78
78
|
return { data: void 0 };
|
79
79
|
return { data: response };
|
80
80
|
} catch (err) {
|
81
|
-
throw
|
81
|
+
throw _chunkR7MSY2BHjs.getCallError.call(void 0, err, {
|
82
82
|
...args,
|
83
83
|
chain: client.chain
|
84
84
|
});
|
@@ -93,7 +93,7 @@ async function simulateContract(client, {
|
|
93
93
|
functionName,
|
94
94
|
...callRequest
|
95
95
|
}) {
|
96
|
-
const calldata =
|
96
|
+
const calldata = _chunkR7MSY2BHjs.encodeFunctionData.call(void 0, {
|
97
97
|
abi,
|
98
98
|
args,
|
99
99
|
functionName
|
@@ -104,7 +104,7 @@ async function simulateContract(client, {
|
|
104
104
|
to: address,
|
105
105
|
...callRequest
|
106
106
|
});
|
107
|
-
const result =
|
107
|
+
const result = _chunkR7MSY2BHjs.decodeFunctionResult.call(void 0, {
|
108
108
|
abi,
|
109
109
|
args,
|
110
110
|
functionName,
|
@@ -121,7 +121,7 @@ async function simulateContract(client, {
|
|
121
121
|
}
|
122
122
|
};
|
123
123
|
} catch (err) {
|
124
|
-
throw
|
124
|
+
throw _chunkR7MSY2BHjs.getContractError.call(void 0, err, {
|
125
125
|
abi,
|
126
126
|
address,
|
127
127
|
args,
|
@@ -158,7 +158,7 @@ async function createEventFilter(client, {
|
|
158
158
|
} = {}) {
|
159
159
|
let topics = [];
|
160
160
|
if (event)
|
161
|
-
topics =
|
161
|
+
topics = _chunkR7MSY2BHjs.encodeEventTopics.call(void 0, {
|
162
162
|
abi: [event],
|
163
163
|
eventName: event.name,
|
164
164
|
args
|
@@ -168,8 +168,8 @@ async function createEventFilter(client, {
|
|
168
168
|
params: [
|
169
169
|
{
|
170
170
|
address,
|
171
|
-
fromBlock: typeof fromBlock === "bigint" ?
|
172
|
-
toBlock: typeof toBlock === "bigint" ?
|
171
|
+
fromBlock: typeof fromBlock === "bigint" ? _chunkR7MSY2BHjs.numberToHex.call(void 0, fromBlock) : fromBlock,
|
172
|
+
toBlock: typeof toBlock === "bigint" ? _chunkR7MSY2BHjs.numberToHex.call(void 0, toBlock) : toBlock,
|
173
173
|
...topics.length ? { topics } : {}
|
174
174
|
}
|
175
175
|
]
|
@@ -192,7 +192,7 @@ async function createContractEventFilter(client, {
|
|
192
192
|
fromBlock,
|
193
193
|
toBlock
|
194
194
|
}) {
|
195
|
-
const topics = eventName ?
|
195
|
+
const topics = eventName ? _chunkR7MSY2BHjs.encodeEventTopics.call(void 0, {
|
196
196
|
abi,
|
197
197
|
args,
|
198
198
|
eventName
|
@@ -202,8 +202,8 @@ async function createContractEventFilter(client, {
|
|
202
202
|
params: [
|
203
203
|
{
|
204
204
|
address,
|
205
|
-
fromBlock: typeof fromBlock === "bigint" ?
|
206
|
-
toBlock: typeof toBlock === "bigint" ?
|
205
|
+
fromBlock: typeof fromBlock === "bigint" ? _chunkR7MSY2BHjs.numberToHex.call(void 0, fromBlock) : fromBlock,
|
206
|
+
toBlock: typeof toBlock === "bigint" ? _chunkR7MSY2BHjs.numberToHex.call(void 0, toBlock) : toBlock,
|
207
207
|
topics
|
208
208
|
}
|
209
209
|
]
|
@@ -235,10 +235,10 @@ async function estimateGas(client, args) {
|
|
235
235
|
...rest
|
236
236
|
} = args;
|
237
237
|
try {
|
238
|
-
|
239
|
-
const blockNumberHex = blockNumber ?
|
238
|
+
_chunkR7MSY2BHjs.assertRequest.call(void 0, args);
|
239
|
+
const blockNumberHex = blockNumber ? _chunkR7MSY2BHjs.numberToHex.call(void 0, blockNumber) : void 0;
|
240
240
|
const formatter = _optionalChain([client, 'access', _4 => _4.chain, 'optionalAccess', _5 => _5.formatters, 'optionalAccess', _6 => _6.transactionRequest]);
|
241
|
-
const request_ =
|
241
|
+
const request_ = _chunkR7MSY2BHjs.format.call(void 0,
|
242
242
|
{
|
243
243
|
from,
|
244
244
|
accessList,
|
@@ -251,10 +251,10 @@ async function estimateGas(client, args) {
|
|
251
251
|
to,
|
252
252
|
value,
|
253
253
|
// Pick out extra data that might exist on the chain's transaction request type.
|
254
|
-
...
|
254
|
+
..._chunkR7MSY2BHjs.extract.call(void 0, rest, { formatter })
|
255
255
|
},
|
256
256
|
{
|
257
|
-
formatter: formatter ||
|
257
|
+
formatter: formatter || _chunkR7MSY2BHjs.formatTransactionRequest
|
258
258
|
}
|
259
259
|
);
|
260
260
|
const balance = await client.request({
|
@@ -263,7 +263,7 @@ async function estimateGas(client, args) {
|
|
263
263
|
});
|
264
264
|
return BigInt(balance);
|
265
265
|
} catch (err) {
|
266
|
-
throw
|
266
|
+
throw _chunkR7MSY2BHjs.getEstimateGasError.call(void 0, err, {
|
267
267
|
...args,
|
268
268
|
chain: client.chain
|
269
269
|
});
|
@@ -278,7 +278,7 @@ async function estimateContractGas(client, {
|
|
278
278
|
functionName,
|
279
279
|
...request
|
280
280
|
}) {
|
281
|
-
const data =
|
281
|
+
const data = _chunkR7MSY2BHjs.encodeFunctionData.call(void 0, {
|
282
282
|
abi,
|
283
283
|
args,
|
284
284
|
functionName
|
@@ -291,7 +291,7 @@ async function estimateContractGas(client, {
|
|
291
291
|
});
|
292
292
|
return gas;
|
293
293
|
} catch (err) {
|
294
|
-
throw
|
294
|
+
throw _chunkR7MSY2BHjs.getContractError.call(void 0, err, {
|
295
295
|
abi,
|
296
296
|
address,
|
297
297
|
args,
|
@@ -304,7 +304,7 @@ async function estimateContractGas(client, {
|
|
304
304
|
|
305
305
|
// src/actions/public/getBalance.ts
|
306
306
|
async function getBalance(client, { address, blockNumber, blockTag = "latest" }) {
|
307
|
-
const blockNumberHex = blockNumber ?
|
307
|
+
const blockNumberHex = blockNumber ? _chunkR7MSY2BHjs.numberToHex.call(void 0, blockNumber) : void 0;
|
308
308
|
const balance = await client.request({
|
309
309
|
method: "eth_getBalance",
|
310
310
|
params: [address, blockNumberHex || blockTag]
|
@@ -319,7 +319,7 @@ async function getBlock(client, {
|
|
319
319
|
blockTag = "latest",
|
320
320
|
includeTransactions = false
|
321
321
|
} = {}) {
|
322
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
322
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunkR7MSY2BHjs.numberToHex.call(void 0, blockNumber) : void 0;
|
323
323
|
let block = null;
|
324
324
|
if (blockHash) {
|
325
325
|
block = await client.request({
|
@@ -333,19 +333,19 @@ async function getBlock(client, {
|
|
333
333
|
});
|
334
334
|
}
|
335
335
|
if (!block)
|
336
|
-
throw new (0,
|
337
|
-
return
|
338
|
-
formatter: _optionalChain([client, 'access', _7 => _7.chain, 'optionalAccess', _8 => _8.formatters, 'optionalAccess', _9 => _9.block]) ||
|
336
|
+
throw new (0, _chunkR7MSY2BHjs.BlockNotFoundError)({ blockHash, blockNumber });
|
337
|
+
return _chunkR7MSY2BHjs.format.call(void 0, block, {
|
338
|
+
formatter: _optionalChain([client, 'access', _7 => _7.chain, 'optionalAccess', _8 => _8.formatters, 'optionalAccess', _9 => _9.block]) || _chunkR7MSY2BHjs.formatBlock
|
339
339
|
});
|
340
340
|
}
|
341
341
|
|
342
342
|
// src/actions/public/getBlockNumber.ts
|
343
343
|
var cacheKey = (id) => `blockNumber.${id}`;
|
344
344
|
function getBlockNumberCache(id) {
|
345
|
-
return
|
345
|
+
return _chunkR7MSY2BHjs.getCache.call(void 0, cacheKey(id));
|
346
346
|
}
|
347
347
|
async function getBlockNumber(client, { maxAge = client.pollingInterval } = {}) {
|
348
|
-
const blockNumberHex = await
|
348
|
+
const blockNumberHex = await _chunkR7MSY2BHjs.withCache.call(void 0,
|
349
349
|
() => client.request({
|
350
350
|
method: "eth_blockNumber"
|
351
351
|
}),
|
@@ -360,7 +360,7 @@ async function getBlockTransactionCount(client, {
|
|
360
360
|
blockNumber,
|
361
361
|
blockTag = "latest"
|
362
362
|
} = {}) {
|
363
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
363
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunkR7MSY2BHjs.numberToHex.call(void 0, blockNumber) : void 0;
|
364
364
|
let count = null;
|
365
365
|
if (blockHash) {
|
366
366
|
count = await client.request({
|
@@ -373,12 +373,12 @@ async function getBlockTransactionCount(client, {
|
|
373
373
|
params: [blockNumberHex || blockTag]
|
374
374
|
});
|
375
375
|
}
|
376
|
-
return
|
376
|
+
return _chunkR7MSY2BHjs.hexToNumber.call(void 0, count);
|
377
377
|
}
|
378
378
|
|
379
379
|
// src/actions/public/getBytecode.ts
|
380
380
|
async function getBytecode(client, { address, blockNumber, blockTag = "latest" }) {
|
381
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
381
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunkR7MSY2BHjs.numberToHex.call(void 0, blockNumber) : void 0;
|
382
382
|
const hex = await client.request({
|
383
383
|
method: "eth_getCode",
|
384
384
|
params: [address, blockNumberHex || blockTag]
|
@@ -391,7 +391,7 @@ async function getBytecode(client, { address, blockNumber, blockTag = "latest" }
|
|
391
391
|
// src/actions/public/getChainId.ts
|
392
392
|
async function getChainId(client) {
|
393
393
|
const chainIdHex = await client.request({ method: "eth_chainId" });
|
394
|
-
return
|
394
|
+
return _chunkR7MSY2BHjs.hexToNumber.call(void 0, chainIdHex);
|
395
395
|
}
|
396
396
|
|
397
397
|
// src/actions/public/getFeeHistory.ts
|
@@ -401,16 +401,16 @@ async function getFeeHistory(client, {
|
|
401
401
|
blockTag = "latest",
|
402
402
|
rewardPercentiles
|
403
403
|
}) {
|
404
|
-
const blockNumberHex = blockNumber ?
|
404
|
+
const blockNumberHex = blockNumber ? _chunkR7MSY2BHjs.numberToHex.call(void 0, blockNumber) : void 0;
|
405
405
|
const feeHistory = await client.request({
|
406
406
|
method: "eth_feeHistory",
|
407
407
|
params: [
|
408
|
-
|
408
|
+
_chunkR7MSY2BHjs.numberToHex.call(void 0, blockCount),
|
409
409
|
blockNumberHex || blockTag,
|
410
410
|
rewardPercentiles
|
411
411
|
]
|
412
412
|
});
|
413
|
-
return
|
413
|
+
return _chunkR7MSY2BHjs.formatFeeHistory.call(void 0, feeHistory);
|
414
414
|
}
|
415
415
|
|
416
416
|
// src/actions/public/getFilterChanges.ts
|
@@ -422,12 +422,12 @@ async function getFilterChanges(client, { filter }) {
|
|
422
422
|
return logs.map((log) => {
|
423
423
|
if (typeof log === "string")
|
424
424
|
return log;
|
425
|
-
const { eventName, args } = "abi" in filter && filter.abi ?
|
425
|
+
const { eventName, args } = "abi" in filter && filter.abi ? _chunkR7MSY2BHjs.decodeEventLog.call(void 0, {
|
426
426
|
abi: filter.abi,
|
427
427
|
data: log.data,
|
428
428
|
topics: log.topics
|
429
429
|
}) : { eventName: void 0, args: void 0 };
|
430
|
-
return
|
430
|
+
return _chunkR7MSY2BHjs.formatLog.call(void 0, log, { args, eventName });
|
431
431
|
});
|
432
432
|
}
|
433
433
|
|
@@ -438,12 +438,12 @@ async function getFilterLogs(client, { filter }) {
|
|
438
438
|
params: [filter.id]
|
439
439
|
});
|
440
440
|
return logs.map((log) => {
|
441
|
-
const { eventName, args } = "abi" in filter && filter.abi ?
|
441
|
+
const { eventName, args } = "abi" in filter && filter.abi ? _chunkR7MSY2BHjs.decodeEventLog.call(void 0, {
|
442
442
|
abi: filter.abi,
|
443
443
|
data: log.data,
|
444
444
|
topics: log.topics
|
445
445
|
}) : { eventName: void 0, args: void 0 };
|
446
|
-
return
|
446
|
+
return _chunkR7MSY2BHjs.formatLog.call(void 0, log, { args, eventName });
|
447
447
|
});
|
448
448
|
}
|
449
449
|
|
@@ -466,7 +466,7 @@ async function getLogs(client, {
|
|
466
466
|
} = {}) {
|
467
467
|
let topics = [];
|
468
468
|
if (event)
|
469
|
-
topics =
|
469
|
+
topics = _chunkR7MSY2BHjs.encodeEventTopics.call(void 0, {
|
470
470
|
abi: [event],
|
471
471
|
eventName: event.name,
|
472
472
|
args
|
@@ -484,25 +484,25 @@ async function getLogs(client, {
|
|
484
484
|
{
|
485
485
|
address,
|
486
486
|
topics,
|
487
|
-
fromBlock: typeof fromBlock === "bigint" ?
|
488
|
-
toBlock: typeof toBlock === "bigint" ?
|
487
|
+
fromBlock: typeof fromBlock === "bigint" ? _chunkR7MSY2BHjs.numberToHex.call(void 0, fromBlock) : fromBlock,
|
488
|
+
toBlock: typeof toBlock === "bigint" ? _chunkR7MSY2BHjs.numberToHex.call(void 0, toBlock) : toBlock
|
489
489
|
}
|
490
490
|
]
|
491
491
|
});
|
492
492
|
}
|
493
493
|
return logs.map((log) => {
|
494
|
-
const { eventName, args: args2 } = event ?
|
494
|
+
const { eventName, args: args2 } = event ? _chunkR7MSY2BHjs.decodeEventLog.call(void 0, {
|
495
495
|
abi: [event],
|
496
496
|
data: log.data,
|
497
497
|
topics: log.topics
|
498
498
|
}) : { eventName: void 0, args: void 0 };
|
499
|
-
return
|
499
|
+
return _chunkR7MSY2BHjs.formatLog.call(void 0, log, { args: args2, eventName });
|
500
500
|
});
|
501
501
|
}
|
502
502
|
|
503
503
|
// src/actions/public/getStorageAt.ts
|
504
504
|
async function getStorageAt(client, { address, blockNumber, blockTag = "latest", slot }) {
|
505
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
505
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunkR7MSY2BHjs.numberToHex.call(void 0, blockNumber) : void 0;
|
506
506
|
const data = await client.request({
|
507
507
|
method: "eth_getStorageAt",
|
508
508
|
params: [address, slot, blockNumberHex || blockTag]
|
@@ -518,7 +518,7 @@ async function getTransaction(client, {
|
|
518
518
|
hash,
|
519
519
|
index
|
520
520
|
}) {
|
521
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
521
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunkR7MSY2BHjs.numberToHex.call(void 0, blockNumber) : void 0;
|
522
522
|
let transaction = null;
|
523
523
|
if (hash) {
|
524
524
|
transaction = await client.request({
|
@@ -528,24 +528,24 @@ async function getTransaction(client, {
|
|
528
528
|
} else if (blockHash) {
|
529
529
|
transaction = await client.request({
|
530
530
|
method: "eth_getTransactionByBlockHashAndIndex",
|
531
|
-
params: [blockHash,
|
531
|
+
params: [blockHash, _chunkR7MSY2BHjs.numberToHex.call(void 0, index)]
|
532
532
|
});
|
533
533
|
} else if (blockNumberHex || blockTag) {
|
534
534
|
transaction = await client.request({
|
535
535
|
method: "eth_getTransactionByBlockNumberAndIndex",
|
536
|
-
params: [blockNumberHex || blockTag,
|
536
|
+
params: [blockNumberHex || blockTag, _chunkR7MSY2BHjs.numberToHex.call(void 0, index)]
|
537
537
|
});
|
538
538
|
}
|
539
539
|
if (!transaction)
|
540
|
-
throw new (0,
|
540
|
+
throw new (0, _chunkR7MSY2BHjs.TransactionNotFoundError)({
|
541
541
|
blockHash,
|
542
542
|
blockNumber,
|
543
543
|
blockTag,
|
544
544
|
hash,
|
545
545
|
index
|
546
546
|
});
|
547
|
-
return
|
548
|
-
formatter: _optionalChain([client, 'access', _10 => _10.chain, 'optionalAccess', _11 => _11.formatters, 'optionalAccess', _12 => _12.transaction]) ||
|
547
|
+
return _chunkR7MSY2BHjs.format.call(void 0, transaction, {
|
548
|
+
formatter: _optionalChain([client, 'access', _10 => _10.chain, 'optionalAccess', _11 => _11.formatters, 'optionalAccess', _12 => _12.transaction]) || _chunkR7MSY2BHjs.formatTransaction
|
549
549
|
});
|
550
550
|
}
|
551
551
|
|
@@ -565,9 +565,9 @@ async function getTransactionConfirmations(client, { hash, transactionReceipt })
|
|
565
565
|
async function getTransactionCount(client, { address, blockTag = "latest", blockNumber }) {
|
566
566
|
const count = await client.request({
|
567
567
|
method: "eth_getTransactionCount",
|
568
|
-
params: [address, blockNumber ?
|
568
|
+
params: [address, blockNumber ? _chunkR7MSY2BHjs.numberToHex.call(void 0, blockNumber) : blockTag]
|
569
569
|
});
|
570
|
-
return
|
570
|
+
return _chunkR7MSY2BHjs.hexToNumber.call(void 0, count);
|
571
571
|
}
|
572
572
|
|
573
573
|
// src/actions/public/getTransactionReceipt.ts
|
@@ -577,9 +577,9 @@ async function getTransactionReceipt(client, { hash }) {
|
|
577
577
|
params: [hash]
|
578
578
|
});
|
579
579
|
if (!receipt)
|
580
|
-
throw new (0,
|
581
|
-
return
|
582
|
-
formatter: _optionalChain([client, 'access', _15 => _15.chain, 'optionalAccess', _16 => _16.formatters, 'optionalAccess', _17 => _17.transactionReceipt]) ||
|
580
|
+
throw new (0, _chunkR7MSY2BHjs.TransactionReceiptNotFoundError)({ hash });
|
581
|
+
return _chunkR7MSY2BHjs.format.call(void 0, receipt, {
|
582
|
+
formatter: _optionalChain([client, 'access', _15 => _15.chain, 'optionalAccess', _16 => _16.formatters, 'optionalAccess', _17 => _17.transactionReceipt]) || _chunkR7MSY2BHjs.formatTransactionReceipt
|
583
583
|
});
|
584
584
|
}
|
585
585
|
|
@@ -591,7 +591,7 @@ async function readContract(client, {
|
|
591
591
|
functionName,
|
592
592
|
...callRequest
|
593
593
|
}) {
|
594
|
-
const calldata =
|
594
|
+
const calldata = _chunkR7MSY2BHjs.encodeFunctionData.call(void 0, {
|
595
595
|
abi,
|
596
596
|
args,
|
597
597
|
functionName
|
@@ -602,14 +602,14 @@ async function readContract(client, {
|
|
602
602
|
to: address,
|
603
603
|
...callRequest
|
604
604
|
});
|
605
|
-
return
|
605
|
+
return _chunkR7MSY2BHjs.decodeFunctionResult.call(void 0, {
|
606
606
|
abi,
|
607
607
|
args,
|
608
608
|
functionName,
|
609
609
|
data: data || "0x"
|
610
610
|
});
|
611
611
|
} catch (err) {
|
612
|
-
throw
|
612
|
+
throw _chunkR7MSY2BHjs.getContractError.call(void 0, err, {
|
613
613
|
abi,
|
614
614
|
address,
|
615
615
|
args,
|
@@ -630,7 +630,7 @@ async function multicall(client, args) {
|
|
630
630
|
} = args;
|
631
631
|
const calls = contracts.map(({ abi, address, args: args2, functionName }) => {
|
632
632
|
try {
|
633
|
-
const callData =
|
633
|
+
const callData = _chunkR7MSY2BHjs.encodeFunctionData.call(void 0, {
|
634
634
|
abi,
|
635
635
|
args: args2,
|
636
636
|
functionName
|
@@ -641,7 +641,7 @@ async function multicall(client, args) {
|
|
641
641
|
target: address
|
642
642
|
};
|
643
643
|
} catch (err) {
|
644
|
-
const error =
|
644
|
+
const error = _chunkR7MSY2BHjs.getContractError.call(void 0, err, {
|
645
645
|
abi,
|
646
646
|
address,
|
647
647
|
args: args2,
|
@@ -658,7 +658,7 @@ async function multicall(client, args) {
|
|
658
658
|
}
|
659
659
|
});
|
660
660
|
const results = await readContract(client, {
|
661
|
-
abi:
|
661
|
+
abi: _chunkR7MSY2BHjs.multicall3Abi,
|
662
662
|
address: multicallAddress,
|
663
663
|
args: [calls],
|
664
664
|
blockNumber,
|
@@ -670,17 +670,17 @@ async function multicall(client, args) {
|
|
670
670
|
const { abi, address, functionName, args: args2 } = contracts[i];
|
671
671
|
try {
|
672
672
|
if (callData === "0x")
|
673
|
-
throw new (0,
|
673
|
+
throw new (0, _chunkR7MSY2BHjs.AbiDecodingZeroDataError)();
|
674
674
|
if (!success)
|
675
|
-
throw new (0,
|
676
|
-
const result =
|
675
|
+
throw new (0, _chunkR7MSY2BHjs.RawContractError)({ data: returnData });
|
676
|
+
const result = _chunkR7MSY2BHjs.decodeFunctionResult.call(void 0, {
|
677
677
|
abi,
|
678
678
|
data: returnData,
|
679
679
|
functionName
|
680
680
|
});
|
681
681
|
return { result, status: "success" };
|
682
682
|
} catch (err) {
|
683
|
-
const error =
|
683
|
+
const error = _chunkR7MSY2BHjs.getContractError.call(void 0, err, {
|
684
684
|
abi,
|
685
685
|
address,
|
686
686
|
args: args2,
|
@@ -753,12 +753,12 @@ function poll(fn, { emitOnBegin, initialWaitTime, interval }) {
|
|
753
753
|
if (emitOnBegin)
|
754
754
|
data = await fn({ unpoll: unwatch });
|
755
755
|
const initialWait = await _asyncNullishCoalesce(await _optionalChain([initialWaitTime, 'optionalCall', _21 => _21(data)]), async () => ( interval));
|
756
|
-
await
|
756
|
+
await _chunkR7MSY2BHjs.wait.call(void 0, initialWait);
|
757
757
|
const poll2 = async () => {
|
758
758
|
if (!active)
|
759
759
|
return;
|
760
760
|
await fn({ unpoll: unwatch });
|
761
|
-
await
|
761
|
+
await _chunkR7MSY2BHjs.wait.call(void 0, interval);
|
762
762
|
poll2();
|
763
763
|
};
|
764
764
|
poll2();
|
@@ -922,7 +922,7 @@ function watchContractEvent(client, {
|
|
922
922
|
args,
|
923
923
|
fromBlock: blockNumber,
|
924
924
|
toBlock: blockNumber,
|
925
|
-
event:
|
925
|
+
event: _chunkR7MSY2BHjs.getAbiItem.call(void 0, {
|
926
926
|
abi,
|
927
927
|
name: eventName
|
928
928
|
})
|
@@ -1104,7 +1104,7 @@ async function waitForTransactionReceipt(client, {
|
|
1104
1104
|
return new Promise((resolve, reject) => {
|
1105
1105
|
if (timeout)
|
1106
1106
|
setTimeout(
|
1107
|
-
() => reject(new (0,
|
1107
|
+
() => reject(new (0, _chunkR7MSY2BHjs.WaitForTransactionReceiptTimeoutError)({ hash })),
|
1108
1108
|
timeout
|
1109
1109
|
);
|
1110
1110
|
const unobserve = observe(
|
@@ -1134,7 +1134,7 @@ async function waitForTransactionReceipt(client, {
|
|
1134
1134
|
return;
|
1135
1135
|
done(() => emit.resolve(receipt));
|
1136
1136
|
} catch (err) {
|
1137
|
-
if (transaction && (err instanceof
|
1137
|
+
if (transaction && (err instanceof _chunkR7MSY2BHjs.TransactionNotFoundError || err instanceof _chunkR7MSY2BHjs.TransactionReceiptNotFoundError)) {
|
1138
1138
|
replacedTransaction = transaction;
|
1139
1139
|
const block = await getBlock(client, {
|
1140
1140
|
blockNumber,
|
@@ -1213,4 +1213,4 @@ async function waitForTransactionReceipt(client, {
|
|
1213
1213
|
|
1214
1214
|
|
1215
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;
|
1216
|
-
//# sourceMappingURL=chunk-
|
1216
|
+
//# sourceMappingURL=chunk-DHSIBSJL.js.map
|
@@ -2,7 +2,7 @@ import {
|
|
2
2
|
formatTransactionRequest,
|
3
3
|
hexToNumber,
|
4
4
|
numberToHex
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-JB4TWW3U.mjs";
|
6
6
|
|
7
7
|
// src/actions/test/dropTransaction.ts
|
8
8
|
async function dropTransaction(client, { hash }) {
|
@@ -262,4 +262,4 @@ export {
|
|
262
262
|
snapshot,
|
263
263
|
stopImpersonatingAccount
|
264
264
|
};
|
265
|
-
//# sourceMappingURL=chunk-
|
265
|
+
//# sourceMappingURL=chunk-DYALOQ44.mjs.map
|
@@ -28,7 +28,7 @@ import {
|
|
28
28
|
numberToHex,
|
29
29
|
wait,
|
30
30
|
withCache
|
31
|
-
} from "./chunk-
|
31
|
+
} from "./chunk-JB4TWW3U.mjs";
|
32
32
|
|
33
33
|
// src/actions/public/call.ts
|
34
34
|
async function call(client, args) {
|
@@ -1213,4 +1213,4 @@ export {
|
|
1213
1213
|
watchEvent,
|
1214
1214
|
watchPendingTransactions
|
1215
1215
|
};
|
1216
|
-
//# sourceMappingURL=chunk-
|
1216
|
+
//# sourceMappingURL=chunk-HN7IYO7U.mjs.map
|
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
|
|
9
9
|
var package_default = {
|
10
10
|
name: "viem",
|
11
11
|
description: "TypeScript Interface for Ethereum",
|
12
|
-
version: "0.0.1-alpha.
|
12
|
+
version: "0.0.1-alpha.33",
|
13
13
|
scripts: {
|
14
14
|
anvil: "source .env && anvil --fork-url $VITE_ANVIL_FORK_URL --fork-block-number $VITE_ANVIL_BLOCK_NUMBER --block-time $VITE_ANVIL_BLOCK_TIME",
|
15
15
|
bench: "vitest bench --no-threads",
|
@@ -2913,7 +2913,11 @@ var defineTransactionRequest = defineFormatter({
|
|
2913
2913
|
|
2914
2914
|
// src/utils/errors/assertRequest.ts
|
2915
2915
|
function assertRequest(args) {
|
2916
|
-
const { maxFeePerGas, maxPriorityFeePerGas } = args;
|
2916
|
+
const { from, maxFeePerGas, maxPriorityFeePerGas, to } = args;
|
2917
|
+
if (from && !isAddress(from))
|
2918
|
+
throw new InvalidAddressError({ address: from });
|
2919
|
+
if (to && !isAddress(to))
|
2920
|
+
throw new InvalidAddressError({ address: to });
|
2917
2921
|
if (maxFeePerGas && maxFeePerGas > 2n ** 256n - 1n)
|
2918
2922
|
throw new FeeCapTooHighError({ maxFeePerGas });
|
2919
2923
|
if (maxPriorityFeePerGas && maxFeePerGas && maxPriorityFeePerGas > maxFeePerGas)
|
@@ -3459,4 +3463,4 @@ export {
|
|
3459
3463
|
parseEther,
|
3460
3464
|
parseGwei
|
3461
3465
|
};
|
3462
|
-
//# sourceMappingURL=chunk-
|
3466
|
+
//# sourceMappingURL=chunk-JB4TWW3U.mjs.map
|