viem 0.1.21 → 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-PCOB33JR.mjs → chunk-4DIN6KDM.mjs} +2 -2
- package/dist/chunk-4DIN6KDM.mjs.map +1 -0
- package/dist/{chunk-YYL4XXAP.js → chunk-BLB7NERO.js} +19 -19
- package/dist/{chunk-YYL4XXAP.js.map → chunk-BLB7NERO.js.map} +1 -1
- package/dist/{chunk-HZ3XNLWB.mjs → chunk-KOAJUBTN.mjs} +328 -30
- package/dist/chunk-KOAJUBTN.mjs.map +1 -0
- package/dist/{chunk-M5K2FJOM.js → chunk-T4AH4Y6Y.js} +397 -99
- 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-75540130.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.mjs +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 +99 -91
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{parseGwei-6fff7cbe.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-2bd23d7e.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-HZ3XNLWB.mjs.map +0 -1
- package/dist/chunk-M5K2FJOM.js.map +0 -1
- package/dist/chunk-PCOB33JR.mjs.map +0 -1
@@ -218,7 +218,9 @@ var BaseError = class extends Error {
|
|
218
218
|
shortMessage || "An error occurred.",
|
219
219
|
"",
|
220
220
|
...args.metaMessages ? [...args.metaMessages, ""] : [],
|
221
|
-
...docsPath6 ? [
|
221
|
+
...docsPath6 ? [
|
222
|
+
`Docs: https://viem.sh${docsPath6}.html${args.docsSlug ? `#${args.docsSlug}` : ""}`
|
223
|
+
] : [],
|
222
224
|
...details ? [`Details: ${details}`] : [],
|
223
225
|
`Version: ${getVersion()}`
|
224
226
|
].join("\n");
|
@@ -519,6 +521,23 @@ var UnsupportedPackedAbiType = class extends BaseError {
|
|
519
521
|
}
|
520
522
|
};
|
521
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
|
+
|
522
541
|
// src/errors/address.ts
|
523
542
|
var InvalidAddressError = class extends BaseError {
|
524
543
|
constructor({ address }) {
|
@@ -583,6 +602,17 @@ var ChainMismatchError = class extends BaseError {
|
|
583
602
|
__publicField(this, "name", "ChainMismatchError");
|
584
603
|
}
|
585
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
|
+
};
|
586
616
|
|
587
617
|
// src/constants/abis.ts
|
588
618
|
var multicall3Abi = [
|
@@ -713,9 +743,9 @@ var TransactionExecutionError = class extends BaseError {
|
|
713
743
|
}) {
|
714
744
|
const prettyArgs = prettyPrint({
|
715
745
|
chain: chain && `${_optionalChain([chain, 'optionalAccess', _4 => _4.name])} (id: ${_optionalChain([chain, 'optionalAccess', _5 => _5.id])})`,
|
716
|
-
from: account.address,
|
746
|
+
from: _optionalChain([account, 'optionalAccess', _6 => _6.address]),
|
717
747
|
to,
|
718
|
-
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"}`,
|
719
749
|
data,
|
720
750
|
gas,
|
721
751
|
gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
|
@@ -778,7 +808,7 @@ var WaitForTransactionReceiptTimeoutError = class extends BaseError {
|
|
778
808
|
// src/errors/contract.ts
|
779
809
|
var CallExecutionError = class extends BaseError {
|
780
810
|
constructor(cause, {
|
781
|
-
account,
|
811
|
+
account: account_,
|
782
812
|
docsPath: docsPath6,
|
783
813
|
chain,
|
784
814
|
data,
|
@@ -790,10 +820,11 @@ var CallExecutionError = class extends BaseError {
|
|
790
820
|
to,
|
791
821
|
value
|
792
822
|
}) {
|
823
|
+
const account = account_ ? parseAccount(account_) : void 0;
|
793
824
|
const prettyArgs = prettyPrint({
|
794
|
-
from: _optionalChain([account, 'optionalAccess',
|
825
|
+
from: _optionalChain([account, 'optionalAccess', _9 => _9.address]),
|
795
826
|
to,
|
796
|
-
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"}`,
|
797
828
|
data,
|
798
829
|
gas,
|
799
830
|
gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
|
@@ -835,7 +866,7 @@ var ContractFunctionExecutionError = class extends BaseError {
|
|
835
866
|
const prettyArgs = prettyPrint({
|
836
867
|
address: contractAddress && getContractAddress(contractAddress),
|
837
868
|
function: functionWithParams,
|
838
|
-
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}`,
|
839
870
|
sender
|
840
871
|
});
|
841
872
|
super(
|
@@ -894,7 +925,7 @@ var ContractFunctionRevertedError = class extends BaseError {
|
|
894
925
|
}) : void 0;
|
895
926
|
metaMessages = [
|
896
927
|
errorWithParams ? `Error: ${errorWithParams}` : "",
|
897
|
-
formattedArgs && formattedArgs !== "()" ? ` ${[...Array(_nullishCoalesce(_optionalChain([errorName, 'optionalAccess',
|
928
|
+
formattedArgs && formattedArgs !== "()" ? ` ${[...Array(_nullishCoalesce(_optionalChain([errorName, 'optionalAccess', _13 => _13.length]), () => ( 0))).keys()].map(() => " ").join("")}${formattedArgs}` : ""
|
898
929
|
];
|
899
930
|
}
|
900
931
|
} else if (message)
|
@@ -1032,9 +1063,9 @@ var EstimateGasExecutionError = class extends BaseError {
|
|
1032
1063
|
value
|
1033
1064
|
}) {
|
1034
1065
|
const prettyArgs = prettyPrint({
|
1035
|
-
from: account.address,
|
1066
|
+
from: _optionalChain([account, 'optionalAccess', _14 => _14.address]),
|
1036
1067
|
to,
|
1037
|
-
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"}`,
|
1038
1069
|
data,
|
1039
1070
|
gas,
|
1040
1071
|
gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
|
@@ -1071,7 +1102,7 @@ var ExecutionRevertedError = class extends BaseError {
|
|
1071
1102
|
cause,
|
1072
1103
|
message
|
1073
1104
|
} = {}) {
|
1074
|
-
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", "")]);
|
1075
1106
|
super(
|
1076
1107
|
`Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`,
|
1077
1108
|
{
|
@@ -1223,7 +1254,7 @@ var TipAboveFeeCapError = class extends BaseError {
|
|
1223
1254
|
__publicField(TipAboveFeeCapError, "nodeMessage", /max priority fee per gas higher than max fee per gas|tip higher than fee cap/);
|
1224
1255
|
var UnknownNodeError = class extends BaseError {
|
1225
1256
|
constructor({ cause }) {
|
1226
|
-
super(`An error occurred while executing: ${_optionalChain([cause, 'optionalAccess',
|
1257
|
+
super(`An error occurred while executing: ${_optionalChain([cause, 'optionalAccess', _21 => _21.message])}`, {
|
1227
1258
|
cause
|
1228
1259
|
});
|
1229
1260
|
__publicField(this, "name", "UnknownNodeError");
|
@@ -1874,9 +1905,9 @@ function rlpToBytes(bytes, offset = 0) {
|
|
1874
1905
|
var paramsRegex = /((function|event)\s)?(.*)(\((.*)\))/;
|
1875
1906
|
function extractFunctionParts(def) {
|
1876
1907
|
const parts = def.match(paramsRegex);
|
1877
|
-
const type = _optionalChain([parts, 'optionalAccess',
|
1878
|
-
const name = _optionalChain([parts, 'optionalAccess',
|
1879
|
-
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;
|
1880
1911
|
return { type, name, params };
|
1881
1912
|
}
|
1882
1913
|
function extractFunctionName(def) {
|
@@ -1884,8 +1915,8 @@ function extractFunctionName(def) {
|
|
1884
1915
|
}
|
1885
1916
|
function extractFunctionParams(def) {
|
1886
1917
|
const params = extractFunctionParts(def).params;
|
1887
|
-
const splitParams = _optionalChain([params, 'optionalAccess',
|
1888
|
-
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) => ({
|
1889
1920
|
type: param[0],
|
1890
1921
|
name: param[1] === "indexed" ? param[2] : param[1],
|
1891
1922
|
...param[1] === "indexed" ? { indexed: true } : {}
|
@@ -2287,7 +2318,7 @@ function decodeArray(data, {
|
|
2287
2318
|
}
|
2288
2319
|
if (hasDynamicChild(param)) {
|
2289
2320
|
const arrayComponents = getArrayComponents(param.type);
|
2290
|
-
const dynamicChild = !_optionalChain([arrayComponents, 'optionalAccess',
|
2321
|
+
const dynamicChild = !_optionalChain([arrayComponents, 'optionalAccess', _31 => _31[0]]);
|
2291
2322
|
let consumed2 = 0;
|
2292
2323
|
let value2 = [];
|
2293
2324
|
for (let i = 0; i < length; ++i) {
|
@@ -2363,7 +2394,7 @@ function decodeTuple(data, { param, position }) {
|
|
2363
2394
|
position: consumed
|
2364
2395
|
});
|
2365
2396
|
consumed += decodedChild.consumed;
|
2366
|
-
value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess',
|
2397
|
+
value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess', _32 => _32.name])] = decodedChild.value;
|
2367
2398
|
}
|
2368
2399
|
return { consumed: 32, value };
|
2369
2400
|
}
|
@@ -2375,7 +2406,7 @@ function decodeTuple(data, { param, position }) {
|
|
2375
2406
|
position: position + consumed
|
2376
2407
|
});
|
2377
2408
|
consumed += decodedChild.consumed;
|
2378
|
-
value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess',
|
2409
|
+
value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess', _33 => _33.name])] = decodedChild.value;
|
2379
2410
|
}
|
2380
2411
|
return { consumed, value };
|
2381
2412
|
}
|
@@ -2388,7 +2419,7 @@ function hasDynamicChild(param) {
|
|
2388
2419
|
if (type.endsWith("[]"))
|
2389
2420
|
return true;
|
2390
2421
|
if (type === "tuple")
|
2391
|
-
return _optionalChain([param, 'access',
|
2422
|
+
return _optionalChain([param, 'access', _34 => _34.components, 'optionalAccess', _35 => _35.some, 'call', _36 => _36(hasDynamicChild)]);
|
2392
2423
|
const arrayComponents = getArrayComponents(param.type);
|
2393
2424
|
if (arrayComponents && hasDynamicChild({ ...param, type: arrayComponents[1] }))
|
2394
2425
|
return true;
|
@@ -2459,7 +2490,7 @@ function decodeEventLog({
|
|
2459
2490
|
docsPath
|
2460
2491
|
});
|
2461
2492
|
const { name, inputs } = abiItem;
|
2462
|
-
const isUnnamed = _optionalChain([inputs, 'optionalAccess',
|
2493
|
+
const isUnnamed = _optionalChain([inputs, 'optionalAccess', _37 => _37.some, 'call', _38 => _38((x) => !("name" in x && x.name))]);
|
2463
2494
|
let args = isUnnamed ? [] : {};
|
2464
2495
|
if (argTopics.length > 0) {
|
2465
2496
|
const indexedInputs = inputs.filter((x) => "indexed" in x && x.indexed);
|
@@ -2680,8 +2711,8 @@ function encodeEventTopics({ abi, eventName, args }) {
|
|
2680
2711
|
const signature = getEventSelector(definition);
|
2681
2712
|
let topics = [];
|
2682
2713
|
if (args && "inputs" in abiItem) {
|
2683
|
-
const args_ = Array.isArray(args) ? args : _nullishCoalesce(_optionalChain([abiItem, 'access',
|
2684
|
-
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(
|
2685
2716
|
(param, i) => Array.isArray(args_[i]) ? args_[i].map(
|
2686
2717
|
(_, j) => encodeArg({ param, value: args_[i][j] })
|
2687
2718
|
) : args_[i] ? encodeArg({ param, value: args_[i] }) : null
|
@@ -2829,19 +2860,30 @@ function formatAbiItemWithArgs({
|
|
2829
2860
|
}
|
2830
2861
|
|
2831
2862
|
// src/utils/account.ts
|
2832
|
-
function getAccount(
|
2833
|
-
if (typeof
|
2834
|
-
if (!isAddress(
|
2835
|
-
throw new InvalidAddressError({ address:
|
2836
|
-
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
|
+
};
|
2837
2871
|
}
|
2838
|
-
if (!isAddress(
|
2839
|
-
throw new InvalidAddressError({ address:
|
2872
|
+
if (!isAddress(source.address))
|
2873
|
+
throw new InvalidAddressError({ address: source.address });
|
2840
2874
|
return {
|
2841
|
-
|
2875
|
+
address: source.address,
|
2876
|
+
signMessage: source.signMessage,
|
2877
|
+
signTransaction: source.signTransaction,
|
2878
|
+
signTypedData: source.signTypedData,
|
2842
2879
|
type: "local"
|
2843
2880
|
};
|
2844
2881
|
}
|
2882
|
+
function parseAccount(account) {
|
2883
|
+
if (typeof account === "string")
|
2884
|
+
return { address: account, type: "json-rpc" };
|
2885
|
+
return account;
|
2886
|
+
}
|
2845
2887
|
|
2846
2888
|
// src/utils/promise/withCache.ts
|
2847
2889
|
var promiseCache = /* @__PURE__ */ new Map();
|
@@ -2938,7 +2980,7 @@ function withTimeout(fn, {
|
|
2938
2980
|
}
|
2939
2981
|
}, timeout);
|
2940
2982
|
}
|
2941
|
-
resolve(await fn({ signal: _optionalChain([controller, 'optionalAccess',
|
2983
|
+
resolve(await fn({ signal: _optionalChain([controller, 'optionalAccess', _47 => _47.signal]) }));
|
2942
2984
|
} catch (err) {
|
2943
2985
|
if (err.name === "AbortError")
|
2944
2986
|
reject(errorInstance);
|
@@ -3004,8 +3046,8 @@ function buildRequest(request, {
|
|
3004
3046
|
{
|
3005
3047
|
delay: ({ count, error }) => {
|
3006
3048
|
if (error && error instanceof HttpRequestError) {
|
3007
|
-
const retryAfter = _optionalChain([error, 'optionalAccess',
|
3008
|
-
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/)]))
|
3009
3051
|
return parseInt(retryAfter) * 1e3;
|
3010
3052
|
}
|
3011
3053
|
return ~~(1 << count) * retryDelay;
|
@@ -3025,7 +3067,7 @@ function getChainContractAddress({
|
|
3025
3067
|
chain,
|
3026
3068
|
contract: name
|
3027
3069
|
}) {
|
3028
|
-
const contract = _optionalChain([chain, 'optionalAccess',
|
3070
|
+
const contract = _optionalChain([chain, 'optionalAccess', _53 => _53.contracts, 'optionalAccess', _54 => _54[name]]);
|
3029
3071
|
if (!contract)
|
3030
3072
|
throw new ChainDoesNotSupportContract({
|
3031
3073
|
chain,
|
@@ -3062,7 +3104,7 @@ function defineFormatter({
|
|
3062
3104
|
}
|
3063
3105
|
return {
|
3064
3106
|
...formatted,
|
3065
|
-
..._optionalChain([formatOverride, 'optionalCall',
|
3107
|
+
..._optionalChain([formatOverride, 'optionalCall', _55 => _55(data)])
|
3066
3108
|
};
|
3067
3109
|
};
|
3068
3110
|
}
|
@@ -3105,7 +3147,7 @@ var defineTransaction = defineFormatter({ format: formatTransaction });
|
|
3105
3147
|
|
3106
3148
|
// src/utils/formatters/block.ts
|
3107
3149
|
function formatBlock(block) {
|
3108
|
-
const transactions = _optionalChain([block, 'access',
|
3150
|
+
const transactions = _optionalChain([block, 'access', _56 => _56.transactions, 'optionalAccess', _57 => _57.map, 'call', _58 => _58((transaction) => {
|
3109
3151
|
if (typeof transaction === "string")
|
3110
3152
|
return transaction;
|
3111
3153
|
return formatTransaction(transaction);
|
@@ -3134,7 +3176,7 @@ function extract(value, { formatter }) {
|
|
3134
3176
|
return {};
|
3135
3177
|
const keys = Object.keys(formatter({}));
|
3136
3178
|
return keys.reduce((data, key) => {
|
3137
|
-
if (_optionalChain([value, 'optionalAccess',
|
3179
|
+
if (_optionalChain([value, 'optionalAccess', _59 => _59.hasOwnProperty, 'call', _60 => _60(key)])) {
|
3138
3180
|
;
|
3139
3181
|
data[key] = value[key];
|
3140
3182
|
}
|
@@ -3148,7 +3190,7 @@ function formatFeeHistory(feeHistory) {
|
|
3148
3190
|
baseFeePerGas: feeHistory.baseFeePerGas.map((value) => BigInt(value)),
|
3149
3191
|
gasUsedRatio: feeHistory.gasUsedRatio,
|
3150
3192
|
oldestBlock: BigInt(feeHistory.oldestBlock),
|
3151
|
-
reward: _optionalChain([feeHistory, 'access',
|
3193
|
+
reward: _optionalChain([feeHistory, 'access', _61 => _61.reward, 'optionalAccess', _62 => _62.map, 'call', _63 => _63(
|
3152
3194
|
(reward) => reward.map((value) => BigInt(value))
|
3153
3195
|
)])
|
3154
3196
|
};
|
@@ -3216,34 +3258,34 @@ function getNodeError(err, args) {
|
|
3216
3258
|
if (FeeCapTooHighError.nodeMessage.test(message))
|
3217
3259
|
return new FeeCapTooHighError({
|
3218
3260
|
cause: err,
|
3219
|
-
maxFeePerGas: _optionalChain([args, 'optionalAccess',
|
3261
|
+
maxFeePerGas: _optionalChain([args, 'optionalAccess', _64 => _64.maxFeePerGas])
|
3220
3262
|
});
|
3221
3263
|
else if (FeeCapTooLowError.nodeMessage.test(message))
|
3222
3264
|
return new FeeCapTooLowError({
|
3223
3265
|
cause: err,
|
3224
|
-
maxFeePerGas: _optionalChain([args, 'optionalAccess',
|
3266
|
+
maxFeePerGas: _optionalChain([args, 'optionalAccess', _65 => _65.maxFeePerGas])
|
3225
3267
|
});
|
3226
3268
|
else if (NonceTooHighError.nodeMessage.test(message))
|
3227
|
-
return new NonceTooHighError({ cause: err, nonce: _optionalChain([args, 'optionalAccess',
|
3269
|
+
return new NonceTooHighError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _66 => _66.nonce]) });
|
3228
3270
|
else if (NonceTooLowError.nodeMessage.test(message))
|
3229
|
-
return new NonceTooLowError({ cause: err, nonce: _optionalChain([args, 'optionalAccess',
|
3271
|
+
return new NonceTooLowError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _67 => _67.nonce]) });
|
3230
3272
|
else if (NonceMaxValueError.nodeMessage.test(message))
|
3231
|
-
return new NonceMaxValueError({ cause: err, nonce: _optionalChain([args, 'optionalAccess',
|
3273
|
+
return new NonceMaxValueError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _68 => _68.nonce]) });
|
3232
3274
|
else if (InsufficientFundsError.nodeMessage.test(message))
|
3233
3275
|
return new InsufficientFundsError({ cause: err });
|
3234
3276
|
else if (IntrinsicGasTooHighError.nodeMessage.test(message))
|
3235
|
-
return new IntrinsicGasTooHighError({ cause: err, gas: _optionalChain([args, 'optionalAccess',
|
3277
|
+
return new IntrinsicGasTooHighError({ cause: err, gas: _optionalChain([args, 'optionalAccess', _69 => _69.gas]) });
|
3236
3278
|
else if (IntrinsicGasTooLowError.nodeMessage.test(message))
|
3237
|
-
return new IntrinsicGasTooLowError({ cause: err, gas: _optionalChain([args, 'optionalAccess',
|
3279
|
+
return new IntrinsicGasTooLowError({ cause: err, gas: _optionalChain([args, 'optionalAccess', _70 => _70.gas]) });
|
3238
3280
|
else if (TransactionTypeNotSupportedError.nodeMessage.test(message))
|
3239
3281
|
return new TransactionTypeNotSupportedError({ cause: err });
|
3240
3282
|
else if (TipAboveFeeCapError.nodeMessage.test(message))
|
3241
3283
|
return new TipAboveFeeCapError({
|
3242
3284
|
cause: err,
|
3243
|
-
maxFeePerGas: _optionalChain([args, 'optionalAccess',
|
3244
|
-
maxPriorityFeePerGas: _optionalChain([args, 'optionalAccess',
|
3285
|
+
maxFeePerGas: _optionalChain([args, 'optionalAccess', _71 => _71.maxFeePerGas]),
|
3286
|
+
maxPriorityFeePerGas: _optionalChain([args, 'optionalAccess', _72 => _72.maxPriorityFeePerGas])
|
3245
3287
|
});
|
3246
|
-
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)
|
3247
3289
|
return new ExecutionRevertedError({
|
3248
3290
|
cause: err,
|
3249
3291
|
message: err.cause.details
|
@@ -3277,7 +3319,7 @@ function getContractError(err, {
|
|
3277
3319
|
functionName,
|
3278
3320
|
sender
|
3279
3321
|
}) {
|
3280
|
-
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 || {};
|
3281
3323
|
let cause = err;
|
3282
3324
|
if (err instanceof AbiDecodingZeroDataError) {
|
3283
3325
|
cause = new ContractFunctionZeroDataError({ functionName });
|
@@ -3366,7 +3408,7 @@ async function http(url, { body, fetchOptions = {}, timeout = 1e4 }) {
|
|
3366
3408
|
}
|
3367
3409
|
);
|
3368
3410
|
let data;
|
3369
|
-
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")])) {
|
3370
3412
|
data = await response.json();
|
3371
3413
|
} else {
|
3372
3414
|
data = await response.text();
|
@@ -3458,15 +3500,15 @@ function webSocket(socket, {
|
|
3458
3500
|
if (typeof message.id === "number" && id_ !== message.id)
|
3459
3501
|
return;
|
3460
3502
|
if (message.error) {
|
3461
|
-
_optionalChain([onError, 'optionalCall',
|
3503
|
+
_optionalChain([onError, 'optionalCall', _83 => _83(new RpcError({ body, error: message.error, url: socket.url }))]);
|
3462
3504
|
} else {
|
3463
|
-
_optionalChain([onData, 'optionalCall',
|
3505
|
+
_optionalChain([onData, 'optionalCall', _84 => _84(message)]);
|
3464
3506
|
}
|
3465
3507
|
if (body.method === "eth_subscribe" && typeof message.result === "string") {
|
3466
3508
|
socket.subscriptions.set(message.result, callback);
|
3467
3509
|
}
|
3468
3510
|
if (body.method === "eth_unsubscribe") {
|
3469
|
-
socket.subscriptions.delete(_optionalChain([body, 'access',
|
3511
|
+
socket.subscriptions.delete(_optionalChain([body, 'access', _85 => _85.params, 'optionalAccess', _86 => _86[0]]));
|
3470
3512
|
}
|
3471
3513
|
};
|
3472
3514
|
socket.requests.set(id_, callback);
|
@@ -3507,6 +3549,163 @@ ${messageBytes.length}`
|
|
3507
3549
|
return keccak256(concat([prefixBytes, messageBytes]), to_);
|
3508
3550
|
}
|
3509
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
|
+
|
3510
3709
|
// src/utils/signature/recoverAddress.ts
|
3511
3710
|
var _secp256k1 = require('@noble/secp256k1');
|
3512
3711
|
function recoverAddress({
|
@@ -3535,6 +3734,25 @@ function recoverMessageAddress({
|
|
3535
3734
|
return recoverAddress({ hash: hashMessage(message), signature });
|
3536
3735
|
}
|
3537
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
|
+
|
3538
3756
|
// src/utils/signature/verifyMessage.ts
|
3539
3757
|
function verifyMessage({
|
3540
3758
|
address,
|
@@ -3547,9 +3765,37 @@ function verifyMessage({
|
|
3547
3765
|
);
|
3548
3766
|
}
|
3549
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
|
+
|
3550
3789
|
// src/utils/transaction/assertRequest.ts
|
3551
3790
|
function assertRequest(args) {
|
3552
|
-
const {
|
3791
|
+
const {
|
3792
|
+
account: account_,
|
3793
|
+
gasPrice,
|
3794
|
+
maxFeePerGas,
|
3795
|
+
maxPriorityFeePerGas,
|
3796
|
+
to
|
3797
|
+
} = args;
|
3798
|
+
const account = account_ ? parseAccount(account_) : void 0;
|
3553
3799
|
if (account && !isAddress(account.address))
|
3554
3800
|
throw new InvalidAddressError({ address: account.address });
|
3555
3801
|
if (to && !isAddress(to))
|
@@ -3565,7 +3811,7 @@ function assertRequest(args) {
|
|
3565
3811
|
// src/actions/public/call.ts
|
3566
3812
|
async function call(client, args) {
|
3567
3813
|
const {
|
3568
|
-
account,
|
3814
|
+
account: account_,
|
3569
3815
|
blockNumber,
|
3570
3816
|
blockTag = "latest",
|
3571
3817
|
accessList,
|
@@ -3579,13 +3825,14 @@ async function call(client, args) {
|
|
3579
3825
|
value,
|
3580
3826
|
...rest
|
3581
3827
|
} = args;
|
3828
|
+
const account = account_ ? parseAccount(account_) : void 0;
|
3582
3829
|
try {
|
3583
3830
|
assertRequest(args);
|
3584
3831
|
const blockNumberHex = blockNumber ? numberToHex(blockNumber) : void 0;
|
3585
|
-
const formatter = _optionalChain([client, 'access',
|
3832
|
+
const formatter = _optionalChain([client, 'access', _93 => _93.chain, 'optionalAccess', _94 => _94.formatters, 'optionalAccess', _95 => _95.transactionRequest]);
|
3586
3833
|
const request_ = format3(
|
3587
3834
|
{
|
3588
|
-
from: _optionalChain([account, 'optionalAccess',
|
3835
|
+
from: _optionalChain([account, 'optionalAccess', _96 => _96.address]),
|
3589
3836
|
accessList,
|
3590
3837
|
data,
|
3591
3838
|
gas,
|
@@ -3612,6 +3859,7 @@ async function call(client, args) {
|
|
3612
3859
|
} catch (err) {
|
3613
3860
|
throw getCallError(err, {
|
3614
3861
|
...args,
|
3862
|
+
account,
|
3615
3863
|
chain: client.chain
|
3616
3864
|
});
|
3617
3865
|
}
|
@@ -3625,6 +3873,7 @@ async function simulateContract(client, {
|
|
3625
3873
|
functionName,
|
3626
3874
|
...callRequest
|
3627
3875
|
}) {
|
3876
|
+
const account = callRequest.account ? parseAccount(callRequest.account) : void 0;
|
3628
3877
|
const calldata = encodeFunctionData({
|
3629
3878
|
abi,
|
3630
3879
|
args,
|
@@ -3659,7 +3908,7 @@ async function simulateContract(client, {
|
|
3659
3908
|
args,
|
3660
3909
|
docsPath: "/docs/contract/simulateContract",
|
3661
3910
|
functionName,
|
3662
|
-
sender: _optionalChain([
|
3911
|
+
sender: _optionalChain([account, 'optionalAccess', _97 => _97.address])
|
3663
3912
|
});
|
3664
3913
|
}
|
3665
3914
|
}
|
@@ -3751,9 +4000,13 @@ async function createContractEventFilter(client, {
|
|
3751
4000
|
|
3752
4001
|
// src/actions/public/estimateGas.ts
|
3753
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);
|
3754
4008
|
try {
|
3755
4009
|
const {
|
3756
|
-
account,
|
3757
4010
|
accessList,
|
3758
4011
|
blockNumber,
|
3759
4012
|
blockTag = "latest",
|
@@ -3766,10 +4019,10 @@ async function estimateGas(client, args) {
|
|
3766
4019
|
to,
|
3767
4020
|
value,
|
3768
4021
|
...rest
|
3769
|
-
} =
|
4022
|
+
} = account.type === "local" ? await prepareRequest(client, args) : args;
|
3770
4023
|
const blockNumberHex = blockNumber ? numberToHex(blockNumber) : void 0;
|
3771
4024
|
assertRequest(args);
|
3772
|
-
const formatter = _optionalChain([client, 'access',
|
4025
|
+
const formatter = _optionalChain([client, 'access', _98 => _98.chain, 'optionalAccess', _99 => _99.formatters, 'optionalAccess', _100 => _100.transactionRequest]);
|
3773
4026
|
const request = format3(
|
3774
4027
|
{
|
3775
4028
|
from: account.address,
|
@@ -3797,6 +4050,7 @@ async function estimateGas(client, args) {
|
|
3797
4050
|
} catch (err) {
|
3798
4051
|
throw getEstimateGasError(err, {
|
3799
4052
|
...args,
|
4053
|
+
account,
|
3800
4054
|
chain: client.chain
|
3801
4055
|
});
|
3802
4056
|
}
|
@@ -3810,6 +4064,7 @@ async function estimateContractGas(client, {
|
|
3810
4064
|
functionName,
|
3811
4065
|
...request
|
3812
4066
|
}) {
|
4067
|
+
const account = parseAccount(request.account);
|
3813
4068
|
const data = encodeFunctionData({
|
3814
4069
|
abi,
|
3815
4070
|
args,
|
@@ -3829,7 +4084,7 @@ async function estimateContractGas(client, {
|
|
3829
4084
|
args,
|
3830
4085
|
docsPath: "/docs/contract/simulateContract",
|
3831
4086
|
functionName,
|
3832
|
-
sender: _optionalChain([
|
4087
|
+
sender: _optionalChain([account, 'optionalAccess', _101 => _101.address])
|
3833
4088
|
});
|
3834
4089
|
}
|
3835
4090
|
}
|
@@ -3867,7 +4122,7 @@ async function getBlock(client, {
|
|
3867
4122
|
if (!block)
|
3868
4123
|
throw new BlockNotFoundError({ blockHash, blockNumber });
|
3869
4124
|
return format3(block, {
|
3870
|
-
formatter: _optionalChain([client, 'access',
|
4125
|
+
formatter: _optionalChain([client, 'access', _102 => _102.chain, 'optionalAccess', _103 => _103.formatters, 'optionalAccess', _104 => _104.block]) || formatBlock
|
3871
4126
|
});
|
3872
4127
|
}
|
3873
4128
|
|
@@ -4079,7 +4334,7 @@ async function getTransaction(client, {
|
|
4079
4334
|
index
|
4080
4335
|
});
|
4081
4336
|
return format3(transaction, {
|
4082
|
-
formatter: _optionalChain([client, 'access',
|
4337
|
+
formatter: _optionalChain([client, 'access', _105 => _105.chain, 'optionalAccess', _106 => _106.formatters, 'optionalAccess', _107 => _107.transaction]) || formatTransaction
|
4083
4338
|
});
|
4084
4339
|
}
|
4085
4340
|
|
@@ -4089,7 +4344,7 @@ async function getTransactionConfirmations(client, { hash: hash2, transactionRec
|
|
4089
4344
|
getBlockNumber(client),
|
4090
4345
|
hash2 ? getTransaction(client, { hash: hash2 }) : void 0
|
4091
4346
|
]);
|
4092
|
-
const transactionBlockNumber = _optionalChain([transactionReceipt, 'optionalAccess',
|
4347
|
+
const transactionBlockNumber = _optionalChain([transactionReceipt, 'optionalAccess', _108 => _108.blockNumber]) || _optionalChain([transaction, 'optionalAccess', _109 => _109.blockNumber]);
|
4093
4348
|
if (!transactionBlockNumber)
|
4094
4349
|
return 0n;
|
4095
4350
|
return blockNumber - transactionBlockNumber + 1n;
|
@@ -4113,7 +4368,7 @@ async function getTransactionReceipt(client, { hash: hash2 }) {
|
|
4113
4368
|
if (!receipt)
|
4114
4369
|
throw new TransactionReceiptNotFoundError({ hash: hash2 });
|
4115
4370
|
return format3(receipt, {
|
4116
|
-
formatter: _optionalChain([client, 'access',
|
4371
|
+
formatter: _optionalChain([client, 'access', _110 => _110.chain, 'optionalAccess', _111 => _111.formatters, 'optionalAccess', _112 => _112.transactionReceipt]) || formatTransactionReceipt
|
4117
4372
|
});
|
4118
4373
|
}
|
4119
4374
|
|
@@ -4282,7 +4537,7 @@ function observe(observerId, callbacks, fn) {
|
|
4282
4537
|
const listeners2 = getListeners();
|
4283
4538
|
if (listeners2.length === 0)
|
4284
4539
|
return;
|
4285
|
-
listeners2.forEach((listener) => _optionalChain([listener, 'access',
|
4540
|
+
listeners2.forEach((listener) => _optionalChain([listener, 'access', _113 => _113.fns, 'access', _114 => _114[key], 'optionalCall', _115 => _115(...args)]));
|
4286
4541
|
};
|
4287
4542
|
}
|
4288
4543
|
const cleanup = fn(emit);
|
@@ -4363,7 +4618,7 @@ async function waitForTransactionReceipt(client, {
|
|
4363
4618
|
reason = "cancelled";
|
4364
4619
|
}
|
4365
4620
|
done(() => {
|
4366
|
-
_optionalChain([emit, 'access',
|
4621
|
+
_optionalChain([emit, 'access', _116 => _116.onReplaced, 'optionalCall', _117 => _117({
|
4367
4622
|
reason,
|
4368
4623
|
replacedTransaction,
|
4369
4624
|
transaction: replacementTransaction,
|
@@ -4391,7 +4646,7 @@ function poll(fn, { emitOnBegin, initialWaitTime, interval }) {
|
|
4391
4646
|
let data;
|
4392
4647
|
if (emitOnBegin)
|
4393
4648
|
data = await fn({ unpoll: unwatch });
|
4394
|
-
const initialWait = await _asyncNullishCoalesce(await _optionalChain([initialWaitTime, 'optionalCall',
|
4649
|
+
const initialWait = await _asyncNullishCoalesce(await _optionalChain([initialWaitTime, 'optionalCall', _118 => _118(data)]), async () => ( interval));
|
4395
4650
|
await wait(initialWait);
|
4396
4651
|
const poll2 = async () => {
|
4397
4652
|
if (!active)
|
@@ -4444,7 +4699,7 @@ function watchBlockNumber(client, {
|
|
4444
4699
|
prevBlockNumber = blockNumber;
|
4445
4700
|
}
|
4446
4701
|
} catch (err) {
|
4447
|
-
_optionalChain([emit, 'access',
|
4702
|
+
_optionalChain([emit, 'access', _119 => _119.onError, 'optionalCall', _120 => _120(err)]);
|
4448
4703
|
}
|
4449
4704
|
},
|
4450
4705
|
{
|
@@ -4484,11 +4739,11 @@ function watchBlocks(client, {
|
|
4484
4739
|
blockTag,
|
4485
4740
|
includeTransactions
|
4486
4741
|
});
|
4487
|
-
if (block.number && _optionalChain([prevBlock, 'optionalAccess',
|
4742
|
+
if (block.number && _optionalChain([prevBlock, 'optionalAccess', _121 => _121.number])) {
|
4488
4743
|
if (block.number === prevBlock.number)
|
4489
4744
|
return;
|
4490
4745
|
if (block.number - prevBlock.number > 1 && emitMissed) {
|
4491
|
-
for (let i = _optionalChain([prevBlock, 'optionalAccess',
|
4746
|
+
for (let i = _optionalChain([prevBlock, 'optionalAccess', _122 => _122.number]) + 1n; i < block.number; i++) {
|
4492
4747
|
const block2 = await getBlock(client, {
|
4493
4748
|
blockNumber: i,
|
4494
4749
|
includeTransactions
|
@@ -4500,8 +4755,8 @@ function watchBlocks(client, {
|
|
4500
4755
|
}
|
4501
4756
|
if (
|
4502
4757
|
// If no previous block exists, emit.
|
4503
|
-
!_optionalChain([prevBlock, 'optionalAccess',
|
4504
|
-
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.
|
4505
4760
|
// We don't want to emit blocks in the past.
|
4506
4761
|
block.number && block.number > prevBlock.number
|
4507
4762
|
) {
|
@@ -4509,7 +4764,7 @@ function watchBlocks(client, {
|
|
4509
4764
|
prevBlock = block;
|
4510
4765
|
}
|
4511
4766
|
} catch (err) {
|
4512
|
-
_optionalChain([emit, 'access',
|
4767
|
+
_optionalChain([emit, 'access', _125 => _125.onError, 'optionalCall', _126 => _126(err)]);
|
4513
4768
|
}
|
4514
4769
|
},
|
4515
4770
|
{
|
@@ -4588,7 +4843,7 @@ function watchContractEvent(client, {
|
|
4588
4843
|
else
|
4589
4844
|
logs.forEach((log) => emit.onLogs([log]));
|
4590
4845
|
} catch (err) {
|
4591
|
-
_optionalChain([emit, 'access',
|
4846
|
+
_optionalChain([emit, 'access', _127 => _127.onError, 'optionalCall', _128 => _128(err)]);
|
4592
4847
|
}
|
4593
4848
|
},
|
4594
4849
|
{
|
@@ -4667,7 +4922,7 @@ function watchEvent(client, {
|
|
4667
4922
|
else
|
4668
4923
|
logs.forEach((log) => emit.onLogs([log]));
|
4669
4924
|
} catch (err) {
|
4670
|
-
_optionalChain([emit, 'access',
|
4925
|
+
_optionalChain([emit, 'access', _129 => _129.onError, 'optionalCall', _130 => _130(err)]);
|
4671
4926
|
}
|
4672
4927
|
},
|
4673
4928
|
{
|
@@ -4718,7 +4973,7 @@ function watchPendingTransactions(client, {
|
|
4718
4973
|
else
|
4719
4974
|
hashes.forEach((hash2) => emit.onTransactions([hash2]));
|
4720
4975
|
} catch (err) {
|
4721
|
-
_optionalChain([emit, 'access',
|
4976
|
+
_optionalChain([emit, 'access', _131 => _131.onError, 'optionalCall', _132 => _132(err)]);
|
4722
4977
|
}
|
4723
4978
|
},
|
4724
4979
|
{
|
@@ -4980,7 +5235,12 @@ async function addChain(client, { chain }) {
|
|
4980
5235
|
}
|
4981
5236
|
|
4982
5237
|
// src/actions/wallet/deployContract.ts
|
4983
|
-
function deployContract(walletClient, {
|
5238
|
+
function deployContract(walletClient, {
|
5239
|
+
abi,
|
5240
|
+
args,
|
5241
|
+
bytecode,
|
5242
|
+
...request
|
5243
|
+
}) {
|
4984
5244
|
const calldata = encodeDeployData({
|
4985
5245
|
abi,
|
4986
5246
|
args,
|
@@ -5021,10 +5281,9 @@ async function requestPermissions(client, permissions) {
|
|
5021
5281
|
// src/actions/wallet/sendTransaction.ts
|
5022
5282
|
async function sendTransaction(client, args) {
|
5023
5283
|
const {
|
5024
|
-
account,
|
5284
|
+
account: account_ = client.account,
|
5025
5285
|
chain = client.chain,
|
5026
5286
|
accessList,
|
5027
|
-
assertChain = true,
|
5028
5287
|
data,
|
5029
5288
|
gas,
|
5030
5289
|
gasPrice,
|
@@ -5035,13 +5294,20 @@ async function sendTransaction(client, args) {
|
|
5035
5294
|
value,
|
5036
5295
|
...rest
|
5037
5296
|
} = args;
|
5297
|
+
if (!account_)
|
5298
|
+
throw new AccountNotFoundError({
|
5299
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
5300
|
+
});
|
5301
|
+
const account = parseAccount(account_);
|
5038
5302
|
try {
|
5039
5303
|
assertRequest(args);
|
5040
|
-
const
|
5041
|
-
if (
|
5042
|
-
|
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
|
+
}
|
5043
5310
|
if (account.type === "local") {
|
5044
|
-
const chainId = _nullishCoalesce(_optionalChain([chain, 'optionalAccess', _128 => _128.id]), () => ( currentChainId));
|
5045
5311
|
const request2 = await prepareRequest(client, {
|
5046
5312
|
account,
|
5047
5313
|
accessList,
|
@@ -5065,7 +5331,7 @@ async function sendTransaction(client, args) {
|
|
5065
5331
|
params: [signedRequest]
|
5066
5332
|
});
|
5067
5333
|
}
|
5068
|
-
const formatter = _optionalChain([chain, 'optionalAccess',
|
5334
|
+
const formatter = _optionalChain([chain, 'optionalAccess', _134 => _134.formatters, 'optionalAccess', _135 => _135.transactionRequest]);
|
5069
5335
|
const request = format3(
|
5070
5336
|
{
|
5071
5337
|
accessList,
|
@@ -5090,12 +5356,25 @@ async function sendTransaction(client, args) {
|
|
5090
5356
|
params: [request]
|
5091
5357
|
});
|
5092
5358
|
} catch (err) {
|
5093
|
-
throw getTransactionError(err,
|
5359
|
+
throw getTransactionError(err, {
|
5360
|
+
...args,
|
5361
|
+
account,
|
5362
|
+
chain: args.chain || void 0
|
5363
|
+
});
|
5094
5364
|
}
|
5095
5365
|
}
|
5096
5366
|
|
5097
5367
|
// src/actions/wallet/signMessage.ts
|
5098
|
-
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_);
|
5099
5378
|
const message_ = message || data;
|
5100
5379
|
if (account.type === "local")
|
5101
5380
|
return account.signMessage(message_);
|
@@ -5107,22 +5386,27 @@ async function signMessage(client, { account, data, message }) {
|
|
5107
5386
|
|
5108
5387
|
// src/actions/wallet/signTypedData.ts
|
5109
5388
|
async function signTypedData(client, {
|
5110
|
-
account,
|
5389
|
+
account: account_ = client.account,
|
5111
5390
|
domain,
|
5112
5391
|
message,
|
5113
5392
|
primaryType,
|
5114
5393
|
types: types_
|
5115
5394
|
}) {
|
5395
|
+
if (!account_)
|
5396
|
+
throw new AccountNotFoundError({
|
5397
|
+
docsPath: "/docs/actions/wallet/signTypedData"
|
5398
|
+
});
|
5399
|
+
const account = parseAccount(account_);
|
5116
5400
|
const types = {
|
5117
5401
|
EIP712Domain: [
|
5118
|
-
_optionalChain([domain, 'optionalAccess',
|
5119
|
-
_optionalChain([domain, 'optionalAccess',
|
5120
|
-
_optionalChain([domain, 'optionalAccess',
|
5121
|
-
_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]) && {
|
5122
5406
|
name: "verifyingContract",
|
5123
5407
|
type: "address"
|
5124
5408
|
},
|
5125
|
-
_optionalChain([domain, 'optionalAccess',
|
5409
|
+
_optionalChain([domain, 'optionalAccess', _140 => _140.salt]) && { name: "salt", type: "bytes32" }
|
5126
5410
|
].filter(Boolean),
|
5127
5411
|
...types_
|
5128
5412
|
};
|
@@ -5262,7 +5546,17 @@ function parseGwei(ether, unit = "wei") {
|
|
5262
5546
|
// src/utils/transaction/prepareRequest.ts
|
5263
5547
|
var defaultTip = parseGwei("1.5");
|
5264
5548
|
async function prepareRequest(client, args) {
|
5265
|
-
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_);
|
5266
5560
|
const block = await getBlock(client, { blockTag: "latest" });
|
5267
5561
|
const request = { ...args, from: account.address };
|
5268
5562
|
if (typeof nonce === "undefined")
|
@@ -5592,5 +5886,9 @@ function parseEther(ether, unit = "wei") {
|
|
5592
5886
|
|
5593
5887
|
|
5594
5888
|
|
5595
|
-
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;
|
5596
|
-
|
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
|