viem 0.2.0-jxom-local-accounts.20230321T212822 → 0.2.0-main.20230323T084936

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.
Files changed (70) hide show
  1. package/dist/abi.d.ts +3 -3
  2. package/dist/abi.js +2 -2
  3. package/dist/abi.mjs +1 -1
  4. package/dist/{chain-75b0942e.d.ts → chain-1b53ef88.d.ts} +48 -53
  5. package/dist/{chain-f8db473f.d.ts → chain-ec8c485d.d.ts} +1 -1
  6. package/dist/chains.d.ts +3 -3
  7. package/dist/chains.js +63 -63
  8. package/dist/chains.mjs +1 -1
  9. package/dist/{chunk-NJSAEA2H.js → chunk-BHAAXXGO.js} +154 -461
  10. package/dist/chunk-BHAAXXGO.js.map +1 -0
  11. package/dist/{chunk-IVRML3IK.mjs → chunk-FOJL5WVL.mjs} +85 -392
  12. package/dist/chunk-FOJL5WVL.mjs.map +1 -0
  13. package/dist/{chunk-6UKHPIXX.mjs → chunk-R7WEI5MQ.mjs} +2 -2
  14. package/dist/chunk-R7WEI5MQ.mjs.map +1 -0
  15. package/dist/{chunk-LYQKHD7R.js → chunk-ZIT7BMZO.js} +19 -19
  16. package/dist/{chunk-LYQKHD7R.js.map → chunk-ZIT7BMZO.js.map} +1 -1
  17. package/dist/contract.d.ts +7 -9
  18. package/dist/contract.js +2 -2
  19. package/dist/contract.mjs +1 -1
  20. package/dist/{createClient-f87255c1.d.ts → createClient-a28317a9.d.ts} +6 -6
  21. package/dist/{createPublicClient-d2c37c92.d.ts → createPublicClient-75540130.d.ts} +206 -160
  22. package/dist/{eip1193-ae706fd8.d.ts → eip1193-4f4e240c.d.ts} +1 -1
  23. package/dist/{encodeFunctionResult-4792a6a3.d.ts → encodeFunctionResult-1f324375.d.ts} +1 -1
  24. package/dist/{encodePacked-3fcdd54b.d.ts → encodePacked-d5d5264a.d.ts} +1 -1
  25. package/dist/ens.d.ts +4 -6
  26. package/dist/ens.js +3 -3
  27. package/dist/ens.mjs +2 -2
  28. package/dist/ethers.d.ts +6 -5
  29. package/dist/ethers.js +5 -7
  30. package/dist/ethers.js.map +1 -1
  31. package/dist/ethers.mjs +5 -7
  32. package/dist/ethers.mjs.map +1 -1
  33. package/dist/{formatAbiItem-765ebc53.d.ts → formatAbiItem-15e8817d.d.ts} +1 -1
  34. package/dist/{getAbiItem-693e6e1b.d.ts → getAbiItem-3e809ff9.d.ts} +1 -1
  35. package/dist/index.d.ts +13 -15
  36. package/dist/index.js +91 -99
  37. package/dist/index.js.map +1 -1
  38. package/dist/index.mjs +5 -13
  39. package/dist/index.mjs.map +1 -1
  40. package/dist/{parseGwei-377678bc.d.ts → parseGwei-6fff7cbe.d.ts} +13 -49
  41. package/dist/public.d.ts +4 -6
  42. package/dist/public.js +2 -2
  43. package/dist/public.mjs +1 -1
  44. package/dist/{test-98c0b642.d.ts → test-2bd23d7e.d.ts} +32 -33
  45. package/dist/test.d.ts +10 -10
  46. package/dist/test.js +2 -2
  47. package/dist/test.mjs +1 -1
  48. package/dist/utils/index.d.ts +18 -30
  49. package/dist/utils/index.js +2 -10
  50. package/dist/utils/index.mjs +5 -13
  51. package/dist/wallet.d.ts +4 -6
  52. package/dist/wallet.js +2 -2
  53. package/dist/wallet.mjs +1 -1
  54. package/dist/window.d.ts +2 -2
  55. package/package.json +1 -9
  56. package/accounts/package.json +0 -4
  57. package/dist/accounts/index.d.ts +0 -33
  58. package/dist/accounts/index.js +0 -89
  59. package/dist/accounts/index.js.map +0 -1
  60. package/dist/accounts/index.mjs +0 -89
  61. package/dist/accounts/index.mjs.map +0 -1
  62. package/dist/chunk-6UKHPIXX.mjs.map +0 -1
  63. package/dist/chunk-FNVFGFWN.mjs +0 -31
  64. package/dist/chunk-FNVFGFWN.mjs.map +0 -1
  65. package/dist/chunk-FQM5MF6U.js +0 -31
  66. package/dist/chunk-FQM5MF6U.js.map +0 -1
  67. package/dist/chunk-IVRML3IK.mjs.map +0 -1
  68. package/dist/chunk-NJSAEA2H.js.map +0 -1
  69. package/dist/parseAccount-2d7ea01d.d.ts +0 -6
  70. package/dist/typedData-ade018d6.d.ts +0 -93
@@ -25,7 +25,7 @@ var package_default = {
25
25
  anvil: "source .env && anvil --fork-url $VITE_ANVIL_FORK_URL --fork-block-number $VITE_ANVIL_BLOCK_NUMBER --block-time $VITE_ANVIL_BLOCK_TIME",
26
26
  bench: "vitest bench --no-threads",
27
27
  "bench:ci": "CI=true vitest bench --no-threads",
28
- build: "tsup && size-limit",
28
+ build: "tsup",
29
29
  changeset: "changeset",
30
30
  "changeset:release": "pnpm build && changeset publish",
31
31
  "changeset:version": "changeset version && pnpm install --lockfile-only",
@@ -53,7 +53,6 @@ var package_default = {
53
53
  entry: [
54
54
  "src/index.ts",
55
55
  "src/abi.ts",
56
- "src/accounts/index.ts",
57
56
  "src/chains.ts",
58
57
  "src/contract.ts",
59
58
  "src/ens.ts",
@@ -67,7 +66,6 @@ var package_default = {
67
66
  },
68
67
  files: [
69
68
  "/abi",
70
- "/accounts",
71
69
  "/dist",
72
70
  "/chains",
73
71
  "/contract",
@@ -90,11 +88,6 @@ var package_default = {
90
88
  module: "./dist/abi.mts",
91
89
  default: "./dist/abi.js"
92
90
  },
93
- "./accounts": {
94
- types: "./dist/accounts/index.d.ts",
95
- module: "./dist/accounts/index.mts",
96
- default: "./dist/accounts/index.js"
97
- },
98
91
  "./chains": {
99
92
  types: "./dist/chains.d.ts",
100
93
  module: "./dist/chains.mts",
@@ -149,8 +142,6 @@ var package_default = {
149
142
  dependencies: {
150
143
  "@noble/hashes": "^1.1.2",
151
144
  "@noble/secp256k1": "^1.7.1",
152
- "@scure/bip32": "^1.2.0",
153
- "@scure/bip39": "^1.1.1",
154
145
  "@wagmi/chains": "~0.2.11",
155
146
  abitype: "~0.7.1",
156
147
  "idna-uts46-hx": "^4.1.2",
@@ -163,7 +154,6 @@ var package_default = {
163
154
  "@adraffy/ens-normalize": "^1.8.9",
164
155
  "@changesets/changelog-github": "^0.4.5",
165
156
  "@changesets/cli": "^2.23.2",
166
- "@size-limit/preset-big-lib": "^8.2.4",
167
157
  "@types/dedent": "^0.7.0",
168
158
  "@types/fs-extra": "^9.0.13",
169
159
  "@types/node": "^17.0.45",
@@ -181,7 +171,6 @@ var package_default = {
181
171
  rimraf: "^4.1.2",
182
172
  rome: "^11.0.0",
183
173
  "simple-git-hooks": "^2.8.1",
184
- "size-limit": "^8.2.4",
185
174
  tsup: "^6.6.0",
186
175
  typescript: "^4.9.4",
187
176
  vite: "^4.1.4",
@@ -200,17 +189,12 @@ var package_default = {
200
189
  "wallet",
201
190
  "web3"
202
191
  ],
203
- "size-limit": [
204
- {
205
- path: "dist/index.js"
206
- }
207
- ],
208
192
  "simple-git-hooks": {
209
193
  "pre-commit": "pnpm format && pnpm lint:fix"
210
194
  },
211
195
  pnpm: {
212
196
  patchedDependencies: {
213
- "vitepress@1.0.0-alpha.49": "patches/vitepress@1.0.0-alpha.49.patch"
197
+ "vitepress@1.0.0-alpha.61": "patches/vitepress@1.0.0-alpha.61.patch"
214
198
  },
215
199
  peerDependencyRules: {
216
200
  ignoreMissing: [
@@ -234,9 +218,7 @@ var BaseError = class extends Error {
234
218
  shortMessage || "An error occurred.",
235
219
  "",
236
220
  ...args.metaMessages ? [...args.metaMessages, ""] : [],
237
- ...docsPath6 ? [
238
- `Docs: https://viem.sh${docsPath6}.html${args.docsSlug ? `#${args.docsSlug}` : ""}`
239
- ] : [],
221
+ ...docsPath6 ? [`Docs: https://viem.sh${docsPath6}.html`] : [],
240
222
  ...details ? [`Details: ${details}`] : [],
241
223
  `Version: ${getVersion()}`
242
224
  ].join("\n");
@@ -537,23 +519,6 @@ var UnsupportedPackedAbiType = class extends BaseError {
537
519
  }
538
520
  };
539
521
 
540
- // src/errors/account.ts
541
- var AccountNotFoundError = class extends BaseError {
542
- constructor({ docsPath: docsPath6 } = {}) {
543
- super(
544
- [
545
- "Could not find an Account to execute with this Action.",
546
- "Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."
547
- ].join("\n"),
548
- {
549
- docsPath: docsPath6,
550
- docsSlug: "account"
551
- }
552
- );
553
- __publicField(this, "name", "AccountNotFoundError");
554
- }
555
- };
556
-
557
522
  // src/errors/address.ts
558
523
  var InvalidAddressError = class extends BaseError {
559
524
  constructor({ address }) {
@@ -618,17 +583,6 @@ var ChainMismatchError = class extends BaseError {
618
583
  __publicField(this, "name", "ChainMismatchError");
619
584
  }
620
585
  };
621
- var ChainNotFoundError = class extends BaseError {
622
- constructor() {
623
- super(
624
- [
625
- "No chain was provided to the request.",
626
- "Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."
627
- ].join("\n")
628
- );
629
- __publicField(this, "name", "ChainNotFoundError");
630
- }
631
- };
632
586
 
633
587
  // src/constants/abis.ts
634
588
  var multicall3Abi = [
@@ -759,9 +713,9 @@ var TransactionExecutionError = class extends BaseError {
759
713
  }) {
760
714
  const prettyArgs = prettyPrint({
761
715
  chain: chain && `${_optionalChain([chain, 'optionalAccess', _4 => _4.name])} (id: ${_optionalChain([chain, 'optionalAccess', _5 => _5.id])})`,
762
- from: _optionalChain([account, 'optionalAccess', _6 => _6.address]),
716
+ from: account.address,
763
717
  to,
764
- value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess', _7 => _7.nativeCurrency, 'access', _8 => _8.symbol]) || "ETH"}`,
718
+ value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess', _6 => _6.nativeCurrency, 'access', _7 => _7.symbol]) || "ETH"}`,
765
719
  data,
766
720
  gas,
767
721
  gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
@@ -824,7 +778,7 @@ var WaitForTransactionReceiptTimeoutError = class extends BaseError {
824
778
  // src/errors/contract.ts
825
779
  var CallExecutionError = class extends BaseError {
826
780
  constructor(cause, {
827
- account: account_,
781
+ account,
828
782
  docsPath: docsPath6,
829
783
  chain,
830
784
  data,
@@ -836,11 +790,10 @@ var CallExecutionError = class extends BaseError {
836
790
  to,
837
791
  value
838
792
  }) {
839
- const account = account_ ? parseAccount(account_) : void 0;
840
793
  const prettyArgs = prettyPrint({
841
- from: _optionalChain([account, 'optionalAccess', _9 => _9.address]),
794
+ from: _optionalChain([account, 'optionalAccess', _8 => _8.address]),
842
795
  to,
843
- value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess', _10 => _10.nativeCurrency, 'access', _11 => _11.symbol]) || "ETH"}`,
796
+ value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess', _9 => _9.nativeCurrency, 'access', _10 => _10.symbol]) || "ETH"}`,
844
797
  data,
845
798
  gas,
846
799
  gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
@@ -882,7 +835,7 @@ var ContractFunctionExecutionError = class extends BaseError {
882
835
  const prettyArgs = prettyPrint({
883
836
  address: contractAddress && getContractAddress(contractAddress),
884
837
  function: functionWithParams,
885
- args: formattedArgs && formattedArgs !== "()" && `${[...Array(_nullishCoalesce(_optionalChain([functionName, 'optionalAccess', _12 => _12.length]), () => ( 0))).keys()].map(() => " ").join("")}${formattedArgs}`,
838
+ args: formattedArgs && formattedArgs !== "()" && `${[...Array(_nullishCoalesce(_optionalChain([functionName, 'optionalAccess', _11 => _11.length]), () => ( 0))).keys()].map(() => " ").join("")}${formattedArgs}`,
886
839
  sender
887
840
  });
888
841
  super(
@@ -941,7 +894,7 @@ var ContractFunctionRevertedError = class extends BaseError {
941
894
  }) : void 0;
942
895
  metaMessages = [
943
896
  errorWithParams ? `Error: ${errorWithParams}` : "",
944
- formattedArgs && formattedArgs !== "()" ? ` ${[...Array(_nullishCoalesce(_optionalChain([errorName, 'optionalAccess', _13 => _13.length]), () => ( 0))).keys()].map(() => " ").join("")}${formattedArgs}` : ""
897
+ formattedArgs && formattedArgs !== "()" ? ` ${[...Array(_nullishCoalesce(_optionalChain([errorName, 'optionalAccess', _12 => _12.length]), () => ( 0))).keys()].map(() => " ").join("")}${formattedArgs}` : ""
945
898
  ];
946
899
  }
947
900
  } else if (message)
@@ -1079,9 +1032,9 @@ var EstimateGasExecutionError = class extends BaseError {
1079
1032
  value
1080
1033
  }) {
1081
1034
  const prettyArgs = prettyPrint({
1082
- from: _optionalChain([account, 'optionalAccess', _14 => _14.address]),
1035
+ from: account.address,
1083
1036
  to,
1084
- value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess', _15 => _15.nativeCurrency, 'access', _16 => _16.symbol]) || "ETH"}`,
1037
+ value: typeof value !== "undefined" && `${formatEther(value)} ${_optionalChain([chain, 'optionalAccess', _13 => _13.nativeCurrency, 'access', _14 => _14.symbol]) || "ETH"}`,
1085
1038
  data,
1086
1039
  gas,
1087
1040
  gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
@@ -1118,7 +1071,7 @@ var ExecutionRevertedError = class extends BaseError {
1118
1071
  cause,
1119
1072
  message
1120
1073
  } = {}) {
1121
- const reason = _optionalChain([message, 'optionalAccess', _17 => _17.replace, 'call', _18 => _18("execution reverted: ", ""), 'optionalAccess', _19 => _19.replace, 'call', _20 => _20("execution reverted", "")]);
1074
+ const reason = _optionalChain([message, 'optionalAccess', _15 => _15.replace, 'call', _16 => _16("execution reverted: ", ""), 'optionalAccess', _17 => _17.replace, 'call', _18 => _18("execution reverted", "")]);
1122
1075
  super(
1123
1076
  `Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`,
1124
1077
  {
@@ -1270,7 +1223,7 @@ var TipAboveFeeCapError = class extends BaseError {
1270
1223
  __publicField(TipAboveFeeCapError, "nodeMessage", /max priority fee per gas higher than max fee per gas|tip higher than fee cap/);
1271
1224
  var UnknownNodeError = class extends BaseError {
1272
1225
  constructor({ cause }) {
1273
- super(`An error occurred while executing: ${_optionalChain([cause, 'optionalAccess', _21 => _21.message])}`, {
1226
+ super(`An error occurred while executing: ${_optionalChain([cause, 'optionalAccess', _19 => _19.message])}`, {
1274
1227
  cause
1275
1228
  });
1276
1229
  __publicField(this, "name", "UnknownNodeError");
@@ -1858,7 +1811,7 @@ function parse2(value) {
1858
1811
  function format2(bytes, to) {
1859
1812
  if (Array.isArray(bytes))
1860
1813
  return bytes.map((b) => format2(b, to));
1861
- return to === "hex" ? trim(bytesToHex(bytes)) : bytes;
1814
+ return to === "hex" ? bytesToHex(bytes) : bytes;
1862
1815
  }
1863
1816
  function rlpToBytes(bytes, offset = 0) {
1864
1817
  if (bytes.length === 0)
@@ -1921,9 +1874,9 @@ function rlpToBytes(bytes, offset = 0) {
1921
1874
  var paramsRegex = /((function|event)\s)?(.*)(\((.*)\))/;
1922
1875
  function extractFunctionParts(def) {
1923
1876
  const parts = def.match(paramsRegex);
1924
- const type = _optionalChain([parts, 'optionalAccess', _22 => _22[2]]) || void 0;
1925
- const name = _optionalChain([parts, 'optionalAccess', _23 => _23[3]]);
1926
- const params = _optionalChain([parts, 'optionalAccess', _24 => _24[5]]) || void 0;
1877
+ const type = _optionalChain([parts, 'optionalAccess', _20 => _20[2]]) || void 0;
1878
+ const name = _optionalChain([parts, 'optionalAccess', _21 => _21[3]]);
1879
+ const params = _optionalChain([parts, 'optionalAccess', _22 => _22[5]]) || void 0;
1927
1880
  return { type, name, params };
1928
1881
  }
1929
1882
  function extractFunctionName(def) {
@@ -1931,8 +1884,8 @@ function extractFunctionName(def) {
1931
1884
  }
1932
1885
  function extractFunctionParams(def) {
1933
1886
  const params = extractFunctionParts(def).params;
1934
- const splitParams = _optionalChain([params, 'optionalAccess', _25 => _25.split, 'call', _26 => _26(","), 'access', _27 => _27.map, 'call', _28 => _28((x) => x.trim().split(" "))]);
1935
- return _optionalChain([splitParams, 'optionalAccess', _29 => _29.map, 'call', _30 => _30((param) => ({
1887
+ const splitParams = _optionalChain([params, 'optionalAccess', _23 => _23.split, 'call', _24 => _24(","), 'access', _25 => _25.map, 'call', _26 => _26((x) => x.trim().split(" "))]);
1888
+ return _optionalChain([splitParams, 'optionalAccess', _27 => _27.map, 'call', _28 => _28((param) => ({
1936
1889
  type: param[0],
1937
1890
  name: param[1] === "indexed" ? param[2] : param[1],
1938
1891
  ...param[1] === "indexed" ? { indexed: true } : {}
@@ -2334,7 +2287,7 @@ function decodeArray(data, {
2334
2287
  }
2335
2288
  if (hasDynamicChild(param)) {
2336
2289
  const arrayComponents = getArrayComponents(param.type);
2337
- const dynamicChild = !_optionalChain([arrayComponents, 'optionalAccess', _31 => _31[0]]);
2290
+ const dynamicChild = !_optionalChain([arrayComponents, 'optionalAccess', _29 => _29[0]]);
2338
2291
  let consumed2 = 0;
2339
2292
  let value2 = [];
2340
2293
  for (let i = 0; i < length; ++i) {
@@ -2410,7 +2363,7 @@ function decodeTuple(data, { param, position }) {
2410
2363
  position: consumed
2411
2364
  });
2412
2365
  consumed += decodedChild.consumed;
2413
- value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess', _32 => _32.name])] = decodedChild.value;
2366
+ value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess', _30 => _30.name])] = decodedChild.value;
2414
2367
  }
2415
2368
  return { consumed: 32, value };
2416
2369
  }
@@ -2422,7 +2375,7 @@ function decodeTuple(data, { param, position }) {
2422
2375
  position: position + consumed
2423
2376
  });
2424
2377
  consumed += decodedChild.consumed;
2425
- value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess', _33 => _33.name])] = decodedChild.value;
2378
+ value[hasUnnamedChild ? i : _optionalChain([component, 'optionalAccess', _31 => _31.name])] = decodedChild.value;
2426
2379
  }
2427
2380
  return { consumed, value };
2428
2381
  }
@@ -2435,7 +2388,7 @@ function hasDynamicChild(param) {
2435
2388
  if (type.endsWith("[]"))
2436
2389
  return true;
2437
2390
  if (type === "tuple")
2438
- return _optionalChain([param, 'access', _34 => _34.components, 'optionalAccess', _35 => _35.some, 'call', _36 => _36(hasDynamicChild)]);
2391
+ return _optionalChain([param, 'access', _32 => _32.components, 'optionalAccess', _33 => _33.some, 'call', _34 => _34(hasDynamicChild)]);
2439
2392
  const arrayComponents = getArrayComponents(param.type);
2440
2393
  if (arrayComponents && hasDynamicChild({ ...param, type: arrayComponents[1] }))
2441
2394
  return true;
@@ -2506,7 +2459,7 @@ function decodeEventLog({
2506
2459
  docsPath
2507
2460
  });
2508
2461
  const { name, inputs } = abiItem;
2509
- const isUnnamed = _optionalChain([inputs, 'optionalAccess', _37 => _37.some, 'call', _38 => _38((x) => !("name" in x && x.name))]);
2462
+ const isUnnamed = _optionalChain([inputs, 'optionalAccess', _35 => _35.some, 'call', _36 => _36((x) => !("name" in x && x.name))]);
2510
2463
  let args = isUnnamed ? [] : {};
2511
2464
  if (argTopics.length > 0) {
2512
2465
  const indexedInputs = inputs.filter((x) => "indexed" in x && x.indexed);
@@ -2727,8 +2680,8 @@ function encodeEventTopics({ abi, eventName, args }) {
2727
2680
  const signature = getEventSelector(definition);
2728
2681
  let topics = [];
2729
2682
  if (args && "inputs" in abiItem) {
2730
- const args_ = Array.isArray(args) ? args : _nullishCoalesce(_optionalChain([abiItem, 'access', _39 => _39.inputs, 'optionalAccess', _40 => _40.map, 'call', _41 => _41((x) => args[x.name])]), () => ( []));
2731
- 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(
2683
+ const args_ = Array.isArray(args) ? args : _nullishCoalesce(_optionalChain([abiItem, 'access', _37 => _37.inputs, 'optionalAccess', _38 => _38.map, 'call', _39 => _39((x) => args[x.name])]), () => ( []));
2684
+ topics = _nullishCoalesce(_optionalChain([abiItem, 'access', _40 => _40.inputs, 'optionalAccess', _41 => _41.filter, 'call', _42 => _42((param) => "indexed" in param && param.indexed), 'access', _43 => _43.map, 'call', _44 => _44(
2732
2685
  (param, i) => Array.isArray(args_[i]) ? args_[i].map(
2733
2686
  (_, j) => encodeArg({ param, value: args_[i][j] })
2734
2687
  ) : args_[i] ? encodeArg({ param, value: args_[i] }) : null
@@ -2875,11 +2828,19 @@ function formatAbiItemWithArgs({
2875
2828
  ).join(", ")})`;
2876
2829
  }
2877
2830
 
2878
- // src/accounts/utils/parseAccount.ts
2879
- function parseAccount(account) {
2880
- if (typeof account === "string")
2831
+ // src/utils/account.ts
2832
+ function getAccount(account) {
2833
+ if (typeof account === "string") {
2834
+ if (!isAddress(account))
2835
+ throw new InvalidAddressError({ address: account });
2881
2836
  return { address: account, type: "json-rpc" };
2882
- return account;
2837
+ }
2838
+ if (!isAddress(account.address))
2839
+ throw new InvalidAddressError({ address: account.address });
2840
+ return {
2841
+ ...account,
2842
+ type: "local"
2843
+ };
2883
2844
  }
2884
2845
 
2885
2846
  // src/utils/promise/withCache.ts
@@ -2977,7 +2938,7 @@ function withTimeout(fn, {
2977
2938
  }
2978
2939
  }, timeout);
2979
2940
  }
2980
- resolve(await fn({ signal: _optionalChain([controller, 'optionalAccess', _47 => _47.signal]) }));
2941
+ resolve(await fn({ signal: _optionalChain([controller, 'optionalAccess', _45 => _45.signal]) }));
2981
2942
  } catch (err) {
2982
2943
  if (err.name === "AbortError")
2983
2944
  reject(errorInstance);
@@ -3043,8 +3004,8 @@ function buildRequest(request, {
3043
3004
  {
3044
3005
  delay: ({ count, error }) => {
3045
3006
  if (error && error instanceof HttpRequestError) {
3046
- const retryAfter = _optionalChain([error, 'optionalAccess', _48 => _48.headers, 'optionalAccess', _49 => _49.get, 'call', _50 => _50("Retry-After")]);
3047
- if (_optionalChain([retryAfter, 'optionalAccess', _51 => _51.match, 'call', _52 => _52(/\d/)]))
3007
+ const retryAfter = _optionalChain([error, 'optionalAccess', _46 => _46.headers, 'optionalAccess', _47 => _47.get, 'call', _48 => _48("Retry-After")]);
3008
+ if (_optionalChain([retryAfter, 'optionalAccess', _49 => _49.match, 'call', _50 => _50(/\d/)]))
3048
3009
  return parseInt(retryAfter) * 1e3;
3049
3010
  }
3050
3011
  return ~~(1 << count) * retryDelay;
@@ -3064,7 +3025,7 @@ function getChainContractAddress({
3064
3025
  chain,
3065
3026
  contract: name
3066
3027
  }) {
3067
- const contract = _optionalChain([chain, 'optionalAccess', _53 => _53.contracts, 'optionalAccess', _54 => _54[name]]);
3028
+ const contract = _optionalChain([chain, 'optionalAccess', _51 => _51.contracts, 'optionalAccess', _52 => _52[name]]);
3068
3029
  if (!contract)
3069
3030
  throw new ChainDoesNotSupportContract({
3070
3031
  chain,
@@ -3101,7 +3062,7 @@ function defineFormatter({
3101
3062
  }
3102
3063
  return {
3103
3064
  ...formatted,
3104
- ..._optionalChain([formatOverride, 'optionalCall', _55 => _55(data)])
3065
+ ..._optionalChain([formatOverride, 'optionalCall', _53 => _53(data)])
3105
3066
  };
3106
3067
  };
3107
3068
  }
@@ -3144,7 +3105,7 @@ var defineTransaction = defineFormatter({ format: formatTransaction });
3144
3105
 
3145
3106
  // src/utils/formatters/block.ts
3146
3107
  function formatBlock(block) {
3147
- const transactions = _optionalChain([block, 'access', _56 => _56.transactions, 'optionalAccess', _57 => _57.map, 'call', _58 => _58((transaction) => {
3108
+ const transactions = _optionalChain([block, 'access', _54 => _54.transactions, 'optionalAccess', _55 => _55.map, 'call', _56 => _56((transaction) => {
3148
3109
  if (typeof transaction === "string")
3149
3110
  return transaction;
3150
3111
  return formatTransaction(transaction);
@@ -3173,7 +3134,7 @@ function extract(value, { formatter }) {
3173
3134
  return {};
3174
3135
  const keys = Object.keys(formatter({}));
3175
3136
  return keys.reduce((data, key) => {
3176
- if (_optionalChain([value, 'optionalAccess', _59 => _59.hasOwnProperty, 'call', _60 => _60(key)])) {
3137
+ if (_optionalChain([value, 'optionalAccess', _57 => _57.hasOwnProperty, 'call', _58 => _58(key)])) {
3177
3138
  ;
3178
3139
  data[key] = value[key];
3179
3140
  }
@@ -3187,7 +3148,7 @@ function formatFeeHistory(feeHistory) {
3187
3148
  baseFeePerGas: feeHistory.baseFeePerGas.map((value) => BigInt(value)),
3188
3149
  gasUsedRatio: feeHistory.gasUsedRatio,
3189
3150
  oldestBlock: BigInt(feeHistory.oldestBlock),
3190
- reward: _optionalChain([feeHistory, 'access', _61 => _61.reward, 'optionalAccess', _62 => _62.map, 'call', _63 => _63(
3151
+ reward: _optionalChain([feeHistory, 'access', _59 => _59.reward, 'optionalAccess', _60 => _60.map, 'call', _61 => _61(
3191
3152
  (reward) => reward.map((value) => BigInt(value))
3192
3153
  )])
3193
3154
  };
@@ -3255,34 +3216,34 @@ function getNodeError(err, args) {
3255
3216
  if (FeeCapTooHighError.nodeMessage.test(message))
3256
3217
  return new FeeCapTooHighError({
3257
3218
  cause: err,
3258
- maxFeePerGas: _optionalChain([args, 'optionalAccess', _64 => _64.maxFeePerGas])
3219
+ maxFeePerGas: _optionalChain([args, 'optionalAccess', _62 => _62.maxFeePerGas])
3259
3220
  });
3260
3221
  else if (FeeCapTooLowError.nodeMessage.test(message))
3261
3222
  return new FeeCapTooLowError({
3262
3223
  cause: err,
3263
- maxFeePerGas: _optionalChain([args, 'optionalAccess', _65 => _65.maxFeePerGas])
3224
+ maxFeePerGas: _optionalChain([args, 'optionalAccess', _63 => _63.maxFeePerGas])
3264
3225
  });
3265
3226
  else if (NonceTooHighError.nodeMessage.test(message))
3266
- return new NonceTooHighError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _66 => _66.nonce]) });
3227
+ return new NonceTooHighError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _64 => _64.nonce]) });
3267
3228
  else if (NonceTooLowError.nodeMessage.test(message))
3268
- return new NonceTooLowError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _67 => _67.nonce]) });
3229
+ return new NonceTooLowError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _65 => _65.nonce]) });
3269
3230
  else if (NonceMaxValueError.nodeMessage.test(message))
3270
- return new NonceMaxValueError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _68 => _68.nonce]) });
3231
+ return new NonceMaxValueError({ cause: err, nonce: _optionalChain([args, 'optionalAccess', _66 => _66.nonce]) });
3271
3232
  else if (InsufficientFundsError.nodeMessage.test(message))
3272
3233
  return new InsufficientFundsError({ cause: err });
3273
3234
  else if (IntrinsicGasTooHighError.nodeMessage.test(message))
3274
- return new IntrinsicGasTooHighError({ cause: err, gas: _optionalChain([args, 'optionalAccess', _69 => _69.gas]) });
3235
+ return new IntrinsicGasTooHighError({ cause: err, gas: _optionalChain([args, 'optionalAccess', _67 => _67.gas]) });
3275
3236
  else if (IntrinsicGasTooLowError.nodeMessage.test(message))
3276
- return new IntrinsicGasTooLowError({ cause: err, gas: _optionalChain([args, 'optionalAccess', _70 => _70.gas]) });
3237
+ return new IntrinsicGasTooLowError({ cause: err, gas: _optionalChain([args, 'optionalAccess', _68 => _68.gas]) });
3277
3238
  else if (TransactionTypeNotSupportedError.nodeMessage.test(message))
3278
3239
  return new TransactionTypeNotSupportedError({ cause: err });
3279
3240
  else if (TipAboveFeeCapError.nodeMessage.test(message))
3280
3241
  return new TipAboveFeeCapError({
3281
3242
  cause: err,
3282
- maxFeePerGas: _optionalChain([args, 'optionalAccess', _71 => _71.maxFeePerGas]),
3283
- maxPriorityFeePerGas: _optionalChain([args, 'optionalAccess', _72 => _72.maxPriorityFeePerGas])
3243
+ maxFeePerGas: _optionalChain([args, 'optionalAccess', _69 => _69.maxFeePerGas]),
3244
+ maxPriorityFeePerGas: _optionalChain([args, 'optionalAccess', _70 => _70.maxPriorityFeePerGas])
3284
3245
  });
3285
- else if (message.match(ExecutionRevertedError.nodeMessage) || "code" in err.cause && _optionalChain([err, 'access', _73 => _73.cause, 'optionalAccess', _74 => _74.code]) === ExecutionRevertedError.code)
3246
+ else if (message.match(ExecutionRevertedError.nodeMessage) || "code" in err.cause && _optionalChain([err, 'access', _71 => _71.cause, 'optionalAccess', _72 => _72.code]) === ExecutionRevertedError.code)
3286
3247
  return new ExecutionRevertedError({
3287
3248
  cause: err,
3288
3249
  message: err.cause.details
@@ -3316,7 +3277,7 @@ function getContractError(err, {
3316
3277
  functionName,
3317
3278
  sender
3318
3279
  }) {
3319
- 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 || {};
3280
+ const { code, data, message } = err instanceof RawContractError ? err : err instanceof CallExecutionError || err instanceof EstimateGasExecutionError ? _optionalChain([err, 'access', _73 => _73.cause, 'optionalAccess', _74 => _74.cause, 'optionalAccess', _75 => _75.cause]) || {} : err.cause || {};
3320
3281
  let cause = err;
3321
3282
  if (err instanceof AbiDecodingZeroDataError) {
3322
3283
  cause = new ContractFunctionZeroDataError({ functionName });
@@ -3405,7 +3366,7 @@ async function http(url, { body, fetchOptions = {}, timeout = 1e4 }) {
3405
3366
  }
3406
3367
  );
3407
3368
  let data;
3408
- 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")])) {
3369
+ if (_optionalChain([response, 'access', _76 => _76.headers, 'access', _77 => _77.get, 'call', _78 => _78("Content-Type"), 'optionalAccess', _79 => _79.startsWith, 'call', _80 => _80("application/json")])) {
3409
3370
  data = await response.json();
3410
3371
  } else {
3411
3372
  data = await response.text();
@@ -3497,15 +3458,15 @@ function webSocket(socket, {
3497
3458
  if (typeof message.id === "number" && id_ !== message.id)
3498
3459
  return;
3499
3460
  if (message.error) {
3500
- _optionalChain([onError, 'optionalCall', _83 => _83(new RpcError({ body, error: message.error, url: socket.url }))]);
3461
+ _optionalChain([onError, 'optionalCall', _81 => _81(new RpcError({ body, error: message.error, url: socket.url }))]);
3501
3462
  } else {
3502
- _optionalChain([onData, 'optionalCall', _84 => _84(message)]);
3463
+ _optionalChain([onData, 'optionalCall', _82 => _82(message)]);
3503
3464
  }
3504
3465
  if (body.method === "eth_subscribe" && typeof message.result === "string") {
3505
3466
  socket.subscriptions.set(message.result, callback);
3506
3467
  }
3507
3468
  if (body.method === "eth_unsubscribe") {
3508
- socket.subscriptions.delete(_optionalChain([body, 'access', _85 => _85.params, 'optionalAccess', _86 => _86[0]]));
3469
+ socket.subscriptions.delete(_optionalChain([body, 'access', _83 => _83.params, 'optionalAccess', _84 => _84[0]]));
3509
3470
  }
3510
3471
  };
3511
3472
  socket.requests.set(id_, callback);
@@ -3546,226 +3507,17 @@ ${messageBytes.length}`
3546
3507
  return keccak256(concat([prefixBytes, messageBytes]), to_);
3547
3508
  }
3548
3509
 
3549
- // src/utils/typedData.ts
3550
- function validateTypedData({
3551
- domain,
3552
- message,
3553
- primaryType,
3554
- types: types_
3555
- }) {
3556
- const types = types_;
3557
- const validateData = (struct, value_) => {
3558
- for (const param of struct) {
3559
- const { name, type: type_ } = param;
3560
- const type = type_;
3561
- const value = value_[name];
3562
- const integerMatch = type.match(integerRegex);
3563
- if (integerMatch && (typeof value === "number" || typeof value === "bigint")) {
3564
- const [_type, base, size_] = integerMatch;
3565
- numberToHex(value, {
3566
- signed: base === "int",
3567
- size: parseInt(size_) / 8
3568
- });
3569
- }
3570
- if (type === "address" && typeof value === "string" && !isAddress(value))
3571
- throw new InvalidAddressError({ address: value });
3572
- const bytesMatch = type.match(bytesRegex);
3573
- if (bytesMatch) {
3574
- const [_type, size_] = bytesMatch;
3575
- if (size_ && size(value) !== parseInt(size_))
3576
- throw new BytesSizeMismatchError({
3577
- expectedSize: parseInt(size_),
3578
- givenSize: size(value)
3579
- });
3580
- }
3581
- const struct2 = types[type];
3582
- if (struct2)
3583
- validateData(struct2, value);
3584
- }
3585
- };
3586
- if (types["EIP712Domain"] && domain)
3587
- validateData(types["EIP712Domain"], domain);
3588
- if (primaryType !== "EIP712Domain") {
3589
- const type = types[primaryType];
3590
- validateData(type, message);
3591
- }
3592
- }
3593
-
3594
- // src/utils/signature/hashTypedData.ts
3595
- function hashTypedData({
3596
- domain: domain_,
3597
- message,
3598
- primaryType,
3599
- types: types_
3600
- }) {
3601
- const domain = typeof domain_ === "undefined" ? {} : domain_;
3602
- const types = {
3603
- EIP712Domain: [
3604
- _optionalChain([domain, 'optionalAccess', _87 => _87.name]) && { name: "name", type: "string" },
3605
- _optionalChain([domain, 'optionalAccess', _88 => _88.version]) && { name: "version", type: "string" },
3606
- _optionalChain([domain, 'optionalAccess', _89 => _89.chainId]) && { name: "chainId", type: "uint256" },
3607
- _optionalChain([domain, 'optionalAccess', _90 => _90.verifyingContract]) && {
3608
- name: "verifyingContract",
3609
- type: "address"
3610
- },
3611
- _optionalChain([domain, 'optionalAccess', _91 => _91.salt]) && { name: "salt", type: "bytes32" }
3612
- ].filter(Boolean),
3613
- ...types_
3614
- };
3615
- validateTypedData({
3616
- domain,
3617
- message,
3618
- primaryType,
3619
- types
3620
- });
3621
- let parts = ["0x1901"];
3622
- if (domain)
3623
- parts.push(
3624
- hashDomain({
3625
- domain,
3626
- types
3627
- })
3628
- );
3629
- if (primaryType !== "EIP712Domain") {
3630
- parts.push(
3631
- hashStruct({
3632
- data: message,
3633
- primaryType,
3634
- types
3635
- })
3636
- );
3637
- }
3638
- return keccak256(concat(parts));
3639
- }
3640
- function hashDomain({
3641
- domain,
3642
- types
3643
- }) {
3644
- return hashStruct({
3645
- data: domain,
3646
- primaryType: "EIP712Domain",
3647
- types
3648
- });
3649
- }
3650
- function hashStruct({
3651
- data,
3652
- primaryType,
3653
- types
3654
- }) {
3655
- const encoded = encodeData({
3656
- data,
3657
- primaryType,
3658
- types
3659
- });
3660
- return keccak256(encoded);
3661
- }
3662
- function encodeData({
3663
- data,
3664
- primaryType,
3665
- types
3666
- }) {
3667
- let encodedTypes = [{ type: "bytes32" }];
3668
- const encodedValues = [hashType({ primaryType, types })];
3669
- for (const field of types[primaryType]) {
3670
- const [type, value] = encodeField({
3671
- types,
3672
- name: field.name,
3673
- type: field.type,
3674
- value: data[field.name]
3675
- });
3676
- encodedTypes.push(type);
3677
- encodedValues.push(value);
3678
- }
3679
- return encodeAbiParameters(encodedTypes, encodedValues);
3680
- }
3681
- function hashType({
3682
- primaryType,
3683
- types
3684
- }) {
3685
- const encodedHashType = toHex(encodeType({ primaryType, types }));
3686
- return keccak256(encodedHashType);
3687
- }
3688
- function encodeType({
3689
- primaryType,
3690
- types
3691
- }) {
3692
- let result = "";
3693
- const unsortedDeps = findTypeDependencies({ primaryType, types });
3694
- unsortedDeps.delete(primaryType);
3695
- const deps = [primaryType, ...Array.from(unsortedDeps).sort()];
3696
- for (const type of deps) {
3697
- result += `${type}(${types[type].map(({ name, type: t }) => `${t} ${name}`).join(",")})`;
3698
- }
3699
- return result;
3700
- }
3701
- function findTypeDependencies({
3702
- primaryType: primaryType_,
3703
- types
3704
- }, results = /* @__PURE__ */ new Set()) {
3705
- const match = primaryType_.match(/^\w*/u);
3706
- const primaryType = _optionalChain([match, 'optionalAccess', _92 => _92[0]]);
3707
- if (results.has(primaryType) || types[primaryType] === void 0) {
3708
- return results;
3709
- }
3710
- results.add(primaryType);
3711
- for (const field of types[primaryType]) {
3712
- findTypeDependencies({ primaryType: field.type, types }, results);
3713
- }
3714
- return results;
3715
- }
3716
- function encodeField({
3717
- types,
3718
- name,
3719
- type,
3720
- value
3721
- }) {
3722
- if (types[type] !== void 0) {
3723
- return [
3724
- { type: "bytes32" },
3725
- keccak256(encodeData({ data: value, primaryType: type, types }))
3726
- ];
3727
- }
3728
- if (type === "bytes") {
3729
- const prepend = value.length % 2 ? "0" : "";
3730
- value = `0x${prepend + value.slice(2)}`;
3731
- return [{ type: "bytes32" }, keccak256(value)];
3732
- }
3733
- if (type === "string")
3734
- return [{ type: "bytes32" }, keccak256(toHex(value))];
3735
- if (type.lastIndexOf("]") === type.length - 1) {
3736
- const parsedType = type.slice(0, type.lastIndexOf("["));
3737
- const typeValuePairs = value.map(
3738
- (item) => encodeField({
3739
- name,
3740
- type: parsedType,
3741
- types,
3742
- value: item
3743
- })
3744
- );
3745
- return [
3746
- { type: "bytes32" },
3747
- keccak256(
3748
- encodeAbiParameters(
3749
- typeValuePairs.map(([t]) => t),
3750
- typeValuePairs.map(([, v]) => v)
3751
- )
3752
- )
3753
- ];
3754
- }
3755
- return [{ type }, value];
3756
- }
3757
-
3758
3510
  // src/utils/signature/recoverAddress.ts
3759
- async function recoverAddress({
3511
+ var _secp256k1 = require('@noble/secp256k1');
3512
+ function recoverAddress({
3760
3513
  hash: hash2,
3761
3514
  signature
3762
3515
  }) {
3763
3516
  const signatureHex = isHex(signature) ? signature : toHex(signature);
3764
3517
  const hashHex = isHex(hash2) ? hash2 : toHex(hash2);
3765
3518
  const v = hexToNumber(`0x${signatureHex.slice(130)}`);
3766
- const { recoverPublicKey } = await Promise.resolve().then(() => require("@noble/secp256k1"));
3767
3519
  const publicKey = toHex(
3768
- recoverPublicKey(
3520
+ _secp256k1.recoverPublicKey.call(void 0,
3769
3521
  hashHex.substring(2),
3770
3522
  signatureHex.substring(2, 130),
3771
3523
  v - 27
@@ -3776,75 +3528,28 @@ async function recoverAddress({
3776
3528
  }
3777
3529
 
3778
3530
  // src/utils/signature/recoverMessageAddress.ts
3779
- async function recoverMessageAddress({
3531
+ function recoverMessageAddress({
3780
3532
  message,
3781
3533
  signature
3782
3534
  }) {
3783
3535
  return recoverAddress({ hash: hashMessage(message), signature });
3784
3536
  }
3785
3537
 
3786
- // src/utils/signature/recoverTypedDataAddress.ts
3787
- async function recoverTypedDataAddress({
3788
- domain,
3789
- message,
3790
- primaryType,
3791
- signature,
3792
- types
3793
- }) {
3794
- return recoverAddress({
3795
- hash: hashTypedData({
3796
- domain,
3797
- message,
3798
- primaryType,
3799
- types
3800
- }),
3801
- signature
3802
- });
3803
- }
3804
-
3805
3538
  // src/utils/signature/verifyMessage.ts
3806
- async function verifyMessage({
3539
+ function verifyMessage({
3807
3540
  address,
3808
3541
  message,
3809
3542
  signature
3810
3543
  }) {
3811
3544
  return isAddressEqual(
3812
3545
  getAddress(address),
3813
- await recoverMessageAddress({ message, signature })
3814
- );
3815
- }
3816
-
3817
- // src/utils/signature/verifyTypedData.ts
3818
- async function verifyTypedData({
3819
- address,
3820
- domain,
3821
- message,
3822
- primaryType,
3823
- signature,
3824
- types
3825
- }) {
3826
- return isAddressEqual(
3827
- getAddress(address),
3828
- await recoverTypedDataAddress({
3829
- domain,
3830
- message,
3831
- primaryType,
3832
- signature,
3833
- types
3834
- })
3546
+ recoverMessageAddress({ message, signature })
3835
3547
  );
3836
3548
  }
3837
3549
 
3838
3550
  // src/utils/transaction/assertRequest.ts
3839
3551
  function assertRequest(args) {
3840
- const {
3841
- account: account_,
3842
- gasPrice,
3843
- maxFeePerGas,
3844
- maxPriorityFeePerGas,
3845
- to
3846
- } = args;
3847
- const account = account_ ? parseAccount(account_) : void 0;
3552
+ const { account, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to } = args;
3848
3553
  if (account && !isAddress(account.address))
3849
3554
  throw new InvalidAddressError({ address: account.address });
3850
3555
  if (to && !isAddress(to))
@@ -3860,7 +3565,7 @@ function assertRequest(args) {
3860
3565
  // src/actions/public/call.ts
3861
3566
  async function call(client, args) {
3862
3567
  const {
3863
- account: account_,
3568
+ account,
3864
3569
  blockNumber,
3865
3570
  blockTag = "latest",
3866
3571
  accessList,
@@ -3874,14 +3579,13 @@ async function call(client, args) {
3874
3579
  value,
3875
3580
  ...rest
3876
3581
  } = args;
3877
- const account = account_ ? parseAccount(account_) : void 0;
3878
3582
  try {
3879
3583
  assertRequest(args);
3880
3584
  const blockNumberHex = blockNumber ? numberToHex(blockNumber) : void 0;
3881
- const formatter = _optionalChain([client, 'access', _93 => _93.chain, 'optionalAccess', _94 => _94.formatters, 'optionalAccess', _95 => _95.transactionRequest]);
3585
+ const formatter = _optionalChain([client, 'access', _85 => _85.chain, 'optionalAccess', _86 => _86.formatters, 'optionalAccess', _87 => _87.transactionRequest]);
3882
3586
  const request_ = format3(
3883
3587
  {
3884
- from: _optionalChain([account, 'optionalAccess', _96 => _96.address]),
3588
+ from: _optionalChain([account, 'optionalAccess', _88 => _88.address]),
3885
3589
  accessList,
3886
3590
  data,
3887
3591
  gas,
@@ -3908,7 +3612,6 @@ async function call(client, args) {
3908
3612
  } catch (err) {
3909
3613
  throw getCallError(err, {
3910
3614
  ...args,
3911
- account,
3912
3615
  chain: client.chain
3913
3616
  });
3914
3617
  }
@@ -3922,7 +3625,6 @@ async function simulateContract(client, {
3922
3625
  functionName,
3923
3626
  ...callRequest
3924
3627
  }) {
3925
- const account = callRequest.account ? parseAccount(callRequest.account) : void 0;
3926
3628
  const calldata = encodeFunctionData({
3927
3629
  abi,
3928
3630
  args,
@@ -3957,7 +3659,7 @@ async function simulateContract(client, {
3957
3659
  args,
3958
3660
  docsPath: "/docs/contract/simulateContract",
3959
3661
  functionName,
3960
- sender: _optionalChain([account, 'optionalAccess', _97 => _97.address])
3662
+ sender: _optionalChain([callRequest, 'access', _89 => _89.account, 'optionalAccess', _90 => _90.address])
3961
3663
  });
3962
3664
  }
3963
3665
  }
@@ -4049,13 +3751,9 @@ async function createContractEventFilter(client, {
4049
3751
 
4050
3752
  // src/actions/public/estimateGas.ts
4051
3753
  async function estimateGas(client, args) {
4052
- if (!args.account)
4053
- throw new AccountNotFoundError({
4054
- docsPath: "/docs/actions/public/estimateGas"
4055
- });
4056
- const account = parseAccount(args.account);
4057
3754
  try {
4058
3755
  const {
3756
+ account,
4059
3757
  accessList,
4060
3758
  blockNumber,
4061
3759
  blockTag = "latest",
@@ -4068,10 +3766,10 @@ async function estimateGas(client, args) {
4068
3766
  to,
4069
3767
  value,
4070
3768
  ...rest
4071
- } = account.type === "local" ? await prepareRequest(client, args) : args;
3769
+ } = args.account.type === "local" ? await prepareRequest(client, args) : args;
4072
3770
  const blockNumberHex = blockNumber ? numberToHex(blockNumber) : void 0;
4073
3771
  assertRequest(args);
4074
- const formatter = _optionalChain([client, 'access', _98 => _98.chain, 'optionalAccess', _99 => _99.formatters, 'optionalAccess', _100 => _100.transactionRequest]);
3772
+ const formatter = _optionalChain([client, 'access', _91 => _91.chain, 'optionalAccess', _92 => _92.formatters, 'optionalAccess', _93 => _93.transactionRequest]);
4075
3773
  const request = format3(
4076
3774
  {
4077
3775
  from: account.address,
@@ -4099,7 +3797,6 @@ async function estimateGas(client, args) {
4099
3797
  } catch (err) {
4100
3798
  throw getEstimateGasError(err, {
4101
3799
  ...args,
4102
- account,
4103
3800
  chain: client.chain
4104
3801
  });
4105
3802
  }
@@ -4113,7 +3810,6 @@ async function estimateContractGas(client, {
4113
3810
  functionName,
4114
3811
  ...request
4115
3812
  }) {
4116
- const account = parseAccount(request.account);
4117
3813
  const data = encodeFunctionData({
4118
3814
  abi,
4119
3815
  args,
@@ -4133,7 +3829,7 @@ async function estimateContractGas(client, {
4133
3829
  args,
4134
3830
  docsPath: "/docs/contract/simulateContract",
4135
3831
  functionName,
4136
- sender: _optionalChain([account, 'optionalAccess', _101 => _101.address])
3832
+ sender: _optionalChain([request, 'access', _94 => _94.account, 'optionalAccess', _95 => _95.address])
4137
3833
  });
4138
3834
  }
4139
3835
  }
@@ -4171,7 +3867,7 @@ async function getBlock(client, {
4171
3867
  if (!block)
4172
3868
  throw new BlockNotFoundError({ blockHash, blockNumber });
4173
3869
  return format3(block, {
4174
- formatter: _optionalChain([client, 'access', _102 => _102.chain, 'optionalAccess', _103 => _103.formatters, 'optionalAccess', _104 => _104.block]) || formatBlock
3870
+ formatter: _optionalChain([client, 'access', _96 => _96.chain, 'optionalAccess', _97 => _97.formatters, 'optionalAccess', _98 => _98.block]) || formatBlock
4175
3871
  });
4176
3872
  }
4177
3873
 
@@ -4383,7 +4079,7 @@ async function getTransaction(client, {
4383
4079
  index
4384
4080
  });
4385
4081
  return format3(transaction, {
4386
- formatter: _optionalChain([client, 'access', _105 => _105.chain, 'optionalAccess', _106 => _106.formatters, 'optionalAccess', _107 => _107.transaction]) || formatTransaction
4082
+ formatter: _optionalChain([client, 'access', _99 => _99.chain, 'optionalAccess', _100 => _100.formatters, 'optionalAccess', _101 => _101.transaction]) || formatTransaction
4387
4083
  });
4388
4084
  }
4389
4085
 
@@ -4393,7 +4089,7 @@ async function getTransactionConfirmations(client, { hash: hash2, transactionRec
4393
4089
  getBlockNumber(client),
4394
4090
  hash2 ? getTransaction(client, { hash: hash2 }) : void 0
4395
4091
  ]);
4396
- const transactionBlockNumber = _optionalChain([transactionReceipt, 'optionalAccess', _108 => _108.blockNumber]) || _optionalChain([transaction, 'optionalAccess', _109 => _109.blockNumber]);
4092
+ const transactionBlockNumber = _optionalChain([transactionReceipt, 'optionalAccess', _102 => _102.blockNumber]) || _optionalChain([transaction, 'optionalAccess', _103 => _103.blockNumber]);
4397
4093
  if (!transactionBlockNumber)
4398
4094
  return 0n;
4399
4095
  return blockNumber - transactionBlockNumber + 1n;
@@ -4417,7 +4113,7 @@ async function getTransactionReceipt(client, { hash: hash2 }) {
4417
4113
  if (!receipt)
4418
4114
  throw new TransactionReceiptNotFoundError({ hash: hash2 });
4419
4115
  return format3(receipt, {
4420
- formatter: _optionalChain([client, 'access', _110 => _110.chain, 'optionalAccess', _111 => _111.formatters, 'optionalAccess', _112 => _112.transactionReceipt]) || formatTransactionReceipt
4116
+ formatter: _optionalChain([client, 'access', _104 => _104.chain, 'optionalAccess', _105 => _105.formatters, 'optionalAccess', _106 => _106.transactionReceipt]) || formatTransactionReceipt
4421
4117
  });
4422
4118
  }
4423
4119
 
@@ -4586,7 +4282,7 @@ function observe(observerId, callbacks, fn) {
4586
4282
  const listeners2 = getListeners();
4587
4283
  if (listeners2.length === 0)
4588
4284
  return;
4589
- listeners2.forEach((listener) => _optionalChain([listener, 'access', _113 => _113.fns, 'access', _114 => _114[key], 'optionalCall', _115 => _115(...args)]));
4285
+ listeners2.forEach((listener) => _optionalChain([listener, 'access', _107 => _107.fns, 'access', _108 => _108[key], 'optionalCall', _109 => _109(...args)]));
4590
4286
  };
4591
4287
  }
4592
4288
  const cleanup = fn(emit);
@@ -4667,7 +4363,7 @@ async function waitForTransactionReceipt(client, {
4667
4363
  reason = "cancelled";
4668
4364
  }
4669
4365
  done(() => {
4670
- _optionalChain([emit, 'access', _116 => _116.onReplaced, 'optionalCall', _117 => _117({
4366
+ _optionalChain([emit, 'access', _110 => _110.onReplaced, 'optionalCall', _111 => _111({
4671
4367
  reason,
4672
4368
  replacedTransaction,
4673
4369
  transaction: replacementTransaction,
@@ -4695,7 +4391,7 @@ function poll(fn, { emitOnBegin, initialWaitTime, interval }) {
4695
4391
  let data;
4696
4392
  if (emitOnBegin)
4697
4393
  data = await fn({ unpoll: unwatch });
4698
- const initialWait = await _asyncNullishCoalesce(await _optionalChain([initialWaitTime, 'optionalCall', _118 => _118(data)]), async () => ( interval));
4394
+ const initialWait = await _asyncNullishCoalesce(await _optionalChain([initialWaitTime, 'optionalCall', _112 => _112(data)]), async () => ( interval));
4699
4395
  await wait(initialWait);
4700
4396
  const poll2 = async () => {
4701
4397
  if (!active)
@@ -4748,7 +4444,7 @@ function watchBlockNumber(client, {
4748
4444
  prevBlockNumber = blockNumber;
4749
4445
  }
4750
4446
  } catch (err) {
4751
- _optionalChain([emit, 'access', _119 => _119.onError, 'optionalCall', _120 => _120(err)]);
4447
+ _optionalChain([emit, 'access', _113 => _113.onError, 'optionalCall', _114 => _114(err)]);
4752
4448
  }
4753
4449
  },
4754
4450
  {
@@ -4788,11 +4484,11 @@ function watchBlocks(client, {
4788
4484
  blockTag,
4789
4485
  includeTransactions
4790
4486
  });
4791
- if (block.number && _optionalChain([prevBlock, 'optionalAccess', _121 => _121.number])) {
4487
+ if (block.number && _optionalChain([prevBlock, 'optionalAccess', _115 => _115.number])) {
4792
4488
  if (block.number === prevBlock.number)
4793
4489
  return;
4794
4490
  if (block.number - prevBlock.number > 1 && emitMissed) {
4795
- for (let i = _optionalChain([prevBlock, 'optionalAccess', _122 => _122.number]) + 1n; i < block.number; i++) {
4491
+ for (let i = _optionalChain([prevBlock, 'optionalAccess', _116 => _116.number]) + 1n; i < block.number; i++) {
4796
4492
  const block2 = await getBlock(client, {
4797
4493
  blockNumber: i,
4798
4494
  includeTransactions
@@ -4804,8 +4500,8 @@ function watchBlocks(client, {
4804
4500
  }
4805
4501
  if (
4806
4502
  // If no previous block exists, emit.
4807
- !_optionalChain([prevBlock, 'optionalAccess', _123 => _123.number]) || // If the block tag is "pending" with no block number, emit.
4808
- blockTag === "pending" && !_optionalChain([block, 'optionalAccess', _124 => _124.number]) || // If the next block number is greater than the previous block number, emit.
4503
+ !_optionalChain([prevBlock, 'optionalAccess', _117 => _117.number]) || // If the block tag is "pending" with no block number, emit.
4504
+ blockTag === "pending" && !_optionalChain([block, 'optionalAccess', _118 => _118.number]) || // If the next block number is greater than the previous block number, emit.
4809
4505
  // We don't want to emit blocks in the past.
4810
4506
  block.number && block.number > prevBlock.number
4811
4507
  ) {
@@ -4813,7 +4509,7 @@ function watchBlocks(client, {
4813
4509
  prevBlock = block;
4814
4510
  }
4815
4511
  } catch (err) {
4816
- _optionalChain([emit, 'access', _125 => _125.onError, 'optionalCall', _126 => _126(err)]);
4512
+ _optionalChain([emit, 'access', _119 => _119.onError, 'optionalCall', _120 => _120(err)]);
4817
4513
  }
4818
4514
  },
4819
4515
  {
@@ -4892,7 +4588,7 @@ function watchContractEvent(client, {
4892
4588
  else
4893
4589
  logs.forEach((log) => emit.onLogs([log]));
4894
4590
  } catch (err) {
4895
- _optionalChain([emit, 'access', _127 => _127.onError, 'optionalCall', _128 => _128(err)]);
4591
+ _optionalChain([emit, 'access', _121 => _121.onError, 'optionalCall', _122 => _122(err)]);
4896
4592
  }
4897
4593
  },
4898
4594
  {
@@ -4971,7 +4667,7 @@ function watchEvent(client, {
4971
4667
  else
4972
4668
  logs.forEach((log) => emit.onLogs([log]));
4973
4669
  } catch (err) {
4974
- _optionalChain([emit, 'access', _129 => _129.onError, 'optionalCall', _130 => _130(err)]);
4670
+ _optionalChain([emit, 'access', _123 => _123.onError, 'optionalCall', _124 => _124(err)]);
4975
4671
  }
4976
4672
  },
4977
4673
  {
@@ -5022,7 +4718,7 @@ function watchPendingTransactions(client, {
5022
4718
  else
5023
4719
  hashes.forEach((hash2) => emit.onTransactions([hash2]));
5024
4720
  } catch (err) {
5025
- _optionalChain([emit, 'access', _131 => _131.onError, 'optionalCall', _132 => _132(err)]);
4721
+ _optionalChain([emit, 'access', _125 => _125.onError, 'optionalCall', _126 => _126(err)]);
5026
4722
  }
5027
4723
  },
5028
4724
  {
@@ -5284,12 +4980,7 @@ async function addChain(client, { chain }) {
5284
4980
  }
5285
4981
 
5286
4982
  // src/actions/wallet/deployContract.ts
5287
- function deployContract(walletClient, {
5288
- abi,
5289
- args,
5290
- bytecode,
5291
- ...request
5292
- }) {
4983
+ function deployContract(walletClient, { abi, args, bytecode, ...request }) {
5293
4984
  const calldata = encodeDeployData({
5294
4985
  abi,
5295
4986
  args,
@@ -5330,9 +5021,10 @@ async function requestPermissions(client, permissions) {
5330
5021
  // src/actions/wallet/sendTransaction.ts
5331
5022
  async function sendTransaction(client, args) {
5332
5023
  const {
5333
- account: account_ = client.account,
5024
+ account,
5334
5025
  chain = client.chain,
5335
5026
  accessList,
5027
+ assertChain = true,
5336
5028
  data,
5337
5029
  gas,
5338
5030
  gasPrice,
@@ -5343,20 +5035,13 @@ async function sendTransaction(client, args) {
5343
5035
  value,
5344
5036
  ...rest
5345
5037
  } = args;
5346
- if (!account_)
5347
- throw new AccountNotFoundError({
5348
- docsPath: "/docs/actions/wallet/sendTransaction"
5349
- });
5350
- const account = parseAccount(account_);
5351
5038
  try {
5352
5039
  assertRequest(args);
5353
- const chainId = await getChainId(client);
5354
- if (chain !== null && chainId !== _optionalChain([chain, 'optionalAccess', _133 => _133.id])) {
5355
- if (!chain)
5356
- throw new ChainNotFoundError();
5357
- throw new ChainMismatchError({ chain, currentChainId: chainId });
5358
- }
5040
+ const currentChainId = await getChainId(client);
5041
+ if (assertChain && chain && currentChainId !== _optionalChain([chain, 'optionalAccess', _127 => _127.id]))
5042
+ throw new ChainMismatchError({ chain, currentChainId });
5359
5043
  if (account.type === "local") {
5044
+ const chainId = _nullishCoalesce(_optionalChain([chain, 'optionalAccess', _128 => _128.id]), () => ( currentChainId));
5360
5045
  const request2 = await prepareRequest(client, {
5361
5046
  account,
5362
5047
  accessList,
@@ -5380,7 +5065,7 @@ async function sendTransaction(client, args) {
5380
5065
  params: [signedRequest]
5381
5066
  });
5382
5067
  }
5383
- const formatter = _optionalChain([chain, 'optionalAccess', _134 => _134.formatters, 'optionalAccess', _135 => _135.transactionRequest]);
5068
+ const formatter = _optionalChain([chain, 'optionalAccess', _129 => _129.formatters, 'optionalAccess', _130 => _130.transactionRequest]);
5384
5069
  const request = format3(
5385
5070
  {
5386
5071
  accessList,
@@ -5405,28 +5090,15 @@ async function sendTransaction(client, args) {
5405
5090
  params: [request]
5406
5091
  });
5407
5092
  } catch (err) {
5408
- throw getTransactionError(err, {
5409
- ...args,
5410
- account,
5411
- chain: args.chain || void 0
5412
- });
5093
+ throw getTransactionError(err, args);
5413
5094
  }
5414
5095
  }
5415
5096
 
5416
5097
  // src/actions/wallet/signMessage.ts
5417
- async function signMessage(client, {
5418
- account: account_ = client.account,
5419
- data,
5420
- message
5421
- }) {
5422
- if (!account_)
5423
- throw new AccountNotFoundError({
5424
- docsPath: "/docs/actions/wallet/signMessage"
5425
- });
5426
- const account = parseAccount(account_);
5098
+ async function signMessage(client, { account, data, message }) {
5427
5099
  const message_ = message || data;
5428
5100
  if (account.type === "local")
5429
- return account.signMessage({ message: message_ });
5101
+ return account.signMessage(message_);
5430
5102
  return client.request({
5431
5103
  method: "personal_sign",
5432
5104
  params: [toHex(message_), account.address]
@@ -5435,27 +5107,22 @@ async function signMessage(client, {
5435
5107
 
5436
5108
  // src/actions/wallet/signTypedData.ts
5437
5109
  async function signTypedData(client, {
5438
- account: account_ = client.account,
5110
+ account,
5439
5111
  domain,
5440
5112
  message,
5441
5113
  primaryType,
5442
5114
  types: types_
5443
5115
  }) {
5444
- if (!account_)
5445
- throw new AccountNotFoundError({
5446
- docsPath: "/docs/actions/wallet/signTypedData"
5447
- });
5448
- const account = parseAccount(account_);
5449
5116
  const types = {
5450
5117
  EIP712Domain: [
5451
- _optionalChain([domain, 'optionalAccess', _136 => _136.name]) && { name: "name", type: "string" },
5452
- _optionalChain([domain, 'optionalAccess', _137 => _137.version]) && { name: "version", type: "string" },
5453
- _optionalChain([domain, 'optionalAccess', _138 => _138.chainId]) && { name: "chainId", type: "uint256" },
5454
- _optionalChain([domain, 'optionalAccess', _139 => _139.verifyingContract]) && {
5118
+ _optionalChain([domain, 'optionalAccess', _131 => _131.name]) && { name: "name", type: "string" },
5119
+ _optionalChain([domain, 'optionalAccess', _132 => _132.version]) && { name: "version", type: "string" },
5120
+ _optionalChain([domain, 'optionalAccess', _133 => _133.chainId]) && { name: "chainId", type: "uint256" },
5121
+ _optionalChain([domain, 'optionalAccess', _134 => _134.verifyingContract]) && {
5455
5122
  name: "verifyingContract",
5456
5123
  type: "address"
5457
5124
  },
5458
- _optionalChain([domain, 'optionalAccess', _140 => _140.salt]) && { name: "salt", type: "bytes32" }
5125
+ _optionalChain([domain, 'optionalAccess', _135 => _135.salt]) && { name: "salt", type: "bytes32" }
5459
5126
  ].filter(Boolean),
5460
5127
  ...types_
5461
5128
  };
@@ -5481,6 +5148,47 @@ async function signTypedData(client, {
5481
5148
  params: [account.address, typedData]
5482
5149
  });
5483
5150
  }
5151
+ function validateTypedData({
5152
+ domain,
5153
+ message,
5154
+ primaryType,
5155
+ types: types_
5156
+ }) {
5157
+ const types = types_;
5158
+ const validateData = (struct, value_) => {
5159
+ for (const param of struct) {
5160
+ const { name, type: type_ } = param;
5161
+ const type2 = type_;
5162
+ const value = value_[name];
5163
+ const integerMatch = type2.match(integerRegex);
5164
+ if (integerMatch && (typeof value === "number" || typeof value === "bigint")) {
5165
+ const [_type, base, size_] = integerMatch;
5166
+ numberToHex(value, {
5167
+ signed: base === "int",
5168
+ size: parseInt(size_) / 8
5169
+ });
5170
+ }
5171
+ if (type2 === "address" && typeof value === "string" && !isAddress(value))
5172
+ throw new InvalidAddressError({ address: value });
5173
+ const bytesMatch = type2.match(bytesRegex);
5174
+ if (bytesMatch) {
5175
+ const [_type, size_] = bytesMatch;
5176
+ if (size_ && size(value) !== parseInt(size_))
5177
+ throw new BytesSizeMismatchError({
5178
+ expectedSize: parseInt(size_),
5179
+ givenSize: size(value)
5180
+ });
5181
+ }
5182
+ const struct2 = types[type2];
5183
+ if (struct2)
5184
+ validateData(struct2, value);
5185
+ }
5186
+ };
5187
+ if (types["EIP712Domain"] && domain)
5188
+ validateData(types["EIP712Domain"], domain);
5189
+ const type = types[primaryType];
5190
+ validateData(type, message);
5191
+ }
5484
5192
 
5485
5193
  // src/actions/wallet/switchChain.ts
5486
5194
  async function switchChain(client, { id: id2 }) {
@@ -5554,17 +5262,7 @@ function parseGwei(ether, unit = "wei") {
5554
5262
  // src/utils/transaction/prepareRequest.ts
5555
5263
  var defaultTip = parseGwei("1.5");
5556
5264
  async function prepareRequest(client, args) {
5557
- const {
5558
- account: account_,
5559
- gas,
5560
- gasPrice,
5561
- maxFeePerGas,
5562
- maxPriorityFeePerGas,
5563
- nonce
5564
- } = args;
5565
- if (!account_)
5566
- throw new AccountNotFoundError();
5567
- const account = parseAccount(account_);
5265
+ const { account, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce } = args;
5568
5266
  const block = await getBlock(client, { blockTag: "latest" });
5569
5267
  const request = { ...args, from: account.address };
5570
5268
  if (typeof nonce === "undefined")
@@ -5894,10 +5592,5 @@ function parseEther(ether, unit = "wei") {
5894
5592
 
5895
5593
 
5896
5594
 
5897
-
5898
-
5899
-
5900
-
5901
-
5902
- 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.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.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.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.validateTypedData = validateTypedData; 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;
5903
- //# sourceMappingURL=chunk-NJSAEA2H.js.map
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
+ //# sourceMappingURL=chunk-BHAAXXGO.js.map