viem 0.0.1-alpha.34 → 0.0.1-alpha.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/abi/package.json +4 -0
  2. package/dist/abi.d.ts +5 -0
  3. package/dist/abi.js +11 -0
  4. package/dist/abi.js.map +1 -0
  5. package/dist/abi.mjs +11 -0
  6. package/dist/abi.mjs.map +1 -0
  7. package/dist/{chain-ce6e149c.d.ts → chain-145cfaf3.d.ts} +1 -1
  8. package/dist/{chain-4a0d4164.d.ts → chain-7b7ac245.d.ts} +2 -2
  9. package/dist/chains.d.ts +3 -3
  10. package/dist/chains.js +46 -46
  11. package/dist/chains.mjs +1 -1
  12. package/dist/{chunk-7ALCXZ5K.js → chunk-3FT7UKPT.js} +75 -75
  13. package/dist/chunk-3FT7UKPT.js.map +1 -0
  14. package/dist/{chunk-EJEZIHXK.js → chunk-57YM6E7I.js} +22 -22
  15. package/dist/{chunk-KQQLLKZV.mjs → chunk-5NDMORWZ.mjs} +3 -3
  16. package/dist/{chunk-IUCGWGPX.js → chunk-A665BF7O.js} +24 -16
  17. package/dist/chunk-A665BF7O.js.map +1 -0
  18. package/dist/{chunk-F76TECTY.js → chunk-HQCSH22G.js} +126 -82
  19. package/dist/chunk-HQCSH22G.js.map +1 -0
  20. package/dist/{chunk-VP57P6CD.mjs → chunk-PBW4YL37.mjs} +87 -43
  21. package/dist/chunk-PBW4YL37.mjs.map +1 -0
  22. package/dist/{chunk-TNN5X44H.mjs → chunk-PH5LCMME.mjs} +10 -2
  23. package/dist/chunk-PH5LCMME.mjs.map +1 -0
  24. package/dist/{chunk-EBLS4P77.js → chunk-TJK6AFBM.js} +14 -14
  25. package/dist/{chunk-EBLS4P77.js.map → chunk-TJK6AFBM.js.map} +1 -1
  26. package/dist/{chunk-VHZHROXW.mjs → chunk-WQDVW7EJ.mjs} +2 -2
  27. package/dist/chunk-WQDVW7EJ.mjs.map +1 -0
  28. package/dist/{chunk-NMET3ZHG.mjs → chunk-YEVW7GK5.mjs} +2 -2
  29. package/dist/{chunk-NMET3ZHG.mjs.map → chunk-YEVW7GK5.mjs.map} +1 -1
  30. package/dist/contract.d.ts +7 -8
  31. package/dist/contract.js +4 -4
  32. package/dist/contract.mjs +10 -10
  33. package/dist/{createClient-8a8b4bf4.d.ts → createClient-7c715e2c.d.ts} +2 -2
  34. package/dist/{createPublicClient-b5afe6b8.d.ts → createPublicClient-4d24afb2.d.ts} +122 -9
  35. package/dist/{eip1193-8c021438.d.ts → eip1193-d538ae6d.d.ts} +11 -1
  36. package/dist/{getAbiItem-d7aa40b1.d.ts → encodeFunctionResult-f59f4cfe.d.ts} +3 -25
  37. package/dist/ens.d.ts +4 -5
  38. package/dist/ens.js +4 -4
  39. package/dist/ens.mjs +3 -3
  40. package/dist/{formatAbiItem-6e00e5e6.d.ts → formatAbiItem-89d97367.d.ts} +1 -1
  41. package/dist/getAbiItem-c9cbc8b8.d.ts +22 -0
  42. package/dist/index.d.ts +12 -13
  43. package/dist/index.js +91 -90
  44. package/dist/index.js.map +1 -1
  45. package/dist/index.mjs +24 -23
  46. package/dist/index.mjs.map +1 -1
  47. package/dist/{parseGwei-ce3a9dfa.d.ts → parseGwei-ad6d1914.d.ts} +5 -6
  48. package/dist/public.d.ts +5 -6
  49. package/dist/public.js +3 -3
  50. package/dist/public.mjs +2 -2
  51. package/dist/{test-5d5828c9.d.ts → test-8646fb50.d.ts} +9 -9
  52. package/dist/test.d.ts +5 -5
  53. package/dist/test.js +3 -3
  54. package/dist/test.mjs +2 -2
  55. package/dist/utils/index.d.ts +12 -14
  56. package/dist/utils/index.js +2 -2
  57. package/dist/utils/index.mjs +5 -5
  58. package/dist/wallet.d.ts +5 -5
  59. package/dist/wallet.js +4 -3
  60. package/dist/wallet.mjs +3 -2
  61. package/dist/window.d.ts +2 -2
  62. package/package.json +8 -2
  63. package/dist/chunk-7ALCXZ5K.js.map +0 -1
  64. package/dist/chunk-F76TECTY.js.map +0 -1
  65. package/dist/chunk-IUCGWGPX.js.map +0 -1
  66. package/dist/chunk-TNN5X44H.mjs.map +0 -1
  67. package/dist/chunk-VHZHROXW.mjs.map +0 -1
  68. package/dist/chunk-VP57P6CD.mjs.map +0 -1
  69. package/dist/wallet-5ab86528.d.ts +0 -115
  70. /package/dist/{chunk-EJEZIHXK.js.map → chunk-57YM6E7I.js.map} +0 -0
  71. /package/dist/{chunk-KQQLLKZV.mjs.map → chunk-5NDMORWZ.mjs.map} +0 -0
@@ -1,11 +1,10 @@
1
- export { D as DecodeAbiArgs, a as DecodeErrorResultArgs, b as DecodeErrorResultResponse, c as DecodeEventLogArgs, d as DecodeEventLogResponse, e as DecodeFunctionDataArgs, f as DecodeFunctionResultArgs, g as DecodeFunctionResultResponse, E as EncodeAbiArgs, h as EncodeDeployDataArgs, i as EncodeErrorResultArgs, j as EncodeEventTopicsArgs, k as EncodeFunctionDataArgs, l as EncodeFunctionResultArgs, G as GetAbiItemArgs, m as decodeAbi, n as decodeErrorResult, o as decodeEventLog, p as decodeFunctionData, q as decodeFunctionResult, r as encodeAbi, s as encodeDeployData, t as encodeErrorResult, u as encodeEventTopics, v as encodeFunctionData, w as encodeFunctionResult, x as getAbiItem } from './getAbiItem-d7aa40b1.js';
2
- export { a as formatAbiItem, f as formatAbiItemWithArgs } from './formatAbiItem-6e00e5e6.js';
3
- export { D as DeployContractArgs, e as DeployContractResponse, b as WriteContractArgs, g as WriteContractResponse, h as deployContract, w as writeContract } from './wallet-5ab86528.js';
4
- export { g as CreateContractEventFilterArgs, h as CreateContractEventFilterResponse, i as EstimateContractGasArgs, j as EstimateContractGasResponse, G as GetBytecodeArgs, k as GetBytecodeResponse, l as GetStorageAtArgs, m as GetStorageAtResponse, M as MulticallArgs, n as MulticallResponse, O as OnLogs, o as OnLogsResponse, R as ReadContractArgs, p as ReadContractResponse, S as SimulateContractArgs, q as SimulateContractResponse, W as WatchContractEventArgs, r as createContractEventFilter, s as estimateContractGas, t as getBytecode, u as getStorageAt, v as multicall, w as readContract, x as simulateContract, y as watchContractEvent } from './createPublicClient-b5afe6b8.js';
1
+ export { D as DecodeAbiParametersResponse, E as EncodeAbiParametersResponse, G as GetAbiItemArgs, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from './getAbiItem-c9cbc8b8.js';
2
+ export { D as DecodeErrorResultArgs, a as DecodeErrorResultResponse, b as DecodeEventLogArgs, c as DecodeEventLogResponse, d as DecodeFunctionDataArgs, e as DecodeFunctionResultArgs, f as DecodeFunctionResultResponse, E as EncodeDeployDataArgs, g as EncodeErrorResultArgs, h as EncodeEventTopicsArgs, i as EncodeFunctionDataArgs, j as EncodeFunctionResultArgs, k as decodeErrorResult, l as decodeEventLog, m as decodeFunctionData, n as decodeFunctionResult, o as encodeDeployData, p as encodeErrorResult, q as encodeEventTopics, r as encodeFunctionData, s as encodeFunctionResult } from './encodeFunctionResult-f59f4cfe.js';
3
+ export { a as formatAbiItem, f as formatAbiItemWithArgs } from './formatAbiItem-89d97367.js';
4
+ export { m as CreateContractEventFilterArgs, n as CreateContractEventFilterResponse, N as DeployContractArgs, Q as DeployContractResponse, o as EstimateContractGasArgs, p as EstimateContractGasResponse, G as GetBytecodeArgs, q as GetBytecodeResponse, r as GetStorageAtArgs, s as GetStorageAtResponse, M as MulticallArgs, t as MulticallResponse, O as OnLogs, u as OnLogsResponse, R as ReadContractArgs, v as ReadContractResponse, w as SimulateContractArgs, x as SimulateContractResponse, y as WatchContractEventArgs, U as WriteContractArgs, V as WriteContractResponse, z as createContractEventFilter, X as deployContract, A as estimateContractGas, D as getBytecode, H as getStorageAt, I as multicall, J as readContract, K as simulateContract, L as watchContractEvent, Y as writeContract } from './createPublicClient-4d24afb2.js';
5
5
  import 'abitype';
6
- import './chain-4a0d4164.js';
6
+ import './chain-7b7ac245.js';
7
7
  import '@wagmi/chains';
8
8
  import 'ethers@6/types/providers';
9
- import 'abitype/dist/abi-78346466';
10
- import './eip1193-8c021438.js';
11
- import './createClient-8a8b4bf4.js';
9
+ import './eip1193-d538ae6d.js';
10
+ import './createClient-7c715e2c.js';
package/dist/contract.js CHANGED
@@ -1,17 +1,17 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
+ var _chunkA665BF7Ojs = require('./chunk-A665BF7O.js');
4
5
 
5
6
 
6
7
 
7
8
 
8
9
 
9
10
 
10
- var _chunk7ALCXZ5Kjs = require('./chunk-7ALCXZ5K.js');
11
11
 
12
12
 
13
13
 
14
- var _chunkIUCGWGPXjs = require('./chunk-IUCGWGPX.js');
14
+ var _chunk3FT7UKPTjs = require('./chunk-3FT7UKPT.js');
15
15
 
16
16
 
17
17
 
@@ -27,7 +27,7 @@ var _chunkIUCGWGPXjs = require('./chunk-IUCGWGPX.js');
27
27
 
28
28
 
29
29
 
30
- var _chunkF76TECTYjs = require('./chunk-F76TECTY.js');
30
+ var _chunkHQCSH22Gjs = require('./chunk-HQCSH22G.js');
31
31
 
32
32
 
33
33
 
@@ -53,5 +53,5 @@ var _chunkF76TECTYjs = require('./chunk-F76TECTY.js');
53
53
 
54
54
 
55
55
 
56
- exports.createContractEventFilter = _chunk7ALCXZ5Kjs.createContractEventFilter; exports.decodeAbi = _chunkF76TECTYjs.decodeAbi; exports.decodeErrorResult = _chunkF76TECTYjs.decodeErrorResult; exports.decodeEventLog = _chunkF76TECTYjs.decodeEventLog; exports.decodeFunctionData = _chunkF76TECTYjs.decodeFunctionData; exports.decodeFunctionResult = _chunkF76TECTYjs.decodeFunctionResult; exports.deployContract = _chunkIUCGWGPXjs.deployContract; exports.encodeAbi = _chunkF76TECTYjs.encodeAbi; exports.encodeDeployData = _chunkF76TECTYjs.encodeDeployData; exports.encodeErrorResult = _chunkF76TECTYjs.encodeErrorResult; exports.encodeEventTopics = _chunkF76TECTYjs.encodeEventTopics; exports.encodeFunctionData = _chunkF76TECTYjs.encodeFunctionData; exports.encodeFunctionResult = _chunkF76TECTYjs.encodeFunctionResult; exports.estimateContractGas = _chunk7ALCXZ5Kjs.estimateContractGas; exports.formatAbiItem = _chunkF76TECTYjs.formatAbiItem; exports.formatAbiItemWithArgs = _chunkF76TECTYjs.formatAbiItemWithArgs; exports.getAbiItem = _chunkF76TECTYjs.getAbiItem; exports.getBytecode = _chunk7ALCXZ5Kjs.getBytecode; exports.getStorageAt = _chunk7ALCXZ5Kjs.getStorageAt; exports.multicall = _chunk7ALCXZ5Kjs.multicall; exports.readContract = _chunk7ALCXZ5Kjs.readContract; exports.simulateContract = _chunk7ALCXZ5Kjs.simulateContract; exports.watchContractEvent = _chunk7ALCXZ5Kjs.watchContractEvent; exports.writeContract = _chunkIUCGWGPXjs.writeContract;
56
+ exports.createContractEventFilter = _chunk3FT7UKPTjs.createContractEventFilter; exports.decodeAbiParameters = _chunkHQCSH22Gjs.decodeAbiParameters; exports.decodeErrorResult = _chunkHQCSH22Gjs.decodeErrorResult; exports.decodeEventLog = _chunkHQCSH22Gjs.decodeEventLog; exports.decodeFunctionData = _chunkHQCSH22Gjs.decodeFunctionData; exports.decodeFunctionResult = _chunkHQCSH22Gjs.decodeFunctionResult; exports.deployContract = _chunkA665BF7Ojs.deployContract; exports.encodeAbiParameters = _chunkHQCSH22Gjs.encodeAbiParameters; exports.encodeDeployData = _chunkHQCSH22Gjs.encodeDeployData; exports.encodeErrorResult = _chunkHQCSH22Gjs.encodeErrorResult; exports.encodeEventTopics = _chunkHQCSH22Gjs.encodeEventTopics; exports.encodeFunctionData = _chunkHQCSH22Gjs.encodeFunctionData; exports.encodeFunctionResult = _chunkHQCSH22Gjs.encodeFunctionResult; exports.estimateContractGas = _chunk3FT7UKPTjs.estimateContractGas; exports.formatAbiItem = _chunkHQCSH22Gjs.formatAbiItem; exports.formatAbiItemWithArgs = _chunkHQCSH22Gjs.formatAbiItemWithArgs; exports.getAbiItem = _chunkHQCSH22Gjs.getAbiItem; exports.getBytecode = _chunk3FT7UKPTjs.getBytecode; exports.getStorageAt = _chunk3FT7UKPTjs.getStorageAt; exports.multicall = _chunk3FT7UKPTjs.multicall; exports.readContract = _chunk3FT7UKPTjs.readContract; exports.simulateContract = _chunk3FT7UKPTjs.simulateContract; exports.watchContractEvent = _chunk3FT7UKPTjs.watchContractEvent; exports.writeContract = _chunkA665BF7Ojs.writeContract;
57
57
  //# sourceMappingURL=contract.js.map
package/dist/contract.mjs CHANGED
@@ -1,3 +1,7 @@
1
+ import {
2
+ deployContract,
3
+ writeContract
4
+ } from "./chunk-PH5LCMME.mjs";
1
5
  import {
2
6
  createContractEventFilter,
3
7
  estimateContractGas,
@@ -7,18 +11,14 @@ import {
7
11
  readContract,
8
12
  simulateContract,
9
13
  watchContractEvent
10
- } from "./chunk-VHZHROXW.mjs";
11
- import {
12
- deployContract,
13
- writeContract
14
- } from "./chunk-TNN5X44H.mjs";
14
+ } from "./chunk-WQDVW7EJ.mjs";
15
15
  import {
16
- decodeAbi,
16
+ decodeAbiParameters,
17
17
  decodeErrorResult,
18
18
  decodeEventLog,
19
19
  decodeFunctionData,
20
20
  decodeFunctionResult,
21
- encodeAbi,
21
+ encodeAbiParameters,
22
22
  encodeDeployData,
23
23
  encodeErrorResult,
24
24
  encodeEventTopics,
@@ -27,16 +27,16 @@ import {
27
27
  formatAbiItem,
28
28
  formatAbiItemWithArgs,
29
29
  getAbiItem
30
- } from "./chunk-VP57P6CD.mjs";
30
+ } from "./chunk-PBW4YL37.mjs";
31
31
  export {
32
32
  createContractEventFilter,
33
- decodeAbi,
33
+ decodeAbiParameters,
34
34
  decodeErrorResult,
35
35
  decodeEventLog,
36
36
  decodeFunctionData,
37
37
  decodeFunctionResult,
38
38
  deployContract,
39
- encodeAbi,
39
+ encodeAbiParameters,
40
40
  encodeDeployData,
41
41
  encodeErrorResult,
42
42
  encodeEventTopics,
@@ -1,5 +1,5 @@
1
- import { R as Requests } from './eip1193-8c021438.js';
2
- import { C as Chain } from './chain-4a0d4164.js';
1
+ import { R as Requests } from './eip1193-d538ae6d.js';
2
+ import { C as Chain } from './chain-7b7ac245.js';
3
3
 
4
4
  type BaseRpcRequests = {
5
5
  request(...args: any): Promise<any>;
@@ -1,8 +1,7 @@
1
- import { P as PublicRequests } from './eip1193-8c021438.js';
2
- import { a as Transport, b as ClientConfig, C as Client } from './createClient-8a8b4bf4.js';
3
- import { Abi, AbiEvent, Narrow, ExtractAbiEvent } from 'abitype';
4
- import { C as Chain, J as ExtractFormatter, S as Formatters, V as Formatter, K as Formatted, d as Block, R as RpcBlock, z as Transaction, T as TransactionReceipt, r as RpcTransactionReceipt, W as TransactionType, A as Address, g as BlockTag, H as Hex, X as MergeIntersectionProperties, u as TransactionRequest, h as ContractConfig, Y as GetValue, Z as ExtractResultFromAbi, _ as MaybeAbiEventName, $ as MaybeExtractEventArgsFromAbi, f as BlockNumber, a0 as ExtractEventNameFromAbi, a as Hash, F as FeeHistory, L as Log, M as FormattedTransaction, N as TransactionFormatter, a1 as ExtractEventArgsFromAbi, a2 as Prettify } from './chain-4a0d4164.js';
5
- import { T as TransactionRequestFormatter, b as WriteContractArgs } from './wallet-5ab86528.js';
1
+ import { W as WalletPermission, a as WatchAssetParams, S as SignableRequests, b as WalletRequests, P as PublicRequests } from './eip1193-d538ae6d.js';
2
+ import { a as Transport, b as ClientConfig, C as Client } from './createClient-7c715e2c.js';
3
+ import { Abi, Narrow, Address as Address$1, AbiEvent, ExtractAbiEvent } from 'abitype';
4
+ import { C as Chain, J as ExtractFormatter, S as Formatters, V as Formatter, K as Formatted, d as Block, R as RpcBlock, z as Transaction, T as TransactionReceipt, r as RpcTransactionReceipt, W as TransactionType, s as RpcTransactionRequest, u as TransactionRequest, A as Address, g as BlockTag, H as Hex, X as MergeIntersectionProperties, Y as ExtractConstructorArgsFromAbi, a as Hash, B as ByteArray, Z as GetValue, h as ContractConfig, _ as ExtractResultFromAbi, $ as MaybeAbiEventName, a0 as MaybeExtractEventArgsFromAbi, f as BlockNumber, a1 as ExtractEventNameFromAbi, F as FeeHistory, L as Log, M as FormattedTransaction, N as TransactionFormatter, a2 as ExtractEventArgsFromAbi, a3 as Prettify } from './chain-7b7ac245.js';
6
5
 
7
6
  type BlockFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'block', NonNullable<Formatters['block']>>;
8
7
  type FormattedBlock<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, Block>;
@@ -27,6 +26,18 @@ declare const defineTransactionReceipt: <TFormat extends Formatter<Partial<RpcTr
27
26
  [key: string]: unknown;
28
27
  }) => TransactionReceipt<bigint, number, "success" | "reverted", TransactionType> & ReturnType<TFormat> & { [K in TExclude[number]]: never; };
29
28
 
29
+ type TransactionRequestFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'transactionRequest', NonNullable<Formatters['transactionRequest']>>;
30
+ type FormattedTransactionRequest$1<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, RpcTransactionRequest>;
31
+ declare function formatTransactionRequest(transactionRequest: Partial<TransactionRequest>): RpcTransactionRequest;
32
+ declare const defineTransactionRequest: <TFormat extends Formatter<Partial<TransactionRequest<bigint, number>>, Partial<RpcTransactionRequest> & {
33
+ [key: string]: unknown;
34
+ }>, TExclude extends ("value" | "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" | "data" | "from" | "gas" | "nonce" | "to" | "accessList")[] = []>({ exclude, format: formatOverride, }: {
35
+ exclude?: TExclude | undefined;
36
+ format?: TFormat | undefined;
37
+ }) => (data: Partial<TransactionRequest<bigint, number>> & {
38
+ [key: string]: unknown;
39
+ }) => RpcTransactionRequest & ReturnType<TFormat> & { [K in TExclude[number]]: never; };
40
+
30
41
  type FormattedCall<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Formatted<TFormatter, TransactionRequest, true>, TransactionRequest>;
31
42
  type CallArgs<TChain extends Chain = Chain> = FormattedCall<TransactionRequestFormatter<TChain>> & {
32
43
  from?: Address;
@@ -44,6 +55,71 @@ type CallResponse = {
44
55
  };
45
56
  declare function call<TChain extends Chain>(client: PublicClient<any, TChain>, args: CallArgs<TChain>): Promise<CallResponse>;
46
57
 
58
+ type AddChainArgs = {
59
+ chain: Chain;
60
+ };
61
+ declare function addChain(client: WalletClient, { chain }: AddChainArgs): Promise<void>;
62
+
63
+ type DeployContractArgs<TChain extends Chain = Chain, TAbi extends Abi | readonly unknown[] = Abi> = Omit<SendTransactionArgs<TChain>, 'accessList' | 'to' | 'data' | 'value'> & {
64
+ abi: Narrow<TAbi>;
65
+ bytecode: Hex;
66
+ } & ExtractConstructorArgsFromAbi<TAbi>;
67
+ type DeployContractResponse = SendTransactionResponse;
68
+ declare function deployContract<TChain extends Chain, TAbi extends Abi | readonly unknown[]>(walletClient: WalletClient, { abi, args, bytecode, ...request }: DeployContractArgs<TChain, TAbi>): Promise<DeployContractResponse>;
69
+
70
+ type GetAccountsResponse = Address$1[];
71
+ declare function getAccounts(client: WalletClient): Promise<GetAccountsResponse>;
72
+
73
+ type GetChainIdResponse = number;
74
+ declare function getChainId(client: PublicClient | WalletClient): Promise<GetChainIdResponse>;
75
+
76
+ type GetPermissionsResponse = WalletPermission[];
77
+ declare function getPermissions(client: WalletClient): Promise<WalletPermission[]>;
78
+
79
+ type RequestAccountsResponse = Address$1[];
80
+ declare function requestAccounts(client: WalletClient): Promise<RequestAccountsResponse>;
81
+
82
+ type RequestPermissionsArgs = {
83
+ eth_accounts: Record<string, any>;
84
+ } & {
85
+ [key: string]: Record<string, any>;
86
+ };
87
+ type RequestPermissionsResponse = WalletPermission[];
88
+ declare function requestPermissions(client: WalletClient, permissions: RequestPermissionsArgs): Promise<WalletPermission[]>;
89
+
90
+ type FormattedTransactionRequest<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Formatted<TFormatter, TransactionRequest, true>, TransactionRequest>;
91
+ type SendTransactionArgs<TChain extends Chain = Chain> = FormattedTransactionRequest<TransactionRequestFormatter<TChain>> & ({
92
+ assertChain?: false;
93
+ chain?: TChain;
94
+ } | {
95
+ assertChain: true;
96
+ chain: TChain;
97
+ });
98
+ type SendTransactionResponse = Hash;
99
+ declare function sendTransaction<TChain extends Chain>(client: WalletClient, args: SendTransactionArgs<TChain>): Promise<SendTransactionResponse>;
100
+
101
+ type SignMessageArgs = {
102
+ from: Address;
103
+ data: Hex | ByteArray;
104
+ };
105
+ type SignMessageResponse = Hex;
106
+ declare function signMessage(client: WalletClient, { from, data: data_ }: SignMessageArgs): Promise<SignMessageResponse>;
107
+
108
+ type SwitchChainArgs = {
109
+ id: Chain['id'];
110
+ };
111
+ declare function switchChain(client: WalletClient, { id }: SwitchChainArgs): Promise<void>;
112
+
113
+ type WatchAssetArgs = WatchAssetParams;
114
+ type WatchAssetResponse = boolean;
115
+ declare function watchAsset(client: WalletClient, params: WatchAssetParams): Promise<WatchAssetResponse>;
116
+
117
+ type WriteContractArgs<TChain extends Chain = Chain, TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = Omit<SendTransactionArgs<TChain>, 'to' | 'data' | 'value'> & {
118
+ value?: GetValue<TAbi, TFunctionName, SendTransactionArgs<TChain>['value']>;
119
+ } & ContractConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'>;
120
+ type WriteContractResponse = SendTransactionResponse;
121
+ declare function writeContract<TChain extends Chain, TAbi extends Abi | readonly unknown[], TFunctionName extends string>(client: WalletClient, { abi, address, args, functionName, ...request }: WriteContractArgs<TChain, TAbi, TFunctionName>): Promise<WriteContractResponse>;
122
+
47
123
  type SimulateContractArgs<TChain extends Chain = Chain, TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any> = Omit<CallArgs<TChain>, 'to' | 'data' | 'value'> & ContractConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'> & {
48
124
  value?: GetValue<TAbi, TFunctionName, CallArgs<TChain>['value']>;
49
125
  };
@@ -220,9 +296,6 @@ type GetBytecodeArgs = {
220
296
  type GetBytecodeResponse = Hex | undefined;
221
297
  declare function getBytecode(client: PublicClient, { address, blockNumber, blockTag }: GetBytecodeArgs): Promise<GetBytecodeResponse>;
222
298
 
223
- type GetChainIdResponse = number;
224
- declare function getChainId(client: PublicClient): Promise<GetChainIdResponse>;
225
-
226
299
  type GetFeeHistoryArgs = {
227
300
  blockCount: number;
228
301
  rewardPercentiles: number[];
@@ -633,6 +706,46 @@ type PublicActions<TChain extends Chain = Chain> = {
633
706
  watchPendingTransactions: (args: WatchPendingTransactionsArgs) => ReturnType<typeof watchPendingTransactions>;
634
707
  };
635
708
 
709
+ type WalletClientConfig<TTransport extends Transport = Transport, TChain extends Chain = Chain> = {
710
+ chain?: ClientConfig<TTransport, TChain>['chain'];
711
+ /** The key of the Wallet Client. */
712
+ key?: ClientConfig['key'];
713
+ /** The name of the Wallet Client. */
714
+ name?: ClientConfig['name'];
715
+ /** Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. */
716
+ pollingInterval?: ClientConfig['pollingInterval'];
717
+ transport: ClientConfig<TTransport, TChain>['transport'];
718
+ };
719
+ type WalletClient<TTransport extends Transport = Transport, TChain extends Chain = Chain, TIncludeActions extends boolean = true> = Client<TTransport, TChain, SignableRequests & WalletRequests> & (TIncludeActions extends true ? WalletActions<TChain> : {});
720
+ /**
721
+ * @description Creates a wallet client with a given transport.
722
+ *
723
+ * - Only has access to "wallet" & "signable" EIP-1474 RPC methods
724
+ * (ie. `eth_sendTransaction`, `eth_requestAccounts`, etc).
725
+ *
726
+ * @example
727
+ * import { createWalletClient, custom } from 'viem'
728
+ * const client = createWalletClient(
729
+ * custom(window.ethereum)
730
+ * )
731
+ */
732
+ declare function createWalletClient<TTransport extends Transport, TChain extends Chain>({ transport, key, name, pollingInterval, }: WalletClientConfig<TTransport, TChain>): WalletClient<TTransport, TChain, true>;
733
+
734
+ type WalletActions<TChain extends Chain = Chain> = {
735
+ addChain: (args: AddChainArgs) => Promise<void>;
736
+ deployContract: <TAbi extends Abi | readonly unknown[]>(args: DeployContractArgs<TChain, TAbi>) => Promise<DeployContractResponse>;
737
+ getAccounts: () => Promise<GetAccountsResponse>;
738
+ getChainId: () => Promise<GetChainIdResponse>;
739
+ getPermissions: () => Promise<GetPermissionsResponse>;
740
+ requestAccounts: () => Promise<RequestAccountsResponse>;
741
+ requestPermissions: (args: RequestPermissionsArgs) => Promise<RequestPermissionsResponse>;
742
+ sendTransaction: (args: SendTransactionArgs<TChain>) => Promise<SendTransactionResponse>;
743
+ signMessage: (args: SignMessageArgs) => Promise<SignMessageResponse>;
744
+ switchChain: (args: SwitchChainArgs) => Promise<void>;
745
+ watchAsset: (args: WatchAssetArgs) => Promise<WatchAssetResponse>;
746
+ writeContract: <TAbi extends Abi | readonly unknown[], TFunctionName extends string>(args: WriteContractArgs<TChain, TAbi, TFunctionName>) => Promise<WriteContractResponse>;
747
+ };
748
+
636
749
  type PublicClientConfig<TTransport extends Transport = Transport, TChain extends Chain = Chain> = Pick<ClientConfig<TTransport, TChain>, 'chain' | 'key' | 'name' | 'pollingInterval' | 'transport'>;
637
750
  type PublicClient<TTransport extends Transport = Transport, TChain extends Chain = Chain, TIncludeActions extends boolean = true> = Client<TTransport, TChain, PublicRequests> & (TIncludeActions extends true ? PublicActions<TChain> : {});
638
751
  /**
@@ -647,4 +760,4 @@ type PublicClient<TTransport extends Transport = Transport, TChain extends Chain
647
760
  */
648
761
  declare function createPublicClient<TTransport extends Transport, TChain extends Chain>({ chain, key, name, transport, pollingInterval, }: PublicClientConfig<TTransport, TChain>): PublicClient<TTransport, TChain, true>;
649
762
 
650
- export { getFilterChanges as $, GetEnsNameArgs as A, BlockFormatter as B, CallArgs as C, getEnsAddress as D, EstimateGasArgs as E, FormattedBlock as F, GetBytecodeArgs as G, getEnsName as H, call as I, createBlockFilter as J, createEventFilter as K, createPendingTransactionFilter as L, MulticallArgs as M, estimateGas as N, OnLogs as O, PublicClient as P, getBalance as Q, ReadContractArgs as R, SimulateContractArgs as S, TransactionReceiptFormatter as T, getBlock as U, getBlockNumber as V, WatchContractEventArgs as W, getBlockNumberCache as X, getBlockTransactionCount as Y, getChainId as Z, getFeeHistory as _, PublicClientConfig as a, getFilterLogs as a0, getLogs as a1, getGasPrice as a2, getTransaction as a3, getTransactionConfirmations as a4, getTransactionReceipt as a5, uninstallFilter as a6, waitForTransactionReceipt as a7, watchBlockNumber as a8, watchBlocks as a9, GetTransactionReceiptArgs as aA, GetTransactionReceiptResponse as aB, GetTransactionResponse as aC, OnBlock as aD, OnBlockNumber as aE, OnBlockNumberResponse as aF, OnBlockResponse as aG, OnTransactions as aH, OnTransactionsResponse as aI, ReplacementReason as aJ, ReplacementResponse as aK, UninstallFilterArgs as aL, UninstallFilterResponse as aM, WaitForTransactionReceiptArgs as aN, WaitForTransactionReceiptResponse as aO, WatchBlockNumberArgs as aP, WatchBlocksArgs as aQ, WatchPendingTransactionsArgs as aR, watchEvent as aa, watchPendingTransactions as ab, CallResponse as ac, CreateBlockFilterResponse as ad, CreateEventFilterArgs as ae, CreateEventFilterResponse as af, CreatePendingTransactionFilterResponse as ag, EstimateGasResponse as ah, GetBalanceArgs as ai, GetBalanceResponse as aj, GetBlockArgs as ak, GetBlockNumberArgs as al, GetBlockNumberResponse as am, GetBlockResponse as an, GetBlockTransactionCountArgs as ao, GetBlockTransactionCountResponse as ap, GetFeeHistoryArgs as aq, GetFeeHistoryResponse as ar, GetFilterChangesArgs as as, GetFilterChangesResponse as at, GetFilterLogsArgs as au, GetFilterLogsResponse as av, GetGasPriceResponse as aw, GetTransactionArgs as ax, GetTransactionConfirmationsArgs as ay, GetTransactionConfirmationsResponse as az, FormattedTransactionReceipt as b, createPublicClient as c, defineBlock as d, defineTransactionReceipt as e, formatBlock as f, CreateContractEventFilterArgs as g, CreateContractEventFilterResponse as h, EstimateContractGasArgs as i, EstimateContractGasResponse as j, GetBytecodeResponse as k, GetStorageAtArgs as l, GetStorageAtResponse as m, MulticallResponse as n, OnLogsResponse as o, ReadContractResponse as p, SimulateContractResponse as q, createContractEventFilter as r, estimateContractGas as s, getBytecode as t, getStorageAt as u, multicall as v, readContract as w, simulateContract as x, watchContractEvent as y, GetEnsAddressArgs as z };
763
+ export { getEnsAddress as $, estimateContractGas as A, BlockFormatter as B, CallArgs as C, getBytecode as D, EstimateGasArgs as E, FormattedBlock as F, GetBytecodeArgs as G, getStorageAt as H, multicall as I, readContract as J, simulateContract as K, watchContractEvent as L, MulticallArgs as M, DeployContractArgs as N, OnLogs as O, PublicClient as P, DeployContractResponse as Q, ReadContractArgs as R, SendTransactionArgs as S, TransactionReceiptFormatter as T, WriteContractArgs as U, WriteContractResponse as V, WalletClient as W, deployContract as X, writeContract as Y, GetEnsAddressArgs as Z, GetEnsNameArgs as _, PublicClientConfig as a, WaitForTransactionReceiptArgs as a$, getEnsName as a0, call as a1, createBlockFilter as a2, createEventFilter as a3, createPendingTransactionFilter as a4, estimateGas as a5, getBalance as a6, getBlock as a7, getBlockNumber as a8, getBlockNumberCache as a9, GetBlockNumberResponse as aA, GetBlockResponse as aB, GetBlockTransactionCountArgs as aC, GetBlockTransactionCountResponse as aD, GetFeeHistoryArgs as aE, GetFeeHistoryResponse as aF, GetFilterChangesArgs as aG, GetFilterChangesResponse as aH, GetFilterLogsArgs as aI, GetFilterLogsResponse as aJ, GetGasPriceResponse as aK, GetTransactionArgs as aL, GetTransactionConfirmationsArgs as aM, GetTransactionConfirmationsResponse as aN, GetTransactionReceiptArgs as aO, GetTransactionReceiptResponse as aP, GetTransactionResponse as aQ, OnBlock as aR, OnBlockNumber as aS, OnBlockNumberResponse as aT, OnBlockResponse as aU, OnTransactions as aV, OnTransactionsResponse as aW, ReplacementReason as aX, ReplacementResponse as aY, UninstallFilterArgs as aZ, UninstallFilterResponse as a_, getBlockTransactionCount as aa, getChainId as ab, getFeeHistory as ac, getFilterChanges as ad, getFilterLogs as ae, getLogs as af, getGasPrice as ag, getTransaction as ah, getTransactionConfirmations as ai, getTransactionReceipt as aj, uninstallFilter as ak, waitForTransactionReceipt as al, watchBlockNumber as am, watchBlocks as an, watchEvent as ao, watchPendingTransactions as ap, CallResponse as aq, CreateBlockFilterResponse as ar, CreateEventFilterArgs as as, CreateEventFilterResponse as at, CreatePendingTransactionFilterResponse as au, EstimateGasResponse as av, GetBalanceArgs as aw, GetBalanceResponse as ax, GetBlockArgs as ay, GetBlockNumberArgs as az, WalletClientConfig as b, WaitForTransactionReceiptResponse as b0, WatchBlockNumberArgs as b1, WatchBlocksArgs as b2, WatchPendingTransactionsArgs as b3, addChain as b4, getAccounts as b5, getPermissions as b6, requestAccounts as b7, requestPermissions as b8, sendTransaction as b9, signMessage as ba, switchChain as bb, watchAsset as bc, AddChainArgs as bd, FormattedTransactionRequest as be, GetPermissionsResponse as bf, GetAccountsResponse as bg, RequestAccountsResponse as bh, RequestPermissionsResponse as bi, SendTransactionResponse as bj, SignMessageArgs as bk, SignMessageResponse as bl, SwitchChainArgs as bm, WatchAssetArgs as bn, WatchAssetResponse as bo, createPublicClient as c, createWalletClient as d, FormattedTransactionReceipt as e, FormattedTransactionRequest$1 as f, TransactionRequestFormatter as g, defineBlock as h, defineTransactionReceipt as i, defineTransactionRequest as j, formatBlock as k, formatTransactionRequest as l, CreateContractEventFilterArgs as m, CreateContractEventFilterResponse as n, EstimateContractGasArgs as o, EstimateContractGasResponse as p, GetBytecodeResponse as q, GetStorageAtArgs as r, GetStorageAtResponse as s, MulticallResponse as t, OnLogsResponse as u, ReadContractResponse as v, SimulateContractArgs as w, SimulateContractResponse as x, WatchContractEventArgs as y, createContractEventFilter as z };
@@ -1,4 +1,4 @@
1
- import { A as Address, a as Hash, a3 as Quantity, s as RpcTransactionRequest, m as RpcBlockNumber, g as BlockTag, l as RpcBlockIdentifier, H as Hex, n as RpcFeeHistory, R as RpcBlock, p as RpcLog, a6 as LogTopic, q as RpcTransaction, r as RpcTransactionReceipt, t as RpcUncle } from './chain-4a0d4164.js';
1
+ import { A as Address, a as Hash, a4 as Quantity, s as RpcTransactionRequest, m as RpcBlockNumber, g as BlockTag, l as RpcBlockIdentifier, H as Hex, n as RpcFeeHistory, R as RpcBlock, p as RpcLog, a8 as LogTopic, q as RpcTransaction, r as RpcTransactionReceipt, t as RpcUncle } from './chain-7b7ac245.js';
2
2
 
3
3
  declare class RpcError extends Error {
4
4
  code: number;
@@ -914,6 +914,16 @@ type WalletRequests = {
914
914
  method: 'eth_accounts';
915
915
  params?: never;
916
916
  }): Promise<Address[]>;
917
+ request(args: {
918
+ /**
919
+ * @description Returns the current chain ID associated with the wallet.
920
+ * @example
921
+ * provider.request({ method: 'eth_chainId' })
922
+ * // => '1'
923
+ */
924
+ method: 'eth_chainId';
925
+ params?: never;
926
+ }): Promise<Quantity>;
917
927
  request(args: {
918
928
  /**
919
929
  * @description Requests that the user provides an Ethereum address to be identified by. Typically causes a browser extension popup to appear.
@@ -1,12 +1,5 @@
1
- import { AbiParameter, Narrow, Abi, AbiParametersToPrimitiveTypes } from 'abitype';
2
- import { H as Hex, b as AbiItem, a6 as LogTopic, a0 as ExtractEventNameFromAbi, a7 as ExtractEventArgsFromTopics, a8 as ExtractFunctionNameFromAbi, a9 as ExtractArgsFromAbi, Z as ExtractResultFromAbi, a4 as ExtractConstructorArgsFromAbi, aa as ExtractErrorNameFromAbi, ab as ExtractErrorArgsFromAbi, a1 as ExtractEventArgsFromAbi, ac as ExtractNameFromAbi } from './chain-4a0d4164.js';
3
- import * as abitype_dist_abi_78346466 from 'abitype/dist/abi-78346466';
4
-
5
- type DecodeAbiArgs<TParams extends readonly AbiParameter[] | readonly unknown[] = readonly AbiParameter[]> = {
6
- data: Hex;
7
- params: Narrow<TParams>;
8
- };
9
- declare function decodeAbi<TParams extends readonly AbiParameter[] | readonly unknown[]>({ data, params }: DecodeAbiArgs<TParams>): readonly unknown[] | undefined;
1
+ import { Abi, Narrow } from 'abitype';
2
+ import { H as Hex, b as AbiItem, a8 as LogTopic, a1 as ExtractEventNameFromAbi, a9 as ExtractEventArgsFromTopics, aa as ExtractFunctionNameFromAbi, a7 as ExtractArgsFromAbi, _ as ExtractResultFromAbi, Y as ExtractConstructorArgsFromAbi, ab as ExtractErrorNameFromAbi, ac as ExtractErrorArgsFromAbi, a2 as ExtractEventArgsFromAbi } from './chain-7b7ac245.js';
10
3
 
11
4
  type DecodeErrorResultArgs = {
12
5
  abi?: Abi;
@@ -47,15 +40,6 @@ type DecodeFunctionResultArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunc
47
40
  type DecodeFunctionResultResponse<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = ExtractResultFromAbi<TAbi, TFunctionName>;
48
41
  declare function decodeFunctionResult<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ abi, args, functionName, data, }: DecodeFunctionResultArgs<TAbi, TFunctionName>): DecodeFunctionResultResponse<TAbi, TFunctionName>;
49
42
 
50
- type EncodeAbiArgs<TParams extends readonly AbiParameter[] | readonly unknown[] = readonly AbiParameter[]> = {
51
- params: Narrow<TParams>;
52
- values: TParams extends readonly AbiParameter[] ? AbiParametersToPrimitiveTypes<TParams> : never;
53
- };
54
- /**
55
- * @description Encodes a list of primitive values into an ABI-encoded hex value.
56
- */
57
- declare function encodeAbi<TParams extends readonly AbiParameter[] | readonly unknown[]>({ params, values }: EncodeAbiArgs<TParams>): `0x${string}`;
58
-
59
43
  type EncodeDeployDataArgs<TAbi extends Abi | readonly unknown[] = Abi> = {
60
44
  abi: Narrow<TAbi>;
61
45
  bytecode: Hex;
@@ -88,10 +72,4 @@ type EncodeFunctionResultArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunc
88
72
  };
89
73
  declare function encodeFunctionResult<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ abi, functionName, result, }: EncodeFunctionResultArgs<TAbi, TFunctionName>): `0x${string}`;
90
74
 
91
- type GetAbiItemArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any> = {
92
- abi: Narrow<TAbi>;
93
- name: ExtractNameFromAbi<TAbi, TFunctionName>;
94
- } & Partial<ExtractArgsFromAbi<TAbi, TFunctionName>>;
95
- declare function getAbiItem<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ abi, args, name }: GetAbiItemArgs<TAbi, TFunctionName>): abitype_dist_abi_78346466.q | abitype_dist_abi_78346466.p | abitype_dist_abi_78346466.o | undefined;
96
-
97
- export { DecodeAbiArgs as D, EncodeAbiArgs as E, GetAbiItemArgs as G, DecodeErrorResultArgs as a, DecodeErrorResultResponse as b, DecodeEventLogArgs as c, DecodeEventLogResponse as d, DecodeFunctionDataArgs as e, DecodeFunctionResultArgs as f, DecodeFunctionResultResponse as g, EncodeDeployDataArgs as h, EncodeErrorResultArgs as i, EncodeEventTopicsArgs as j, EncodeFunctionDataArgs as k, EncodeFunctionResultArgs as l, decodeAbi as m, decodeErrorResult as n, decodeEventLog as o, decodeFunctionData as p, decodeFunctionResult as q, encodeAbi as r, encodeDeployData as s, encodeErrorResult as t, encodeEventTopics as u, encodeFunctionData as v, encodeFunctionResult as w, getAbiItem as x };
75
+ export { DecodeErrorResultArgs as D, EncodeDeployDataArgs as E, DecodeErrorResultResponse as a, DecodeEventLogArgs as b, DecodeEventLogResponse as c, DecodeFunctionDataArgs as d, DecodeFunctionResultArgs as e, DecodeFunctionResultResponse as f, EncodeErrorResultArgs as g, EncodeEventTopicsArgs as h, EncodeFunctionDataArgs as i, EncodeFunctionResultArgs as j, decodeErrorResult as k, decodeEventLog as l, decodeFunctionData as m, decodeFunctionResult as n, encodeDeployData as o, encodeErrorResult as p, encodeEventTopics as q, encodeFunctionData as r, encodeFunctionResult as s };
package/dist/ens.d.ts CHANGED
@@ -1,12 +1,11 @@
1
- export { z as GetEnsAddressArgs, A as GetEnsNameArgs, D as getEnsAddress, H as getEnsName } from './createPublicClient-b5afe6b8.js';
1
+ export { Z as GetEnsAddressArgs, _ as GetEnsNameArgs, $ as getEnsAddress, a0 as getEnsName } from './createPublicClient-4d24afb2.js';
2
2
  export { l as labelhash, n as namehash } from './namehash-88f4639d.js';
3
- import './eip1193-8c021438.js';
4
- import './chain-4a0d4164.js';
3
+ import './eip1193-d538ae6d.js';
4
+ import './chain-7b7ac245.js';
5
5
  import '@wagmi/chains';
6
6
  import 'abitype';
7
7
  import 'ethers@6/types/providers';
8
- import './createClient-8a8b4bf4.js';
9
- import './wallet-5ab86528.js';
8
+ import './createClient-7c715e2c.js';
10
9
 
11
10
  /**
12
11
  * @description Normalizes ENS name
package/dist/ens.js CHANGED
@@ -3,9 +3,9 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkEJEZIHXKjs = require('./chunk-EJEZIHXK.js');
7
- require('./chunk-7ALCXZ5K.js');
8
- require('./chunk-F76TECTY.js');
6
+ var _chunk57YM6E7Ijs = require('./chunk-57YM6E7I.js');
7
+ require('./chunk-3FT7UKPT.js');
8
+ require('./chunk-HQCSH22G.js');
9
9
 
10
10
  // src/utils/ens/normalize.ts
11
11
  var _idnauts46hx = require('idna-uts46-hx');
@@ -18,5 +18,5 @@ function normalize(name) {
18
18
 
19
19
 
20
20
 
21
- exports.getEnsAddress = _chunkEJEZIHXKjs.getEnsAddress; exports.getEnsName = _chunkEJEZIHXKjs.getEnsName; exports.labelhash = _chunkEJEZIHXKjs.labelhash; exports.namehash = _chunkEJEZIHXKjs.namehash; exports.normalize = normalize;
21
+ exports.getEnsAddress = _chunk57YM6E7Ijs.getEnsAddress; exports.getEnsName = _chunk57YM6E7Ijs.getEnsName; exports.labelhash = _chunk57YM6E7Ijs.labelhash; exports.namehash = _chunk57YM6E7Ijs.namehash; exports.normalize = normalize;
22
22
  //# sourceMappingURL=ens.js.map
package/dist/ens.mjs CHANGED
@@ -3,9 +3,9 @@ import {
3
3
  getEnsName,
4
4
  labelhash,
5
5
  namehash
6
- } from "./chunk-KQQLLKZV.mjs";
7
- import "./chunk-VHZHROXW.mjs";
8
- import "./chunk-VP57P6CD.mjs";
6
+ } from "./chunk-5NDMORWZ.mjs";
7
+ import "./chunk-WQDVW7EJ.mjs";
8
+ import "./chunk-PBW4YL37.mjs";
9
9
 
10
10
  // src/utils/ens/normalize.ts
11
11
  import { toUnicode } from "idna-uts46-hx";
@@ -1,4 +1,4 @@
1
- import { b as AbiItem } from './chain-4a0d4164.js';
1
+ import { b as AbiItem } from './chain-7b7ac245.js';
2
2
 
3
3
  declare function formatAbiItemWithArgs({ abiItem, args, includeFunctionName, includeName, }: {
4
4
  abiItem: AbiItem;
@@ -0,0 +1,22 @@
1
+ import { AbiParameter, AbiParametersToPrimitiveTypes, Narrow, Abi } from 'abitype';
2
+ import { H as Hex, a6 as ExtractNameFromAbi, a7 as ExtractArgsFromAbi } from './chain-7b7ac245.js';
3
+
4
+ type DecodeAbiParametersResponse<TParams extends readonly AbiParameter[] | readonly unknown[] = readonly AbiParameter[]> = AbiParametersToPrimitiveTypes<TParams extends readonly AbiParameter[] ? TParams : AbiParameter[]>;
5
+ declare function decodeAbiParameters<TParams extends readonly AbiParameter[] | readonly unknown[]>(params: Narrow<TParams>, data: Hex): DecodeAbiParametersResponse<TParams>;
6
+
7
+ type EncodeAbiParametersResponse = Hex;
8
+ /**
9
+ * @description Encodes a list of primitive values into an ABI-encoded hex value.
10
+ */
11
+ declare function encodeAbiParameters<TParams extends readonly AbiParameter[] | readonly unknown[]>(params: Narrow<TParams>, values: TParams extends readonly AbiParameter[] ? AbiParametersToPrimitiveTypes<TParams> : never): EncodeAbiParametersResponse;
12
+
13
+ type GetAbiItemArgs<TAbi extends Abi | readonly unknown[] = Abi, TItemName extends string = string> = {
14
+ abi: Narrow<TAbi>;
15
+ name: ExtractNameFromAbi<TAbi, TItemName>;
16
+ } & Partial<ExtractArgsFromAbi<TAbi, TItemName>>;
17
+ type GetAbiItemResponse<TAbi extends Abi | readonly unknown[] = Abi, TItemName extends string = string> = Extract<TAbi[number], {
18
+ name: TItemName;
19
+ }>;
20
+ declare function getAbiItem<TAbi extends Abi | readonly unknown[], TItemName extends string, TResponse = GetAbiItemResponse<TAbi, TItemName>>({ abi, args, name }: GetAbiItemArgs<TAbi, TItemName>): TResponse;
21
+
22
+ export { DecodeAbiParametersResponse as D, EncodeAbiParametersResponse as E, GetAbiItemArgs as G, decodeAbiParameters as d, encodeAbiParameters as e, getAbiItem as g };
package/dist/index.d.ts CHANGED
@@ -1,21 +1,20 @@
1
- import { T as TransportConfig, a as Transport, B as BaseRpcRequests } from './createClient-8a8b4bf4.js';
2
- export { C as Client, b as ClientConfig, a as Transport, T as TransportConfig, c as createClient, d as createTransport } from './createClient-8a8b4bf4.js';
3
- import { B as BaseError, H as HttpOptions, R as RpcResponse } from './parseGwei-ce3a9dfa.js';
4
- export { B as BaseError, C as CallExecutionError, a as ContractFunctionExecutionError, b as ContractFunctionRevertedError, c as ContractFunctionZeroDataError, E as EstimateGasExecutionError, d as ExecutionRevertedError, F as FeeCapTooHighError, e as FeeCapTooLowError, G as GetContractAddressOptions, o as GetCreate2AddressOptions, p as GetCreateAddressOptions, I as InsufficientFundsError, f as IntrinsicGasTooHighError, g as IntrinsicGasTooLowError, N as NonceMaxValueError, h as NonceTooHighError, i as NonceTooLowError, j as RawContractError, T as TipAboveFeeCapError, q as ToRlpResponse, k as TransactionExecutionError, m as TransactionNotFoundError, n as TransactionReceiptNotFoundError, l as TransactionTypeNotSupportedError, U as UnknownNodeError, W as WaitForTransactionReceiptTimeoutError, r as boolToBytes, s as boolToHex, t as bytesToBigint, u as bytesToBool, v as bytesToHex, w as bytesToNumber, x as bytesToString, y as etherUnits, z as formatEther, A as formatGwei, D as formatUnit, J as fromBytes, K as fromHex, L as fromRlp, M as getAddress, O as getContractAddress, P as getContractError, Q as getCreate2Address, S as getCreateAddress, V as getEventSelector, X as getFunctionSelector, Y as gweiUnits, Z as hexToBigInt, _ as hexToBool, $ as hexToBytes, a0 as hexToNumber, a1 as hexToString, a2 as isAddress, a3 as isAddressEqual, a4 as isBytes, a5 as isHex, a6 as keccak256, a7 as numberToBytes, a8 as numberToHex, a9 as pad, aa as padBytes, ab as padHex, ac as parseEther, ad as parseGwei, ae as parseUnit, af as size, ag as slice, ah as sliceBytes, ai as sliceHex, aj as stringToBytes, ak as stringToHex, al as stringify, am as toBytes, an as toHex, ao as toRlp, ap as trim, aq as weiUnits } from './parseGwei-ce3a9dfa.js';
1
+ import { T as TransportConfig, a as Transport, B as BaseRpcRequests } from './createClient-7c715e2c.js';
2
+ export { C as Client, b as ClientConfig, a as Transport, T as TransportConfig, c as createClient, d as createTransport } from './createClient-7c715e2c.js';
3
+ import { B as BaseError, H as HttpOptions, R as RpcResponse } from './parseGwei-ad6d1914.js';
4
+ export { B as BaseError, C as CallExecutionError, a as ContractFunctionExecutionError, b as ContractFunctionRevertedError, c as ContractFunctionZeroDataError, E as EstimateGasExecutionError, d as ExecutionRevertedError, F as FeeCapTooHighError, e as FeeCapTooLowError, G as GetContractAddressOptions, o as GetCreate2AddressOptions, p as GetCreateAddressOptions, I as InsufficientFundsError, f as IntrinsicGasTooHighError, g as IntrinsicGasTooLowError, N as NonceMaxValueError, h as NonceTooHighError, i as NonceTooLowError, j as RawContractError, T as TipAboveFeeCapError, q as ToRlpResponse, k as TransactionExecutionError, m as TransactionNotFoundError, n as TransactionReceiptNotFoundError, l as TransactionTypeNotSupportedError, U as UnknownNodeError, W as WaitForTransactionReceiptTimeoutError, r as boolToBytes, s as boolToHex, t as bytesToBigint, u as bytesToBool, v as bytesToHex, w as bytesToNumber, x as bytesToString, y as etherUnits, z as formatEther, A as formatGwei, D as formatUnit, J as fromBytes, K as fromHex, L as fromRlp, M as getAddress, O as getContractAddress, P as getContractError, Q as getCreate2Address, S as getCreateAddress, V as getEventSelector, X as getFunctionSelector, Y as gweiUnits, Z as hexToBigInt, _ as hexToBool, $ as hexToBytes, a0 as hexToNumber, a1 as hexToString, a2 as isAddress, a3 as isAddressEqual, a4 as isBytes, a5 as isHex, a6 as keccak256, a7 as numberToBytes, a8 as numberToHex, a9 as pad, aa as padBytes, ab as padHex, ac as parseEther, ad as parseGwei, ae as parseUnit, af as size, ag as slice, ah as sliceBytes, ai as sliceHex, aj as stringToBytes, ak as stringToHex, al as stringify, am as toBytes, an as toHex, ao as toRlp, ap as trim, aq as weiUnits } from './parseGwei-ad6d1914.js';
5
5
  import WebSocket from 'isomorphic-ws';
6
- import { H as Hex, a as Hash, C as Chain, B as ByteArray } from './chain-4a0d4164.js';
7
- export { b as AbiItem, c as AccessList, A as Address, d as Block, e as BlockIdentifier, f as BlockNumber, g as BlockTag, B as ByteArray, C as Chain, h as ContractConfig, J as ExtractFormatter, F as FeeHistory, i as FeeValues, j as FeeValuesEIP1559, k as FeeValuesLegacy, K as Formatted, M as FormattedTransaction, 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, t as RpcUncle, z as Transaction, D as TransactionBase, E as TransactionEIP1559, G as TransactionEIP2930, N as TransactionFormatter, I as TransactionLegacy, T as TransactionReceipt, u as TransactionRequest, v as TransactionRequestBase, w as TransactionRequestEIP1559, x as TransactionRequestEIP2930, y as TransactionRequestLegacy, U as Uncle, O as defineTransaction, P as formatTransaction, Q as transactionType } from './chain-4a0d4164.js';
8
- export { B as BlockFormatter, F as FormattedBlock, b as FormattedTransactionReceipt, P as PublicClient, a as PublicClientConfig, T as TransactionReceiptFormatter, c as createPublicClient, d as defineBlock, e as defineTransactionReceipt, f as formatBlock } from './createPublicClient-b5afe6b8.js';
9
- export { T as TestClient, a as TestClientConfig, c as createTestClient } from './test-5d5828c9.js';
10
- export { F as FormattedTransactionRequest, T as TransactionRequestFormatter, W as WalletClient, a as WalletClientConfig, c as createWalletClient, d as defineTransactionRequest, f as formatTransactionRequest } from './wallet-5ab86528.js';
6
+ import { H as Hex, a as Hash, C as Chain, B as ByteArray } from './chain-7b7ac245.js';
7
+ export { b as AbiItem, c as AccessList, A as Address, d as Block, e as BlockIdentifier, f as BlockNumber, g as BlockTag, B as ByteArray, C as Chain, h as ContractConfig, J as ExtractFormatter, F as FeeHistory, i as FeeValues, j as FeeValuesEIP1559, k as FeeValuesLegacy, K as Formatted, M as FormattedTransaction, 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, t as RpcUncle, z as Transaction, D as TransactionBase, E as TransactionEIP1559, G as TransactionEIP2930, N as TransactionFormatter, I as TransactionLegacy, T as TransactionReceipt, u as TransactionRequest, v as TransactionRequestBase, w as TransactionRequestEIP1559, x as TransactionRequestEIP2930, y as TransactionRequestLegacy, U as Uncle, O as defineTransaction, P as formatTransaction, Q as transactionType } from './chain-7b7ac245.js';
8
+ export { B as BlockFormatter, F as FormattedBlock, e as FormattedTransactionReceipt, f as FormattedTransactionRequest, P as PublicClient, a as PublicClientConfig, T as TransactionReceiptFormatter, g as TransactionRequestFormatter, W as WalletClient, b as WalletClientConfig, c as createPublicClient, d as createWalletClient, h as defineBlock, i as defineTransactionReceipt, j as defineTransactionRequest, k as formatBlock, l as formatTransactionRequest } from './createPublicClient-4d24afb2.js';
9
+ export { T as TestClient, a as TestClientConfig, c as createTestClient } from './test-8646fb50.js';
11
10
  export { l as labelhash, n as namehash } from './namehash-88f4639d.js';
12
- export { D as DecodeAbiArgs, a as DecodeErrorResultArgs, b as DecodeErrorResultResponse, c as DecodeEventLogArgs, d as DecodeEventLogResponse, e as DecodeFunctionDataArgs, f as DecodeFunctionResultArgs, g as DecodeFunctionResultResponse, E as EncodeAbiArgs, h as EncodeDeployDataArgs, i as EncodeErrorResultArgs, j as EncodeEventTopicsArgs, k as EncodeFunctionDataArgs, l as EncodeFunctionResultArgs, G as GetAbiItemArgs, m as decodeAbi, n as decodeErrorResult, o as decodeEventLog, p as decodeFunctionData, q as decodeFunctionResult, r as encodeAbi, s as encodeDeployData, t as encodeErrorResult, u as encodeEventTopics, v as encodeFunctionData, w as encodeFunctionResult, x as getAbiItem } from './getAbiItem-d7aa40b1.js';
13
- export { d as defineChain } from './chain-ce6e149c.js';
14
- import './eip1193-8c021438.js';
11
+ export { D as DecodeAbiParametersResponse, E as EncodeAbiParametersResponse, G as GetAbiItemArgs, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from './getAbiItem-c9cbc8b8.js';
12
+ export { D as DecodeErrorResultArgs, a as DecodeErrorResultResponse, b as DecodeEventLogArgs, c as DecodeEventLogResponse, d as DecodeFunctionDataArgs, e as DecodeFunctionResultArgs, f as DecodeFunctionResultResponse, E as EncodeDeployDataArgs, g as EncodeErrorResultArgs, h as EncodeEventTopicsArgs, i as EncodeFunctionDataArgs, j as EncodeFunctionResultArgs, k as decodeErrorResult, l as decodeEventLog, m as decodeFunctionData, n as decodeFunctionResult, o as encodeDeployData, p as encodeErrorResult, q as encodeEventTopics, r as encodeFunctionData, s as encodeFunctionResult } from './encodeFunctionResult-f59f4cfe.js';
13
+ export { d as defineChain } from './chain-145cfaf3.js';
14
+ import './eip1193-d538ae6d.js';
15
15
  import 'abitype';
16
16
  import '@wagmi/chains';
17
17
  import 'ethers@6/types/providers';
18
- import 'abitype/dist/abi-78346466';
19
18
 
20
19
  declare class AbiConstructorNotFoundError extends BaseError {
21
20
  name: string;