viem 0.1.20 → 0.2.0-0-2-0.20230320T235312
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/abi.d.ts +3 -3
- package/dist/abi.js +2 -2
- package/dist/abi.mjs +1 -1
- package/dist/account-07d04222.d.ts +74 -0
- package/dist/{chain-1b53ef88.d.ts → chain-b2e88e30.d.ts} +113 -108
- package/dist/{chain-ec8c485d.d.ts → chain-c4f924cf.d.ts} +1 -1
- package/dist/chains.d.ts +3 -3
- package/dist/chains.js +63 -63
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-YFSMUTVA.mjs → chunk-4DIN6KDM.mjs} +2 -2
- package/dist/chunk-4DIN6KDM.mjs.map +1 -0
- package/dist/{chunk-KGXWL2EP.js → chunk-BLB7NERO.js} +19 -19
- package/dist/chunk-BLB7NERO.js.map +1 -0
- package/dist/{chunk-T5H6ROQX.mjs → chunk-KOAJUBTN.mjs} +334 -33
- package/dist/chunk-KOAJUBTN.mjs.map +1 -0
- package/dist/{chunk-FXDLMUBO.js → chunk-T4AH4Y6Y.js} +403 -102
- package/dist/chunk-T4AH4Y6Y.js.map +1 -0
- package/dist/contract.d.ts +8 -7
- package/dist/contract.js +2 -2
- package/dist/contract.mjs +1 -1
- package/dist/{createClient-a28317a9.d.ts → createClient-d4f1dea1.d.ts} +6 -6
- package/dist/{createPublicClient-0021fc35.d.ts → createPublicClient-3a714a8d.d.ts} +154 -207
- package/dist/{eip1193-4f4e240c.d.ts → eip1193-cd3e872a.d.ts} +1 -1
- package/dist/{encodeFunctionResult-1f324375.d.ts → encodeFunctionResult-750c9055.d.ts} +1 -1
- package/dist/{encodePacked-d5d5264a.d.ts → encodePacked-de74201f.d.ts} +1 -1
- package/dist/ens.d.ts +5 -4
- package/dist/ens.js +3 -3
- package/dist/ens.mjs +2 -2
- package/dist/ethers.d.ts +3 -5
- package/dist/ethers.js +3 -3
- package/dist/ethers.js.map +1 -1
- package/dist/ethers.mjs +1 -1
- package/dist/ethers.mjs.map +1 -1
- package/dist/{formatAbiItem-15e8817d.d.ts → formatAbiItem-fdbdda39.d.ts} +1 -1
- package/dist/{getAbiItem-3e809ff9.d.ts → getAbiItem-9d709e3b.d.ts} +1 -1
- package/dist/index.d.ts +14 -13
- package/dist/index.js +101 -91
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{parseGwei-c2fb9fa2.d.ts → parseGwei-f930d155.d.ts} +46 -9
- package/dist/public.d.ts +5 -4
- package/dist/public.js +2 -2
- package/dist/public.mjs +1 -1
- package/dist/{test-a203fdee.d.ts → test-c70126a6.d.ts} +33 -32
- package/dist/test.d.ts +10 -10
- package/dist/test.js +2 -2
- package/dist/test.mjs +1 -1
- package/dist/utils/index.d.ts +28 -18
- package/dist/utils/index.js +10 -2
- package/dist/utils/index.mjs +11 -3
- package/dist/wallet.d.ts +5 -4
- package/dist/wallet.js +2 -2
- package/dist/wallet.mjs +1 -1
- package/dist/window.d.ts +2 -2
- package/package.json +2 -2
- package/dist/chunk-FXDLMUBO.js.map +0 -1
- package/dist/chunk-KGXWL2EP.js.map +0 -1
- package/dist/chunk-T5H6ROQX.mjs.map +0 -1
- package/dist/chunk-YFSMUTVA.mjs.map +0 -1
@@ -13,11 +13,14 @@ var __publicField = (obj, key, value) => {
|
|
13
13
|
|
14
14
|
var _abitype = require('abitype');
|
15
15
|
|
16
|
+
// src/errors/utils.ts
|
17
|
+
|
18
|
+
|
16
19
|
// package.json
|
17
20
|
var package_default = {
|
18
21
|
name: "viem",
|
19
22
|
description: "TypeScript Interface for Ethereum",
|
20
|
-
version: "0.1.
|
23
|
+
version: "0.1.21",
|
21
24
|
scripts: {
|
22
25
|
anvil: "source .env && anvil --fork-url $VITE_ANVIL_FORK_URL --fork-block-number $VITE_ANVIL_BLOCK_NUMBER --block-time $VITE_ANVIL_BLOCK_TIME",
|
23
26
|
bench: "vitest bench --no-threads",
|
@@ -215,7 +218,9 @@ var BaseError = class extends Error {
|
|
215
218
|
shortMessage || "An error occurred.",
|
216
219
|
"",
|
217
220
|
...args.metaMessages ? [...args.metaMessages, ""] : [],
|
218
|
-
...docsPath6 ? [
|
221
|
+
...docsPath6 ? [
|
222
|
+
`Docs: https://viem.sh${docsPath6}.html${args.docsSlug ? `#${args.docsSlug}` : ""}`
|
223
|
+
] : [],
|
219
224
|
...details ? [`Details: ${details}`] : [],
|
220
225
|
`Version: ${getVersion()}`
|
221
226
|
].join("\n");
|
@@ -516,6 +521,23 @@ var UnsupportedPackedAbiType = class extends BaseError {
|
|
516
521
|
}
|
517
522
|
};
|
518
523
|
|
524
|
+
// src/errors/account.ts
|
525
|
+
var AccountNotFoundError = class extends BaseError {
|
526
|
+
constructor({ docsPath: docsPath6 } = {}) {
|
527
|
+
super(
|
528
|
+
[
|
529
|
+
"Could not find an Account to execute with this Action.",
|
530
|
+
"Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."
|
531
|
+
].join("\n"),
|
532
|
+
{
|
533
|
+
docsPath: docsPath6,
|
534
|
+
docsSlug: "account"
|
535
|
+
}
|
536
|
+
);
|
537
|
+
__publicField(this, "name", "AccountNotFoundError");
|
538
|
+
}
|
539
|
+
};
|
540
|
+
|
519
541
|
// src/errors/address.ts
|
520
542
|
var InvalidAddressError = class extends BaseError {
|
521
543
|
constructor({ address }) {
|
@@ -569,7 +591,7 @@ var ChainMismatchError = class extends BaseError {
|
|
569
591
|
currentChainId
|
570
592
|
}) {
|
571
593
|
super(
|
572
|
-
`The current chain (id: ${currentChainId}) does not match the chain
|
594
|
+
`The current chain of the wallet (id: ${currentChainId}) does not match the target chain for the transaction (id: ${chain.id} \u2013 ${chain.name}).`,
|
573
595
|
{
|
574
596
|
metaMessages: [
|
575
597
|
`Current Chain ID: ${currentChainId}`,
|
@@ -580,6 +602,17 @@ var ChainMismatchError = class extends BaseError {
|
|
580
602
|
__publicField(this, "name", "ChainMismatchError");
|
581
603
|
}
|
582
604
|
};
|
605
|
+
var ChainNotFoundError = class extends BaseError {
|
606
|
+
constructor() {
|
607
|
+
super(
|
608
|
+
[
|
609
|
+
"No chain was provided to the request.",
|
610
|
+
"Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."
|
611
|
+
].join("\n")
|
612
|
+
);
|
613
|
+
__publicField(this, "name", "ChainNotFoundError");
|
614
|
+
}
|
615
|
+
};
|
583
616
|
|
584
617
|
// src/constants/abis.ts
|
585
618
|
var multicall3Abi = [
|
@@ -710,9 +743,9 @@ var TransactionExecutionError = class extends BaseError {
|
|
710
743
|
}) {
|
711
744
|
const prettyArgs = prettyPrint({
|
712
745
|
chain: chain && `${_optionalChain([chain, 'optionalAccess', _4 => _4.name])} (id: ${_optionalChain([chain, 'optionalAccess', _5 => _5.id])})`,
|
713
|
-
from: account.address,
|
746
|
+
from: _optionalChain([account, 'optionalAccess', _6 => _6.address]),
|
714
747
|
to,
|
715
|
-
value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess',
|
748
|
+
value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess', _7 => _7.nativeCurrency, 'access', _8 => _8.symbol]) || "ETH"}`,
|
716
749
|
data,
|
717
750
|
gas,
|
718
751
|
gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
|
@@ -775,7 +808,7 @@ var WaitForTransactionReceiptTimeoutError = class extends BaseError {
|
|
775
808
|
// src/errors/contract.ts
|
776
809
|
var CallExecutionError = class extends BaseError {
|
777
810
|
constructor(cause, {
|
778
|
-
account,
|
811
|
+
account: account_,
|
779
812
|
docsPath: docsPath6,
|
780
813
|
chain,
|
781
814
|
data,
|
@@ -787,10 +820,11 @@ var CallExecutionError = class extends BaseError {
|
|
787
820
|
to,
|
788
821
|
value
|
789
822
|
}) {
|
823
|
+
const account = account_ ? parseAccount(account_) : void 0;
|
790
824
|
const prettyArgs = prettyPrint({
|
791
|
-
from: _optionalChain([account, 'optionalAccess',
|
825
|
+
from: _optionalChain([account, 'optionalAccess', _9 => _9.address]),
|
792
826
|
to,
|
793
|
-
value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess',
|
827
|
+
value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess', _10 => _10.nativeCurrency, 'access', _11 => _11.symbol]) || "ETH"}`,
|
794
828
|
data,
|
795
829
|
gas,
|
796
830
|
gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
|
@@ -832,7 +866,7 @@ var ContractFunctionExecutionError = class extends BaseError {
|
|
832
866
|
const prettyArgs = prettyPrint({
|
833
867
|
address: contractAddress && getContractAddress(contractAddress),
|
834
868
|
function: functionWithParams,
|
835
|
-
args: formattedArgs && formattedArgs !== "()" && `${[...Array(_nullishCoalesce(_optionalChain([functionName, 'optionalAccess',
|
869
|
+
args: formattedArgs && formattedArgs !== "()" && `${[...Array(_nullishCoalesce(_optionalChain([functionName, 'optionalAccess', _12 => _12.length]), () => ( 0))).keys()].map(() => " ").join("")}${formattedArgs}`,
|
836
870
|
sender
|
837
871
|
});
|
838
872
|
super(
|
@@ -891,7 +925,7 @@ var ContractFunctionRevertedError = class extends BaseError {
|
|
891
925
|
}) : void 0;
|
892
926
|
metaMessages = [
|
893
927
|
errorWithParams ? `Error: ${errorWithParams}` : "",
|
894
|
-
formattedArgs && formattedArgs !== "()" ? ` ${[...Array(_nullishCoalesce(_optionalChain([errorName, 'optionalAccess',
|
928
|
+
formattedArgs && formattedArgs !== "()" ? ` ${[...Array(_nullishCoalesce(_optionalChain([errorName, 'optionalAccess', _13 => _13.length]), () => ( 0))).keys()].map(() => " ").join("")}${formattedArgs}` : ""
|
895
929
|
];
|
896
930
|
}
|
897
931
|
} else if (message)
|
@@ -1029,9 +1063,9 @@ var EstimateGasExecutionError = class extends BaseError {
|
|
1029
1063
|
value
|
1030
1064
|
}) {
|
1031
1065
|
const prettyArgs = prettyPrint({
|
1032
|
-
from: account.address,
|
1066
|
+
from: _optionalChain([account, 'optionalAccess', _14 => _14.address]),
|
1033
1067
|
to,
|
1034
|
-
value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess',
|
1068
|
+
value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess', _15 => _15.nativeCurrency, 'access', _16 => _16.symbol]) || "ETH"}`,
|
1035
1069
|
data,
|
1036
1070
|
gas,
|
1037
1071
|
gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
|
@@ -1068,7 +1102,7 @@ var ExecutionRevertedError = class extends BaseError {
|
|
1068
1102
|
cause,
|
1069
1103
|
message
|
1070
1104
|
} = {}) {
|
1071
|
-
const reason = _optionalChain([message, 'optionalAccess',
|
1105
|
+
const reason = _optionalChain([message, 'optionalAccess', _17 => _17.replace, 'call', _18 => _18("execution reverted: ", ""), 'optionalAccess', _19 => _19.replace, 'call', _20 => _20("execution reverted", "")]);
|
1072
1106
|
super(
|
1073
1107
|
`Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`,
|
1074
1108
|
{
|
@@ -1220,7 +1254,7 @@ var TipAboveFeeCapError = class extends BaseError {
|
|
1220
1254
|
__publicField(TipAboveFeeCapError, "nodeMessage", /max priority fee per gas higher than max fee per gas|tip higher than fee cap/);
|
1221
1255
|
var UnknownNodeError = class extends BaseError {
|
1222
1256
|
constructor({ cause }) {
|
1223
|
-
super(`An error occurred while executing: ${_optionalChain([cause, 'optionalAccess',
|
1257
|
+
super(`An error occurred while executing: ${_optionalChain([cause, 'optionalAccess', _21 => _21.message])}`, {
|
1224
1258
|
cause
|
1225
1259
|
});
|
1226
1260
|
__publicField(this, "name", "UnknownNodeError");
|
@@ -1871,9 +1905,9 @@ function rlpToBytes(bytes, offset = 0) {
|
|
1871
1905
|
var paramsRegex = /((function|event)\s)?(.*)(\((.*)\))/;
|
1872
1906
|
function extractFunctionParts(def) {
|
1873
1907
|
const parts = def.match(paramsRegex);
|
1874
|
-
const type = _optionalChain([parts, 'optionalAccess',
|
1875
|
-
const name = _optionalChain([parts, 'optionalAccess',
|
1876
|
-
const params = _optionalChain([parts, 'optionalAccess',
|
1908
|
+
const type = _optionalChain([parts, 'optionalAccess', _22 => _22[2]]) || void 0;
|
1909
|
+
const name = _optionalChain([parts, 'optionalAccess', _23 => _23[3]]);
|
1910
|
+
const params = _optionalChain([parts, 'optionalAccess', _24 => _24[5]]) || void 0;
|
1877
1911
|
return { type, name, params };
|
1878
1912
|
}
|
1879
1913
|
function extractFunctionName(def) {
|
@@ -1881,8 +1915,8 @@ function extractFunctionName(def) {
|
|
1881
1915
|
}
|
1882
1916
|
function extractFunctionParams(def) {
|
1883
1917
|
const params = extractFunctionParts(def).params;
|
1884
|
-
const splitParams = _optionalChain([params, 'optionalAccess',
|
1885
|
-
return _optionalChain([splitParams, 'optionalAccess',
|
1918
|
+
const splitParams = _optionalChain([params, 'optionalAccess', _25 => _25.split, 'call', _26 => _26(","), 'access', _27 => _27.map, 'call', _28 => _28((x) => x.trim().split(" "))]);
|
1919
|
+
return _optionalChain([splitParams, 'optionalAccess', _29 => _29.map, 'call', _30 => _30((param) => ({
|
1886
1920
|
type: param[0],
|
1887
1921
|
name: param[1] === "indexed" ? param[2] : param[1],
|
1888
1922
|
...param[1] === "indexed" ? { indexed: true } : {}
|
@@ -2284,7 +2318,7 @@ function decodeArray(data, {
|
|
2284
2318
|
}
|
2285
2319
|
if (hasDynamicChild(param)) {
|
2286
2320
|
const arrayComponents = getArrayComponents(param.type);
|
2287
|
-
const dynamicChild = !_optionalChain([arrayComponents, 'optionalAccess',
|
2321
|
+
const dynamicChild = !_optionalChain([arrayComponents, 'optionalAccess', _31 => _31[0]]);
|
2288
2322
|
let consumed2 = 0;
|
2289
2323
|
let value2 = [];
|
2290
2324
|
for (let i = 0; i < length; ++i) {
|
@@ -2360,7 +2394,7 @@ function decodeTuple(data, { param, position }) {
|
|
2360
2394
|
position: consumed
|
2361
2395
|
});
|
2362
2396
|
consumed += decodedChild.consumed;
|
2363
|
-
value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess',
|
2397
|
+
value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess', _32 => _32.name])] = decodedChild.value;
|
2364
2398
|
}
|
2365
2399
|
return { consumed: 32, value };
|
2366
2400
|
}
|
@@ -2372,7 +2406,7 @@ function decodeTuple(data, { param, position }) {
|
|
2372
2406
|
position: position + consumed
|
2373
2407
|
});
|
2374
2408
|
consumed += decodedChild.consumed;
|
2375
|
-
value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess',
|
2409
|
+
value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess', _33 => _33.name])] = decodedChild.value;
|
2376
2410
|
}
|
2377
2411
|
return { consumed, value };
|
2378
2412
|
}
|
@@ -2385,7 +2419,7 @@ function hasDynamicChild(param) {
|
|
2385
2419
|
if (type.endsWith("[]"))
|
2386
2420
|
return true;
|
2387
2421
|
if (type === "tuple")
|
2388
|
-
return _optionalChain([param, 'access',
|
2422
|
+
return _optionalChain([param, 'access', _34 => _34.components, 'optionalAccess', _35 => _35.some, 'call', _36 => _36(hasDynamicChild)]);
|
2389
2423
|
const arrayComponents = getArrayComponents(param.type);
|
2390
2424
|
if (arrayComponents && hasDynamicChild({ ...param, type: arrayComponents[1] }))
|
2391
2425
|
return true;
|
@@ -2456,7 +2490,7 @@ function decodeEventLog({
|
|
2456
2490
|
docsPath
|
2457
2491
|
});
|
2458
2492
|
const { name, inputs } = abiItem;
|
2459
|
-
const isUnnamed = _optionalChain([inputs, 'optionalAccess',
|
2493
|
+
const isUnnamed = _optionalChain([inputs, 'optionalAccess', _37 => _37.some, 'call', _38 => _38((x) => !("name" in x && x.name))]);
|
2460
2494
|
let args = isUnnamed ? [] : {};
|
2461
2495
|
if (argTopics.length > 0) {
|
2462
2496
|
const indexedInputs = inputs.filter((x) => "indexed" in x && x.indexed);
|
@@ -2677,8 +2711,8 @@ function encodeEventTopics({ abi, eventName, args }) {
|
|
2677
2711
|
const signature = getEventSelector(definition);
|
2678
2712
|
let topics = [];
|
2679
2713
|
if (args && "inputs" in abiItem) {
|
2680
|
-
const args_ = Array.isArray(args) ? args : _nullishCoalesce(_optionalChain([abiItem, 'access',
|
2681
|
-
topics = _nullishCoalesce(_optionalChain([abiItem, 'access',
|
2714
|
+
const args_ = Array.isArray(args) ? args : _nullishCoalesce(_optionalChain([abiItem, 'access', _39 => _39.inputs, 'optionalAccess', _40 => _40.map, 'call', _41 => _41((x) => args[x.name])]), () => ( []));
|
2715
|
+
topics = _nullishCoalesce(_optionalChain([abiItem, 'access', _42 => _42.inputs, 'optionalAccess', _43 => _43.filter, 'call', _44 => _44((param) => "indexed" in param && param.indexed), 'access', _45 => _45.map, 'call', _46 => _46(
|
2682
2716
|
(param, i) => Array.isArray(args_[i]) ? args_[i].map(
|
2683
2717
|
(_, j) => encodeArg({ param, value: args_[i][j] })
|
2684
2718
|
) : args_[i] ? encodeArg({ param, value: args_[i] }) : null
|
@@ -2826,19 +2860,30 @@ function formatAbiItemWithArgs({
|
|
2826
2860
|
}
|
2827
2861
|
|
2828
2862
|
// src/utils/account.ts
|
2829
|
-
function getAccount(
|
2830
|
-
if (typeof
|
2831
|
-
if (!isAddress(
|
2832
|
-
throw new InvalidAddressError({ address:
|
2833
|
-
return {
|
2863
|
+
function getAccount(source) {
|
2864
|
+
if (typeof source === "string") {
|
2865
|
+
if (!isAddress(source))
|
2866
|
+
throw new InvalidAddressError({ address: source });
|
2867
|
+
return {
|
2868
|
+
address: source,
|
2869
|
+
type: "json-rpc"
|
2870
|
+
};
|
2834
2871
|
}
|
2835
|
-
if (!isAddress(
|
2836
|
-
throw new InvalidAddressError({ address:
|
2872
|
+
if (!isAddress(source.address))
|
2873
|
+
throw new InvalidAddressError({ address: source.address });
|
2837
2874
|
return {
|
2838
|
-
|
2875
|
+
address: source.address,
|
2876
|
+
signMessage: source.signMessage,
|
2877
|
+
signTransaction: source.signTransaction,
|
2878
|
+
signTypedData: source.signTypedData,
|
2839
2879
|
type: "local"
|
2840
2880
|
};
|
2841
2881
|
}
|
2882
|
+
function parseAccount(account) {
|
2883
|
+
if (typeof account === "string")
|
2884
|
+
return { address: account, type: "json-rpc" };
|
2885
|
+
return account;
|
2886
|
+
}
|
2842
2887
|
|
2843
2888
|
// src/utils/promise/withCache.ts
|
2844
2889
|
var promiseCache = /* @__PURE__ */ new Map();
|
@@ -2935,7 +2980,7 @@ function withTimeout(fn, {
|
|
2935
2980
|
}
|
2936
2981
|
}, timeout);
|
2937
2982
|
}
|
2938
|
-
resolve(await fn({ signal: _optionalChain([controller, 'optionalAccess',
|
2983
|
+
resolve(await fn({ signal: _optionalChain([controller, 'optionalAccess', _47 => _47.signal]) }));
|
2939
2984
|
} catch (err) {
|
2940
2985
|
if (err.name === "AbortError")
|
2941
2986
|
reject(errorInstance);
|
@@ -3001,8 +3046,8 @@ function buildRequest(request, {
|
|
3001
3046
|
{
|
3002
3047
|
delay: ({ count, error }) => {
|
3003
3048
|
if (error && error instanceof HttpRequestError) {
|
3004
|
-
const retryAfter = _optionalChain([error, 'optionalAccess',
|
3005
|
-
if (_optionalChain([retryAfter, 'optionalAccess',
|
3049
|
+
const retryAfter = _optionalChain([error, 'optionalAccess', _48 => _48.headers, 'optionalAccess', _49 => _49.get, 'call', _50 => _50("Retry-After")]);
|
3050
|
+
if (_optionalChain([retryAfter, 'optionalAccess', _51 => _51.match, 'call', _52 => _52(/\d/)]))
|
3006
3051
|
return parseInt(retryAfter) * 1e3;
|
3007
3052
|
}
|
3008
3053
|
return ~~(1 << count) * retryDelay;
|
@@ -3022,7 +3067,7 @@ function getChainContractAddress({
|
|
3022
3067
|
chain,
|
3023
3068
|
contract: name
|
3024
3069
|
}) {
|
3025
|
-
const contract = _optionalChain([chain, 'optionalAccess',
|
3070
|
+
const contract = _optionalChain([chain, 'optionalAccess', _53 => _53.contracts, 'optionalAccess', _54 => _54[name]]);
|
3026
3071
|
if (!contract)
|
3027
3072
|
throw new ChainDoesNotSupportContract({
|
3028
3073
|
chain,
|
@@ -3059,7 +3104,7 @@ function defineFormatter({
|
|
3059
3104
|
}
|
3060
3105
|
return {
|
3061
3106
|
...formatted,
|
3062
|
-
..._optionalChain([formatOverride, 'optionalCall',
|
3107
|
+
..._optionalChain([formatOverride, 'optionalCall', _55 => _55(data)])
|
3063
3108
|
};
|
3064
3109
|
};
|
3065
3110
|
}
|
@@ -3102,7 +3147,7 @@ var defineTransaction = defineFormatter({ format: formatTransaction });
|
|
3102
3147
|
|
3103
3148
|
// src/utils/formatters/block.ts
|
3104
3149
|
function formatBlock(block) {
|
3105
|
-
const transactions = _optionalChain([block, 'access',
|
3150
|
+
const transactions = _optionalChain([block, 'access', _56 => _56.transactions, 'optionalAccess', _57 => _57.map, 'call', _58 => _58((transaction) => {
|
3106
3151
|
if (typeof transaction === "string")
|
3107
3152
|
return transaction;
|
3108
3153
|
return formatTransaction(transaction);
|
@@ -3131,7 +3176,7 @@ function extract(value, { formatter }) {
|
|
3131
3176
|
return {};
|
3132
3177
|
const keys = Object.keys(formatter({}));
|
3133
3178
|
return keys.reduce((data, key) => {
|
3134
|
-
if (_optionalChain([value, 'optionalAccess',
|
3179
|
+
if (_optionalChain([value, 'optionalAccess', _59 => _59.hasOwnProperty, 'call', _60 => _60(key)])) {
|
3135
3180
|
;
|
3136
3181
|
data[key] = value[key];
|
3137
3182
|
}
|
@@ -3145,7 +3190,7 @@ function formatFeeHistory(feeHistory) {
|
|
3145
3190
|
baseFeePerGas: feeHistory.baseFeePerGas.map((value) => BigInt(value)),
|
3146
3191
|
gasUsedRatio: feeHistory.gasUsedRatio,
|
3147
3192
|
oldestBlock: BigInt(feeHistory.oldestBlock),
|
3148
|
-
reward: _optionalChain([feeHistory, 'access',
|
3193
|
+
reward: _optionalChain([feeHistory, 'access', _61 => _61.reward, 'optionalAccess', _62 => _62.map, 'call', _63 => _63(
|
3149
3194
|
(reward) => reward.map((value) => BigInt(value))
|
3150
3195
|
)])
|
3151
3196
|
};
|
@@ -3213,34 +3258,34 @@ function getNodeError(err, args) {
|
|
3213
3258
|
if (FeeCapTooHighError.nodeMessage.test(message))
|
3214
3259
|
return new FeeCapTooHighError({
|
3215
3260
|
cause: err,
|
3216
|
-
maxFeePerGas: _optionalChain([args, 'optionalAccess',
|
3261
|
+
maxFeePerGas: _optionalChain([args, 'optionalAccess', _64 => _64.maxFeePerGas])
|
3217
3262
|
});
|
3218
3263
|
else if (FeeCapTooLowError.nodeMessage.test(message))
|
3219
3264
|
return new FeeCapTooLowError({
|
3220
3265
|
cause: err,
|
3221
|
-
maxFeePerGas: _optionalChain([args, 'optionalAccess',
|
3266
|
+
maxFeePerGas: _optionalChain([args, 'optionalAccess', _65 => _65.maxFeePerGas])
|
3222
3267
|
});
|
3223
3268
|
else if (NonceTooHighError.nodeMessage.test(message))
|
3224
|
-
return new NonceTooHighError({ cause: err, nonce: _optionalChain([args, 'optionalAccess',
|
3269
|
+
return new NonceTooHighError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _66 => _66.nonce]) });
|
3225
3270
|
else if (NonceTooLowError.nodeMessage.test(message))
|
3226
|
-
return new NonceTooLowError({ cause: err, nonce: _optionalChain([args, 'optionalAccess',
|
3271
|
+
return new NonceTooLowError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _67 => _67.nonce]) });
|
3227
3272
|
else if (NonceMaxValueError.nodeMessage.test(message))
|
3228
|
-
return new NonceMaxValueError({ cause: err, nonce: _optionalChain([args, 'optionalAccess',
|
3273
|
+
return new NonceMaxValueError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _68 => _68.nonce]) });
|
3229
3274
|
else if (InsufficientFundsError.nodeMessage.test(message))
|
3230
3275
|
return new InsufficientFundsError({ cause: err });
|
3231
3276
|
else if (IntrinsicGasTooHighError.nodeMessage.test(message))
|
3232
|
-
return new IntrinsicGasTooHighError({ cause: err, gas: _optionalChain([args, 'optionalAccess',
|
3277
|
+
return new IntrinsicGasTooHighError({ cause: err, gas: _optionalChain([args, 'optionalAccess', _69 => _69.gas]) });
|
3233
3278
|
else if (IntrinsicGasTooLowError.nodeMessage.test(message))
|
3234
|
-
return new IntrinsicGasTooLowError({ cause: err, gas: _optionalChain([args, 'optionalAccess',
|
3279
|
+
return new IntrinsicGasTooLowError({ cause: err, gas: _optionalChain([args, 'optionalAccess', _70 => _70.gas]) });
|
3235
3280
|
else if (TransactionTypeNotSupportedError.nodeMessage.test(message))
|
3236
3281
|
return new TransactionTypeNotSupportedError({ cause: err });
|
3237
3282
|
else if (TipAboveFeeCapError.nodeMessage.test(message))
|
3238
3283
|
return new TipAboveFeeCapError({
|
3239
3284
|
cause: err,
|
3240
|
-
maxFeePerGas: _optionalChain([args, 'optionalAccess',
|
3241
|
-
maxPriorityFeePerGas: _optionalChain([args, 'optionalAccess',
|
3285
|
+
maxFeePerGas: _optionalChain([args, 'optionalAccess', _71 => _71.maxFeePerGas]),
|
3286
|
+
maxPriorityFeePerGas: _optionalChain([args, 'optionalAccess', _72 => _72.maxPriorityFeePerGas])
|
3242
3287
|
});
|
3243
|
-
else if (message.match(ExecutionRevertedError.nodeMessage) || "code" in err.cause && _optionalChain([err, 'access',
|
3288
|
+
else if (message.match(ExecutionRevertedError.nodeMessage) || "code" in err.cause && _optionalChain([err, 'access', _73 => _73.cause, 'optionalAccess', _74 => _74.code]) === ExecutionRevertedError.code)
|
3244
3289
|
return new ExecutionRevertedError({
|
3245
3290
|
cause: err,
|
3246
3291
|
message: err.cause.details
|
@@ -3274,7 +3319,7 @@ function getContractError(err, {
|
|
3274
3319
|
functionName,
|
3275
3320
|
sender
|
3276
3321
|
}) {
|
3277
|
-
const { code, data, message } = err instanceof RawContractError ? err : err instanceof CallExecutionError || err instanceof EstimateGasExecutionError ? _optionalChain([err, 'access',
|
3322
|
+
const { code, data, message } = err instanceof RawContractError ? err : err instanceof CallExecutionError || err instanceof EstimateGasExecutionError ? _optionalChain([err, 'access', _75 => _75.cause, 'optionalAccess', _76 => _76.cause, 'optionalAccess', _77 => _77.cause]) || {} : err.cause || {};
|
3278
3323
|
let cause = err;
|
3279
3324
|
if (err instanceof AbiDecodingZeroDataError) {
|
3280
3325
|
cause = new ContractFunctionZeroDataError({ functionName });
|
@@ -3363,7 +3408,7 @@ async function http(url, { body, fetchOptions = {}, timeout = 1e4 }) {
|
|
3363
3408
|
}
|
3364
3409
|
);
|
3365
3410
|
let data;
|
3366
|
-
if (_optionalChain([response, 'access',
|
3411
|
+
if (_optionalChain([response, 'access', _78 => _78.headers, 'access', _79 => _79.get, 'call', _80 => _80("Content-Type"), 'optionalAccess', _81 => _81.startsWith, 'call', _82 => _82("application/json")])) {
|
3367
3412
|
data = await response.json();
|
3368
3413
|
} else {
|
3369
3414
|
data = await response.text();
|
@@ -3455,15 +3500,15 @@ function webSocket(socket, {
|
|
3455
3500
|
if (typeof message.id === "number" && id_ !== message.id)
|
3456
3501
|
return;
|
3457
3502
|
if (message.error) {
|
3458
|
-
_optionalChain([onError, 'optionalCall',
|
3503
|
+
_optionalChain([onError, 'optionalCall', _83 => _83(new RpcError({ body, error: message.error, url: socket.url }))]);
|
3459
3504
|
} else {
|
3460
|
-
_optionalChain([onData, 'optionalCall',
|
3505
|
+
_optionalChain([onData, 'optionalCall', _84 => _84(message)]);
|
3461
3506
|
}
|
3462
3507
|
if (body.method === "eth_subscribe" && typeof message.result === "string") {
|
3463
3508
|
socket.subscriptions.set(message.result, callback);
|
3464
3509
|
}
|
3465
3510
|
if (body.method === "eth_unsubscribe") {
|
3466
|
-
socket.subscriptions.delete(_optionalChain([body, 'access',
|
3511
|
+
socket.subscriptions.delete(_optionalChain([body, 'access', _85 => _85.params, 'optionalAccess', _86 => _86[0]]));
|
3467
3512
|
}
|
3468
3513
|
};
|
3469
3514
|
socket.requests.set(id_, callback);
|
@@ -3504,6 +3549,163 @@ ${messageBytes.length}`
|
|
3504
3549
|
return keccak256(concat([prefixBytes, messageBytes]), to_);
|
3505
3550
|
}
|
3506
3551
|
|
3552
|
+
// src/utils/signature/hashTypedData.ts
|
3553
|
+
function hashTypedData({
|
3554
|
+
domain,
|
3555
|
+
message,
|
3556
|
+
primaryType,
|
3557
|
+
types: types_
|
3558
|
+
}) {
|
3559
|
+
const types = {
|
3560
|
+
EIP712Domain: [
|
3561
|
+
_optionalChain([domain, 'optionalAccess', _87 => _87.name]) && { name: "name", type: "string" },
|
3562
|
+
_optionalChain([domain, 'optionalAccess', _88 => _88.version]) && { name: "version", type: "string" },
|
3563
|
+
_optionalChain([domain, 'optionalAccess', _89 => _89.chainId]) && { name: "chainId", type: "uint256" },
|
3564
|
+
_optionalChain([domain, 'optionalAccess', _90 => _90.verifyingContract]) && {
|
3565
|
+
name: "verifyingContract",
|
3566
|
+
type: "address"
|
3567
|
+
},
|
3568
|
+
_optionalChain([domain, 'optionalAccess', _91 => _91.salt]) && { name: "salt", type: "bytes32" }
|
3569
|
+
].filter(Boolean),
|
3570
|
+
...types_
|
3571
|
+
};
|
3572
|
+
let parts = ["0x1901"];
|
3573
|
+
if (domain)
|
3574
|
+
parts.push(
|
3575
|
+
hashDomain({
|
3576
|
+
domain,
|
3577
|
+
types
|
3578
|
+
})
|
3579
|
+
);
|
3580
|
+
if (primaryType !== "EIP712Domain") {
|
3581
|
+
parts.push(
|
3582
|
+
hashStruct({
|
3583
|
+
data: message,
|
3584
|
+
primaryType,
|
3585
|
+
types
|
3586
|
+
})
|
3587
|
+
);
|
3588
|
+
}
|
3589
|
+
return keccak256(concat(parts));
|
3590
|
+
}
|
3591
|
+
function hashDomain({
|
3592
|
+
domain,
|
3593
|
+
types
|
3594
|
+
}) {
|
3595
|
+
return hashStruct({
|
3596
|
+
data: domain,
|
3597
|
+
primaryType: "EIP712Domain",
|
3598
|
+
types
|
3599
|
+
});
|
3600
|
+
}
|
3601
|
+
function hashStruct({
|
3602
|
+
data,
|
3603
|
+
primaryType,
|
3604
|
+
types
|
3605
|
+
}) {
|
3606
|
+
const encoded = encodeData({
|
3607
|
+
data,
|
3608
|
+
primaryType,
|
3609
|
+
types
|
3610
|
+
});
|
3611
|
+
return keccak256(encoded);
|
3612
|
+
}
|
3613
|
+
function encodeData({
|
3614
|
+
data,
|
3615
|
+
primaryType,
|
3616
|
+
types
|
3617
|
+
}) {
|
3618
|
+
let encodedTypes = [{ type: "bytes32" }];
|
3619
|
+
const encodedValues = [hashType({ primaryType, types })];
|
3620
|
+
for (const field of types[primaryType]) {
|
3621
|
+
const [type, value] = encodeField({
|
3622
|
+
types,
|
3623
|
+
name: field.name,
|
3624
|
+
type: field.type,
|
3625
|
+
value: data[field.name]
|
3626
|
+
});
|
3627
|
+
encodedTypes.push(type);
|
3628
|
+
encodedValues.push(value);
|
3629
|
+
}
|
3630
|
+
return encodeAbiParameters(encodedTypes, encodedValues);
|
3631
|
+
}
|
3632
|
+
function hashType({
|
3633
|
+
primaryType,
|
3634
|
+
types
|
3635
|
+
}) {
|
3636
|
+
const encodedHashType = toHex(encodeType({ primaryType, types }));
|
3637
|
+
return keccak256(encodedHashType);
|
3638
|
+
}
|
3639
|
+
function encodeType({
|
3640
|
+
primaryType,
|
3641
|
+
types
|
3642
|
+
}) {
|
3643
|
+
let result = "";
|
3644
|
+
const unsortedDeps = findTypeDependencies({ primaryType, types });
|
3645
|
+
unsortedDeps.delete(primaryType);
|
3646
|
+
const deps = [primaryType, ...Array.from(unsortedDeps).sort()];
|
3647
|
+
for (const type of deps) {
|
3648
|
+
result += `${type}(${types[type].map(({ name, type: t }) => `${t} ${name}`).join(",")})`;
|
3649
|
+
}
|
3650
|
+
return result;
|
3651
|
+
}
|
3652
|
+
function findTypeDependencies({
|
3653
|
+
primaryType: primaryType_,
|
3654
|
+
types
|
3655
|
+
}, results = /* @__PURE__ */ new Set()) {
|
3656
|
+
const match = primaryType_.match(/^\w*/u);
|
3657
|
+
const primaryType = _optionalChain([match, 'optionalAccess', _92 => _92[0]]);
|
3658
|
+
if (results.has(primaryType) || types[primaryType] === void 0) {
|
3659
|
+
return results;
|
3660
|
+
}
|
3661
|
+
results.add(primaryType);
|
3662
|
+
for (const field of types[primaryType]) {
|
3663
|
+
findTypeDependencies({ primaryType: field.type, types }, results);
|
3664
|
+
}
|
3665
|
+
return results;
|
3666
|
+
}
|
3667
|
+
function encodeField({
|
3668
|
+
types,
|
3669
|
+
name,
|
3670
|
+
type,
|
3671
|
+
value
|
3672
|
+
}) {
|
3673
|
+
if (types[type] !== void 0) {
|
3674
|
+
return [
|
3675
|
+
{ type: "bytes32" },
|
3676
|
+
keccak256(encodeData({ data: value, primaryType: type, types }))
|
3677
|
+
];
|
3678
|
+
}
|
3679
|
+
if (type === "bytes") {
|
3680
|
+
const prepend = value.length % 2 ? "0" : "";
|
3681
|
+
value = `0x${prepend + value.slice(2)}`;
|
3682
|
+
return [{ type: "bytes32" }, keccak256(value)];
|
3683
|
+
}
|
3684
|
+
if (type === "string")
|
3685
|
+
return [{ type: "bytes32" }, keccak256(toHex(value))];
|
3686
|
+
if (type.lastIndexOf("]") === type.length - 1) {
|
3687
|
+
const parsedType = type.slice(0, type.lastIndexOf("["));
|
3688
|
+
const typeValuePairs = value.map(
|
3689
|
+
(item) => encodeField({
|
3690
|
+
name,
|
3691
|
+
type: parsedType,
|
3692
|
+
types,
|
3693
|
+
value: item
|
3694
|
+
})
|
3695
|
+
);
|
3696
|
+
return [
|
3697
|
+
{ type: "bytes32" },
|
3698
|
+
keccak256(
|
3699
|
+
encodeAbiParameters(
|
3700
|
+
typeValuePairs.map(([t]) => t),
|
3701
|
+
typeValuePairs.map(([, v]) => v)
|
3702
|
+
)
|
3703
|
+
)
|
3704
|
+
];
|
3705
|
+
}
|
3706
|
+
return [{ type }, value];
|
3707
|
+
}
|
3708
|
+
|
3507
3709
|
// src/utils/signature/recoverAddress.ts
|
3508
3710
|
var _secp256k1 = require('@noble/secp256k1');
|
3509
3711
|
function recoverAddress({
|
@@ -3532,6 +3734,25 @@ function recoverMessageAddress({
|
|
3532
3734
|
return recoverAddress({ hash: hashMessage(message), signature });
|
3533
3735
|
}
|
3534
3736
|
|
3737
|
+
// src/utils/signature/recoverTypedDataAddress.ts
|
3738
|
+
function recoverTypedDataAddress({
|
3739
|
+
domain,
|
3740
|
+
message,
|
3741
|
+
primaryType,
|
3742
|
+
signature,
|
3743
|
+
types
|
3744
|
+
}) {
|
3745
|
+
return recoverAddress({
|
3746
|
+
hash: hashTypedData({
|
3747
|
+
domain,
|
3748
|
+
message,
|
3749
|
+
primaryType,
|
3750
|
+
types
|
3751
|
+
}),
|
3752
|
+
signature
|
3753
|
+
});
|
3754
|
+
}
|
3755
|
+
|
3535
3756
|
// src/utils/signature/verifyMessage.ts
|
3536
3757
|
function verifyMessage({
|
3537
3758
|
address,
|
@@ -3544,9 +3765,37 @@ function verifyMessage({
|
|
3544
3765
|
);
|
3545
3766
|
}
|
3546
3767
|
|
3768
|
+
// src/utils/signature/verifyTypedData.ts
|
3769
|
+
function verifyTypedData({
|
3770
|
+
address,
|
3771
|
+
domain,
|
3772
|
+
message,
|
3773
|
+
primaryType,
|
3774
|
+
signature,
|
3775
|
+
types
|
3776
|
+
}) {
|
3777
|
+
return isAddressEqual(
|
3778
|
+
getAddress(address),
|
3779
|
+
recoverTypedDataAddress({
|
3780
|
+
domain,
|
3781
|
+
message,
|
3782
|
+
primaryType,
|
3783
|
+
signature,
|
3784
|
+
types
|
3785
|
+
})
|
3786
|
+
);
|
3787
|
+
}
|
3788
|
+
|
3547
3789
|
// src/utils/transaction/assertRequest.ts
|
3548
3790
|
function assertRequest(args) {
|
3549
|
-
const {
|
3791
|
+
const {
|
3792
|
+
account: account_,
|
3793
|
+
gasPrice,
|
3794
|
+
maxFeePerGas,
|
3795
|
+
maxPriorityFeePerGas,
|
3796
|
+
to
|
3797
|
+
} = args;
|
3798
|
+
const account = account_ ? parseAccount(account_) : void 0;
|
3550
3799
|
if (account && !isAddress(account.address))
|
3551
3800
|
throw new InvalidAddressError({ address: account.address });
|
3552
3801
|
if (to && !isAddress(to))
|
@@ -3562,7 +3811,7 @@ function assertRequest(args) {
|
|
3562
3811
|
// src/actions/public/call.ts
|
3563
3812
|
async function call(client, args) {
|
3564
3813
|
const {
|
3565
|
-
account,
|
3814
|
+
account: account_,
|
3566
3815
|
blockNumber,
|
3567
3816
|
blockTag = "latest",
|
3568
3817
|
accessList,
|
@@ -3576,13 +3825,14 @@ async function call(client, args) {
|
|
3576
3825
|
value,
|
3577
3826
|
...rest
|
3578
3827
|
} = args;
|
3828
|
+
const account = account_ ? parseAccount(account_) : void 0;
|
3579
3829
|
try {
|
3580
3830
|
assertRequest(args);
|
3581
3831
|
const blockNumberHex = blockNumber ? numberToHex(blockNumber) : void 0;
|
3582
|
-
const formatter = _optionalChain([client, 'access',
|
3832
|
+
const formatter = _optionalChain([client, 'access', _93 => _93.chain, 'optionalAccess', _94 => _94.formatters, 'optionalAccess', _95 => _95.transactionRequest]);
|
3583
3833
|
const request_ = format3(
|
3584
3834
|
{
|
3585
|
-
from: _optionalChain([account, 'optionalAccess',
|
3835
|
+
from: _optionalChain([account, 'optionalAccess', _96 => _96.address]),
|
3586
3836
|
accessList,
|
3587
3837
|
data,
|
3588
3838
|
gas,
|
@@ -3609,6 +3859,7 @@ async function call(client, args) {
|
|
3609
3859
|
} catch (err) {
|
3610
3860
|
throw getCallError(err, {
|
3611
3861
|
...args,
|
3862
|
+
account,
|
3612
3863
|
chain: client.chain
|
3613
3864
|
});
|
3614
3865
|
}
|
@@ -3622,6 +3873,7 @@ async function simulateContract(client, {
|
|
3622
3873
|
functionName,
|
3623
3874
|
...callRequest
|
3624
3875
|
}) {
|
3876
|
+
const account = callRequest.account ? parseAccount(callRequest.account) : void 0;
|
3625
3877
|
const calldata = encodeFunctionData({
|
3626
3878
|
abi,
|
3627
3879
|
args,
|
@@ -3656,7 +3908,7 @@ async function simulateContract(client, {
|
|
3656
3908
|
args,
|
3657
3909
|
docsPath: "/docs/contract/simulateContract",
|
3658
3910
|
functionName,
|
3659
|
-
sender: _optionalChain([
|
3911
|
+
sender: _optionalChain([account, 'optionalAccess', _97 => _97.address])
|
3660
3912
|
});
|
3661
3913
|
}
|
3662
3914
|
}
|
@@ -3748,9 +4000,13 @@ async function createContractEventFilter(client, {
|
|
3748
4000
|
|
3749
4001
|
// src/actions/public/estimateGas.ts
|
3750
4002
|
async function estimateGas(client, args) {
|
4003
|
+
if (!args.account)
|
4004
|
+
throw new AccountNotFoundError({
|
4005
|
+
docsPath: "/docs/actions/public/estimateGas"
|
4006
|
+
});
|
4007
|
+
const account = parseAccount(args.account);
|
3751
4008
|
try {
|
3752
4009
|
const {
|
3753
|
-
account,
|
3754
4010
|
accessList,
|
3755
4011
|
blockNumber,
|
3756
4012
|
blockTag = "latest",
|
@@ -3763,10 +4019,10 @@ async function estimateGas(client, args) {
|
|
3763
4019
|
to,
|
3764
4020
|
value,
|
3765
4021
|
...rest
|
3766
|
-
} =
|
4022
|
+
} = account.type === "local" ? await prepareRequest(client, args) : args;
|
3767
4023
|
const blockNumberHex = blockNumber ? numberToHex(blockNumber) : void 0;
|
3768
4024
|
assertRequest(args);
|
3769
|
-
const formatter = _optionalChain([client, 'access',
|
4025
|
+
const formatter = _optionalChain([client, 'access', _98 => _98.chain, 'optionalAccess', _99 => _99.formatters, 'optionalAccess', _100 => _100.transactionRequest]);
|
3770
4026
|
const request = format3(
|
3771
4027
|
{
|
3772
4028
|
from: account.address,
|
@@ -3794,6 +4050,7 @@ async function estimateGas(client, args) {
|
|
3794
4050
|
} catch (err) {
|
3795
4051
|
throw getEstimateGasError(err, {
|
3796
4052
|
...args,
|
4053
|
+
account,
|
3797
4054
|
chain: client.chain
|
3798
4055
|
});
|
3799
4056
|
}
|
@@ -3807,6 +4064,7 @@ async function estimateContractGas(client, {
|
|
3807
4064
|
functionName,
|
3808
4065
|
...request
|
3809
4066
|
}) {
|
4067
|
+
const account = parseAccount(request.account);
|
3810
4068
|
const data = encodeFunctionData({
|
3811
4069
|
abi,
|
3812
4070
|
args,
|
@@ -3826,7 +4084,7 @@ async function estimateContractGas(client, {
|
|
3826
4084
|
args,
|
3827
4085
|
docsPath: "/docs/contract/simulateContract",
|
3828
4086
|
functionName,
|
3829
|
-
sender: _optionalChain([
|
4087
|
+
sender: _optionalChain([account, 'optionalAccess', _101 => _101.address])
|
3830
4088
|
});
|
3831
4089
|
}
|
3832
4090
|
}
|
@@ -3864,7 +4122,7 @@ async function getBlock(client, {
|
|
3864
4122
|
if (!block)
|
3865
4123
|
throw new BlockNotFoundError({ blockHash, blockNumber });
|
3866
4124
|
return format3(block, {
|
3867
|
-
formatter: _optionalChain([client, 'access',
|
4125
|
+
formatter: _optionalChain([client, 'access', _102 => _102.chain, 'optionalAccess', _103 => _103.formatters, 'optionalAccess', _104 => _104.block]) || formatBlock
|
3868
4126
|
});
|
3869
4127
|
}
|
3870
4128
|
|
@@ -4076,7 +4334,7 @@ async function getTransaction(client, {
|
|
4076
4334
|
index
|
4077
4335
|
});
|
4078
4336
|
return format3(transaction, {
|
4079
|
-
formatter: _optionalChain([client, 'access',
|
4337
|
+
formatter: _optionalChain([client, 'access', _105 => _105.chain, 'optionalAccess', _106 => _106.formatters, 'optionalAccess', _107 => _107.transaction]) || formatTransaction
|
4080
4338
|
});
|
4081
4339
|
}
|
4082
4340
|
|
@@ -4086,7 +4344,7 @@ async function getTransactionConfirmations(client, { hash: hash2, transactionRec
|
|
4086
4344
|
getBlockNumber(client),
|
4087
4345
|
hash2 ? getTransaction(client, { hash: hash2 }) : void 0
|
4088
4346
|
]);
|
4089
|
-
const transactionBlockNumber = _optionalChain([transactionReceipt, 'optionalAccess',
|
4347
|
+
const transactionBlockNumber = _optionalChain([transactionReceipt, 'optionalAccess', _108 => _108.blockNumber]) || _optionalChain([transaction, 'optionalAccess', _109 => _109.blockNumber]);
|
4090
4348
|
if (!transactionBlockNumber)
|
4091
4349
|
return 0n;
|
4092
4350
|
return blockNumber - transactionBlockNumber + 1n;
|
@@ -4110,7 +4368,7 @@ async function getTransactionReceipt(client, { hash: hash2 }) {
|
|
4110
4368
|
if (!receipt)
|
4111
4369
|
throw new TransactionReceiptNotFoundError({ hash: hash2 });
|
4112
4370
|
return format3(receipt, {
|
4113
|
-
formatter: _optionalChain([client, 'access',
|
4371
|
+
formatter: _optionalChain([client, 'access', _110 => _110.chain, 'optionalAccess', _111 => _111.formatters, 'optionalAccess', _112 => _112.transactionReceipt]) || formatTransactionReceipt
|
4114
4372
|
});
|
4115
4373
|
}
|
4116
4374
|
|
@@ -4279,7 +4537,7 @@ function observe(observerId, callbacks, fn) {
|
|
4279
4537
|
const listeners2 = getListeners();
|
4280
4538
|
if (listeners2.length === 0)
|
4281
4539
|
return;
|
4282
|
-
listeners2.forEach((listener) => _optionalChain([listener, 'access',
|
4540
|
+
listeners2.forEach((listener) => _optionalChain([listener, 'access', _113 => _113.fns, 'access', _114 => _114[key], 'optionalCall', _115 => _115(...args)]));
|
4283
4541
|
};
|
4284
4542
|
}
|
4285
4543
|
const cleanup = fn(emit);
|
@@ -4360,7 +4618,7 @@ async function waitForTransactionReceipt(client, {
|
|
4360
4618
|
reason = "cancelled";
|
4361
4619
|
}
|
4362
4620
|
done(() => {
|
4363
|
-
_optionalChain([emit, 'access',
|
4621
|
+
_optionalChain([emit, 'access', _116 => _116.onReplaced, 'optionalCall', _117 => _117({
|
4364
4622
|
reason,
|
4365
4623
|
replacedTransaction,
|
4366
4624
|
transaction: replacementTransaction,
|
@@ -4388,7 +4646,7 @@ function poll(fn, { emitOnBegin, initialWaitTime, interval }) {
|
|
4388
4646
|
let data;
|
4389
4647
|
if (emitOnBegin)
|
4390
4648
|
data = await fn({ unpoll: unwatch });
|
4391
|
-
const initialWait = await _asyncNullishCoalesce(await _optionalChain([initialWaitTime, 'optionalCall',
|
4649
|
+
const initialWait = await _asyncNullishCoalesce(await _optionalChain([initialWaitTime, 'optionalCall', _118 => _118(data)]), async () => ( interval));
|
4392
4650
|
await wait(initialWait);
|
4393
4651
|
const poll2 = async () => {
|
4394
4652
|
if (!active)
|
@@ -4441,7 +4699,7 @@ function watchBlockNumber(client, {
|
|
4441
4699
|
prevBlockNumber = blockNumber;
|
4442
4700
|
}
|
4443
4701
|
} catch (err) {
|
4444
|
-
_optionalChain([emit, 'access',
|
4702
|
+
_optionalChain([emit, 'access', _119 => _119.onError, 'optionalCall', _120 => _120(err)]);
|
4445
4703
|
}
|
4446
4704
|
},
|
4447
4705
|
{
|
@@ -4481,11 +4739,11 @@ function watchBlocks(client, {
|
|
4481
4739
|
blockTag,
|
4482
4740
|
includeTransactions
|
4483
4741
|
});
|
4484
|
-
if (block.number && _optionalChain([prevBlock, 'optionalAccess',
|
4742
|
+
if (block.number && _optionalChain([prevBlock, 'optionalAccess', _121 => _121.number])) {
|
4485
4743
|
if (block.number === prevBlock.number)
|
4486
4744
|
return;
|
4487
4745
|
if (block.number - prevBlock.number > 1 && emitMissed) {
|
4488
|
-
for (let i = _optionalChain([prevBlock, 'optionalAccess',
|
4746
|
+
for (let i = _optionalChain([prevBlock, 'optionalAccess', _122 => _122.number]) + 1n; i < block.number; i++) {
|
4489
4747
|
const block2 = await getBlock(client, {
|
4490
4748
|
blockNumber: i,
|
4491
4749
|
includeTransactions
|
@@ -4497,8 +4755,8 @@ function watchBlocks(client, {
|
|
4497
4755
|
}
|
4498
4756
|
if (
|
4499
4757
|
// If no previous block exists, emit.
|
4500
|
-
!_optionalChain([prevBlock, 'optionalAccess',
|
4501
|
-
blockTag === "pending" && !_optionalChain([block, 'optionalAccess',
|
4758
|
+
!_optionalChain([prevBlock, 'optionalAccess', _123 => _123.number]) || // If the block tag is "pending" with no block number, emit.
|
4759
|
+
blockTag === "pending" && !_optionalChain([block, 'optionalAccess', _124 => _124.number]) || // If the next block number is greater than the previous block number, emit.
|
4502
4760
|
// We don't want to emit blocks in the past.
|
4503
4761
|
block.number && block.number > prevBlock.number
|
4504
4762
|
) {
|
@@ -4506,7 +4764,7 @@ function watchBlocks(client, {
|
|
4506
4764
|
prevBlock = block;
|
4507
4765
|
}
|
4508
4766
|
} catch (err) {
|
4509
|
-
_optionalChain([emit, 'access',
|
4767
|
+
_optionalChain([emit, 'access', _125 => _125.onError, 'optionalCall', _126 => _126(err)]);
|
4510
4768
|
}
|
4511
4769
|
},
|
4512
4770
|
{
|
@@ -4585,7 +4843,7 @@ function watchContractEvent(client, {
|
|
4585
4843
|
else
|
4586
4844
|
logs.forEach((log) => emit.onLogs([log]));
|
4587
4845
|
} catch (err) {
|
4588
|
-
_optionalChain([emit, 'access',
|
4846
|
+
_optionalChain([emit, 'access', _127 => _127.onError, 'optionalCall', _128 => _128(err)]);
|
4589
4847
|
}
|
4590
4848
|
},
|
4591
4849
|
{
|
@@ -4664,7 +4922,7 @@ function watchEvent(client, {
|
|
4664
4922
|
else
|
4665
4923
|
logs.forEach((log) => emit.onLogs([log]));
|
4666
4924
|
} catch (err) {
|
4667
|
-
_optionalChain([emit, 'access',
|
4925
|
+
_optionalChain([emit, 'access', _129 => _129.onError, 'optionalCall', _130 => _130(err)]);
|
4668
4926
|
}
|
4669
4927
|
},
|
4670
4928
|
{
|
@@ -4715,7 +4973,7 @@ function watchPendingTransactions(client, {
|
|
4715
4973
|
else
|
4716
4974
|
hashes.forEach((hash2) => emit.onTransactions([hash2]));
|
4717
4975
|
} catch (err) {
|
4718
|
-
_optionalChain([emit, 'access',
|
4976
|
+
_optionalChain([emit, 'access', _131 => _131.onError, 'optionalCall', _132 => _132(err)]);
|
4719
4977
|
}
|
4720
4978
|
},
|
4721
4979
|
{
|
@@ -4977,7 +5235,12 @@ async function addChain(client, { chain }) {
|
|
4977
5235
|
}
|
4978
5236
|
|
4979
5237
|
// src/actions/wallet/deployContract.ts
|
4980
|
-
function deployContract(walletClient, {
|
5238
|
+
function deployContract(walletClient, {
|
5239
|
+
abi,
|
5240
|
+
args,
|
5241
|
+
bytecode,
|
5242
|
+
...request
|
5243
|
+
}) {
|
4981
5244
|
const calldata = encodeDeployData({
|
4982
5245
|
abi,
|
4983
5246
|
args,
|
@@ -5018,10 +5281,9 @@ async function requestPermissions(client, permissions) {
|
|
5018
5281
|
// src/actions/wallet/sendTransaction.ts
|
5019
5282
|
async function sendTransaction(client, args) {
|
5020
5283
|
const {
|
5021
|
-
account,
|
5022
|
-
chain,
|
5284
|
+
account: account_ = client.account,
|
5285
|
+
chain = client.chain,
|
5023
5286
|
accessList,
|
5024
|
-
assertChain = true,
|
5025
5287
|
data,
|
5026
5288
|
gas,
|
5027
5289
|
gasPrice,
|
@@ -5032,13 +5294,20 @@ async function sendTransaction(client, args) {
|
|
5032
5294
|
value,
|
5033
5295
|
...rest
|
5034
5296
|
} = args;
|
5297
|
+
if (!account_)
|
5298
|
+
throw new AccountNotFoundError({
|
5299
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
5300
|
+
});
|
5301
|
+
const account = parseAccount(account_);
|
5035
5302
|
try {
|
5036
5303
|
assertRequest(args);
|
5037
|
-
const
|
5038
|
-
if (
|
5039
|
-
|
5304
|
+
const chainId = await getChainId(client);
|
5305
|
+
if (chain !== null && chainId !== _optionalChain([chain, 'optionalAccess', _133 => _133.id])) {
|
5306
|
+
if (!chain)
|
5307
|
+
throw new ChainNotFoundError();
|
5308
|
+
throw new ChainMismatchError({ chain, currentChainId: chainId });
|
5309
|
+
}
|
5040
5310
|
if (account.type === "local") {
|
5041
|
-
const chainId = _nullishCoalesce(_optionalChain([chain, 'optionalAccess', _128 => _128.id]), () => ( currentChainId));
|
5042
5311
|
const request2 = await prepareRequest(client, {
|
5043
5312
|
account,
|
5044
5313
|
accessList,
|
@@ -5062,7 +5331,7 @@ async function sendTransaction(client, args) {
|
|
5062
5331
|
params: [signedRequest]
|
5063
5332
|
});
|
5064
5333
|
}
|
5065
|
-
const formatter = _optionalChain([chain, 'optionalAccess',
|
5334
|
+
const formatter = _optionalChain([chain, 'optionalAccess', _134 => _134.formatters, 'optionalAccess', _135 => _135.transactionRequest]);
|
5066
5335
|
const request = format3(
|
5067
5336
|
{
|
5068
5337
|
accessList,
|
@@ -5087,12 +5356,25 @@ async function sendTransaction(client, args) {
|
|
5087
5356
|
params: [request]
|
5088
5357
|
});
|
5089
5358
|
} catch (err) {
|
5090
|
-
throw getTransactionError(err,
|
5359
|
+
throw getTransactionError(err, {
|
5360
|
+
...args,
|
5361
|
+
account,
|
5362
|
+
chain: args.chain || void 0
|
5363
|
+
});
|
5091
5364
|
}
|
5092
5365
|
}
|
5093
5366
|
|
5094
5367
|
// src/actions/wallet/signMessage.ts
|
5095
|
-
async function signMessage(client, {
|
5368
|
+
async function signMessage(client, {
|
5369
|
+
account: account_ = client.account,
|
5370
|
+
data,
|
5371
|
+
message
|
5372
|
+
}) {
|
5373
|
+
if (!account_)
|
5374
|
+
throw new AccountNotFoundError({
|
5375
|
+
docsPath: "/docs/actions/wallet/signMessage"
|
5376
|
+
});
|
5377
|
+
const account = parseAccount(account_);
|
5096
5378
|
const message_ = message || data;
|
5097
5379
|
if (account.type === "local")
|
5098
5380
|
return account.signMessage(message_);
|
@@ -5104,22 +5386,27 @@ async function signMessage(client, { account, data, message }) {
|
|
5104
5386
|
|
5105
5387
|
// src/actions/wallet/signTypedData.ts
|
5106
5388
|
async function signTypedData(client, {
|
5107
|
-
account,
|
5389
|
+
account: account_ = client.account,
|
5108
5390
|
domain,
|
5109
5391
|
message,
|
5110
5392
|
primaryType,
|
5111
5393
|
types: types_
|
5112
5394
|
}) {
|
5395
|
+
if (!account_)
|
5396
|
+
throw new AccountNotFoundError({
|
5397
|
+
docsPath: "/docs/actions/wallet/signTypedData"
|
5398
|
+
});
|
5399
|
+
const account = parseAccount(account_);
|
5113
5400
|
const types = {
|
5114
5401
|
EIP712Domain: [
|
5115
|
-
_optionalChain([domain, 'optionalAccess',
|
5116
|
-
_optionalChain([domain, 'optionalAccess',
|
5117
|
-
_optionalChain([domain, 'optionalAccess',
|
5118
|
-
_optionalChain([domain, 'optionalAccess',
|
5402
|
+
_optionalChain([domain, 'optionalAccess', _136 => _136.name]) && { name: "name", type: "string" },
|
5403
|
+
_optionalChain([domain, 'optionalAccess', _137 => _137.version]) && { name: "version", type: "string" },
|
5404
|
+
_optionalChain([domain, 'optionalAccess', _138 => _138.chainId]) && { name: "chainId", type: "uint256" },
|
5405
|
+
_optionalChain([domain, 'optionalAccess', _139 => _139.verifyingContract]) && {
|
5119
5406
|
name: "verifyingContract",
|
5120
5407
|
type: "address"
|
5121
5408
|
},
|
5122
|
-
_optionalChain([domain, 'optionalAccess',
|
5409
|
+
_optionalChain([domain, 'optionalAccess', _140 => _140.salt]) && { name: "salt", type: "bytes32" }
|
5123
5410
|
].filter(Boolean),
|
5124
5411
|
...types_
|
5125
5412
|
};
|
@@ -5259,7 +5546,17 @@ function parseGwei(ether, unit = "wei") {
|
|
5259
5546
|
// src/utils/transaction/prepareRequest.ts
|
5260
5547
|
var defaultTip = parseGwei("1.5");
|
5261
5548
|
async function prepareRequest(client, args) {
|
5262
|
-
const {
|
5549
|
+
const {
|
5550
|
+
account: account_,
|
5551
|
+
gas,
|
5552
|
+
gasPrice,
|
5553
|
+
maxFeePerGas,
|
5554
|
+
maxPriorityFeePerGas,
|
5555
|
+
nonce
|
5556
|
+
} = args;
|
5557
|
+
if (!account_)
|
5558
|
+
throw new AccountNotFoundError();
|
5559
|
+
const account = parseAccount(account_);
|
5263
5560
|
const block = await getBlock(client, { blockTag: "latest" });
|
5264
5561
|
const request = { ...args, from: account.address };
|
5265
5562
|
if (typeof nonce === "undefined")
|
@@ -5589,5 +5886,9 @@ function parseEther(ether, unit = "wei") {
|
|
5589
5886
|
|
5590
5887
|
|
5591
5888
|
|
5592
|
-
exports.BaseError = BaseError; exports.AbiConstructorNotFoundError = AbiConstructorNotFoundError; exports.AbiConstructorParamsNotFoundError = AbiConstructorParamsNotFoundError; exports.AbiDecodingDataSizeInvalidError = AbiDecodingDataSizeInvalidError; exports.AbiDecodingZeroDataError = AbiDecodingZeroDataError; exports.AbiEncodingArrayLengthMismatchError = AbiEncodingArrayLengthMismatchError; exports.AbiEncodingLengthMismatchError = AbiEncodingLengthMismatchError; exports.AbiErrorInputsNotFoundError = AbiErrorInputsNotFoundError; exports.AbiErrorNotFoundError = AbiErrorNotFoundError; exports.AbiErrorSignatureNotFoundError = AbiErrorSignatureNotFoundError; exports.AbiEventSignatureEmptyTopicsError = AbiEventSignatureEmptyTopicsError; exports.AbiEventSignatureNotFoundError = AbiEventSignatureNotFoundError; exports.AbiEventNotFoundError = AbiEventNotFoundError; exports.AbiFunctionNotFoundError = AbiFunctionNotFoundError; exports.AbiFunctionOutputsNotFoundError = AbiFunctionOutputsNotFoundError; exports.AbiFunctionSignatureNotFoundError = AbiFunctionSignatureNotFoundError; exports.DecodeLogTopicsMismatch = DecodeLogTopicsMismatch; exports.InvalidAbiEncodingTypeError = InvalidAbiEncodingTypeError; exports.InvalidAbiDecodingTypeError = InvalidAbiDecodingTypeError; exports.InvalidArrayError = InvalidArrayError; exports.InvalidDefinitionTypeError = InvalidDefinitionTypeError; exports.InvalidAddressError = InvalidAddressError; exports.BlockNotFoundError = BlockNotFoundError; exports.ChainDoesNotSupportContract = ChainDoesNotSupportContract; exports.multicall3Abi = multicall3Abi; exports.panicReasons = panicReasons; exports.etherUnits = etherUnits; exports.gweiUnits = gweiUnits; exports.weiUnits = weiUnits; exports.TransactionExecutionError = TransactionExecutionError; exports.TransactionNotFoundError = TransactionNotFoundError; exports.TransactionReceiptNotFoundError = TransactionReceiptNotFoundError; exports.WaitForTransactionReceiptTimeoutError = WaitForTransactionReceiptTimeoutError; exports.CallExecutionError = CallExecutionError; exports.ContractFunctionExecutionError = ContractFunctionExecutionError; exports.ContractFunctionRevertedError = ContractFunctionRevertedError; exports.ContractFunctionZeroDataError = ContractFunctionZeroDataError; exports.RawContractError = RawContractError; exports.SizeExceedsPaddingSizeError = SizeExceedsPaddingSizeError; exports.DataLengthTooLongError = DataLengthTooLongError; exports.DataLengthTooShortError = DataLengthTooShortError; exports.InvalidBytesBooleanError = InvalidBytesBooleanError; exports.InvalidHexBooleanError = InvalidHexBooleanError; exports.InvalidHexValueError = InvalidHexValueError; exports.OffsetOutOfBoundsError = OffsetOutOfBoundsError; exports.EstimateGasExecutionError = EstimateGasExecutionError; exports.FilterTypeNotSupportedError = FilterTypeNotSupportedError; exports.ExecutionRevertedError = ExecutionRevertedError; exports.FeeCapTooHighError = FeeCapTooHighError; exports.FeeCapTooLowError = FeeCapTooLowError; exports.NonceTooHighError = NonceTooHighError; exports.NonceTooLowError = NonceTooLowError; exports.NonceMaxValueError = NonceMaxValueError; exports.InsufficientFundsError = InsufficientFundsError; exports.IntrinsicGasTooHighError = IntrinsicGasTooHighError; exports.IntrinsicGasTooLowError = IntrinsicGasTooLowError; exports.TransactionTypeNotSupportedError = TransactionTypeNotSupportedError; exports.TipAboveFeeCapError = TipAboveFeeCapError; exports.UnknownNodeError = UnknownNodeError; exports.RequestError = RequestError; exports.RpcRequestError = RpcRequestError; exports.ParseRpcError = ParseRpcError; exports.InvalidRequestRpcError = InvalidRequestRpcError; exports.MethodNotFoundRpcError = MethodNotFoundRpcError; exports.InvalidParamsRpcError = InvalidParamsRpcError; exports.InternalRpcError = InternalRpcError; exports.InvalidInputRpcError = InvalidInputRpcError; exports.ResourceNotFoundRpcError = ResourceNotFoundRpcError; exports.ResourceUnavailableRpcError = ResourceUnavailableRpcError; exports.TransactionRejectedRpcError = TransactionRejectedRpcError; exports.MethodNotSupportedRpcError = MethodNotSupportedRpcError; exports.LimitExceededRpcError = LimitExceededRpcError; exports.JsonRpcVersionUnsupportedError = JsonRpcVersionUnsupportedError; exports.UserRejectedRequestError = UserRejectedRequestError; exports.SwitchChainError = SwitchChainError; exports.UnknownRpcError = UnknownRpcError; exports.HttpRequestError = HttpRequestError; exports.WebSocketRequestError = WebSocketRequestError; exports.RpcError = RpcError; exports.TimeoutError = TimeoutError; exports.UrlRequiredError = UrlRequiredError; exports.concat = concat; exports.concatBytes = concatBytes; exports.concatHex = concatHex; exports.isBytes = isBytes; exports.isHex = isHex; exports.pad = pad; exports.padHex = padHex; exports.padBytes = padBytes; exports.trim = trim; exports.size = size; exports.slice = slice; exports.sliceBytes = sliceBytes; exports.sliceHex = sliceHex; exports.boolToHex = boolToHex; exports.bytesToHex = bytesToHex; exports.toHex = toHex; exports.numberToHex = numberToHex; exports.stringToHex = stringToHex; exports.toBytes = toBytes; exports.boolToBytes = boolToBytes; exports.hexToBytes = hexToBytes; exports.numberToBytes = numberToBytes; exports.stringToBytes = stringToBytes; exports.toRlp = toRlp; exports.fromHex = fromHex; exports.hexToBigInt = hexToBigInt; exports.hexToBool = hexToBool; exports.hexToNumber = hexToNumber; exports.hexToString = hexToString; exports.fromBytes = fromBytes; exports.bytesToBigint = bytesToBigint; exports.bytesToBool = bytesToBool; exports.bytesToNumber = bytesToNumber; exports.bytesToString = bytesToString; exports.fromRlp = fromRlp; exports.extractFunctionParts = extractFunctionParts; exports.extractFunctionName = extractFunctionName; exports.extractFunctionParams = extractFunctionParams; exports.extractFunctionType = extractFunctionType; exports.keccak256 = keccak256; exports.getEventSelector = getEventSelector; exports.getFunctionSelector = getFunctionSelector; exports.isAddress = isAddress; exports.getAddress = getAddress; exports.getContractAddress = getContractAddress2; exports.getCreateAddress = getCreateAddress; exports.getCreate2Address = getCreate2Address; exports.isAddressEqual = isAddressEqual; exports.encodeAbiParameters = encodeAbiParameters; exports.decodeAbiParameters = decodeAbiParameters; exports.formatAbiItem = formatAbiItem; exports.decodeErrorResult = decodeErrorResult; exports.decodeEventLog = decodeEventLog; exports.decodeFunctionData = decodeFunctionData; exports.getAbiItem = getAbiItem; exports.decodeFunctionResult = decodeFunctionResult; exports.encodeDeployData = encodeDeployData; exports.encodeErrorResult = encodeErrorResult; exports.encodeEventTopics = encodeEventTopics; exports.encodeFunctionData = encodeFunctionData; exports.encodeFunctionResult = encodeFunctionResult; exports.arrayRegex = arrayRegex; exports.bytesRegex = bytesRegex; exports.integerRegex = integerRegex; exports.encodePacked = encodePacked; exports.formatAbiItemWithArgs = formatAbiItemWithArgs; exports.parseAbi = _abitype.parseAbi; exports.parseAbiItem = _abitype.parseAbiItem; exports.parseAbiParameter = _abitype.parseAbiParameter; exports.parseAbiParameters = _abitype.parseAbiParameters; exports.getAccount = getAccount; exports.isDeterministicError = isDeterministicError; exports.buildRequest = buildRequest; exports.defineChain = defineChain; exports.getChainContractAddress = getChainContractAddress; exports.format = format3; exports.defineFormatter = defineFormatter; exports.transactionType = transactionType; exports.formatTransaction = formatTransaction; exports.defineTransaction = defineTransaction; exports.formatBlock = formatBlock; exports.defineBlock = defineBlock; exports.extract = extract; exports.defineTransactionReceipt = defineTransactionReceipt; exports.formatTransactionRequest = formatTransactionRequest; exports.defineTransactionRequest = defineTransactionRequest; exports.containsNodeError = containsNodeError; exports.getNodeError = getNodeError; exports.getCallError = getCallError; exports.getContractError = getContractError; exports.getEstimateGasError = getEstimateGasError; exports.getTransactionError = getTransactionError; exports.stringify = stringify; exports.getSocket = getSocket; exports.rpc = rpc; exports.hashMessage = hashMessage; exports.recoverAddress = recoverAddress; exports.recoverMessageAddress = recoverMessageAddress; exports.verifyMessage = verifyMessage; exports.assertRequest = assertRequest; 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; exports.dropTransaction = dropTransaction; exports.getAutomine = getAutomine; exports.getTxpoolContent = getTxpoolContent; exports.getTxpoolStatus = getTxpoolStatus; exports.impersonateAccount = impersonateAccount; exports.increaseTime = increaseTime; exports.inspectTxpool = inspectTxpool; exports.mine = mine; exports.removeBlockTimestampInterval = removeBlockTimestampInterval; exports.reset = reset; exports.revert = revert; exports.sendUnsignedTransaction = sendUnsignedTransaction; exports.setAutomine = setAutomine; exports.setBalance = setBalance; exports.setBlockGasLimit = setBlockGasLimit; exports.setBlockTimestampInterval = setBlockTimestampInterval; exports.setCode = setCode; exports.setCoinbase = setCoinbase; exports.setIntervalMining = setIntervalMining; exports.setLoggingEnabled = setLoggingEnabled; exports.setMinGasPrice = setMinGasPrice; exports.setNextBlockBaseFeePerGas = setNextBlockBaseFeePerGas; exports.setNextBlockTimestamp = setNextBlockTimestamp; exports.setNonce = setNonce; exports.setRpcUrl = setRpcUrl; exports.setStorageAt = setStorageAt; exports.snapshot = snapshot; exports.stopImpersonatingAccount = stopImpersonatingAccount; exports.addChain = addChain; exports.deployContract = deployContract; exports.getAddresses = getAddresses; exports.getPermissions = getPermissions; exports.requestAddresses = requestAddresses; exports.requestPermissions = requestPermissions; exports.sendTransaction = sendTransaction; exports.signMessage = signMessage; exports.signTypedData = signTypedData; exports.switchChain = switchChain; exports.watchAsset = watchAsset; exports.writeContract = writeContract; exports.parseUnits = parseUnits; exports.parseGwei = parseGwei; exports.prepareRequest = prepareRequest; exports.formatUnits = formatUnits; exports.formatEther = formatEther; exports.formatGwei = formatGwei; exports.parseEther = parseEther;
|
5593
|
-
|
5889
|
+
|
5890
|
+
|
5891
|
+
|
5892
|
+
|
5893
|
+
exports.BaseError = BaseError; exports.AbiConstructorNotFoundError = AbiConstructorNotFoundError; exports.AbiConstructorParamsNotFoundError = AbiConstructorParamsNotFoundError; exports.AbiDecodingDataSizeInvalidError = AbiDecodingDataSizeInvalidError; exports.AbiDecodingZeroDataError = AbiDecodingZeroDataError; exports.AbiEncodingArrayLengthMismatchError = AbiEncodingArrayLengthMismatchError; exports.AbiEncodingLengthMismatchError = AbiEncodingLengthMismatchError; exports.AbiErrorInputsNotFoundError = AbiErrorInputsNotFoundError; exports.AbiErrorNotFoundError = AbiErrorNotFoundError; exports.AbiErrorSignatureNotFoundError = AbiErrorSignatureNotFoundError; exports.AbiEventSignatureEmptyTopicsError = AbiEventSignatureEmptyTopicsError; exports.AbiEventSignatureNotFoundError = AbiEventSignatureNotFoundError; exports.AbiEventNotFoundError = AbiEventNotFoundError; exports.AbiFunctionNotFoundError = AbiFunctionNotFoundError; exports.AbiFunctionOutputsNotFoundError = AbiFunctionOutputsNotFoundError; exports.AbiFunctionSignatureNotFoundError = AbiFunctionSignatureNotFoundError; exports.DecodeLogTopicsMismatch = DecodeLogTopicsMismatch; exports.InvalidAbiEncodingTypeError = InvalidAbiEncodingTypeError; exports.InvalidAbiDecodingTypeError = InvalidAbiDecodingTypeError; exports.InvalidArrayError = InvalidArrayError; exports.InvalidDefinitionTypeError = InvalidDefinitionTypeError; exports.InvalidAddressError = InvalidAddressError; exports.BlockNotFoundError = BlockNotFoundError; exports.ChainDoesNotSupportContract = ChainDoesNotSupportContract; exports.multicall3Abi = multicall3Abi; exports.panicReasons = panicReasons; exports.etherUnits = etherUnits; exports.gweiUnits = gweiUnits; exports.weiUnits = weiUnits; exports.TransactionExecutionError = TransactionExecutionError; exports.TransactionNotFoundError = TransactionNotFoundError; exports.TransactionReceiptNotFoundError = TransactionReceiptNotFoundError; exports.WaitForTransactionReceiptTimeoutError = WaitForTransactionReceiptTimeoutError; exports.CallExecutionError = CallExecutionError; exports.ContractFunctionExecutionError = ContractFunctionExecutionError; exports.ContractFunctionRevertedError = ContractFunctionRevertedError; exports.ContractFunctionZeroDataError = ContractFunctionZeroDataError; exports.RawContractError = RawContractError; exports.SizeExceedsPaddingSizeError = SizeExceedsPaddingSizeError; exports.DataLengthTooLongError = DataLengthTooLongError; exports.DataLengthTooShortError = DataLengthTooShortError; exports.InvalidBytesBooleanError = InvalidBytesBooleanError; exports.InvalidHexBooleanError = InvalidHexBooleanError; exports.InvalidHexValueError = InvalidHexValueError; exports.OffsetOutOfBoundsError = OffsetOutOfBoundsError; exports.EstimateGasExecutionError = EstimateGasExecutionError; exports.FilterTypeNotSupportedError = FilterTypeNotSupportedError; exports.ExecutionRevertedError = ExecutionRevertedError; exports.FeeCapTooHighError = FeeCapTooHighError; exports.FeeCapTooLowError = FeeCapTooLowError; exports.NonceTooHighError = NonceTooHighError; exports.NonceTooLowError = NonceTooLowError; exports.NonceMaxValueError = NonceMaxValueError; exports.InsufficientFundsError = InsufficientFundsError; exports.IntrinsicGasTooHighError = IntrinsicGasTooHighError; exports.IntrinsicGasTooLowError = IntrinsicGasTooLowError; exports.TransactionTypeNotSupportedError = TransactionTypeNotSupportedError; exports.TipAboveFeeCapError = TipAboveFeeCapError; exports.UnknownNodeError = UnknownNodeError; exports.RequestError = RequestError; exports.RpcRequestError = RpcRequestError; exports.ParseRpcError = ParseRpcError; exports.InvalidRequestRpcError = InvalidRequestRpcError; exports.MethodNotFoundRpcError = MethodNotFoundRpcError; exports.InvalidParamsRpcError = InvalidParamsRpcError; exports.InternalRpcError = InternalRpcError; exports.InvalidInputRpcError = InvalidInputRpcError; exports.ResourceNotFoundRpcError = ResourceNotFoundRpcError; exports.ResourceUnavailableRpcError = ResourceUnavailableRpcError; exports.TransactionRejectedRpcError = TransactionRejectedRpcError; exports.MethodNotSupportedRpcError = MethodNotSupportedRpcError; exports.LimitExceededRpcError = LimitExceededRpcError; exports.JsonRpcVersionUnsupportedError = JsonRpcVersionUnsupportedError; exports.UserRejectedRequestError = UserRejectedRequestError; exports.SwitchChainError = SwitchChainError; exports.UnknownRpcError = UnknownRpcError; exports.HttpRequestError = HttpRequestError; exports.WebSocketRequestError = WebSocketRequestError; exports.RpcError = RpcError; exports.TimeoutError = TimeoutError; exports.UrlRequiredError = UrlRequiredError; exports.concat = concat; exports.concatBytes = concatBytes; exports.concatHex = concatHex; exports.isBytes = isBytes; exports.isHex = isHex; exports.pad = pad; exports.padHex = padHex; exports.padBytes = padBytes; exports.trim = trim; exports.size = size; exports.slice = slice; exports.sliceBytes = sliceBytes; exports.sliceHex = sliceHex; exports.boolToHex = boolToHex; exports.bytesToHex = bytesToHex; exports.toHex = toHex; exports.numberToHex = numberToHex; exports.stringToHex = stringToHex; exports.toBytes = toBytes; exports.boolToBytes = boolToBytes; exports.hexToBytes = hexToBytes; exports.numberToBytes = numberToBytes; exports.stringToBytes = stringToBytes; exports.toRlp = toRlp; exports.fromHex = fromHex; exports.hexToBigInt = hexToBigInt; exports.hexToBool = hexToBool; exports.hexToNumber = hexToNumber; exports.hexToString = hexToString; exports.fromBytes = fromBytes; exports.bytesToBigint = bytesToBigint; exports.bytesToBool = bytesToBool; exports.bytesToNumber = bytesToNumber; exports.bytesToString = bytesToString; exports.fromRlp = fromRlp; exports.extractFunctionParts = extractFunctionParts; exports.extractFunctionName = extractFunctionName; exports.extractFunctionParams = extractFunctionParams; exports.extractFunctionType = extractFunctionType; exports.keccak256 = keccak256; exports.getEventSelector = getEventSelector; exports.getFunctionSelector = getFunctionSelector; exports.isAddress = isAddress; exports.getAddress = getAddress; exports.getContractAddress = getContractAddress2; exports.getCreateAddress = getCreateAddress; exports.getCreate2Address = getCreate2Address; exports.isAddressEqual = isAddressEqual; exports.encodeAbiParameters = encodeAbiParameters; exports.decodeAbiParameters = decodeAbiParameters; exports.formatAbiItem = formatAbiItem; exports.decodeErrorResult = decodeErrorResult; exports.decodeEventLog = decodeEventLog; exports.decodeFunctionData = decodeFunctionData; exports.getAbiItem = getAbiItem; exports.decodeFunctionResult = decodeFunctionResult; exports.encodeDeployData = encodeDeployData; exports.encodeErrorResult = encodeErrorResult; exports.encodeEventTopics = encodeEventTopics; exports.encodeFunctionData = encodeFunctionData; exports.encodeFunctionResult = encodeFunctionResult; exports.arrayRegex = arrayRegex; exports.bytesRegex = bytesRegex; exports.integerRegex = integerRegex; exports.encodePacked = encodePacked; exports.formatAbiItemWithArgs = formatAbiItemWithArgs; exports.parseAbi = _abitype.parseAbi; exports.parseAbiItem = _abitype.parseAbiItem; exports.parseAbiParameter = _abitype.parseAbiParameter; exports.parseAbiParameters = _abitype.parseAbiParameters; exports.getAccount = getAccount; exports.parseAccount = parseAccount; exports.isDeterministicError = isDeterministicError; exports.buildRequest = buildRequest; exports.defineChain = defineChain; exports.getChainContractAddress = getChainContractAddress; exports.format = format3; exports.defineFormatter = defineFormatter; exports.transactionType = transactionType; exports.formatTransaction = formatTransaction; exports.defineTransaction = defineTransaction; exports.formatBlock = formatBlock; exports.defineBlock = defineBlock; exports.extract = extract; exports.defineTransactionReceipt = defineTransactionReceipt; exports.formatTransactionRequest = formatTransactionRequest; exports.defineTransactionRequest = defineTransactionRequest; exports.containsNodeError = containsNodeError; exports.getNodeError = getNodeError; exports.getCallError = getCallError; exports.getContractError = getContractError; exports.getEstimateGasError = getEstimateGasError; exports.getTransactionError = getTransactionError; exports.stringify = stringify; exports.getSocket = getSocket; exports.rpc = rpc; exports.hashMessage = hashMessage; exports.hashTypedData = hashTypedData; exports.recoverAddress = recoverAddress; exports.recoverMessageAddress = recoverMessageAddress; exports.recoverTypedDataAddress = recoverTypedDataAddress; exports.verifyMessage = verifyMessage; exports.verifyTypedData = verifyTypedData; exports.assertRequest = assertRequest; 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; exports.dropTransaction = dropTransaction; exports.getAutomine = getAutomine; exports.getTxpoolContent = getTxpoolContent; exports.getTxpoolStatus = getTxpoolStatus; exports.impersonateAccount = impersonateAccount; exports.increaseTime = increaseTime; exports.inspectTxpool = inspectTxpool; exports.mine = mine; exports.removeBlockTimestampInterval = removeBlockTimestampInterval; exports.reset = reset; exports.revert = revert; exports.sendUnsignedTransaction = sendUnsignedTransaction; exports.setAutomine = setAutomine; exports.setBalance = setBalance; exports.setBlockGasLimit = setBlockGasLimit; exports.setBlockTimestampInterval = setBlockTimestampInterval; exports.setCode = setCode; exports.setCoinbase = setCoinbase; exports.setIntervalMining = setIntervalMining; exports.setLoggingEnabled = setLoggingEnabled; exports.setMinGasPrice = setMinGasPrice; exports.setNextBlockBaseFeePerGas = setNextBlockBaseFeePerGas; exports.setNextBlockTimestamp = setNextBlockTimestamp; exports.setNonce = setNonce; exports.setRpcUrl = setRpcUrl; exports.setStorageAt = setStorageAt; exports.snapshot = snapshot; exports.stopImpersonatingAccount = stopImpersonatingAccount; exports.addChain = addChain; exports.deployContract = deployContract; exports.getAddresses = getAddresses; exports.getPermissions = getPermissions; exports.requestAddresses = requestAddresses; exports.requestPermissions = requestPermissions; exports.sendTransaction = sendTransaction; exports.signMessage = signMessage; exports.signTypedData = signTypedData; exports.switchChain = switchChain; exports.watchAsset = watchAsset; exports.writeContract = writeContract; exports.parseUnits = parseUnits; exports.parseGwei = parseGwei; exports.prepareRequest = prepareRequest; exports.formatUnits = formatUnits; exports.formatEther = formatEther; exports.formatGwei = formatGwei; exports.parseEther = parseEther;
|
5894
|
+
//# sourceMappingURL=chunk-T4AH4Y6Y.js.map
|