viem 0.0.1-alpha.7 → 0.0.1-alpha.9

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.
@@ -1,7 +1,7 @@
1
- export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DropTransactionArgs, E as EstimateGasArgs, d as EstimateGasResponse, be as FormattedTransactionRequest, G as GetBalanceArgs, e as GetBalanceResponse, f as GetBlockArgs, g as GetBlockNumberArgs, h as GetBlockNumberResponse, i as GetBlockResponse, j as GetBlockTransactionCountArgs, k as GetBlockTransactionCountResponse, l as GetFeeHistoryArgs, m as GetFeeHistoryResponse, n as GetFilterChangesArgs, o as GetFilterChangesResponse, p as GetFilterLogsArgs, q as GetFilterLogsResponse, r as GetGasPriceResponse, s as GetPermissionsResponse, t as GetTransactionArgs, u as GetTransactionConfirmationsArgs, v as GetTransactionConfirmationsResponse, w as GetTransactionCountArgs, x as GetTransactionCountResponse, z as GetTransactionReceiptArgs, A as GetTransactionReceiptResponse, y as GetTransactionResponse, I as ImpersonateAccountArgs, B as IncreaseTimeArgs, M as MineArgs, O as OnBlock, F as OnBlockNumber, H as OnBlockNumberResponse, J as OnBlockResponse, K as OnTransactions, L as OnTransactionsResponse, bc as ReplacementReason, bd as ReplacementResponse, N as RequestPermissionsResponse, R as ResetArgs, P as RevertArgs, S as SendTransactionArgs, Q as SendTransactionResponse, T as SendUnsignedTransactionArgs, U as SendUnsignedTransactionResponse, V as SetBalanceArgs, W as SetBlockGasLimitArgs, $ as SetBlockTimestampIntervalArgs, X as SetCodeArgs, Y as SetCoinbaseArgs, Z as SetIntervalMiningArgs, _ as SetMinGasPriceArgs, a1 as SetNextBlockBaseFeePerGasArgs, a0 as SetNextBlockTimestampArgs, a2 as SetNonceArgs, a3 as SetStorageAtArgs, a4 as SignMessageArgs, a5 as SignMessageResponse, a6 as StopImpersonatingAccountArgs, a7 as SwitchChainArgs, a8 as UninstallFilterArgs, a9 as UninstallFilterResponse, aa as WaitForTransactionReceiptArgs, ab as WaitForTransactionReceiptResponse, ac as WatchAssetArgs, ad as WatchAssetResponse, ae as WatchBlockNumberArgs, af as WatchBlocksArgs, ag as WatchPendingTransactionsArgs, ah as addChain, ai as call, aj as createBlockFilter, ak as createPendingTransactionFilter, am as dropTransaction, al as estimateGas, an as getAccounts, ao as getAutomine, ap as getBalance, aq as getBlock, ar as getBlockNumber, bb as getBlockNumberCache, as as getBlockTransactionCount, at as getChainId, au as getFeeHistory, av as getFilterChanges, aw as getFilterLogs, ax as getGasPrice, ay as getPermissions, az as getTransaction, aA as getTransactionConfirmations, aB as getTransactionCount, aC as getTransactionReceipt, aD as getTxpoolContent, aE as getTxpoolStatus, aF as impersonateAccount, aG as increaseTime, aH as inspectTxpool, aI as mine, aJ as removeBlockTimestampInterval, aL as requestAccounts, aM as requestPermissions, aK as reset, aN as revert, aO as sendTransaction, aP as sendUnsignedTransaction, aQ as setAutomine, aR as setBalance, aS as setBlockGasLimit, aT as setBlockTimestampInterval, aU as setCode, aV as setCoinbase, aW as setIntervalMining, aX as setLoggingEnabled, aY as setMinGasPrice, aZ as setNextBlockBaseFeePerGas, a_ as setNextBlockTimestamp, a$ as setNonce, b0 as setStorageAt, b1 as signMessage, b2 as snapshot, b3 as stopImpersonatingAccount, b4 as switchChain, b5 as uninstallFilter, b6 as waitForTransactionReceipt, b7 as watchAsset, b8 as watchBlockNumber, b9 as watchBlocks, ba as watchPendingTransactions } from '../watchAsset-e99e744d.js';
1
+ export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DropTransactionArgs, E as EstimateGasArgs, d as EstimateGasResponse, be as FormattedTransactionRequest, G as GetBalanceArgs, e as GetBalanceResponse, f as GetBlockArgs, g as GetBlockNumberArgs, h as GetBlockNumberResponse, i as GetBlockResponse, j as GetBlockTransactionCountArgs, k as GetBlockTransactionCountResponse, l as GetFeeHistoryArgs, m as GetFeeHistoryResponse, n as GetFilterChangesArgs, o as GetFilterChangesResponse, p as GetFilterLogsArgs, q as GetFilterLogsResponse, r as GetGasPriceResponse, s as GetPermissionsResponse, t as GetTransactionArgs, u as GetTransactionConfirmationsArgs, v as GetTransactionConfirmationsResponse, w as GetTransactionCountArgs, x as GetTransactionCountResponse, z as GetTransactionReceiptArgs, A as GetTransactionReceiptResponse, y as GetTransactionResponse, I as ImpersonateAccountArgs, B as IncreaseTimeArgs, M as MineArgs, O as OnBlock, F as OnBlockNumber, H as OnBlockNumberResponse, J as OnBlockResponse, K as OnTransactions, L as OnTransactionsResponse, bc as ReplacementReason, bd as ReplacementResponse, N as RequestPermissionsResponse, R as ResetArgs, P as RevertArgs, S as SendTransactionArgs, Q as SendTransactionResponse, T as SendUnsignedTransactionArgs, U as SendUnsignedTransactionResponse, V as SetBalanceArgs, W as SetBlockGasLimitArgs, $ as SetBlockTimestampIntervalArgs, X as SetCodeArgs, Y as SetCoinbaseArgs, Z as SetIntervalMiningArgs, _ as SetMinGasPriceArgs, a1 as SetNextBlockBaseFeePerGasArgs, a0 as SetNextBlockTimestampArgs, a2 as SetNonceArgs, a3 as SetStorageAtArgs, a4 as SignMessageArgs, a5 as SignMessageResponse, a6 as StopImpersonatingAccountArgs, a7 as SwitchChainArgs, a8 as UninstallFilterArgs, a9 as UninstallFilterResponse, aa as WaitForTransactionReceiptArgs, ab as WaitForTransactionReceiptResponse, ac as WatchAssetArgs, ad as WatchAssetResponse, ae as WatchBlockNumberArgs, af as WatchBlocksArgs, ag as WatchPendingTransactionsArgs, ah as addChain, ai as call, aj as createBlockFilter, ak as createPendingTransactionFilter, am as dropTransaction, al as estimateGas, an as getAccounts, ao as getAutomine, ap as getBalance, aq as getBlock, ar as getBlockNumber, bb as getBlockNumberCache, as as getBlockTransactionCount, at as getChainId, au as getFeeHistory, av as getFilterChanges, aw as getFilterLogs, ax as getGasPrice, ay as getPermissions, az as getTransaction, aA as getTransactionConfirmations, aB as getTransactionCount, aC as getTransactionReceipt, aD as getTxpoolContent, aE as getTxpoolStatus, aF as impersonateAccount, aG as increaseTime, aH as inspectTxpool, aI as mine, aJ as removeBlockTimestampInterval, aL as requestAccounts, aM as requestPermissions, aK as reset, aN as revert, aO as sendTransaction, aP as sendUnsignedTransaction, aQ as setAutomine, aR as setBalance, aS as setBlockGasLimit, aT as setBlockTimestampInterval, aU as setCode, aV as setCoinbase, aW as setIntervalMining, aX as setLoggingEnabled, aY as setMinGasPrice, aZ as setNextBlockBaseFeePerGas, a_ as setNextBlockTimestamp, a$ as setNonce, b0 as setStorageAt, b1 as signMessage, b2 as snapshot, b3 as stopImpersonatingAccount, b4 as switchChain, b5 as uninstallFilter, b6 as waitForTransactionReceipt, b7 as watchAsset, b8 as watchBlockNumber, b9 as watchBlocks, ba as watchPendingTransactions } from '../watchAsset-dc7dcdd9.js';
2
2
  import '../chains.js';
3
3
  import '../rpc-b77c5aee.js';
4
4
  import '@wagmi/chains';
5
- import '../createWalletClient-b5c3c89e.js';
6
- import '../eip1193-100454ab.js';
5
+ import '../createWalletClient-d612fe08.js';
6
+ import '../eip1193-020a6f13.js';
7
7
  import '../transactionRequest-3e463099.js';
@@ -58,9 +58,9 @@ import {
58
58
  watchBlockNumber,
59
59
  watchBlocks,
60
60
  watchPendingTransactions
61
- } from "../chunk-6NVPLWQM.js";
62
- import "../chunk-TKAGJYBH.js";
63
- import "../chunk-3N57H2YM.js";
61
+ } from "../chunk-6BXRN6CQ.js";
62
+ import "../chunk-26WUARDL.js";
63
+ import "../chunk-7H5SPKXN.js";
64
64
  export {
65
65
  addChain,
66
66
  call,
package/dist/chains.d.ts CHANGED
@@ -24,7 +24,7 @@ declare const defineBlock: <TFormat extends Formatter<Partial<RpcBlock>, Partial
24
24
  }) => Block<bigint, Transaction<bigint, number>> & ReturnType<TFormat> & { [K in TExclude[number]]: never; };
25
25
  declare const defineTransaction: <TFormat extends Formatter<Partial<RpcTransaction>, Partial<Transaction<bigint, number>> & {
26
26
  [key: string]: unknown;
27
- }>, TExclude extends ("gas" | "type" | "blockHash" | "blockNumber" | "hash" | "value" | "from" | "input" | "nonce" | "r" | "s" | "to" | "transactionIndex" | "v" | "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" | "accessList")[] = []>({ exclude, format: formatOverride, }: {
27
+ }>, TExclude extends ("type" | "gas" | "blockHash" | "blockNumber" | "hash" | "value" | "from" | "input" | "nonce" | "r" | "s" | "to" | "transactionIndex" | "v" | "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" | "accessList")[] = []>({ exclude, format: formatOverride, }: {
28
28
  exclude?: TExclude | undefined;
29
29
  format?: TFormat | undefined;
30
30
  }) => (data: Partial<RpcTransaction> & {
package/dist/chains.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  formatTransaction,
4
4
  formatTransactionReceipt,
5
5
  formatTransactionRequest
6
- } from "./chunk-TKAGJYBH.js";
7
- import "./chunk-3N57H2YM.js";
6
+ } from "./chunk-26WUARDL.js";
7
+ import "./chunk-7H5SPKXN.js";
8
8
 
9
9
  // src/chains.ts
10
10
  import {
@@ -4,12 +4,16 @@ import {
4
4
  AbiDecodingDataSizeInvalidError,
5
5
  AbiEncodingArrayLengthMismatchError,
6
6
  AbiEncodingLengthMismatchError,
7
+ AbiErrorInputsNotFoundError,
8
+ AbiErrorNotFoundError,
7
9
  AbiErrorSignatureNotFoundError,
10
+ AbiEventNotFoundError,
8
11
  AbiFunctionNotFoundError,
9
12
  AbiFunctionOutputsNotFoundError,
10
13
  AbiFunctionSignatureNotFoundError,
11
14
  DataLengthTooLongError,
12
15
  DataLengthTooShortError,
16
+ FilterTypeNotSupportedError,
13
17
  InvalidAbiDecodingTypeError,
14
18
  InvalidAbiEncodingTypeError,
15
19
  InvalidAddressError,
@@ -20,7 +24,7 @@ import {
20
24
  InvalidHexValueError,
21
25
  OffsetOutOfBoundsError,
22
26
  SizeExceedsPaddingSizeError
23
- } from "./chunk-3N57H2YM.js";
27
+ } from "./chunk-7H5SPKXN.js";
24
28
 
25
29
  // src/utils/data/concat.ts
26
30
  function concat(values) {
@@ -556,7 +560,7 @@ function encodeAbi({
556
560
  const preparedParams = prepareParams({ params, values });
557
561
  const data = encodeParams(preparedParams);
558
562
  if (data.length === 0)
559
- return void 0;
563
+ return "0x";
560
564
  return data;
561
565
  }
562
566
  function prepareParams({
@@ -599,7 +603,9 @@ function prepareParam({
599
603
  if (param.type === "string") {
600
604
  return encodeString(value);
601
605
  }
602
- throw new InvalidAbiEncodingTypeError(param.type);
606
+ throw new InvalidAbiEncodingTypeError(param.type, {
607
+ docsPath: "/docs/contract/encodeAbi"
608
+ });
603
609
  }
604
610
  function encodeParams(preparedParams) {
605
611
  let staticSize = 0;
@@ -729,10 +735,13 @@ function decodeAbi({
729
735
  }) {
730
736
  if (size(data) % 32 !== 0)
731
737
  throw new AbiDecodingDataSizeInvalidError(size(data));
732
- return decodeParams({
738
+ const values = decodeParams({
733
739
  data,
734
740
  params
735
741
  });
742
+ if (values.length === 0)
743
+ return void 0;
744
+ return values;
736
745
  }
737
746
  function decodeParams({
738
747
  data,
@@ -781,7 +790,9 @@ function decodeParam({
781
790
  if (param.type === "bool") {
782
791
  return decodeBool(value);
783
792
  }
784
- throw new InvalidAbiDecodingTypeError(param.type);
793
+ throw new InvalidAbiDecodingTypeError(param.type, {
794
+ docsPath: "/docs/contract/decodeAbi"
795
+ });
785
796
  }
786
797
  function decodeAddress(value) {
787
798
  return { consumed: 32, value: checksumAddress(trim(value)) };
@@ -916,7 +927,9 @@ function hasDynamicChild(param) {
916
927
  // src/utils/abi/getDefinition.ts
917
928
  function getDefinition(description) {
918
929
  if (description.type !== "function" && description.type !== "event" && description.type !== "error")
919
- throw new InvalidDefinitionTypeError(description.type);
930
+ throw new InvalidDefinitionTypeError(description.type, {
931
+ docsPath: "/docs/contract/getDefinition"
932
+ });
920
933
  return `${description.name}(${getParams(description.inputs)})`;
921
934
  }
922
935
  function getParams(params) {
@@ -940,7 +953,9 @@ function decodeErrorResult({ abi, data }) {
940
953
  (x) => signature === getFunctionSignature(getDefinition(x))
941
954
  );
942
955
  if (!description)
943
- throw new AbiErrorSignatureNotFoundError(signature);
956
+ throw new AbiErrorSignatureNotFoundError(signature, {
957
+ docsPath: "/docs/contract/decodeErrorResult"
958
+ });
944
959
  return {
945
960
  errorName: description.name,
946
961
  args: "inputs" in description && description.inputs && description.inputs.length > 0 ? decodeAbi({ data: slice(data, 4), params: description.inputs }) : void 0
@@ -954,7 +969,9 @@ function decodeFunctionData({ abi, data }) {
954
969
  (x) => signature === getFunctionSignature(getDefinition(x))
955
970
  );
956
971
  if (!description)
957
- throw new AbiFunctionSignatureNotFoundError(signature);
972
+ throw new AbiFunctionSignatureNotFoundError(signature, {
973
+ docsPath: "/docs/contract/decodeFunctionData"
974
+ });
958
975
  return {
959
976
  functionName: description.name,
960
977
  args: "inputs" in description && description.inputs && description.inputs.length > 0 ? decodeAbi({ data: slice(data, 4), params: description.inputs }) : void 0
@@ -962,6 +979,7 @@ function decodeFunctionData({ abi, data }) {
962
979
  }
963
980
 
964
981
  // src/utils/abi/decodeFunctionResult.ts
982
+ var docsPath = "/docs/contract/decodeFunctionResult";
965
983
  function decodeFunctionResult({
966
984
  abi,
967
985
  functionName,
@@ -969,14 +987,19 @@ function decodeFunctionResult({
969
987
  }) {
970
988
  const description = abi.find((x) => "name" in x && x.name === functionName);
971
989
  if (!description)
972
- throw new AbiFunctionNotFoundError(functionName);
990
+ throw new AbiFunctionNotFoundError(functionName, { docsPath });
973
991
  if (!("outputs" in description))
974
- throw new AbiFunctionOutputsNotFoundError(functionName);
992
+ throw new AbiFunctionOutputsNotFoundError(functionName, { docsPath });
975
993
  const values = decodeAbi({ data, params: description.outputs });
976
- return values.length > 1 ? values : values.length === 1 ? values[0] : void 0;
994
+ if (values && values.length > 1)
995
+ return values;
996
+ if (values && values.length === 1)
997
+ return values[0];
998
+ return void 0;
977
999
  }
978
1000
 
979
1001
  // src/utils/abi/encodeDeployData.ts
1002
+ var docsPath2 = "/docs/contract/encodeDeployData";
980
1003
  function encodeDeployData({
981
1004
  abi,
982
1005
  args,
@@ -986,11 +1009,11 @@ function encodeDeployData({
986
1009
  return bytecode;
987
1010
  const description = abi.find((x) => "type" in x && x.type === "constructor");
988
1011
  if (!description)
989
- throw new AbiConstructorNotFoundError();
1012
+ throw new AbiConstructorNotFoundError({ docsPath: docsPath2 });
990
1013
  if (!("inputs" in description))
991
- throw new AbiConstructorParamsNotFoundError();
1014
+ throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath2 });
992
1015
  if (!description.inputs || description.inputs.length === 0)
993
- throw new AbiConstructorParamsNotFoundError();
1016
+ throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath2 });
994
1017
  const data = encodeAbi({
995
1018
  params: description.inputs,
996
1019
  values: args
@@ -998,6 +1021,62 @@ function encodeDeployData({
998
1021
  return concatHex([bytecode, data]);
999
1022
  }
1000
1023
 
1024
+ // src/utils/abi/encodeErrorResult.ts
1025
+ var docsPath3 = "/docs/contract/encodeErrorResult";
1026
+ function encodeErrorResult({
1027
+ abi,
1028
+ errorName,
1029
+ args
1030
+ }) {
1031
+ const description = abi.find((x) => "name" in x && x.name === errorName);
1032
+ if (!description)
1033
+ throw new AbiErrorNotFoundError(errorName, { docsPath: docsPath3 });
1034
+ const definition = getDefinition(description);
1035
+ const signature = getFunctionSignature(definition);
1036
+ let data = "0x";
1037
+ if (args && args.length > 0) {
1038
+ if (!("inputs" in description && description.inputs))
1039
+ throw new AbiErrorInputsNotFoundError(errorName, { docsPath: docsPath3 });
1040
+ data = encodeAbi({ params: description.inputs, values: args });
1041
+ }
1042
+ return concatHex([signature, data]);
1043
+ }
1044
+
1045
+ // src/utils/abi/encodeEventTopics.ts
1046
+ function encodeEventTopics({
1047
+ abi,
1048
+ eventName,
1049
+ args
1050
+ }) {
1051
+ const description = abi.find((x) => "name" in x && x.name === eventName);
1052
+ if (!description)
1053
+ throw new AbiEventNotFoundError(eventName, {
1054
+ docsPath: "/docs/contract/encodeEventTopics"
1055
+ });
1056
+ const definition = getDefinition(description);
1057
+ const signature = getEventSignature(definition);
1058
+ let topics = [];
1059
+ if (args && "inputs" in description) {
1060
+ const args_ = Array.isArray(args) ? args : description.inputs?.map((x) => args[x.name]) ?? [];
1061
+ topics = description.inputs?.filter((param) => "indexed" in param && param.indexed).map(
1062
+ (param, i) => Array.isArray(args_[i]) ? args_[i].map(
1063
+ (_, j) => encodeArg({ param, value: args_[i][j] })
1064
+ ) : args_[i] ? encodeArg({ param, value: args_[i] }) : null
1065
+ ) ?? [];
1066
+ }
1067
+ return [signature, ...topics];
1068
+ }
1069
+ function encodeArg({
1070
+ param,
1071
+ value
1072
+ }) {
1073
+ if (param.type === "string" || param.type === "bytes")
1074
+ return keccak256(encodeBytes(value));
1075
+ if (param.type === "tuple" || param.type.match(/^(.*)\[(\d+)?\]$/))
1076
+ throw new FilterTypeNotSupportedError(param.type);
1077
+ return encodeAbi({ params: [param], values: [value] });
1078
+ }
1079
+
1001
1080
  // src/utils/abi/encodeFunctionData.ts
1002
1081
  function encodeFunctionData({
1003
1082
  abi,
@@ -1006,7 +1085,9 @@ function encodeFunctionData({
1006
1085
  }) {
1007
1086
  const description = abi.find((x) => "name" in x && x.name === functionName);
1008
1087
  if (!description)
1009
- throw new AbiFunctionNotFoundError(functionName);
1088
+ throw new AbiFunctionNotFoundError(functionName, {
1089
+ docsPath: "/docs/contract/encodeFunctionData"
1090
+ });
1010
1091
  const definition = getDefinition(description);
1011
1092
  const signature = getFunctionSignature(definition);
1012
1093
  const data = "inputs" in description && description.inputs ? encodeAbi({
@@ -1017,6 +1098,7 @@ function encodeFunctionData({
1017
1098
  }
1018
1099
 
1019
1100
  // src/utils/abi/encodeFunctionResult.ts
1101
+ var docsPath4 = "/docs/contract/encodeFunctionResult";
1020
1102
  function encodeFunctionResult({
1021
1103
  abi,
1022
1104
  functionName,
@@ -1024,16 +1106,13 @@ function encodeFunctionResult({
1024
1106
  }) {
1025
1107
  const description = abi.find((x) => "name" in x && x.name === functionName);
1026
1108
  if (!description)
1027
- throw new AbiFunctionNotFoundError(functionName);
1109
+ throw new AbiFunctionNotFoundError(functionName, { docsPath: docsPath4 });
1028
1110
  if (!("outputs" in description))
1029
- throw new AbiFunctionOutputsNotFoundError(functionName);
1111
+ throw new AbiFunctionOutputsNotFoundError(functionName, { docsPath: docsPath4 });
1030
1112
  let values = Array.isArray(result) ? result : [result];
1031
1113
  if (description.outputs.length === 0 && !values[0])
1032
1114
  values = [];
1033
- const data = encodeAbi({ params: description.outputs, values });
1034
- if (!data)
1035
- return "0x";
1036
- return data;
1115
+ return encodeAbi({ params: description.outputs, values });
1037
1116
  }
1038
1117
 
1039
1118
  // src/constants.ts
@@ -1271,6 +1350,8 @@ export {
1271
1350
  decodeFunctionData,
1272
1351
  decodeFunctionResult,
1273
1352
  encodeDeployData,
1353
+ encodeErrorResult,
1354
+ encodeEventTopics,
1274
1355
  encodeFunctionData,
1275
1356
  encodeFunctionResult,
1276
1357
  etherUnits,
@@ -3,7 +3,7 @@ import {
3
3
  buildRequest,
4
4
  getSocket,
5
5
  rpc
6
- } from "./chunk-3N57H2YM.js";
6
+ } from "./chunk-7H5SPKXN.js";
7
7
 
8
8
  // src/clients/transports/createTransport.ts
9
9
  function createTransport(config, value) {
@@ -11,7 +11,7 @@ import {
11
11
  getAddress,
12
12
  hexToNumber,
13
13
  numberToHex
14
- } from "./chunk-TKAGJYBH.js";
14
+ } from "./chunk-26WUARDL.js";
15
15
  import {
16
16
  BaseError,
17
17
  BlockNotFoundError,
@@ -22,7 +22,7 @@ import {
22
22
  getCache,
23
23
  wait,
24
24
  withCache
25
- } from "./chunk-3N57H2YM.js";
25
+ } from "./chunk-7H5SPKXN.js";
26
26
 
27
27
  // src/actions/public/call.ts
28
28
  async function call(client, {
@@ -302,7 +302,7 @@ async function getTransactionCount(client, { address, blockTag = "latest", block
302
302
  method: "eth_getTransactionCount",
303
303
  params: [address, blockNumber ? numberToHex(blockNumber) : blockTag]
304
304
  });
305
- return hexToNumber(count ?? "0x0");
305
+ return hexToNumber(count);
306
306
  }
307
307
 
308
308
  // src/actions/public/getTransactionReceipt.ts
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
9
9
  var package_default = {
10
10
  name: "viem",
11
11
  description: "TypeScript (& JavaScript) Interface for Ethereum",
12
- version: "0.0.1-alpha.7",
12
+ version: "0.0.1-alpha.9",
13
13
  scripts: {
14
14
  anvil: "source .env && anvil --fork-url $ANVIL_FORK_URL --fork-block-number $VITE_ANVIL_BLOCK_NUMBER --block-time $VITE_ANVIL_BLOCK_TIME",
15
15
  bench: "vitest bench --no-threads",
@@ -158,28 +158,28 @@ var BaseError = class extends Error {
158
158
 
159
159
  // src/errors/abi.ts
160
160
  var AbiConstructorNotFoundError = class extends BaseError {
161
- constructor() {
161
+ constructor({ docsPath }) {
162
162
  super(
163
163
  [
164
- "Constructor arguments were provided (`args`), but a constructor was not found on the ABI.",
164
+ "A constructor was not found on the ABI.",
165
165
  "Make sure you are using the correct ABI and that the constructor exists on it."
166
166
  ].join("\n"),
167
167
  {
168
- docsPath: "/docs/contract/encodeDeployData"
168
+ docsPath
169
169
  }
170
170
  );
171
171
  __publicField(this, "name", "AbiConstructorNotFoundError");
172
172
  }
173
173
  };
174
174
  var AbiConstructorParamsNotFoundError = class extends BaseError {
175
- constructor() {
175
+ constructor({ docsPath }) {
176
176
  super(
177
177
  [
178
178
  "Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.",
179
179
  "Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."
180
180
  ].join("\n"),
181
181
  {
182
- docsPath: "/docs/contract/encodeDeployData"
182
+ docsPath
183
183
  }
184
184
  );
185
185
  __publicField(this, "name", "AbiConstructorParamsNotFoundError");
@@ -227,8 +227,37 @@ var AbiEncodingLengthMismatchError = class extends BaseError {
227
227
  __publicField(this, "name", "AbiEncodingLengthMismatchError");
228
228
  }
229
229
  };
230
+ var AbiErrorInputsNotFoundError = class extends BaseError {
231
+ constructor(errorName, { docsPath }) {
232
+ super(
233
+ [
234
+ `Arguments (\`args\`) were provided to "${errorName}", but "${errorName}" on the ABI does not contain any parameters (\`inputs\`).`,
235
+ "Cannot encode error result without knowing what the parameter types are.",
236
+ "Make sure you are using the correct ABI and that the inputs exist on it."
237
+ ].join("\n"),
238
+ {
239
+ docsPath
240
+ }
241
+ );
242
+ __publicField(this, "name", "AbiErrorInputsNotFoundError");
243
+ }
244
+ };
245
+ var AbiErrorNotFoundError = class extends BaseError {
246
+ constructor(errorName, { docsPath }) {
247
+ super(
248
+ [
249
+ `Error "${errorName}" not found on ABI.`,
250
+ "Make sure you are using the correct ABI and that the error exists on it."
251
+ ].join("\n"),
252
+ {
253
+ docsPath
254
+ }
255
+ );
256
+ __publicField(this, "name", "AbiErrorNotFoundError");
257
+ }
258
+ };
230
259
  var AbiErrorSignatureNotFoundError = class extends BaseError {
231
- constructor(signature) {
260
+ constructor(signature, { docsPath }) {
232
261
  super(
233
262
  [
234
263
  `Encoded error signature "${signature}" not found on ABI.`,
@@ -236,28 +265,42 @@ var AbiErrorSignatureNotFoundError = class extends BaseError {
236
265
  `You can look up the signature "${signature}" here: https://sig.eth.samczsun.com/.`
237
266
  ].join("\n"),
238
267
  {
239
- docsPath: "/docs/contract/decodeErrorResult"
268
+ docsPath
240
269
  }
241
270
  );
242
271
  __publicField(this, "name", "AbiErrorSignatureNotFoundError");
243
272
  }
244
273
  };
274
+ var AbiEventNotFoundError = class extends BaseError {
275
+ constructor(eventName, { docsPath }) {
276
+ super(
277
+ [
278
+ `Event "${eventName}" not found on ABI.`,
279
+ "Make sure you are using the correct ABI and that the event exists on it."
280
+ ].join("\n"),
281
+ {
282
+ docsPath
283
+ }
284
+ );
285
+ __publicField(this, "name", "AbiEventNotFoundError");
286
+ }
287
+ };
245
288
  var AbiFunctionNotFoundError = class extends BaseError {
246
- constructor(functionName) {
289
+ constructor(functionName, { docsPath }) {
247
290
  super(
248
291
  [
249
292
  `Function "${functionName}" not found on ABI.`,
250
293
  "Make sure you are using the correct ABI and that the function exists on it."
251
294
  ].join("\n"),
252
295
  {
253
- docsPath: "/docs/contract/encodeFunctionData"
296
+ docsPath
254
297
  }
255
298
  );
256
299
  __publicField(this, "name", "AbiFunctionNotFoundError");
257
300
  }
258
301
  };
259
302
  var AbiFunctionOutputsNotFoundError = class extends BaseError {
260
- constructor(functionName) {
303
+ constructor(functionName, { docsPath }) {
261
304
  super(
262
305
  [
263
306
  `Function "${functionName}" does not contain any \`outputs\` on ABI.`,
@@ -265,14 +308,14 @@ var AbiFunctionOutputsNotFoundError = class extends BaseError {
265
308
  "Make sure you are using the correct ABI and that the function exists on it."
266
309
  ].join("\n"),
267
310
  {
268
- docsPath: "/docs/contract/decodeFunctionResult"
311
+ docsPath
269
312
  }
270
313
  );
271
314
  __publicField(this, "name", "AbiFunctionOutputsNotFoundError");
272
315
  }
273
316
  };
274
317
  var AbiFunctionSignatureNotFoundError = class extends BaseError {
275
- constructor(signature) {
318
+ constructor(signature, { docsPath }) {
276
319
  super(
277
320
  [
278
321
  `Encoded function signature "${signature}" not found on ABI.`,
@@ -280,32 +323,32 @@ var AbiFunctionSignatureNotFoundError = class extends BaseError {
280
323
  `You can look up the signature "${signature}" here: https://sig.eth.samczsun.com/.`
281
324
  ].join("\n"),
282
325
  {
283
- docsPath: "/docs/contract/decodeFunctionData"
326
+ docsPath
284
327
  }
285
328
  );
286
329
  __publicField(this, "name", "AbiFunctionSignatureNotFoundError");
287
330
  }
288
331
  };
289
332
  var InvalidAbiEncodingTypeError = class extends BaseError {
290
- constructor(type) {
333
+ constructor(type, { docsPath }) {
291
334
  super(
292
335
  [
293
336
  `Type "${type}" is not a valid encoding type.`,
294
337
  "Please provide a valid ABI type."
295
338
  ].join("\n"),
296
- { docsPath: "/docs/contract/encodeAbi#params" }
339
+ { docsPath }
297
340
  );
298
341
  __publicField(this, "name", "InvalidAbiEncodingType");
299
342
  }
300
343
  };
301
344
  var InvalidAbiDecodingTypeError = class extends BaseError {
302
- constructor(type) {
345
+ constructor(type, { docsPath }) {
303
346
  super(
304
347
  [
305
348
  `Type "${type}" is not a valid decoding type.`,
306
349
  "Please provide a valid ABI type."
307
350
  ].join("\n"),
308
- { docsPath: "/docs/contract/decodeAbi#params" }
351
+ { docsPath }
309
352
  );
310
353
  __publicField(this, "name", "InvalidAbiDecodingType");
311
354
  }
@@ -317,14 +360,14 @@ var InvalidArrayError = class extends BaseError {
317
360
  }
318
361
  };
319
362
  var InvalidDefinitionTypeError = class extends BaseError {
320
- constructor(type) {
363
+ constructor(type, { docsPath }) {
321
364
  super(
322
365
  [
323
366
  `"${type}" is not a valid definition type.`,
324
367
  'Valid types: "function", "event", "error"'
325
368
  ].join("\n"),
326
369
  {
327
- docsPath: "/docs/contract/getDefinition"
370
+ docsPath
328
371
  }
329
372
  );
330
373
  __publicField(this, "name", "InvalidDefinitionTypeError");
@@ -419,6 +462,14 @@ var OffsetOutOfBoundsError = class extends BaseError {
419
462
  }
420
463
  };
421
464
 
465
+ // src/errors/log.ts
466
+ var FilterTypeNotSupportedError = class extends BaseError {
467
+ constructor(type) {
468
+ super(`Filter type "${type}" is not supported.`);
469
+ __publicField(this, "name", "FilterTypeNotSupportedError");
470
+ }
471
+ };
472
+
422
473
  // src/errors/request.ts
423
474
  var RequestError = class extends BaseError {
424
475
  constructor(err, { docsPath, humanMessage }) {
@@ -1008,7 +1059,10 @@ export {
1008
1059
  AbiDecodingDataSizeInvalidError,
1009
1060
  AbiEncodingArrayLengthMismatchError,
1010
1061
  AbiEncodingLengthMismatchError,
1062
+ AbiErrorInputsNotFoundError,
1063
+ AbiErrorNotFoundError,
1011
1064
  AbiErrorSignatureNotFoundError,
1065
+ AbiEventNotFoundError,
1012
1066
  AbiFunctionNotFoundError,
1013
1067
  AbiFunctionOutputsNotFoundError,
1014
1068
  AbiFunctionSignatureNotFoundError,
@@ -1025,6 +1079,7 @@ export {
1025
1079
  InvalidHexBooleanError,
1026
1080
  InvalidHexValueError,
1027
1081
  OffsetOutOfBoundsError,
1082
+ FilterTypeNotSupportedError,
1028
1083
  RequestError,
1029
1084
  RpcRequestError,
1030
1085
  ParseRpcError,
@@ -1,7 +1,7 @@
1
- export { C as Client, a as ClientConfig, P as PublicClient, b as PublicClientConfig, T as TestClient, c as TestClientConfig, d as Transport, e as TransportConfig, W as WalletClient, f as WalletClientConfig, g as createClient, h as createPublicClient, i as createTestClient, j as createTransport, k as createWalletClient } from '../createWalletClient-b5c3c89e.js';
2
- export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from '../webSocket-f4abf66c.js';
1
+ export { C as Client, a as ClientConfig, P as PublicClient, b as PublicClientConfig, T as TestClient, c as TestClientConfig, d as Transport, e as TransportConfig, W as WalletClient, f as WalletClientConfig, g as createClient, h as createPublicClient, i as createTestClient, j as createTransport, k as createWalletClient } from '../createWalletClient-d612fe08.js';
2
+ export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from '../webSocket-7f88e9e0.js';
3
3
  import '../chains.js';
4
4
  import '../rpc-b77c5aee.js';
5
5
  import '@wagmi/chains';
6
- import '../eip1193-100454ab.js';
6
+ import '../eip1193-020a6f13.js';
7
7
  import '../rpc-26932bae.js';
@@ -8,8 +8,8 @@ import {
8
8
  fallback,
9
9
  http,
10
10
  webSocket
11
- } from "../chunk-26LBGCAV.js";
12
- import "../chunk-3N57H2YM.js";
11
+ } from "../chunk-375SRM5R.js";
12
+ import "../chunk-7H5SPKXN.js";
13
13
  export {
14
14
  createClient,
15
15
  createPublicClient,
@@ -1,5 +1,5 @@
1
1
  import { Chain } from './chains.js';
2
- import { R as Requests, P as PublicRequests, T as TestRequests, S as SignableRequests, b as WalletRequests } from './eip1193-100454ab.js';
2
+ import { R as Requests, P as PublicRequests, T as TestRequests, S as SignableRequests, b as WalletRequests } from './eip1193-020a6f13.js';
3
3
 
4
4
  type BaseRpcRequests = {
5
5
  request(...args: any): Promise<any>;
@@ -405,7 +405,7 @@ type PublicRequests = {
405
405
  * */
406
406
  method: 'eth_getTransactionCount';
407
407
  params: [address: Address, block: RpcBlockNumber | BlockTag | RpcBlockIdentifier];
408
- }): Promise<Quantity | null>;
408
+ }): Promise<Quantity>;
409
409
  request(args: {
410
410
  /**
411
411
  * @description Returns the receipt of a transaction specified by hash
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DropTransactionArgs, E as EstimateGasArgs, d as EstimateGasResponse, G as GetBalanceArgs, e as GetBalanceResponse, f as GetBlockArgs, g as GetBlockNumberArgs, h as GetBlockNumberResponse, i as GetBlockResponse, j as GetBlockTransactionCountArgs, k as GetBlockTransactionCountResponse, l as GetFeeHistoryArgs, m as GetFeeHistoryResponse, n as GetFilterChangesArgs, o as GetFilterChangesResponse, p as GetFilterLogsArgs, q as GetFilterLogsResponse, r as GetGasPriceResponse, s as GetPermissionsResponse, t as GetTransactionArgs, u as GetTransactionConfirmationsArgs, v as GetTransactionConfirmationsResponse, w as GetTransactionCountArgs, x as GetTransactionCountResponse, z as GetTransactionReceiptArgs, A as GetTransactionReceiptResponse, y as GetTransactionResponse, I as ImpersonateAccountArgs, B as IncreaseTimeArgs, M as MineArgs, O as OnBlock, F as OnBlockNumber, H as OnBlockNumberResponse, J as OnBlockResponse, K as OnTransactions, L as OnTransactionsResponse, N as RequestPermissionsResponse, R as ResetArgs, P as RevertArgs, S as SendTransactionArgs, Q as SendTransactionResponse, T as SendUnsignedTransactionArgs, U as SendUnsignedTransactionResponse, V as SetBalanceArgs, W as SetBlockGasLimitArgs, $ as SetBlockTimestampIntervalArgs, X as SetCodeArgs, Y as SetCoinbaseArgs, Z as SetIntervalMiningArgs, _ as SetMinGasPriceArgs, a1 as SetNextBlockBaseFeePerGasArgs, a0 as SetNextBlockTimestampArgs, a2 as SetNonceArgs, a3 as SetStorageAtArgs, a4 as SignMessageArgs, a5 as SignMessageResponse, a6 as StopImpersonatingAccountArgs, a7 as SwitchChainArgs, a8 as UninstallFilterArgs, a9 as UninstallFilterResponse, aa as WaitForTransactionReceiptArgs, ab as WaitForTransactionReceiptResponse, ac as WatchAssetArgs, ad as WatchAssetResponse, ae as WatchBlockNumberArgs, af as WatchBlocksArgs, ag as WatchPendingTransactionsArgs, ah as addChain, ai as call, aj as createBlockFilter, ak as createPendingTransactionFilter, am as dropTransaction, al as estimateGas, an as getAccounts, ao as getAutomine, ap as getBalance, aq as getBlock, ar as getBlockNumber, as as getBlockTransactionCount, at as getChainId, au as getFeeHistory, av as getFilterChanges, aw as getFilterLogs, ax as getGasPrice, ay as getPermissions, az as getTransaction, aA as getTransactionConfirmations, aB as getTransactionCount, aC as getTransactionReceipt, aD as getTxpoolContent, aE as getTxpoolStatus, aF as impersonateAccount, aG as increaseTime, aH as inspectTxpool, aI as mine, aJ as removeBlockTimestampInterval, aL as requestAccounts, aM as requestPermissions, aK as reset, aN as revert, aO as sendTransaction, aP as sendUnsignedTransaction, aQ as setAutomine, aR as setBalance, aS as setBlockGasLimit, aT as setBlockTimestampInterval, aU as setCode, aV as setCoinbase, aW as setIntervalMining, aX as setLoggingEnabled, aY as setMinGasPrice, aZ as setNextBlockBaseFeePerGas, a_ as setNextBlockTimestamp, a$ as setNonce, b0 as setStorageAt, b1 as signMessage, b2 as snapshot, b3 as stopImpersonatingAccount, b4 as switchChain, b5 as uninstallFilter, b6 as waitForTransactionReceipt, b7 as watchAsset, b8 as watchBlockNumber, b9 as watchBlocks, ba as watchPendingTransactions } from './watchAsset-e99e744d.js';
2
- export { C as Client, a as ClientConfig, P as PublicClient, b as PublicClientConfig, T as TestClient, c as TestClientConfig, d as Transport, e as TransportConfig, W as WalletClient, f as WalletClientConfig, g as createClient, h as createPublicClient, i as createTestClient, j as createTransport, k as createWalletClient } from './createWalletClient-b5c3c89e.js';
3
- export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from './webSocket-f4abf66c.js';
1
+ export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DropTransactionArgs, E as EstimateGasArgs, d as EstimateGasResponse, G as GetBalanceArgs, e as GetBalanceResponse, f as GetBlockArgs, g as GetBlockNumberArgs, h as GetBlockNumberResponse, i as GetBlockResponse, j as GetBlockTransactionCountArgs, k as GetBlockTransactionCountResponse, l as GetFeeHistoryArgs, m as GetFeeHistoryResponse, n as GetFilterChangesArgs, o as GetFilterChangesResponse, p as GetFilterLogsArgs, q as GetFilterLogsResponse, r as GetGasPriceResponse, s as GetPermissionsResponse, t as GetTransactionArgs, u as GetTransactionConfirmationsArgs, v as GetTransactionConfirmationsResponse, w as GetTransactionCountArgs, x as GetTransactionCountResponse, z as GetTransactionReceiptArgs, A as GetTransactionReceiptResponse, y as GetTransactionResponse, I as ImpersonateAccountArgs, B as IncreaseTimeArgs, M as MineArgs, O as OnBlock, F as OnBlockNumber, H as OnBlockNumberResponse, J as OnBlockResponse, K as OnTransactions, L as OnTransactionsResponse, N as RequestPermissionsResponse, R as ResetArgs, P as RevertArgs, S as SendTransactionArgs, Q as SendTransactionResponse, T as SendUnsignedTransactionArgs, U as SendUnsignedTransactionResponse, V as SetBalanceArgs, W as SetBlockGasLimitArgs, $ as SetBlockTimestampIntervalArgs, X as SetCodeArgs, Y as SetCoinbaseArgs, Z as SetIntervalMiningArgs, _ as SetMinGasPriceArgs, a1 as SetNextBlockBaseFeePerGasArgs, a0 as SetNextBlockTimestampArgs, a2 as SetNonceArgs, a3 as SetStorageAtArgs, a4 as SignMessageArgs, a5 as SignMessageResponse, a6 as StopImpersonatingAccountArgs, a7 as SwitchChainArgs, a8 as UninstallFilterArgs, a9 as UninstallFilterResponse, aa as WaitForTransactionReceiptArgs, ab as WaitForTransactionReceiptResponse, ac as WatchAssetArgs, ad as WatchAssetResponse, ae as WatchBlockNumberArgs, af as WatchBlocksArgs, ag as WatchPendingTransactionsArgs, ah as addChain, ai as call, aj as createBlockFilter, ak as createPendingTransactionFilter, am as dropTransaction, al as estimateGas, an as getAccounts, ao as getAutomine, ap as getBalance, aq as getBlock, ar as getBlockNumber, as as getBlockTransactionCount, at as getChainId, au as getFeeHistory, av as getFilterChanges, aw as getFilterLogs, ax as getGasPrice, ay as getPermissions, az as getTransaction, aA as getTransactionConfirmations, aB as getTransactionCount, aC as getTransactionReceipt, aD as getTxpoolContent, aE as getTxpoolStatus, aF as impersonateAccount, aG as increaseTime, aH as inspectTxpool, aI as mine, aJ as removeBlockTimestampInterval, aL as requestAccounts, aM as requestPermissions, aK as reset, aN as revert, aO as sendTransaction, aP as sendUnsignedTransaction, aQ as setAutomine, aR as setBalance, aS as setBlockGasLimit, aT as setBlockTimestampInterval, aU as setCode, aV as setCoinbase, aW as setIntervalMining, aX as setLoggingEnabled, aY as setMinGasPrice, aZ as setNextBlockBaseFeePerGas, a_ as setNextBlockTimestamp, a$ as setNonce, b0 as setStorageAt, b1 as signMessage, b2 as snapshot, b3 as stopImpersonatingAccount, b4 as switchChain, b5 as uninstallFilter, b6 as waitForTransactionReceipt, b7 as watchAsset, b8 as watchBlockNumber, b9 as watchBlocks, ba as watchPendingTransactions } from './watchAsset-dc7dcdd9.js';
2
+ export { C as Client, a as ClientConfig, P as PublicClient, b as PublicClientConfig, T as TestClient, c as TestClientConfig, d as Transport, e as TransportConfig, W as WalletClient, f as WalletClientConfig, g as createClient, h as createPublicClient, i as createTestClient, j as createTransport, k as createWalletClient } from './createWalletClient-d612fe08.js';
3
+ export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from './webSocket-7f88e9e0.js';
4
4
  import { H as Hex, A as Address, a as Hash, B as ByteArray, b as BlockTag } from './rpc-b77c5aee.js';
5
5
  export { c as AccessList, A as Address, d as Block, f as BlockIdentifier, h as BlockNumber, b as BlockTag, B as ByteArray, F as FeeHistory, i as FeeValues, j as FeeValuesEIP1559, k as FeeValuesLegacy, a as Hash, H as Hex, L as Log, R as RpcBlock, l as RpcBlockIdentifier, m as RpcBlockNumber, n as RpcFeeHistory, o as RpcFeeValues, p as RpcLog, q as RpcTransaction, r as RpcTransactionReceipt, s as RpcTransactionRequest, u as RpcUncle, D as Transaction, E as TransactionBase, G as TransactionEIP1559, I as TransactionEIP2930, J as TransactionLegacy, T as TransactionReceipt, v as TransactionRequest, x as TransactionRequestBase, y as TransactionRequestEIP1559, z as TransactionRequestEIP2930, C as TransactionRequestLegacy, U as Uncle, e as etherUnits, g as gweiUnits, t as transactionType, w as weiUnits } from './rpc-b77c5aee.js';
6
- export { E as EncodeRlpResponse, G as GetContractAddressOptions, b as GetCreate2AddressOptions, a as GetCreateAddressOptions, e as boolToBytes, f as boolToHex, g as bytesToBigint, h as bytesToBool, c as bytesToHex, i as bytesToNumber, d as bytesToString, j as decodeAbi, k as decodeBytes, l as decodeErrorResult, m as decodeFunctionData, n as decodeFunctionResult, o as decodeHex, p as decodeRlp, q as encodeAbi, r as encodeBytes, s as encodeDeployData, t as encodeFunctionData, u as encodeFunctionResult, v as encodeHex, w as encodeRlp, D as formatEther, W as formatGwei, X as formatUnit, x as getAddress, y as getContractAddress, A as getCreate2Address, z as getCreateAddress, B as getEventSignature, C as getFunctionSignature, K as hexToBigInt, L as hexToBool, M as hexToBytes, Y as hexToNumber, N as hexToString, F as isAddress, H as isAddressEqual, I as isBytes, J as isHex, O as keccak256, P as numberToBytes, Z as numberToHex, Q as pad, R as padBytes, S as padHex, T as parseEther, U as parseGwei, V as parseUnit, _ as size, $ as slice, a0 as sliceBytes, a1 as sliceHex, a2 as stringToBytes, a3 as stringToHex, a4 as trim } from './parseGwei-9cc6638c.js';
6
+ export { E as EncodeRlpResponse, G as GetContractAddressOptions, b as GetCreate2AddressOptions, a as GetCreateAddressOptions, e as boolToBytes, f as boolToHex, g as bytesToBigint, h as bytesToBool, c as bytesToHex, i as bytesToNumber, d as bytesToString, j as decodeAbi, k as decodeBytes, l as decodeErrorResult, m as decodeFunctionData, n as decodeFunctionResult, o as decodeHex, p as decodeRlp, q as encodeAbi, r as encodeBytes, s as encodeDeployData, t as encodeErrorResult, u as encodeEventTopics, v as encodeFunctionData, w as encodeFunctionResult, x as encodeHex, y as encodeRlp, H as formatEther, Y as formatGwei, Z as formatUnit, z as getAddress, A as getContractAddress, C as getCreate2Address, B as getCreateAddress, D as getEventSignature, F as getFunctionSignature, M as hexToBigInt, N as hexToBool, O as hexToBytes, _ as hexToNumber, P as hexToString, I as isAddress, J as isAddressEqual, K as isBytes, L as isHex, Q as keccak256, R as numberToBytes, $ as numberToHex, S as pad, T as padBytes, U as padHex, V as parseEther, W as parseGwei, X as parseUnit, a0 as size, a1 as slice, a2 as sliceBytes, a3 as sliceHex, a4 as stringToBytes, a5 as stringToHex, a6 as trim } from './parseGwei-64031f5e.js';
7
7
  export { F as FormattedBlock, a as FormattedTransaction, b as FormattedTransactionRequest, f as formatBlock, c as formatTransaction, d as formatTransactionRequest } from './transactionRequest-3e463099.js';
8
8
  import './chains.js';
9
9
  import '@wagmi/chains';
10
- import './eip1193-100454ab.js';
10
+ import './eip1193-020a6f13.js';
11
11
  import './rpc-26932bae.js';
12
12
  import 'abitype';
13
13
 
@@ -30,11 +30,15 @@ declare class BaseError extends Error {
30
30
 
31
31
  declare class AbiConstructorNotFoundError extends BaseError {
32
32
  name: string;
33
- constructor();
33
+ constructor({ docsPath }: {
34
+ docsPath: string;
35
+ });
34
36
  }
35
37
  declare class AbiConstructorParamsNotFoundError extends BaseError {
36
38
  name: string;
37
- constructor();
39
+ constructor({ docsPath }: {
40
+ docsPath: string;
41
+ });
38
42
  }
39
43
  declare class AbiDecodingDataSizeInvalidError extends BaseError {
40
44
  name: string;
@@ -55,25 +59,59 @@ declare class AbiEncodingLengthMismatchError extends BaseError {
55
59
  givenLength: number;
56
60
  });
57
61
  }
62
+ declare class AbiErrorInputsNotFoundError extends BaseError {
63
+ name: string;
64
+ constructor(errorName: string, { docsPath }: {
65
+ docsPath: string;
66
+ });
67
+ }
68
+ declare class AbiErrorNotFoundError extends BaseError {
69
+ name: string;
70
+ constructor(errorName: string, { docsPath }: {
71
+ docsPath: string;
72
+ });
73
+ }
74
+ declare class AbiErrorSignatureNotFoundError extends BaseError {
75
+ name: string;
76
+ constructor(signature: Hex, { docsPath }: {
77
+ docsPath: string;
78
+ });
79
+ }
80
+ declare class AbiEventNotFoundError extends BaseError {
81
+ name: string;
82
+ constructor(eventName: string, { docsPath }: {
83
+ docsPath: string;
84
+ });
85
+ }
58
86
  declare class AbiFunctionNotFoundError extends BaseError {
59
87
  name: string;
60
- constructor(functionName: string);
88
+ constructor(functionName: string, { docsPath }: {
89
+ docsPath: string;
90
+ });
61
91
  }
62
92
  declare class AbiFunctionOutputsNotFoundError extends BaseError {
63
93
  name: string;
64
- constructor(functionName: string);
94
+ constructor(functionName: string, { docsPath }: {
95
+ docsPath: string;
96
+ });
65
97
  }
66
98
  declare class AbiFunctionSignatureNotFoundError extends BaseError {
67
99
  name: string;
68
- constructor(signature: Hex);
100
+ constructor(signature: Hex, { docsPath }: {
101
+ docsPath: string;
102
+ });
69
103
  }
70
104
  declare class InvalidAbiEncodingTypeError extends BaseError {
71
105
  name: string;
72
- constructor(type: string);
106
+ constructor(type: string, { docsPath }: {
107
+ docsPath: string;
108
+ });
73
109
  }
74
110
  declare class InvalidAbiDecodingTypeError extends BaseError {
75
111
  name: string;
76
- constructor(type: string);
112
+ constructor(type: string, { docsPath }: {
113
+ docsPath: string;
114
+ });
77
115
  }
78
116
  declare class InvalidArrayError extends BaseError {
79
117
  name: string;
@@ -81,7 +119,9 @@ declare class InvalidArrayError extends BaseError {
81
119
  }
82
120
  declare class InvalidDefinitionTypeError extends BaseError {
83
121
  name: string;
84
- constructor(type: string);
122
+ constructor(type: string, { docsPath }: {
123
+ docsPath: string;
124
+ });
85
125
  }
86
126
 
87
127
  declare class InvalidAddressError extends BaseError {
@@ -142,6 +182,11 @@ declare class OffsetOutOfBoundsError extends BaseError {
142
182
  });
143
183
  }
144
184
 
185
+ declare class FilterTypeNotSupportedError extends BaseError {
186
+ name: string;
187
+ constructor(type: string);
188
+ }
189
+
145
190
  declare class HttpRequestError extends BaseError {
146
191
  name: string;
147
192
  status: number;
@@ -297,4 +342,4 @@ declare class UrlRequiredError extends BaseError {
297
342
  constructor();
298
343
  }
299
344
 
300
- export { AbiConstructorNotFoundError, AbiConstructorParamsNotFoundError, AbiDecodingDataSizeInvalidError, AbiEncodingArrayLengthMismatchError, AbiEncodingLengthMismatchError, AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, AbiFunctionSignatureNotFoundError, BaseError, BlockNotFoundError, DataLengthTooLongError, DataLengthTooShortError, HttpRequestError, InternalRpcError, InvalidAbiDecodingTypeError, InvalidAbiEncodingTypeError, InvalidAddressError, InvalidArrayError, InvalidBytesBooleanError, InvalidDefinitionTypeError, InvalidGasArgumentsError, InvalidHexBooleanError, InvalidHexValueError, InvalidInputRpcError, InvalidParamsRpcError, InvalidRequestRpcError, JsonRpcVersionUnsupportedError, LimitExceededRpcError, MethodNotFoundRpcError, MethodNotSupportedRpcError, OffsetOutOfBoundsError, ParseRpcError, RequestError, ResourceNotFoundRpcError, ResourceUnavailableRpcError, RpcError, RpcRequestError, SizeExceedsPaddingSizeError, TimeoutError, TransactionNotFoundError, TransactionReceiptNotFoundError, TransactionRejectedRpcError, UnknownRpcError, UrlRequiredError, WaitForTransactionReceiptTimeoutError, WebSocketRequestError };
345
+ export { AbiConstructorNotFoundError, AbiConstructorParamsNotFoundError, AbiDecodingDataSizeInvalidError, AbiEncodingArrayLengthMismatchError, AbiEncodingLengthMismatchError, AbiErrorInputsNotFoundError, AbiErrorNotFoundError, AbiErrorSignatureNotFoundError, AbiEventNotFoundError, AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, AbiFunctionSignatureNotFoundError, BaseError, BlockNotFoundError, DataLengthTooLongError, DataLengthTooShortError, FilterTypeNotSupportedError, HttpRequestError, InternalRpcError, InvalidAbiDecodingTypeError, InvalidAbiEncodingTypeError, InvalidAddressError, InvalidArrayError, InvalidBytesBooleanError, InvalidDefinitionTypeError, InvalidGasArgumentsError, InvalidHexBooleanError, InvalidHexValueError, InvalidInputRpcError, InvalidParamsRpcError, InvalidRequestRpcError, JsonRpcVersionUnsupportedError, LimitExceededRpcError, MethodNotFoundRpcError, MethodNotSupportedRpcError, OffsetOutOfBoundsError, ParseRpcError, RequestError, ResourceNotFoundRpcError, ResourceUnavailableRpcError, RpcError, RpcRequestError, SizeExceedsPaddingSizeError, TimeoutError, TransactionNotFoundError, TransactionReceiptNotFoundError, TransactionRejectedRpcError, UnknownRpcError, UrlRequiredError, WaitForTransactionReceiptTimeoutError, WebSocketRequestError };
package/dist/index.js CHANGED
@@ -57,7 +57,7 @@ import {
57
57
  watchBlockNumber,
58
58
  watchBlocks,
59
59
  watchPendingTransactions
60
- } from "./chunk-6NVPLWQM.js";
60
+ } from "./chunk-6BXRN6CQ.js";
61
61
  import {
62
62
  createClient,
63
63
  createPublicClient,
@@ -68,7 +68,7 @@ import {
68
68
  fallback,
69
69
  http,
70
70
  webSocket
71
- } from "./chunk-26LBGCAV.js";
71
+ } from "./chunk-375SRM5R.js";
72
72
  import {
73
73
  boolToBytes,
74
74
  boolToHex,
@@ -87,6 +87,8 @@ import {
87
87
  encodeAbi,
88
88
  encodeBytes,
89
89
  encodeDeployData,
90
+ encodeErrorResult,
91
+ encodeEventTopics,
90
92
  encodeFunctionData,
91
93
  encodeFunctionResult,
92
94
  encodeHex,
@@ -132,13 +134,17 @@ import {
132
134
  transactionType,
133
135
  trim,
134
136
  weiUnits
135
- } from "./chunk-TKAGJYBH.js";
137
+ } from "./chunk-26WUARDL.js";
136
138
  import {
137
139
  AbiConstructorNotFoundError,
138
140
  AbiConstructorParamsNotFoundError,
139
141
  AbiDecodingDataSizeInvalidError,
140
142
  AbiEncodingArrayLengthMismatchError,
141
143
  AbiEncodingLengthMismatchError,
144
+ AbiErrorInputsNotFoundError,
145
+ AbiErrorNotFoundError,
146
+ AbiErrorSignatureNotFoundError,
147
+ AbiEventNotFoundError,
142
148
  AbiFunctionNotFoundError,
143
149
  AbiFunctionOutputsNotFoundError,
144
150
  AbiFunctionSignatureNotFoundError,
@@ -146,6 +152,7 @@ import {
146
152
  BlockNotFoundError,
147
153
  DataLengthTooLongError,
148
154
  DataLengthTooShortError,
155
+ FilterTypeNotSupportedError,
149
156
  HttpRequestError,
150
157
  InternalRpcError,
151
158
  InvalidAbiDecodingTypeError,
@@ -180,13 +187,17 @@ import {
180
187
  UrlRequiredError,
181
188
  WaitForTransactionReceiptTimeoutError,
182
189
  WebSocketRequestError
183
- } from "./chunk-3N57H2YM.js";
190
+ } from "./chunk-7H5SPKXN.js";
184
191
  export {
185
192
  AbiConstructorNotFoundError,
186
193
  AbiConstructorParamsNotFoundError,
187
194
  AbiDecodingDataSizeInvalidError,
188
195
  AbiEncodingArrayLengthMismatchError,
189
196
  AbiEncodingLengthMismatchError,
197
+ AbiErrorInputsNotFoundError,
198
+ AbiErrorNotFoundError,
199
+ AbiErrorSignatureNotFoundError,
200
+ AbiEventNotFoundError,
190
201
  AbiFunctionNotFoundError,
191
202
  AbiFunctionOutputsNotFoundError,
192
203
  AbiFunctionSignatureNotFoundError,
@@ -194,6 +205,7 @@ export {
194
205
  BlockNotFoundError,
195
206
  DataLengthTooLongError,
196
207
  DataLengthTooShortError,
208
+ FilterTypeNotSupportedError,
197
209
  HttpRequestError,
198
210
  InternalRpcError,
199
211
  InvalidAbiDecodingTypeError,
@@ -256,6 +268,8 @@ export {
256
268
  encodeAbi,
257
269
  encodeBytes,
258
270
  encodeDeployData,
271
+ encodeErrorResult,
272
+ encodeEventTopics,
259
273
  encodeFunctionData,
260
274
  encodeFunctionResult,
261
275
  encodeHex,
@@ -1,6 +1,18 @@
1
- import { Abi, AbiFunction, ExtractAbiFunction, AbiParametersToPrimitiveTypes, AbiParameter, ExtractAbiFunctionNames } from 'abitype';
1
+ import { Abi, AbiFunction, ExtractAbiFunction, AbiParametersToPrimitiveTypes, AbiError, ExtractAbiError, AbiEvent, ExtractAbiEvent, AbiParameter, AbiParameterToPrimitiveType, ExtractAbiFunctionNames, ExtractAbiErrorNames, ExtractAbiEventNames } from 'abitype';
2
2
  import { H as Hex, A as Address, B as ByteArray } from './rpc-b77c5aee.js';
3
3
 
4
+ type AbiEventParametersToPrimitiveTypes<TAbiParameters extends readonly AbiParameter[], TBase = TAbiParameters[0] extends {
5
+ name: string;
6
+ } ? {} : []> = TAbiParameters extends readonly [infer Head, ...infer Tail] ? Head extends {
7
+ indexed: true;
8
+ } ? Head extends AbiParameter ? Head extends {
9
+ name: infer Name;
10
+ } ? Name extends string ? {
11
+ [name in Name]?: AbiParameterToPrimitiveType<Head> | AbiParameterToPrimitiveType<Head>[] | null;
12
+ } & (Tail extends readonly [] ? {} : Tail extends readonly AbiParameter[] ? AbiEventParametersToPrimitiveTypes<Tail> : {}) : never : [
13
+ (AbiParameterToPrimitiveType<Head> | AbiParameterToPrimitiveType<Head>[] | null),
14
+ ...(Tail extends readonly [] ? [] : Tail extends readonly AbiParameter[] ? AbiEventParametersToPrimitiveTypes<Tail> : [])
15
+ ] : TBase : TBase : TBase;
4
16
  type ExtractArgsFromAbi<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TAbiFunction extends AbiFunction & {
5
17
  type: 'function';
6
18
  } = TAbi extends Abi ? ExtractAbiFunction<TAbi, TFunctionName> : AbiFunction & {
@@ -35,6 +47,18 @@ type ExtractConstructorArgsFromAbi<TAbi extends Abi | readonly unknown[], TAbiFu
35
47
  } : {
36
48
  /** Arguments to pass contract method */ args: TArgs;
37
49
  };
50
+ type ExtractErrorArgsFromAbi<TAbi extends Abi | readonly unknown[], TErrorName extends string, TAbiError extends AbiError = TAbi extends Abi ? ExtractAbiError<TAbi, TErrorName> : AbiError, TArgs = AbiParametersToPrimitiveTypes<TAbiError['inputs']>, FailedToParseArgs = ([TArgs] extends [never] ? true : false) | (readonly unknown[] extends TArgs ? true : false)> = true extends FailedToParseArgs ? {
51
+ /**
52
+ * Arguments to pass contract method
53
+ *
54
+ * Use a [const assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) on {@link abi} for type inference.
55
+ */
56
+ args?: readonly unknown[];
57
+ } : TArgs extends readonly [] ? {
58
+ args?: never;
59
+ } : {
60
+ /** Arguments to pass contract method */ args: TArgs;
61
+ };
38
62
  type ExtractResultFromAbi<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TAbiFunction extends AbiFunction & {
39
63
  type: 'function';
40
64
  } = TAbi extends Abi ? ExtractAbiFunction<TAbi, TFunctionName> : AbiFunction & {
@@ -51,11 +75,27 @@ type ExtractResultFromAbi<TAbi extends Abi | readonly unknown[], TFunctionName e
51
75
  } : {
52
76
  /** Arguments to pass contract method */ result: TArgs;
53
77
  };
78
+ type ExtractEventArgsFromAbi<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TAbiEvent extends AbiEvent & {
79
+ type: 'event';
80
+ } = TAbi extends Abi ? ExtractAbiEvent<TAbi, TFunctionName> : AbiEvent & {
81
+ type: 'event';
82
+ }, TArgs = AbiEventParametersToPrimitiveTypes<TAbiEvent['inputs']>, FailedToParseArgs = ([TArgs] extends [never] ? true : false) | (readonly unknown[] extends TArgs ? true : false)> = true extends FailedToParseArgs ? {
83
+ /**
84
+ * Arguments to pass contract method
85
+ *
86
+ * Use a [const assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) on {@link abi} for type inference.
87
+ */
88
+ args?: readonly unknown[];
89
+ } : TArgs extends readonly [] ? {
90
+ args?: never;
91
+ } : {
92
+ args?: TArgs;
93
+ };
54
94
 
55
95
  declare function decodeAbi<TParams extends readonly AbiParameter[]>({ data, params, }: {
56
96
  data: Hex;
57
97
  params: TParams;
58
- }): AbiParametersToPrimitiveTypes<TParams>;
98
+ }): AbiParametersToPrimitiveTypes<TParams> | undefined;
59
99
 
60
100
  declare function decodeErrorResult({ abi, data }: {
61
101
  abi: Abi;
@@ -85,13 +125,23 @@ declare function decodeFunctionResult<TAbi extends Abi = Abi, TFunctionName exte
85
125
  declare function encodeAbi<TParams extends readonly AbiParameter[]>({ params, values, }: {
86
126
  params: TParams;
87
127
  values: AbiParametersToPrimitiveTypes<TParams>;
88
- }): `0x${string}` | undefined;
128
+ }): `0x${string}`;
89
129
 
90
130
  declare function encodeDeployData<TAbi extends Abi = Abi>({ abi, args, bytecode, }: {
91
131
  abi: TAbi;
92
132
  bytecode: Hex;
93
133
  } & ExtractConstructorArgsFromAbi<TAbi>): `0x${string}`;
94
134
 
135
+ declare function encodeErrorResult<TAbi extends Abi = Abi, TErrorName extends ExtractAbiErrorNames<TAbi> = any>({ abi, errorName, args, }: {
136
+ abi: TAbi;
137
+ errorName: TErrorName;
138
+ } & ExtractErrorArgsFromAbi<TAbi, TErrorName>): `0x${string}`;
139
+
140
+ declare function encodeEventTopics<TAbi extends Abi = Abi, TEventName extends ExtractAbiEventNames<TAbi> = any>({ abi, eventName, args, }: {
141
+ abi: TAbi;
142
+ eventName: TEventName;
143
+ } & ExtractEventArgsFromAbi<TAbi, TEventName>): `0x${string}`[];
144
+
95
145
  declare function encodeFunctionData<TAbi extends Abi = Abi, TFunctionName extends ExtractAbiFunctionNames<TAbi> = any>({ abi, args, functionName, }: {
96
146
  abi: TAbi;
97
147
  functionName: TFunctionName;
@@ -303,4 +353,4 @@ declare function parseEther(ether: `${number}`, unit?: 'wei' | 'gwei'): bigint;
303
353
 
304
354
  declare function parseGwei(ether: `${number}`, unit?: 'wei'): bigint;
305
355
 
306
- export { slice as $, getCreate2Address as A, getEventSignature as B, getFunctionSignature as C, formatEther as D, EncodeRlpResponse as E, isAddress as F, GetContractAddressOptions as G, isAddressEqual as H, isBytes as I, isHex as J, hexToBigInt as K, hexToBool as L, hexToBytes as M, hexToString as N, keccak256 as O, numberToBytes as P, pad as Q, padBytes as R, padHex as S, parseEther as T, parseGwei as U, parseUnit as V, formatGwei as W, formatUnit as X, hexToNumber as Y, numberToHex as Z, size as _, GetCreateAddressOptions as a, sliceBytes as a0, sliceHex as a1, stringToBytes as a2, stringToHex as a3, trim as a4, GetCreate2AddressOptions as b, bytesToHex as c, bytesToString as d, boolToBytes as e, boolToHex as f, bytesToBigint as g, bytesToBool as h, bytesToNumber as i, decodeAbi as j, decodeBytes as k, decodeErrorResult as l, decodeFunctionData as m, decodeFunctionResult as n, decodeHex as o, decodeRlp as p, encodeAbi as q, encodeBytes as r, encodeDeployData as s, encodeFunctionData as t, encodeFunctionResult as u, encodeHex as v, encodeRlp as w, getAddress as x, getContractAddress as y, getCreateAddress as z };
356
+ export { numberToHex as $, getContractAddress as A, getCreateAddress as B, getCreate2Address as C, getEventSignature as D, EncodeRlpResponse as E, getFunctionSignature as F, GetContractAddressOptions as G, formatEther as H, isAddress as I, isAddressEqual as J, isBytes as K, isHex as L, hexToBigInt as M, hexToBool as N, hexToBytes as O, hexToString as P, keccak256 as Q, numberToBytes as R, pad as S, padBytes as T, padHex as U, parseEther as V, parseGwei as W, parseUnit as X, formatGwei as Y, formatUnit as Z, hexToNumber as _, GetCreateAddressOptions as a, size as a0, slice as a1, sliceBytes as a2, sliceHex as a3, stringToBytes as a4, stringToHex as a5, trim as a6, GetCreate2AddressOptions as b, bytesToHex as c, bytesToString as d, boolToBytes as e, boolToHex as f, bytesToBigint as g, bytesToBool as h, bytesToNumber as i, decodeAbi as j, decodeBytes as k, decodeErrorResult as l, decodeFunctionData as m, decodeFunctionResult as n, decodeHex as o, decodeRlp as p, encodeAbi as q, encodeBytes as r, encodeDeployData as s, encodeErrorResult as t, encodeEventTopics as u, encodeFunctionData as v, encodeFunctionResult as w, encodeHex as x, encodeRlp as y, getAddress as z };
@@ -1,4 +1,4 @@
1
- export { E as EncodeRlpResponse, G as GetContractAddressOptions, b as GetCreate2AddressOptions, a as GetCreateAddressOptions, e as boolToBytes, f as boolToHex, g as bytesToBigint, h as bytesToBool, c as bytesToHex, i as bytesToNumber, d as bytesToString, j as decodeAbi, k as decodeBytes, l as decodeErrorResult, m as decodeFunctionData, n as decodeFunctionResult, o as decodeHex, p as decodeRlp, q as encodeAbi, r as encodeBytes, s as encodeDeployData, t as encodeFunctionData, u as encodeFunctionResult, v as encodeHex, w as encodeRlp, D as formatEther, W as formatGwei, X as formatUnit, x as getAddress, y as getContractAddress, A as getCreate2Address, z as getCreateAddress, B as getEventSignature, C as getFunctionSignature, K as hexToBigInt, L as hexToBool, M as hexToBytes, Y as hexToNumber, N as hexToString, F as isAddress, H as isAddressEqual, I as isBytes, J as isHex, O as keccak256, P as numberToBytes, Z as numberToHex, Q as pad, R as padBytes, S as padHex, T as parseEther, U as parseGwei, V as parseUnit, _ as size, $ as slice, a0 as sliceBytes, a1 as sliceHex, a2 as stringToBytes, a3 as stringToHex, a4 as trim } from '../parseGwei-9cc6638c.js';
1
+ export { E as EncodeRlpResponse, G as GetContractAddressOptions, b as GetCreate2AddressOptions, a as GetCreateAddressOptions, e as boolToBytes, f as boolToHex, g as bytesToBigint, h as bytesToBool, c as bytesToHex, i as bytesToNumber, d as bytesToString, j as decodeAbi, k as decodeBytes, l as decodeErrorResult, m as decodeFunctionData, n as decodeFunctionResult, o as decodeHex, p as decodeRlp, q as encodeAbi, r as encodeBytes, s as encodeDeployData, t as encodeErrorResult, u as encodeEventTopics, v as encodeFunctionData, w as encodeFunctionResult, x as encodeHex, y as encodeRlp, H as formatEther, Y as formatGwei, Z as formatUnit, z as getAddress, A as getContractAddress, C as getCreate2Address, B as getCreateAddress, D as getEventSignature, F as getFunctionSignature, M as hexToBigInt, N as hexToBool, O as hexToBytes, _ as hexToNumber, P as hexToString, I as isAddress, J as isAddressEqual, K as isBytes, L as isHex, Q as keccak256, R as numberToBytes, $ as numberToHex, S as pad, T as padBytes, U as padHex, V as parseEther, W as parseGwei, X as parseUnit, a0 as size, a1 as slice, a2 as sliceBytes, a3 as sliceHex, a4 as stringToBytes, a5 as stringToHex, a6 as trim } from '../parseGwei-64031f5e.js';
2
2
  export { B as BlockFormatter, E as ExtractFormatter, e as Formatted, F as FormattedBlock, a as FormattedTransaction, h as FormattedTransactionReceipt, b as FormattedTransactionRequest, g as TransactionFormatter, i as TransactionReceiptFormatter, T as TransactionRequestFormatter, j as format, f as formatBlock, c as formatTransaction, d as formatTransactionRequest } from '../transactionRequest-3e463099.js';
3
3
  export { r as rpc } from '../rpc-26932bae.js';
4
4
  import 'abitype';
@@ -16,6 +16,8 @@ import {
16
16
  encodeAbi,
17
17
  encodeBytes,
18
18
  encodeDeployData,
19
+ encodeErrorResult,
20
+ encodeEventTopics,
19
21
  encodeFunctionData,
20
22
  encodeFunctionResult,
21
23
  encodeHex,
@@ -61,11 +63,11 @@ import {
61
63
  stringToBytes,
62
64
  stringToHex,
63
65
  trim
64
- } from "../chunk-TKAGJYBH.js";
66
+ } from "../chunk-26WUARDL.js";
65
67
  import {
66
68
  buildRequest,
67
69
  rpc
68
- } from "../chunk-3N57H2YM.js";
70
+ } from "../chunk-7H5SPKXN.js";
69
71
  export {
70
72
  boolToBytes,
71
73
  boolToHex,
@@ -85,6 +87,8 @@ export {
85
87
  encodeAbi,
86
88
  encodeBytes,
87
89
  encodeDeployData,
90
+ encodeErrorResult,
91
+ encodeEventTopics,
88
92
  encodeFunctionData,
89
93
  encodeFunctionResult,
90
94
  encodeHex,
@@ -1,8 +1,8 @@
1
1
  import { Chain, Formatter } from './chains.js';
2
2
  import { H as Hex, b as BlockTag, M as MergeIntersectionProperties, v as TransactionRequest, K as EstimateGasParameters, A as Address, a as Hash, F as FeeHistory, L as Log, r as RpcTransactionReceipt, T as TransactionReceipt, N as TransactionType, D as Transaction, q as RpcTransaction, Q as Quantity, B as ByteArray } from './rpc-b77c5aee.js';
3
- import { P as PublicClient, T as TestClient, W as WalletClient } from './createWalletClient-b5c3c89e.js';
3
+ import { P as PublicClient, T as TestClient, W as WalletClient } from './createWalletClient-d612fe08.js';
4
4
  import { T as TransactionRequestFormatter, e as Formatted, F as FormattedBlock, B as BlockFormatter, a as FormattedTransaction, g as TransactionFormatter, h as FormattedTransactionReceipt, i as TransactionReceiptFormatter, E as ExtractFormatter } from './transactionRequest-3e463099.js';
5
- import { W as WalletPermission, a as WatchAssetParams } from './eip1193-100454ab.js';
5
+ import { W as WalletPermission, a as WatchAssetParams } from './eip1193-020a6f13.js';
6
6
 
7
7
  type FilterType = 'transaction' | 'block' | 'event';
8
8
  type Filter<TFilterType extends FilterType = 'event'> = {
@@ -1,4 +1,4 @@
1
- import { e as TransportConfig, d as Transport, B as BaseRpcRequests } from './createWalletClient-b5c3c89e.js';
1
+ import { e as TransportConfig, d as Transport, B as BaseRpcRequests } from './createWalletClient-d612fe08.js';
2
2
  import { a as Hash } from './rpc-b77c5aee.js';
3
3
  import { R as RpcResponse } from './rpc-26932bae.js';
4
4
 
package/dist/window.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { R as Requests, E as Events } from './eip1193-100454ab.js';
1
+ import { R as Requests, E as Events } from './eip1193-020a6f13.js';
2
2
  import './rpc-b77c5aee.js';
3
3
 
4
4
  type WindowProvider = Requests & Events;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viem",
3
3
  "description": "TypeScript (& JavaScript) Interface for Ethereum",
4
- "version": "0.0.1-alpha.7",
4
+ "version": "0.0.1-alpha.9",
5
5
  "files": [
6
6
  "/actions",
7
7
  "/chains",