viem 0.0.1-alpha.33 → 0.0.1-alpha.35
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/LICENSE +1 -1
- package/abi/package.json +4 -0
- package/dist/abi.d.ts +5 -0
- package/dist/abi.js +11 -0
- package/dist/abi.js.map +1 -0
- package/dist/abi.mjs +11 -0
- package/dist/abi.mjs.map +1 -0
- package/dist/{chain-ce6e149c.d.ts → chain-145cfaf3.d.ts} +1 -1
- package/dist/{chain-4a0d4164.d.ts → chain-7b7ac245.d.ts} +2 -2
- package/dist/chains.d.ts +3 -3
- package/dist/chains.js +46 -46
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-DHSIBSJL.js → chunk-3FT7UKPT.js} +75 -75
- package/dist/chunk-3FT7UKPT.js.map +1 -0
- package/dist/{chunk-BUCF6SRR.js → chunk-57YM6E7I.js} +22 -22
- package/dist/{chunk-KMBDF3HQ.mjs → chunk-5NDMORWZ.mjs} +3 -3
- package/dist/{chunk-3CEIPU6M.js → chunk-A665BF7O.js} +24 -16
- package/dist/chunk-A665BF7O.js.map +1 -0
- package/dist/{chunk-R7MSY2BH.js → chunk-HQCSH22G.js} +128 -83
- package/dist/chunk-HQCSH22G.js.map +1 -0
- package/dist/{chunk-JB4TWW3U.mjs → chunk-PBW4YL37.mjs} +89 -44
- package/dist/chunk-PBW4YL37.mjs.map +1 -0
- package/dist/{chunk-VEAHSGOL.mjs → chunk-PH5LCMME.mjs} +10 -2
- package/dist/chunk-PH5LCMME.mjs.map +1 -0
- package/dist/{chunk-RNGEVZVH.js → chunk-TJK6AFBM.js} +14 -14
- package/dist/{chunk-RNGEVZVH.js.map → chunk-TJK6AFBM.js.map} +1 -1
- package/dist/{chunk-HN7IYO7U.mjs → chunk-WQDVW7EJ.mjs} +2 -2
- package/dist/chunk-WQDVW7EJ.mjs.map +1 -0
- package/dist/{chunk-DYALOQ44.mjs → chunk-YEVW7GK5.mjs} +2 -2
- package/dist/{chunk-DYALOQ44.mjs.map → chunk-YEVW7GK5.mjs.map} +1 -1
- package/dist/contract.d.ts +7 -8
- package/dist/contract.js +4 -4
- package/dist/contract.mjs +10 -10
- package/dist/{createClient-8a8b4bf4.d.ts → createClient-7c715e2c.d.ts} +2 -2
- package/dist/{createPublicClient-b5afe6b8.d.ts → createPublicClient-4d24afb2.d.ts} +122 -9
- package/dist/{eip1193-8c021438.d.ts → eip1193-d538ae6d.d.ts} +11 -1
- package/dist/{getAbiItem-d7aa40b1.d.ts → encodeFunctionResult-f59f4cfe.d.ts} +3 -25
- package/dist/ens.d.ts +4 -5
- package/dist/ens.js +4 -4
- package/dist/ens.mjs +3 -3
- package/dist/{formatAbiItem-6e00e5e6.d.ts → formatAbiItem-89d97367.d.ts} +1 -1
- package/dist/getAbiItem-c9cbc8b8.d.ts +22 -0
- package/dist/index.d.ts +12 -13
- package/dist/index.js +91 -90
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -23
- package/dist/index.mjs.map +1 -1
- package/dist/{parseGwei-ce3a9dfa.d.ts → parseGwei-ad6d1914.d.ts} +5 -6
- package/dist/public.d.ts +5 -6
- package/dist/public.js +3 -3
- package/dist/public.mjs +2 -2
- package/dist/{test-5d5828c9.d.ts → test-8646fb50.d.ts} +9 -9
- package/dist/test.d.ts +5 -5
- package/dist/test.js +3 -3
- package/dist/test.mjs +2 -2
- package/dist/utils/index.d.ts +12 -14
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +5 -5
- package/dist/wallet.d.ts +5 -5
- package/dist/wallet.js +4 -3
- package/dist/wallet.mjs +3 -2
- package/dist/window.d.ts +2 -2
- package/package.json +8 -2
- package/dist/chunk-3CEIPU6M.js.map +0 -1
- package/dist/chunk-DHSIBSJL.js.map +0 -1
- package/dist/chunk-HN7IYO7U.mjs.map +0 -1
- package/dist/chunk-JB4TWW3U.mjs.map +0 -1
- package/dist/chunk-R7MSY2BH.js.map +0 -1
- package/dist/chunk-VEAHSGOL.mjs.map +0 -1
- package/dist/wallet-5ab86528.d.ts +0 -115
- /package/dist/{chunk-BUCF6SRR.js.map → chunk-57YM6E7I.js.map} +0 -0
- /package/dist/{chunk-KMBDF3HQ.mjs.map → chunk-5NDMORWZ.mjs.map} +0 -0
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
|
|
9
9
|
var package_default = {
|
10
10
|
name: "viem",
|
11
11
|
description: "TypeScript Interface for Ethereum",
|
12
|
-
version: "0.0.1-alpha.
|
12
|
+
version: "0.0.1-alpha.35",
|
13
13
|
scripts: {
|
14
14
|
anvil: "source .env && anvil --fork-url $VITE_ANVIL_FORK_URL --fork-block-number $VITE_ANVIL_BLOCK_NUMBER --block-time $VITE_ANVIL_BLOCK_TIME",
|
15
15
|
bench: "vitest bench --no-threads",
|
@@ -40,6 +40,7 @@ var package_default = {
|
|
40
40
|
tsup: {
|
41
41
|
entry: [
|
42
42
|
"src/index.ts",
|
43
|
+
"src/abi.ts",
|
43
44
|
"src/chains.ts",
|
44
45
|
"src/contract.ts",
|
45
46
|
"src/ens.ts",
|
@@ -51,6 +52,7 @@ var package_default = {
|
|
51
52
|
]
|
52
53
|
},
|
53
54
|
files: [
|
55
|
+
"/abi",
|
54
56
|
"/dist",
|
55
57
|
"/chains",
|
56
58
|
"/contract",
|
@@ -67,6 +69,11 @@ var package_default = {
|
|
67
69
|
module: "./dist/index.mts",
|
68
70
|
default: "./dist/index.js"
|
69
71
|
},
|
72
|
+
"./abi": {
|
73
|
+
types: "./dist/abi.d.ts",
|
74
|
+
module: "./dist/abi.mts",
|
75
|
+
default: "./dist/abi.js"
|
76
|
+
},
|
70
77
|
"./chains": {
|
71
78
|
types: "./dist/chains.d.ts",
|
72
79
|
module: "./dist/chains.mts",
|
@@ -116,7 +123,7 @@ var package_default = {
|
|
116
123
|
dependencies: {
|
117
124
|
"@noble/hashes": "^1.1.2",
|
118
125
|
"@wagmi/chains": "~0.2.8",
|
119
|
-
abitype: "~0.
|
126
|
+
abitype: "~0.5.0",
|
120
127
|
"idna-uts46-hx": "^4.1.2",
|
121
128
|
"isomorphic-ws": "^5.0.0",
|
122
129
|
ws: "^8.12.0"
|
@@ -268,6 +275,16 @@ var AbiEncodingArrayLengthMismatchError = class extends BaseError {
|
|
268
275
|
__publicField(this, "name", "AbiEncodingArrayLengthMismatchError");
|
269
276
|
}
|
270
277
|
};
|
278
|
+
var AbiEncodingBytesSizeMismatchError = class extends BaseError {
|
279
|
+
constructor({ expectedSize, value }) {
|
280
|
+
super(
|
281
|
+
`Size of bytes "${value}" (bytes${size(
|
282
|
+
value
|
283
|
+
)}) does not match expected size (bytes${expectedSize}).`
|
284
|
+
);
|
285
|
+
__publicField(this, "name", "AbiEncodingBytesSizeMismatchError");
|
286
|
+
}
|
287
|
+
};
|
271
288
|
var AbiEncodingLengthMismatchError = class extends BaseError {
|
272
289
|
constructor({
|
273
290
|
expectedLength,
|
@@ -489,6 +506,23 @@ var ChainDoesNotSupportContract = class extends BaseError {
|
|
489
506
|
__publicField(this, "name", "ChainDoesNotSupportContract");
|
490
507
|
}
|
491
508
|
};
|
509
|
+
var ChainMismatchError = class extends BaseError {
|
510
|
+
constructor({
|
511
|
+
chain,
|
512
|
+
currentChainId
|
513
|
+
}) {
|
514
|
+
super(
|
515
|
+
`The current chain (id: ${currentChainId}) does not match the chain passed to the request (id: ${chain.id} \u2013 ${chain.name}).`,
|
516
|
+
{
|
517
|
+
metaMessages: [
|
518
|
+
`Current Chain ID: ${currentChainId}`,
|
519
|
+
`Expected Chain ID: ${chain.id} \u2013 ${chain.name}`
|
520
|
+
]
|
521
|
+
}
|
522
|
+
);
|
523
|
+
__publicField(this, "name", "ChainMismatchError");
|
524
|
+
}
|
525
|
+
};
|
492
526
|
|
493
527
|
// src/constants/abis.ts
|
494
528
|
var multicall3Abi = [
|
@@ -593,9 +627,10 @@ var TransactionExecutionError = class extends BaseError {
|
|
593
627
|
value
|
594
628
|
}) {
|
595
629
|
const prettyArgs = prettyPrint({
|
630
|
+
chain: chain && `${_optionalChain([chain, 'optionalAccess', _4 => _4.name])} (id: ${_optionalChain([chain, 'optionalAccess', _5 => _5.id])})`,
|
596
631
|
from,
|
597
632
|
to,
|
598
|
-
value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess',
|
633
|
+
value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess', _6 => _6.nativeCurrency, 'access', _7 => _7.symbol]) || "ETH"}`,
|
599
634
|
data,
|
600
635
|
gas,
|
601
636
|
gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
|
@@ -673,7 +708,7 @@ var CallExecutionError = class extends BaseError {
|
|
673
708
|
const prettyArgs = prettyPrint({
|
674
709
|
from,
|
675
710
|
to,
|
676
|
-
value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess',
|
711
|
+
value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess', _8 => _8.nativeCurrency, 'access', _9 => _9.symbol]) || "ETH"}`,
|
677
712
|
data,
|
678
713
|
gas,
|
679
714
|
gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
|
@@ -715,7 +750,7 @@ var ContractFunctionExecutionError = class extends BaseError {
|
|
715
750
|
const prettyArgs = prettyPrint({
|
716
751
|
address: contractAddress && getContractAddress(contractAddress),
|
717
752
|
function: functionWithParams,
|
718
|
-
args: formattedArgs && formattedArgs !== "()" && `${[...Array(_nullishCoalesce(_optionalChain([functionName, 'optionalAccess',
|
753
|
+
args: formattedArgs && formattedArgs !== "()" && `${[...Array(_nullishCoalesce(_optionalChain([functionName, 'optionalAccess', _10 => _10.length]), () => ( 0))).keys()].map(() => " ").join("")}${formattedArgs}`,
|
719
754
|
sender
|
720
755
|
});
|
721
756
|
super(
|
@@ -774,7 +809,7 @@ var ContractFunctionRevertedError = class extends BaseError {
|
|
774
809
|
}) : void 0;
|
775
810
|
metaMessages = [
|
776
811
|
errorWithParams ? `Error: ${errorWithParams}` : "",
|
777
|
-
formattedArgs && formattedArgs !== "()" ? ` ${[...Array(_nullishCoalesce(_optionalChain([errorName, 'optionalAccess',
|
812
|
+
formattedArgs && formattedArgs !== "()" ? ` ${[...Array(_nullishCoalesce(_optionalChain([errorName, 'optionalAccess', _11 => _11.length]), () => ( 0))).keys()].map(() => " ").join("")}${formattedArgs}` : ""
|
778
813
|
];
|
779
814
|
}
|
780
815
|
} else if (message)
|
@@ -900,7 +935,7 @@ var EstimateGasExecutionError = class extends BaseError {
|
|
900
935
|
const prettyArgs = prettyPrint({
|
901
936
|
from,
|
902
937
|
to,
|
903
|
-
value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess',
|
938
|
+
value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess', _12 => _12.nativeCurrency, 'access', _13 => _13.symbol]) || "ETH"}`,
|
904
939
|
data,
|
905
940
|
gas,
|
906
941
|
gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
|
@@ -937,7 +972,7 @@ var ExecutionRevertedError = class extends BaseError {
|
|
937
972
|
cause,
|
938
973
|
message
|
939
974
|
} = {}) {
|
940
|
-
const reason = _optionalChain([message, 'optionalAccess',
|
975
|
+
const reason = _optionalChain([message, 'optionalAccess', _14 => _14.replace, 'call', _15 => _15("execution reverted: ", ""), 'optionalAccess', _16 => _16.replace, 'call', _17 => _17("execution reverted", "")]);
|
941
976
|
super(
|
942
977
|
`Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`,
|
943
978
|
{
|
@@ -1089,7 +1124,7 @@ var TipAboveFeeCapError = class extends BaseError {
|
|
1089
1124
|
__publicField(TipAboveFeeCapError, "nodeMessage", /max priority fee per gas higher than max fee per gas|tip higher than fee cap/);
|
1090
1125
|
var UnknownNodeError = class extends BaseError {
|
1091
1126
|
constructor({ cause }) {
|
1092
|
-
super(`An error occurred while executing: ${_optionalChain([cause, 'optionalAccess',
|
1127
|
+
super(`An error occurred while executing: ${_optionalChain([cause, 'optionalAccess', _18 => _18.message])}`, {
|
1093
1128
|
cause
|
1094
1129
|
});
|
1095
1130
|
__publicField(this, "name", "UnknownNodeError");
|
@@ -1517,11 +1552,6 @@ function stringToHex(value) {
|
|
1517
1552
|
|
1518
1553
|
// src/utils/encoding/toBytes.ts
|
1519
1554
|
var encoder = new TextEncoder();
|
1520
|
-
function boolToBytes(value) {
|
1521
|
-
const bytes = new Uint8Array(1);
|
1522
|
-
bytes[0] = Number(value);
|
1523
|
-
return bytes;
|
1524
|
-
}
|
1525
1555
|
function toBytes(value) {
|
1526
1556
|
if (typeof value === "number" || typeof value === "bigint")
|
1527
1557
|
return numberToBytes(value);
|
@@ -1531,6 +1561,11 @@ function toBytes(value) {
|
|
1531
1561
|
return hexToBytes(value);
|
1532
1562
|
return stringToBytes(value);
|
1533
1563
|
}
|
1564
|
+
function boolToBytes(value) {
|
1565
|
+
const bytes = new Uint8Array(1);
|
1566
|
+
bytes[0] = Number(value);
|
1567
|
+
return bytes;
|
1568
|
+
}
|
1534
1569
|
function hexToBytes(hex_) {
|
1535
1570
|
let hex = hex_.slice(2);
|
1536
1571
|
if (hex.length % 2)
|
@@ -1541,7 +1576,7 @@ function hexToBytes(hex_) {
|
|
1541
1576
|
const hexByte = hex.slice(start, start + 2);
|
1542
1577
|
const byte = Number.parseInt(hexByte, 16);
|
1543
1578
|
if (Number.isNaN(byte) || byte < 0)
|
1544
|
-
throw new
|
1579
|
+
throw new BaseError(`Invalid byte sequence ("${hexByte}" in "${hex}").`);
|
1545
1580
|
bytes[index] = byte;
|
1546
1581
|
}
|
1547
1582
|
return bytes;
|
@@ -1734,9 +1769,9 @@ function rlpToBytes(bytes, offset = 0) {
|
|
1734
1769
|
var paramsRegex = /((function|event)\s)?(.*)(\((.*)\))/;
|
1735
1770
|
function extractFunctionParts(def) {
|
1736
1771
|
const parts = def.match(paramsRegex);
|
1737
|
-
const type = _optionalChain([parts, 'optionalAccess',
|
1738
|
-
const name = _optionalChain([parts, 'optionalAccess',
|
1739
|
-
const params = _optionalChain([parts, 'optionalAccess',
|
1772
|
+
const type = _optionalChain([parts, 'optionalAccess', _19 => _19[2]]) || void 0;
|
1773
|
+
const name = _optionalChain([parts, 'optionalAccess', _20 => _20[3]]);
|
1774
|
+
const params = _optionalChain([parts, 'optionalAccess', _21 => _21[5]]) || void 0;
|
1740
1775
|
return { type, name, params };
|
1741
1776
|
}
|
1742
1777
|
function extractFunctionName(def) {
|
@@ -1744,8 +1779,8 @@ function extractFunctionName(def) {
|
|
1744
1779
|
}
|
1745
1780
|
function extractFunctionParams(def) {
|
1746
1781
|
const params = extractFunctionParts(def).params;
|
1747
|
-
const splitParams = _optionalChain([params, 'optionalAccess',
|
1748
|
-
return _optionalChain([splitParams, 'optionalAccess',
|
1782
|
+
const splitParams = _optionalChain([params, 'optionalAccess', _22 => _22.split, 'call', _23 => _23(","), 'access', _24 => _24.map, 'call', _25 => _25((x) => x.trim().split(" "))]);
|
1783
|
+
return _optionalChain([splitParams, 'optionalAccess', _26 => _26.map, 'call', _27 => _27((param) => ({
|
1749
1784
|
type: param[0],
|
1750
1785
|
name: param[1] === "indexed" ? param[2] : param[1],
|
1751
1786
|
...param[1] === "indexed" ? { indexed: true } : {}
|
@@ -1847,8 +1882,8 @@ function isAddressEqual(a, b) {
|
|
1847
1882
|
return a.toLowerCase() === b.toLowerCase();
|
1848
1883
|
}
|
1849
1884
|
|
1850
|
-
// src/utils/abi/
|
1851
|
-
function
|
1885
|
+
// src/utils/abi/encodeAbiParameters.ts
|
1886
|
+
function encodeAbiParameters(params, values) {
|
1852
1887
|
if (params.length !== values.length)
|
1853
1888
|
throw new AbiEncodingLengthMismatchError({
|
1854
1889
|
expectedLength: params.length,
|
@@ -1898,13 +1933,13 @@ function prepareParam({
|
|
1898
1933
|
return encodeNumber(value, { signed });
|
1899
1934
|
}
|
1900
1935
|
if (param.type.startsWith("bytes")) {
|
1901
|
-
return
|
1936
|
+
return encodeBytes(value, { param });
|
1902
1937
|
}
|
1903
1938
|
if (param.type === "string") {
|
1904
1939
|
return encodeString(value);
|
1905
1940
|
}
|
1906
1941
|
throw new InvalidAbiEncodingTypeError(param.type, {
|
1907
|
-
docsPath: "/docs/contract/
|
1942
|
+
docsPath: "/docs/contract/encodeAbiParameters"
|
1908
1943
|
});
|
1909
1944
|
}
|
1910
1945
|
function encodeParams(preparedParams) {
|
@@ -1932,6 +1967,8 @@ function encodeParams(preparedParams) {
|
|
1932
1967
|
return concat([...staticParams, ...dynamicParams]);
|
1933
1968
|
}
|
1934
1969
|
function encodeAddress(value) {
|
1970
|
+
if (!isAddress(value))
|
1971
|
+
throw new InvalidAddressError({ address: value });
|
1935
1972
|
return { dynamic: false, encoded: padHex(value.toLowerCase()) };
|
1936
1973
|
}
|
1937
1974
|
function encodeArray(value, {
|
@@ -1972,13 +2009,17 @@ function encodeArray(value, {
|
|
1972
2009
|
encoded: concat(preparedParams.map(({ encoded }) => encoded))
|
1973
2010
|
};
|
1974
2011
|
}
|
1975
|
-
function
|
2012
|
+
function encodeBytes(value, { param }) {
|
1976
2013
|
const [_, size_] = param.type.split("bytes");
|
1977
2014
|
if (!size_) {
|
1978
2015
|
const partsLength = Math.floor(size(value) / 32);
|
1979
2016
|
const parts = [];
|
1980
2017
|
for (let i = 0; i < partsLength + 1; i++) {
|
1981
|
-
parts.push(
|
2018
|
+
parts.push(
|
2019
|
+
padHex(slice(value, i * 32, (i + 1) * 32), {
|
2020
|
+
dir: "right"
|
2021
|
+
})
|
2022
|
+
);
|
1982
2023
|
}
|
1983
2024
|
return {
|
1984
2025
|
dynamic: true,
|
@@ -1988,6 +2029,11 @@ function toBytes2(value, { param }) {
|
|
1988
2029
|
])
|
1989
2030
|
};
|
1990
2031
|
}
|
2032
|
+
if (size(value) !== parseInt(size_))
|
2033
|
+
throw new AbiEncodingBytesSizeMismatchError({
|
2034
|
+
expectedSize: parseInt(size_),
|
2035
|
+
value
|
2036
|
+
});
|
1991
2037
|
return { dynamic: false, encoded: padHex(value, { dir: "right" }) };
|
1992
2038
|
}
|
1993
2039
|
function encodeBool(value) {
|
@@ -2022,7 +2068,8 @@ function encodeTuple(value, { param }) {
|
|
2022
2068
|
value: value[index]
|
2023
2069
|
});
|
2024
2070
|
preparedParams.push(preparedParam);
|
2025
|
-
|
2071
|
+
if (preparedParam.dynamic)
|
2072
|
+
dynamic = true;
|
2026
2073
|
}
|
2027
2074
|
return {
|
2028
2075
|
dynamic,
|
@@ -2037,19 +2084,16 @@ function getArrayComponents(type) {
|
|
2037
2084
|
) : void 0;
|
2038
2085
|
}
|
2039
2086
|
|
2040
|
-
// src/utils/abi/
|
2041
|
-
function
|
2087
|
+
// src/utils/abi/decodeAbiParameters.ts
|
2088
|
+
function decodeAbiParameters(params, data) {
|
2042
2089
|
if (data === "0x" && params.length > 0)
|
2043
2090
|
throw new AbiDecodingZeroDataError();
|
2044
2091
|
if (size(data) % 32 !== 0)
|
2045
2092
|
throw new AbiDecodingDataSizeInvalidError(size(data));
|
2046
|
-
|
2093
|
+
return decodeParams({
|
2047
2094
|
data,
|
2048
2095
|
params
|
2049
2096
|
});
|
2050
|
-
if (values.length === 0)
|
2051
|
-
return void 0;
|
2052
|
-
return values;
|
2053
2097
|
}
|
2054
2098
|
function decodeParams({
|
2055
2099
|
data,
|
@@ -2086,7 +2130,7 @@ function decodeParam({
|
|
2086
2130
|
return decodeString(data, { position });
|
2087
2131
|
}
|
2088
2132
|
if (param.type.startsWith("bytes")) {
|
2089
|
-
return
|
2133
|
+
return decodeBytes(data, { param, position });
|
2090
2134
|
}
|
2091
2135
|
let value = slice(data, position, position + 32);
|
2092
2136
|
if (param.type.startsWith("uint") || param.type.startsWith("int")) {
|
@@ -2099,7 +2143,7 @@ function decodeParam({
|
|
2099
2143
|
return decodeBool(value);
|
2100
2144
|
}
|
2101
2145
|
throw new InvalidAbiDecodingTypeError(param.type, {
|
2102
|
-
docsPath: "/docs/contract/
|
2146
|
+
docsPath: "/docs/contract/decodeAbiParameters"
|
2103
2147
|
});
|
2104
2148
|
}
|
2105
2149
|
function decodeAddress(value) {
|
@@ -2128,7 +2172,7 @@ function decodeArray(data, {
|
|
2128
2172
|
}
|
2129
2173
|
if (hasDynamicChild(param)) {
|
2130
2174
|
const arrayComponents = getArrayComponents(param.type);
|
2131
|
-
const dynamicChild = !_optionalChain([arrayComponents, 'optionalAccess',
|
2175
|
+
const dynamicChild = !_optionalChain([arrayComponents, 'optionalAccess', _28 => _28[0]]);
|
2132
2176
|
let consumed2 = 0;
|
2133
2177
|
let value2 = [];
|
2134
2178
|
for (let i = 0; i < length; ++i) {
|
@@ -2159,7 +2203,7 @@ function decodeArray(data, {
|
|
2159
2203
|
function decodeBool(value) {
|
2160
2204
|
return { consumed: 32, value: hexToBool(value) };
|
2161
2205
|
}
|
2162
|
-
function
|
2206
|
+
function decodeBytes(data, { param, position }) {
|
2163
2207
|
const [_, size2] = param.type.split("bytes");
|
2164
2208
|
if (!size2) {
|
2165
2209
|
const offset = hexToNumber(slice(data, position, position + 32));
|
@@ -2200,7 +2244,7 @@ function decodeTuple(data, { param, position }) {
|
|
2200
2244
|
position: consumed
|
2201
2245
|
});
|
2202
2246
|
consumed += decodedChild.consumed;
|
2203
|
-
value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess',
|
2247
|
+
value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess', _29 => _29.name])] = decodedChild.value;
|
2204
2248
|
}
|
2205
2249
|
return { consumed: 32, value };
|
2206
2250
|
}
|
@@ -2212,7 +2256,7 @@ function decodeTuple(data, { param, position }) {
|
|
2212
2256
|
position: position + consumed
|
2213
2257
|
});
|
2214
2258
|
consumed += decodedChild.consumed;
|
2215
|
-
value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess',
|
2259
|
+
value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess', _30 => _30.name])] = decodedChild.value;
|
2216
2260
|
}
|
2217
2261
|
return { consumed, value };
|
2218
2262
|
}
|
@@ -2225,7 +2269,7 @@ function hasDynamicChild(param) {
|
|
2225
2269
|
if (type.endsWith("[]"))
|
2226
2270
|
return true;
|
2227
2271
|
if (type === "tuple")
|
2228
|
-
return _optionalChain([param, 'access',
|
2272
|
+
return _optionalChain([param, 'access', _31 => _31.components, 'optionalAccess', _32 => _32.some, 'call', _33 => _33(hasDynamicChild)]);
|
2229
2273
|
const arrayComponents = getArrayComponents(param.type);
|
2230
2274
|
if (arrayComponents && hasDynamicChild({ ...param, type: arrayComponents[1] }))
|
2231
2275
|
return true;
|
@@ -2271,7 +2315,7 @@ function decodeErrorResult({
|
|
2271
2315
|
});
|
2272
2316
|
return {
|
2273
2317
|
abiItem,
|
2274
|
-
args: "inputs" in abiItem && abiItem.inputs && abiItem.inputs.length > 0 ?
|
2318
|
+
args: "inputs" in abiItem && abiItem.inputs && abiItem.inputs.length > 0 ? decodeAbiParameters(abiItem.inputs, slice(data, 4)) : void 0,
|
2275
2319
|
errorName: abiItem.name
|
2276
2320
|
};
|
2277
2321
|
}
|
@@ -2291,7 +2335,7 @@ function decodeEventLog({
|
|
2291
2335
|
docsPath: "/docs/contract/decodeEventLog"
|
2292
2336
|
});
|
2293
2337
|
const { name, inputs } = abiItem;
|
2294
|
-
const isUnnamed = _optionalChain([inputs, 'optionalAccess',
|
2338
|
+
const isUnnamed = _optionalChain([inputs, 'optionalAccess', _34 => _34.some, 'call', _35 => _35((x) => !("name" in x && x.name))]);
|
2295
2339
|
let args = isUnnamed ? [] : {};
|
2296
2340
|
for (let i = 0; i < inputs.length; i++) {
|
2297
2341
|
const param = inputs[i];
|
@@ -2308,7 +2352,7 @@ function decodeEventLog({
|
|
2308
2352
|
}
|
2309
2353
|
if (data && data !== "0x") {
|
2310
2354
|
const params = inputs.filter((x) => !("indexed" in x && x.indexed));
|
2311
|
-
const decodedData =
|
2355
|
+
const decodedData = decodeAbiParameters(params, data);
|
2312
2356
|
if (decodedData) {
|
2313
2357
|
if (isUnnamed)
|
2314
2358
|
args = [...args, ...decodedData];
|
@@ -2327,7 +2371,7 @@ function decodeEventLog({
|
|
2327
2371
|
function decodeTopic({ param, value }) {
|
2328
2372
|
if (param.type === "string" || param.type === "bytes" || param.type === "tuple" || param.type.match(/^(.*)\[(\d+)?\]$/))
|
2329
2373
|
return value;
|
2330
|
-
const decodedArg =
|
2374
|
+
const decodedArg = decodeAbiParameters([param], value) || [];
|
2331
2375
|
return decodedArg[0];
|
2332
2376
|
}
|
2333
2377
|
|
@@ -2343,7 +2387,7 @@ function decodeFunctionData({ abi, data }) {
|
|
2343
2387
|
});
|
2344
2388
|
return {
|
2345
2389
|
functionName: description.name,
|
2346
|
-
args: "inputs" in description && description.inputs && description.inputs.length > 0 ?
|
2390
|
+
args: "inputs" in description && description.inputs && description.inputs.length > 0 ? decodeAbiParameters(description.inputs, slice(data, 4)) : void 0
|
2347
2391
|
};
|
2348
2392
|
}
|
2349
2393
|
|
@@ -2436,7 +2480,7 @@ function decodeFunctionResult({
|
|
2436
2480
|
throw new AbiFunctionNotFoundError(functionName, { docsPath });
|
2437
2481
|
if (!("outputs" in description))
|
2438
2482
|
throw new AbiFunctionOutputsNotFoundError(functionName, { docsPath });
|
2439
|
-
const values =
|
2483
|
+
const values = decodeAbiParameters(description.outputs, data);
|
2440
2484
|
if (values && values.length > 1)
|
2441
2485
|
return values;
|
2442
2486
|
if (values && values.length === 1)
|
@@ -2462,10 +2506,10 @@ function encodeDeployData({
|
|
2462
2506
|
throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath2 });
|
2463
2507
|
if (!description.inputs || description.inputs.length === 0)
|
2464
2508
|
throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath2 });
|
2465
|
-
const data =
|
2466
|
-
|
2467
|
-
|
2468
|
-
|
2509
|
+
const data = encodeAbiParameters(
|
2510
|
+
description.inputs,
|
2511
|
+
args
|
2512
|
+
);
|
2469
2513
|
return concatHex([bytecode, data]);
|
2470
2514
|
}
|
2471
2515
|
|
@@ -2485,7 +2529,7 @@ function encodeErrorResult({ abi, errorName, args }) {
|
|
2485
2529
|
if (args && args.length > 0) {
|
2486
2530
|
if (!("inputs" in description && description.inputs))
|
2487
2531
|
throw new AbiErrorInputsNotFoundError(errorName, { docsPath: docsPath3 });
|
2488
|
-
data =
|
2532
|
+
data = encodeAbiParameters(description.inputs, args);
|
2489
2533
|
}
|
2490
2534
|
return concatHex([signature, data]);
|
2491
2535
|
}
|
@@ -2501,8 +2545,8 @@ function encodeEventTopics({ abi, eventName, args }) {
|
|
2501
2545
|
const signature = getEventSelector(definition);
|
2502
2546
|
let topics = [];
|
2503
2547
|
if (args && "inputs" in abiItem) {
|
2504
|
-
const args_ = Array.isArray(args) ? args : _nullishCoalesce(_optionalChain([abiItem, 'access',
|
2505
|
-
topics = _nullishCoalesce(_optionalChain([abiItem, 'access',
|
2548
|
+
const args_ = Array.isArray(args) ? args : _nullishCoalesce(_optionalChain([abiItem, 'access', _36 => _36.inputs, 'optionalAccess', _37 => _37.map, 'call', _38 => _38((x) => args[x.name])]), () => ( []));
|
2549
|
+
topics = _nullishCoalesce(_optionalChain([abiItem, 'access', _39 => _39.inputs, 'optionalAccess', _40 => _40.filter, 'call', _41 => _41((param) => "indexed" in param && param.indexed), 'access', _42 => _42.map, 'call', _43 => _43(
|
2506
2550
|
(param, i) => Array.isArray(args_[i]) ? args_[i].map(
|
2507
2551
|
(_, j) => encodeArg({ param, value: args_[i][j] })
|
2508
2552
|
) : args_[i] ? encodeArg({ param, value: args_[i] }) : null
|
@@ -2518,7 +2562,7 @@ function encodeArg({
|
|
2518
2562
|
return keccak256(toBytes(value));
|
2519
2563
|
if (param.type === "tuple" || param.type.match(/^(.*)\[(\d+)?\]$/))
|
2520
2564
|
throw new FilterTypeNotSupportedError(param.type);
|
2521
|
-
return
|
2565
|
+
return encodeAbiParameters([param], [value]);
|
2522
2566
|
}
|
2523
2567
|
|
2524
2568
|
// src/utils/abi/encodeFunctionData.ts
|
@@ -2534,10 +2578,10 @@ function encodeFunctionData({ abi, args, functionName }) {
|
|
2534
2578
|
});
|
2535
2579
|
const definition = formatAbiItem(description);
|
2536
2580
|
const signature = getFunctionSelector(definition);
|
2537
|
-
const data = "inputs" in description && description.inputs ?
|
2538
|
-
|
2539
|
-
|
2540
|
-
|
2581
|
+
const data = "inputs" in description && description.inputs ? encodeAbiParameters(
|
2582
|
+
description.inputs,
|
2583
|
+
_nullishCoalesce(args, () => ( []))
|
2584
|
+
) : void 0;
|
2541
2585
|
return concatHex([signature, _nullishCoalesce(data, () => ( "0x"))]);
|
2542
2586
|
}
|
2543
2587
|
|
@@ -2558,7 +2602,7 @@ function encodeFunctionResult({
|
|
2558
2602
|
let values = Array.isArray(result) ? result : [result];
|
2559
2603
|
if (description.outputs.length === 0 && !values[0])
|
2560
2604
|
values = [];
|
2561
|
-
return
|
2605
|
+
return encodeAbiParameters(description.outputs, values);
|
2562
2606
|
}
|
2563
2607
|
|
2564
2608
|
// src/utils/abi/formatAbiItemWithArgs.ts
|
@@ -2674,7 +2718,7 @@ function withTimeout(fn, {
|
|
2674
2718
|
}
|
2675
2719
|
}, timeout);
|
2676
2720
|
}
|
2677
|
-
resolve(await fn({ signal: _optionalChain([controller, 'optionalAccess',
|
2721
|
+
resolve(await fn({ signal: _optionalChain([controller, 'optionalAccess', _44 => _44.signal]) }));
|
2678
2722
|
} catch (err) {
|
2679
2723
|
if (err.name === "AbortError")
|
2680
2724
|
reject(errorInstance);
|
@@ -2740,8 +2784,8 @@ function buildRequest(request, {
|
|
2740
2784
|
{
|
2741
2785
|
delay: ({ count, error }) => {
|
2742
2786
|
if (error && error instanceof HttpRequestError) {
|
2743
|
-
const retryAfter = _optionalChain([error, 'optionalAccess',
|
2744
|
-
if (_optionalChain([retryAfter, 'optionalAccess',
|
2787
|
+
const retryAfter = _optionalChain([error, 'optionalAccess', _45 => _45.headers, 'optionalAccess', _46 => _46.get, 'call', _47 => _47("Retry-After")]);
|
2788
|
+
if (_optionalChain([retryAfter, 'optionalAccess', _48 => _48.match, 'call', _49 => _49(/\d/)]))
|
2745
2789
|
return parseInt(retryAfter) * 1e3;
|
2746
2790
|
}
|
2747
2791
|
return ~~(1 << count) * retryDelay;
|
@@ -2776,7 +2820,7 @@ function defineFormatter({
|
|
2776
2820
|
}
|
2777
2821
|
return {
|
2778
2822
|
...formatted,
|
2779
|
-
..._optionalChain([formatOverride, 'optionalCall',
|
2823
|
+
..._optionalChain([formatOverride, 'optionalCall', _50 => _50(data)])
|
2780
2824
|
};
|
2781
2825
|
};
|
2782
2826
|
}
|
@@ -2816,7 +2860,7 @@ var defineTransaction = defineFormatter({ format: formatTransaction });
|
|
2816
2860
|
|
2817
2861
|
// src/utils/formatters/block.ts
|
2818
2862
|
function formatBlock(block) {
|
2819
|
-
const transactions = _optionalChain([block, 'access',
|
2863
|
+
const transactions = _optionalChain([block, 'access', _51 => _51.transactions, 'optionalAccess', _52 => _52.map, 'call', _53 => _53((transaction) => {
|
2820
2864
|
if (typeof transaction === "string")
|
2821
2865
|
return transaction;
|
2822
2866
|
return formatTransaction(transaction);
|
@@ -2842,7 +2886,7 @@ function extract(value, { formatter }) {
|
|
2842
2886
|
return {};
|
2843
2887
|
const keys = Object.keys(formatter({}));
|
2844
2888
|
return keys.reduce((data, key) => {
|
2845
|
-
if (_optionalChain([value, 'optionalAccess',
|
2889
|
+
if (_optionalChain([value, 'optionalAccess', _54 => _54.hasOwnProperty, 'call', _55 => _55(key)])) {
|
2846
2890
|
;
|
2847
2891
|
data[key] = value[key];
|
2848
2892
|
}
|
@@ -2856,7 +2900,7 @@ function formatFeeHistory(feeHistory) {
|
|
2856
2900
|
baseFeePerGas: feeHistory.baseFeePerGas.map((value) => BigInt(value)),
|
2857
2901
|
gasUsedRatio: feeHistory.gasUsedRatio,
|
2858
2902
|
oldestBlock: BigInt(feeHistory.oldestBlock),
|
2859
|
-
reward: _optionalChain([feeHistory, 'access',
|
2903
|
+
reward: _optionalChain([feeHistory, 'access', _56 => _56.reward, 'optionalAccess', _57 => _57.map, 'call', _58 => _58(
|
2860
2904
|
(reward) => reward.map((value) => BigInt(value))
|
2861
2905
|
)])
|
2862
2906
|
};
|
@@ -2933,34 +2977,34 @@ function getNodeError(err, args = {}) {
|
|
2933
2977
|
if (FeeCapTooHighError.nodeMessage.test(message))
|
2934
2978
|
return new FeeCapTooHighError({
|
2935
2979
|
cause: err,
|
2936
|
-
maxFeePerGas: _optionalChain([args, 'optionalAccess',
|
2980
|
+
maxFeePerGas: _optionalChain([args, 'optionalAccess', _59 => _59.maxFeePerGas])
|
2937
2981
|
});
|
2938
2982
|
else if (FeeCapTooLowError.nodeMessage.test(message))
|
2939
2983
|
return new FeeCapTooLowError({
|
2940
2984
|
cause: err,
|
2941
|
-
maxFeePerGas: _optionalChain([args, 'optionalAccess',
|
2985
|
+
maxFeePerGas: _optionalChain([args, 'optionalAccess', _60 => _60.maxFeePerGas])
|
2942
2986
|
});
|
2943
2987
|
else if (NonceTooHighError.nodeMessage.test(message))
|
2944
|
-
return new NonceTooHighError({ cause: err, nonce: _optionalChain([args, 'optionalAccess',
|
2988
|
+
return new NonceTooHighError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _61 => _61.nonce]) });
|
2945
2989
|
else if (NonceTooLowError.nodeMessage.test(message))
|
2946
|
-
return new NonceTooLowError({ cause: err, nonce: _optionalChain([args, 'optionalAccess',
|
2990
|
+
return new NonceTooLowError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _62 => _62.nonce]) });
|
2947
2991
|
else if (NonceMaxValueError.nodeMessage.test(message))
|
2948
|
-
return new NonceMaxValueError({ cause: err, nonce: _optionalChain([args, 'optionalAccess',
|
2992
|
+
return new NonceMaxValueError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _63 => _63.nonce]) });
|
2949
2993
|
else if (InsufficientFundsError.nodeMessage.test(message))
|
2950
2994
|
return new InsufficientFundsError({ cause: err });
|
2951
2995
|
else if (IntrinsicGasTooHighError.nodeMessage.test(message))
|
2952
|
-
return new IntrinsicGasTooHighError({ cause: err, gas: _optionalChain([args, 'optionalAccess',
|
2996
|
+
return new IntrinsicGasTooHighError({ cause: err, gas: _optionalChain([args, 'optionalAccess', _64 => _64.gas]) });
|
2953
2997
|
else if (IntrinsicGasTooLowError.nodeMessage.test(message))
|
2954
|
-
return new IntrinsicGasTooLowError({ cause: err, gas: _optionalChain([args, 'optionalAccess',
|
2998
|
+
return new IntrinsicGasTooLowError({ cause: err, gas: _optionalChain([args, 'optionalAccess', _65 => _65.gas]) });
|
2955
2999
|
else if (TransactionTypeNotSupportedError.nodeMessage.test(message))
|
2956
3000
|
return new TransactionTypeNotSupportedError({ cause: err });
|
2957
3001
|
else if (TipAboveFeeCapError.nodeMessage.test(message))
|
2958
3002
|
return new TipAboveFeeCapError({
|
2959
3003
|
cause: err,
|
2960
|
-
maxFeePerGas: _optionalChain([args, 'optionalAccess',
|
2961
|
-
maxPriorityFeePerGas: _optionalChain([args, 'optionalAccess',
|
3004
|
+
maxFeePerGas: _optionalChain([args, 'optionalAccess', _66 => _66.maxFeePerGas]),
|
3005
|
+
maxPriorityFeePerGas: _optionalChain([args, 'optionalAccess', _67 => _67.maxPriorityFeePerGas])
|
2962
3006
|
});
|
2963
|
-
else if (message.match(ExecutionRevertedError.nodeMessage) || "code" in err.cause && _optionalChain([err, 'access',
|
3007
|
+
else if (message.match(ExecutionRevertedError.nodeMessage) || "code" in err.cause && _optionalChain([err, 'access', _68 => _68.cause, 'optionalAccess', _69 => _69.code]) === ExecutionRevertedError.code)
|
2964
3008
|
return new ExecutionRevertedError({
|
2965
3009
|
cause: err,
|
2966
3010
|
message: err.cause.details
|
@@ -2994,7 +3038,7 @@ function getContractError(err, {
|
|
2994
3038
|
functionName,
|
2995
3039
|
sender
|
2996
3040
|
}) {
|
2997
|
-
const { code, data, message } = err instanceof RawContractError ? err : err instanceof CallExecutionError || err instanceof EstimateGasExecutionError ? _optionalChain([err, 'access',
|
3041
|
+
const { code, data, message } = err instanceof RawContractError ? err : err instanceof CallExecutionError || err instanceof EstimateGasExecutionError ? _optionalChain([err, 'access', _70 => _70.cause, 'optionalAccess', _71 => _71.cause, 'optionalAccess', _72 => _72.cause]) || {} : err.cause || {};
|
2998
3042
|
let cause = err;
|
2999
3043
|
if (err instanceof AbiDecodingZeroDataError) {
|
3000
3044
|
cause = new ContractFunctionZeroDataError({ functionName });
|
@@ -3083,7 +3127,7 @@ async function http(url, { body, fetchOptions = {}, timeout = 1e4 }) {
|
|
3083
3127
|
}
|
3084
3128
|
);
|
3085
3129
|
let data;
|
3086
|
-
if (_optionalChain([response, 'access',
|
3130
|
+
if (_optionalChain([response, 'access', _73 => _73.headers, 'access', _74 => _74.get, 'call', _75 => _75("Content-Type"), 'optionalAccess', _76 => _76.startsWith, 'call', _77 => _77("application/json")])) {
|
3087
3131
|
data = await response.json();
|
3088
3132
|
} else {
|
3089
3133
|
data = await response.text();
|
@@ -3175,15 +3219,15 @@ function webSocket(socket, {
|
|
3175
3219
|
if (typeof message.id === "number" && id_ !== message.id)
|
3176
3220
|
return;
|
3177
3221
|
if (message.error) {
|
3178
|
-
_optionalChain([onError, 'optionalCall',
|
3222
|
+
_optionalChain([onError, 'optionalCall', _78 => _78(new RpcError({ body, error: message.error, url: socket.url }))]);
|
3179
3223
|
} else {
|
3180
|
-
_optionalChain([onData, 'optionalCall',
|
3224
|
+
_optionalChain([onData, 'optionalCall', _79 => _79(message)]);
|
3181
3225
|
}
|
3182
3226
|
if (body.method === "eth_subscribe" && typeof message.result === "string") {
|
3183
3227
|
socket.subscriptions.set(message.result, callback);
|
3184
3228
|
}
|
3185
3229
|
if (body.method === "eth_unsubscribe") {
|
3186
|
-
socket.subscriptions.delete(_optionalChain([body, 'access',
|
3230
|
+
socket.subscriptions.delete(_optionalChain([body, 'access', _80 => _80.params, 'optionalAccess', _81 => _81[0]]));
|
3187
3231
|
}
|
3188
3232
|
};
|
3189
3233
|
socket.requests.set(id_, callback);
|
@@ -3462,5 +3506,6 @@ function parseGwei(ether, unit = "wei") {
|
|
3462
3506
|
|
3463
3507
|
|
3464
3508
|
|
3465
|
-
|
3466
|
-
|
3509
|
+
|
3510
|
+
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.AbiEventSignatureNotFoundError = AbiEventSignatureNotFoundError; exports.AbiEventNotFoundError = AbiEventNotFoundError; exports.AbiFunctionNotFoundError = AbiFunctionNotFoundError; exports.AbiFunctionOutputsNotFoundError = AbiFunctionOutputsNotFoundError; exports.AbiFunctionSignatureNotFoundError = AbiFunctionSignatureNotFoundError; exports.InvalidAbiEncodingTypeError = InvalidAbiEncodingTypeError; exports.InvalidAbiDecodingTypeError = InvalidAbiDecodingTypeError; exports.InvalidArrayError = InvalidArrayError; exports.InvalidDefinitionTypeError = InvalidDefinitionTypeError; exports.InvalidAddressError = InvalidAddressError; exports.BlockNotFoundError = BlockNotFoundError; exports.ChainDoesNotSupportContract = ChainDoesNotSupportContract; exports.ChainMismatchError = ChainMismatchError; exports.multicall3Abi = multicall3Abi; exports.panicReasons = panicReasons; 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.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.checksumAddress = checksumAddress; 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.formatAbiItemWithArgs = formatAbiItemWithArgs; exports.getCache = getCache; exports.withCache = withCache; exports.wait = wait; exports.isDeterministicError = isDeterministicError; exports.buildRequest = buildRequest; exports.defineChain = defineChain; 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.formatFeeHistory = formatFeeHistory; exports.formatLog = formatLog; exports.formatTransactionReceipt = formatTransactionReceipt; exports.defineTransactionReceipt = defineTransactionReceipt; exports.formatTransactionRequest = formatTransactionRequest; exports.defineTransactionRequest = defineTransactionRequest; exports.assertRequest = assertRequest; 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.etherUnits = etherUnits; exports.gweiUnits = gweiUnits; exports.weiUnits = weiUnits; exports.formatUnit = formatUnit; exports.formatEther = formatEther; exports.formatGwei = formatGwei; exports.parseUnit = parseUnit; exports.parseEther = parseEther; exports.parseGwei = parseGwei;
|
3511
|
+
//# sourceMappingURL=chunk-HQCSH22G.js.map
|