viem 0.0.1-alpha.3 → 0.0.1-alpha.31

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 (101) hide show
  1. package/chains/package.json +1 -1
  2. package/contract/package.json +4 -0
  3. package/dist/chain-00b37e4e.d.ts +543 -0
  4. package/dist/chain-38182d92.d.ts +5 -0
  5. package/dist/chains.d.ts +1305 -74
  6. package/dist/chains.js +125 -130
  7. package/dist/chains.js.map +1 -0
  8. package/dist/chains.mjs +129 -0
  9. package/dist/chains.mjs.map +1 -0
  10. package/dist/chunk-5STAX3WF.js +265 -0
  11. package/dist/chunk-5STAX3WF.js.map +1 -0
  12. package/dist/chunk-6ZFIUYGC.mjs +3436 -0
  13. package/dist/chunk-6ZFIUYGC.mjs.map +1 -0
  14. package/dist/chunk-APXHGB76.mjs +197 -0
  15. package/dist/chunk-APXHGB76.mjs.map +1 -0
  16. package/dist/chunk-C54QK7K3.mjs +210 -0
  17. package/dist/chunk-C54QK7K3.mjs.map +1 -0
  18. package/dist/{chunk-YZEQFYZ3.js → chunk-IBWRBL2I.mjs} +725 -556
  19. package/dist/chunk-IBWRBL2I.mjs.map +1 -0
  20. package/dist/chunk-J7QHQ26Y.js +3436 -0
  21. package/dist/chunk-J7QHQ26Y.js.map +1 -0
  22. package/dist/chunk-MYFKW55L.js +210 -0
  23. package/dist/chunk-MYFKW55L.js.map +1 -0
  24. package/dist/chunk-NCPBWOQA.js +1216 -0
  25. package/dist/chunk-NCPBWOQA.js.map +1 -0
  26. package/dist/chunk-QBB3DFIB.mjs +265 -0
  27. package/dist/chunk-QBB3DFIB.mjs.map +1 -0
  28. package/dist/chunk-UUULPQHV.js +197 -0
  29. package/dist/chunk-UUULPQHV.js.map +1 -0
  30. package/dist/contract.d.ts +11 -0
  31. package/dist/contract.js +57 -0
  32. package/dist/contract.js.map +1 -0
  33. package/dist/contract.mjs +57 -0
  34. package/dist/contract.mjs.map +1 -0
  35. package/dist/createClient-5258d590.d.ts +70 -0
  36. package/dist/createPublicClient-99be385b.d.ts +650 -0
  37. package/dist/{eip1193-8b4d90ce.d.ts → eip1193-fcdeee04.d.ts} +13 -10
  38. package/dist/ens.d.ts +22 -0
  39. package/dist/ens.js +22 -0
  40. package/dist/ens.js.map +1 -0
  41. package/dist/ens.mjs +22 -0
  42. package/dist/ens.mjs.map +1 -0
  43. package/dist/formatAbiItem-50cb39d8.d.ts +14 -0
  44. package/dist/getAbiItem-6d4f64d2.d.ts +97 -0
  45. package/dist/index.d.ts +251 -67
  46. package/dist/index.js +769 -344
  47. package/dist/index.js.map +1 -0
  48. package/dist/index.mjs +769 -0
  49. package/dist/index.mjs.map +1 -0
  50. package/dist/namehash-88f4639d.d.ts +22 -0
  51. package/dist/parseGwei-8af7a0a6.d.ts +509 -0
  52. package/dist/public.d.ts +29 -0
  53. package/dist/public.js +60 -0
  54. package/dist/public.js.map +1 -0
  55. package/dist/public.mjs +60 -0
  56. package/dist/public.mjs.map +1 -0
  57. package/dist/test-79ec416c.d.ts +213 -0
  58. package/dist/test.d.ts +20 -0
  59. package/dist/test.js +62 -0
  60. package/dist/test.js.map +1 -0
  61. package/dist/test.mjs +62 -0
  62. package/dist/test.mjs.map +1 -0
  63. package/dist/utils/index.d.ts +52 -7
  64. package/dist/utils/index.js +187 -126
  65. package/dist/utils/index.js.map +1 -0
  66. package/dist/utils/index.mjs +187 -0
  67. package/dist/utils/index.mjs.map +1 -0
  68. package/dist/wallet-cf5c8351.d.ts +115 -0
  69. package/dist/wallet.d.ts +7 -0
  70. package/dist/wallet.js +24 -0
  71. package/dist/wallet.js.map +1 -0
  72. package/dist/wallet.mjs +24 -0
  73. package/dist/wallet.mjs.map +1 -0
  74. package/dist/window.d.ts +5 -2
  75. package/dist/window.js +1 -0
  76. package/dist/window.js.map +1 -0
  77. package/dist/window.mjs +1 -0
  78. package/dist/window.mjs.map +1 -0
  79. package/ens/package.json +4 -0
  80. package/package.json +46 -73
  81. package/public/package.json +4 -0
  82. package/test/package.json +4 -0
  83. package/utils/package.json +1 -1
  84. package/wallet/package.json +4 -0
  85. package/window/package.json +1 -1
  86. package/actions/package.json +0 -4
  87. package/clients/package.json +0 -4
  88. package/dist/actions/index.d.ts +0 -7
  89. package/dist/actions/index.js +0 -124
  90. package/dist/chunk-SRDTRROA.js +0 -1214
  91. package/dist/chunk-TLEMV4T3.js +0 -258
  92. package/dist/chunk-WZITKXV3.js +0 -996
  93. package/dist/clients/index.d.ts +0 -7
  94. package/dist/clients/index.js +0 -23
  95. package/dist/createWalletClient-15ad1601.d.ts +0 -130
  96. package/dist/parseGwei-0f85e8ca.d.ts +0 -248
  97. package/dist/rpc-15b85963.d.ts +0 -292
  98. package/dist/rpc-26932bae.d.ts +0 -61
  99. package/dist/transactionRequest-f538ea86.d.ts +0 -44
  100. package/dist/watchAsset-0c9d01e2.d.ts +0 -522
  101. package/dist/webSocket-b55b0951.d.ts +0 -83
@@ -0,0 +1,650 @@
1
+ import { P as PublicRequests } from './eip1193-fcdeee04.js';
2
+ import { a as Transport, b as ClientConfig, C as Client } from './createClient-5258d590.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-00b37e4e.js';
5
+ import { T as TransactionRequestFormatter, b as WriteContractArgs } from './wallet-cf5c8351.js';
6
+
7
+ type BlockFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'block', NonNullable<Formatters['block']>>;
8
+ type FormattedBlock<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, Block>;
9
+ declare function formatBlock(block: Partial<RpcBlock>): Block<bigint, Transaction<bigint, number>>;
10
+ declare const defineBlock: <TFormat extends Formatter<Partial<RpcBlock>, Partial<Block<bigint, Transaction<bigint, number>>> & {
11
+ [key: string]: unknown;
12
+ }>, TExclude extends (keyof RpcBlock)[] = []>({ exclude, format: formatOverride, }: {
13
+ exclude?: TExclude | undefined;
14
+ format?: TFormat | undefined;
15
+ }) => (data: Partial<RpcBlock> & {
16
+ [key: string]: unknown;
17
+ }) => Block<bigint, Transaction<bigint, number>> & ReturnType<TFormat> & { [K in TExclude[number]]: never; };
18
+
19
+ type TransactionReceiptFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'transactionReceipt', NonNullable<Formatters['transactionReceipt']>>;
20
+ type FormattedTransactionReceipt<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, TransactionReceipt>;
21
+ declare const defineTransactionReceipt: <TFormat extends Formatter<Partial<RpcTransactionReceipt>, Partial<TransactionReceipt<bigint, number, "success" | "reverted", TransactionType>> & {
22
+ [key: string]: unknown;
23
+ }>, TExclude extends (keyof RpcTransactionReceipt)[] = []>({ exclude, format: formatOverride, }: {
24
+ exclude?: TExclude | undefined;
25
+ format?: TFormat | undefined;
26
+ }) => (data: Partial<RpcTransactionReceipt> & {
27
+ [key: string]: unknown;
28
+ }) => TransactionReceipt<bigint, number, "success" | "reverted", TransactionType> & ReturnType<TFormat> & { [K in TExclude[number]]: never; };
29
+
30
+ type FormattedCall<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Formatted<TFormatter, TransactionRequest, true>, TransactionRequest>;
31
+ type CallArgs<TChain extends Chain = Chain> = FormattedCall<TransactionRequestFormatter<TChain>> & {
32
+ from?: Address;
33
+ } & ({
34
+ /** The balance of the account at a block number. */
35
+ blockNumber?: bigint;
36
+ blockTag?: never;
37
+ } | {
38
+ blockNumber?: never;
39
+ /** The balance of the account at a block tag. */
40
+ blockTag?: BlockTag;
41
+ });
42
+ type CallResponse = {
43
+ data: Hex | undefined;
44
+ };
45
+ declare function call<TChain extends Chain>(client: PublicClient<any, TChain>, args: CallArgs<TChain>): Promise<CallResponse>;
46
+
47
+ 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
+ value?: GetValue<TAbi, TFunctionName, CallArgs<TChain>['value']>;
49
+ };
50
+ type SimulateContractResponse<TChain extends Chain = Chain, TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = {
51
+ result: ExtractResultFromAbi<TAbi, TFunctionName>;
52
+ request: WriteContractArgs<TChain, TAbi, TFunctionName> & ContractConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'>;
53
+ };
54
+ declare function simulateContract<TChain extends Chain, TAbi extends Abi | readonly unknown[], TFunctionName extends string>(client: PublicClient<any, TChain>, { abi, address, args, functionName, ...callRequest }: SimulateContractArgs<TChain, TAbi, TFunctionName>): Promise<SimulateContractResponse<TChain, TAbi, TFunctionName>>;
55
+
56
+ type CreatePendingTransactionFilterResponse = Filter<'transaction'>;
57
+ declare function createPendingTransactionFilter(client: PublicClient): Promise<CreatePendingTransactionFilterResponse>;
58
+
59
+ type CreateBlockFilterResponse = Filter<'block'>;
60
+ declare function createBlockFilter(client: PublicClient): Promise<CreateBlockFilterResponse>;
61
+
62
+ type CreateEventFilterArgs<TAbiEvent extends AbiEvent | undefined = undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined = undefined> = {
63
+ address?: Address | Address[];
64
+ fromBlock?: BlockNumber | BlockTag;
65
+ toBlock?: BlockNumber | BlockTag;
66
+ } & (MaybeExtractEventArgsFromAbi<TAbi, TEventName> extends infer TEventFilterArgs ? {
67
+ args: TEventFilterArgs | (TArgs extends TEventFilterArgs ? TArgs : never);
68
+ event: TAbiEvent;
69
+ } | {
70
+ args?: never;
71
+ event?: TAbiEvent;
72
+ } | {
73
+ args?: never;
74
+ event?: never;
75
+ } : {
76
+ args?: never;
77
+ event?: never;
78
+ });
79
+ type CreateEventFilterResponse<TAbiEvent extends AbiEvent | undefined = undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined = undefined> = Filter<'event', TAbi, TEventName, TArgs>;
80
+ declare function createEventFilter<TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined = undefined>(client: PublicClient, { address, args, event, fromBlock, toBlock, }?: CreateEventFilterArgs<TAbiEvent, TAbi, TEventName, TArgs>): Promise<CreateEventFilterResponse<TAbiEvent, TAbi, TEventName, TArgs>>;
81
+
82
+ type CreateContractEventFilterArgs<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string | undefined = undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined = undefined> = {
83
+ address?: Address | Address[];
84
+ abi: Narrow<TAbi>;
85
+ eventName?: ExtractEventNameFromAbi<TAbi, TEventName>;
86
+ fromBlock?: BlockNumber | BlockTag;
87
+ toBlock?: BlockNumber | BlockTag;
88
+ } & (undefined extends TEventName ? {
89
+ args?: never;
90
+ } : MaybeExtractEventArgsFromAbi<TAbi, TEventName> extends infer TEventFilterArgs ? {
91
+ args?: TEventFilterArgs | (TArgs extends TEventFilterArgs ? TArgs : never);
92
+ } : {
93
+ args?: never;
94
+ });
95
+ type CreateContractEventFilterResponse<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string | undefined = undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined = undefined> = Filter<'event', TAbi, TEventName, TArgs>;
96
+ declare function createContractEventFilter<TAbi extends Abi | readonly unknown[], TEventName extends string | undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined>(client: PublicClient, { address, abi, args, eventName, fromBlock, toBlock, }: CreateContractEventFilterArgs<TAbi, TEventName, TArgs>): Promise<CreateContractEventFilterResponse<TAbi, TEventName, TArgs>>;
97
+
98
+ type FormattedEstimateGas<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Formatted<TFormatter, TransactionRequest, true>, TransactionRequest>;
99
+ type EstimateGasArgs<TChain extends Chain = Chain> = FormattedEstimateGas<TransactionRequestFormatter<TChain>> & ({
100
+ /** The balance of the account at a block number. */
101
+ blockNumber?: bigint;
102
+ blockTag?: never;
103
+ } | {
104
+ blockNumber?: never;
105
+ /** The balance of the account at a block tag. */
106
+ blockTag?: BlockTag;
107
+ });
108
+ type EstimateGasResponse = bigint;
109
+ /**
110
+ * @description Estimates the gas necessary to complete a transaction without submitting it to the network.
111
+ */
112
+ declare function estimateGas<TChain extends Chain>(client: PublicClient<any, TChain>, args: EstimateGasArgs<TChain>): Promise<EstimateGasResponse>;
113
+
114
+ type EstimateContractGasArgs<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'> & {
115
+ value?: GetValue<TAbi, TFunctionName, CallArgs<TChain>['value']>;
116
+ };
117
+ type EstimateContractGasResponse = bigint;
118
+ declare function estimateContractGas<TChain extends Chain, TAbi extends Abi | readonly unknown[], TFunctionName extends string>(client: PublicClient<any, TChain>, { abi, address, args, functionName, ...request }: EstimateContractGasArgs<TChain, TAbi, TFunctionName>): Promise<EstimateContractGasResponse>;
119
+
120
+ type GetBalanceArgs = {
121
+ /** The address of the account. */
122
+ address: Address;
123
+ } & ({
124
+ /** The balance of the account at a block number. */
125
+ blockNumber?: bigint;
126
+ blockTag?: never;
127
+ } | {
128
+ blockNumber?: never;
129
+ /** The balance of the account at a block tag. */
130
+ blockTag?: BlockTag;
131
+ });
132
+ type GetBalanceResponse = bigint;
133
+ /**
134
+ * @description Returns the balance of an address in wei.
135
+ */
136
+ declare function getBalance(client: PublicClient, { address, blockNumber, blockTag }: GetBalanceArgs): Promise<GetBalanceResponse>;
137
+
138
+ type GetBlockArgs = {
139
+ /** Whether or not to include transaction data in the response. */
140
+ includeTransactions?: boolean;
141
+ } & ({
142
+ /** Hash of the block. */
143
+ blockHash?: Hash;
144
+ blockNumber?: never;
145
+ blockTag?: never;
146
+ } | {
147
+ blockHash?: never;
148
+ /** The block number. */
149
+ blockNumber?: bigint;
150
+ blockTag?: never;
151
+ } | {
152
+ blockHash?: never;
153
+ blockNumber?: never;
154
+ /** The block tag. Defaults to 'latest'. */
155
+ blockTag?: BlockTag;
156
+ });
157
+ type GetBlockResponse<TChain extends Chain = Chain> = FormattedBlock<BlockFormatter<TChain>>;
158
+ declare function getBlock<TChain extends Chain>(client: PublicClient<any, TChain>, { blockHash, blockNumber, blockTag, includeTransactions, }?: GetBlockArgs): Promise<GetBlockResponse<TChain>>;
159
+
160
+ type GetBlockNumberArgs = {
161
+ /** The maximum age (in ms) of the cached value. */
162
+ maxAge?: number;
163
+ };
164
+ type GetBlockNumberResponse = bigint;
165
+ declare function getBlockNumberCache(id: string): {
166
+ clear: () => void;
167
+ promise: {
168
+ clear: () => boolean;
169
+ get: () => Promise<unknown> | undefined;
170
+ set: (data: Promise<unknown>) => Map<string, Promise<unknown>>;
171
+ };
172
+ response: {
173
+ clear: () => boolean;
174
+ get: () => {
175
+ created: Date;
176
+ data: unknown;
177
+ } | undefined;
178
+ set: (data: {
179
+ created: Date;
180
+ data: unknown;
181
+ }) => Map<string, {
182
+ created: Date;
183
+ data: unknown;
184
+ }>;
185
+ };
186
+ };
187
+ /**
188
+ * @description Returns the number of the most recent block seen.
189
+ */
190
+ declare function getBlockNumber(client: PublicClient<any, any, any>, { maxAge }?: GetBlockNumberArgs): Promise<GetBlockNumberResponse>;
191
+
192
+ type GetBlockTransactionCountArgs = {
193
+ /** Hash of the block. */
194
+ blockHash?: Hash;
195
+ blockNumber?: never;
196
+ blockTag?: never;
197
+ } | {
198
+ blockHash?: never;
199
+ /** The block number. */
200
+ blockNumber?: bigint;
201
+ blockTag?: never;
202
+ } | {
203
+ blockHash?: never;
204
+ blockNumber?: never;
205
+ /** The block tag. Defaults to 'latest'. */
206
+ blockTag?: BlockTag;
207
+ };
208
+ type GetBlockTransactionCountResponse = number;
209
+ declare function getBlockTransactionCount<TChain extends Chain>(client: PublicClient<any, TChain>, { blockHash, blockNumber, blockTag, }?: GetBlockTransactionCountArgs): Promise<GetBlockTransactionCountResponse>;
210
+
211
+ type GetBytecodeArgs = {
212
+ address: Address;
213
+ } & ({
214
+ blockNumber?: never;
215
+ blockTag?: BlockTag;
216
+ } | {
217
+ blockNumber?: bigint;
218
+ blockTag?: never;
219
+ });
220
+ type GetBytecodeResponse = Hex | undefined;
221
+ declare function getBytecode(client: PublicClient, { address, blockNumber, blockTag }: GetBytecodeArgs): Promise<GetBytecodeResponse>;
222
+
223
+ type GetChainIdResponse = number;
224
+ declare function getChainId(client: PublicClient): Promise<GetChainIdResponse>;
225
+
226
+ type GetFeeHistoryArgs = {
227
+ blockCount: number;
228
+ rewardPercentiles: number[];
229
+ } & ({
230
+ blockNumber?: never;
231
+ blockTag?: BlockTag;
232
+ } | {
233
+ blockNumber?: bigint;
234
+ blockTag?: never;
235
+ });
236
+ type GetFeeHistoryResponse = FeeHistory;
237
+ /**
238
+ * @description Returns a collection of historical gas information.
239
+ */
240
+ declare function getFeeHistory(client: PublicClient, { blockCount, blockNumber, blockTag, rewardPercentiles, }: GetFeeHistoryArgs): Promise<GetFeeHistoryResponse>;
241
+
242
+ type GetFilterChangesArgs<TFilterType extends FilterType = FilterType, TAbiEvent extends AbiEvent | undefined = undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = {
243
+ filter: Filter<TFilterType, TAbi, TEventName, any>;
244
+ };
245
+ type GetFilterChangesResponse<TFilterType extends FilterType = FilterType, TAbiEvent extends AbiEvent | undefined = undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = TFilterType extends 'event' ? Log<bigint, number, TAbiEvent, TAbi, TEventName>[] : Hash[];
246
+ declare function getFilterChanges<TFilterType extends FilterType, TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined>(client: PublicClient, { filter }: GetFilterChangesArgs<TFilterType, TAbiEvent, TAbi, TEventName>): Promise<GetFilterChangesResponse<TFilterType, TAbiEvent, TAbi, TEventName>>;
247
+
248
+ type GetFilterLogsArgs<TAbiEvent extends AbiEvent | undefined = undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = {
249
+ filter: Filter<'event', TAbi, TEventName, any>;
250
+ };
251
+ type GetFilterLogsResponse<TAbiEvent extends AbiEvent | undefined = undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = Log<bigint, number, TAbiEvent, TAbi, TEventName>[];
252
+ declare function getFilterLogs<TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined>(client: PublicClient, { filter }: GetFilterLogsArgs<TAbiEvent, TAbi, TEventName>): Promise<GetFilterLogsResponse<TAbiEvent, TAbi, TEventName>>;
253
+
254
+ type GetGasPriceResponse = bigint;
255
+ /**
256
+ * @description Returns the current price of gas (in wei).
257
+ */
258
+ declare function getGasPrice(client: PublicClient): Promise<GetGasPriceResponse>;
259
+
260
+ type GetLogsArgs<TAbiEvent extends AbiEvent | undefined = undefined, TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = {
261
+ /** Address or list of addresses from which logs originated */
262
+ address?: Address | Address[];
263
+ } & ({
264
+ event: TAbiEvent;
265
+ args?: MaybeExtractEventArgsFromAbi<[TAbiEvent], TEventName>;
266
+ } | {
267
+ event?: never;
268
+ args?: never;
269
+ }) & ({
270
+ /** Block number or tag after which to include logs */
271
+ fromBlock?: BlockNumber<bigint> | BlockTag;
272
+ /** Block number or tag before which to include logs */
273
+ toBlock?: BlockNumber<bigint> | BlockTag;
274
+ blockHash?: never;
275
+ } | {
276
+ fromBlock?: never;
277
+ toBlock?: never;
278
+ /** Hash of block to include logs from */
279
+ blockHash?: Hash;
280
+ });
281
+ type GetLogsResponse<TAbiEvent extends AbiEvent | undefined = undefined, TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = Log<bigint, number, TAbiEvent, [TAbiEvent], TEventName>[];
282
+ /**
283
+ * @description Returns a collection of event logs.
284
+ */
285
+ declare function getLogs<TAbiEvent extends AbiEvent | undefined>(client: PublicClient, { address, blockHash, fromBlock, toBlock, event, args, }?: GetLogsArgs<TAbiEvent>): Promise<GetLogsResponse<TAbiEvent>>;
286
+
287
+ type GetStorageAtArgs = {
288
+ address: Address;
289
+ slot: Hex;
290
+ } & ({
291
+ blockNumber?: never;
292
+ blockTag?: BlockTag;
293
+ } | {
294
+ blockNumber?: bigint;
295
+ blockTag?: never;
296
+ });
297
+ type GetStorageAtResponse = Hex | undefined;
298
+ declare function getStorageAt(client: PublicClient, { address, blockNumber, blockTag, slot }: GetStorageAtArgs): Promise<GetStorageAtResponse>;
299
+
300
+ type GetTransactionArgs = {
301
+ /** The block hash */
302
+ blockHash: Hash;
303
+ blockNumber?: never;
304
+ blockTag?: never;
305
+ hash?: never;
306
+ /** The index of the transaction on the block. */
307
+ index: number;
308
+ } | {
309
+ blockHash?: never;
310
+ /** The block number */
311
+ blockNumber: bigint;
312
+ blockTag?: never;
313
+ hash?: never;
314
+ /** The index of the transaction on the block. */
315
+ index: number;
316
+ } | {
317
+ blockHash?: never;
318
+ blockNumber?: never;
319
+ /** The block tag. */
320
+ blockTag: BlockTag;
321
+ hash?: never;
322
+ /** The index of the transaction on the block. */
323
+ index: number;
324
+ } | {
325
+ blockHash?: never;
326
+ blockNumber?: never;
327
+ blockTag?: never;
328
+ /** The hash of the transaction. */
329
+ hash: Hash;
330
+ index?: number;
331
+ };
332
+ type GetTransactionResponse<TChain extends Chain = Chain> = FormattedTransaction<TransactionFormatter<TChain>>;
333
+ /** @description Returns information about a transaction given a hash or block identifier. */
334
+ declare function getTransaction<TChain extends Chain>(client: PublicClient<any, TChain>, { blockHash, blockNumber, blockTag, hash, index, }: GetTransactionArgs): Promise<GetTransactionResponse<TChain>>;
335
+
336
+ type GetTransactionConfirmationsArgs<TChain extends Chain = Chain> = {
337
+ /** The transaction hash. */
338
+ hash: Hash;
339
+ transactionReceipt?: never;
340
+ } | {
341
+ hash?: never;
342
+ /** The transaction receipt. */
343
+ transactionReceipt: FormattedTransactionReceipt<TransactionReceiptFormatter<TChain>>;
344
+ };
345
+ type GetTransactionConfirmationsResponse = bigint;
346
+ declare function getTransactionConfirmations<TChain extends Chain>(client: PublicClient<any, TChain>, { hash, transactionReceipt }: GetTransactionConfirmationsArgs<TChain>): Promise<GetTransactionConfirmationsResponse>;
347
+
348
+ type GetTransactionReceiptArgs = {
349
+ /** The hash of the transaction. */
350
+ hash: Hash;
351
+ };
352
+ type GetTransactionReceiptResponse<TChain extends Chain = Chain> = FormattedTransactionReceipt<TransactionReceiptFormatter<TChain>>;
353
+ declare function getTransactionReceipt<TChain extends Chain>(client: PublicClient<any, TChain>, { hash }: GetTransactionReceiptArgs): Promise<Formatted<ExtractFormatter<TChain, "transactionReceipt", Formatter<RpcTransactionReceipt, TransactionReceipt<bigint, number, "success" | "reverted", TransactionType>>>, TransactionReceipt<bigint, number, "success" | "reverted", TransactionType>, false>>;
354
+
355
+ type MAXIMUM_DEPTH = 20;
356
+ type Contract<TAbi extends Abi | readonly unknown[] = Abi | readonly unknown[], TFunctionName extends string = string> = {
357
+ abi: TAbi;
358
+ functionName: TFunctionName;
359
+ };
360
+ type MulticallContracts<TContracts extends Contract[], TProperties extends Record<string, any> = object, Result extends any[] = [], Depth extends ReadonlyArray<number> = []> = Depth['length'] extends MAXIMUM_DEPTH ? (ContractConfig & TProperties)[] : TContracts extends [] ? [] : TContracts extends [infer Head extends Contract] ? [
361
+ ...Result,
362
+ ContractConfig<Head['abi'], Head['functionName']> & TProperties
363
+ ] : TContracts extends [
364
+ infer Head extends Contract,
365
+ ...infer Tail extends Contract[]
366
+ ] ? MulticallContracts<[
367
+ ...Tail
368
+ ], TProperties, [
369
+ ...Result,
370
+ ContractConfig<Head['abi'], Head['functionName']> & TProperties
371
+ ], [
372
+ ...Depth,
373
+ 1
374
+ ]> : unknown[] extends TContracts ? TContracts : TContracts extends ContractConfig<infer TAbi, infer TFunctionName>[] ? (ContractConfig<TAbi, TFunctionName> & TProperties)[] : (ContractConfig & TProperties)[];
375
+ type MulticallResult<Result, TAllowFailure extends boolean = true> = TAllowFailure extends true ? ({
376
+ error?: undefined;
377
+ result: Result;
378
+ status: 'success';
379
+ } | {
380
+ error: Error;
381
+ result?: undefined;
382
+ status: 'error';
383
+ }) : Result;
384
+ type MulticallResults<TContracts extends Contract[], TAllowFailure extends boolean = true, Result extends any[] = [], Depth extends ReadonlyArray<number> = []> = Depth['length'] extends MAXIMUM_DEPTH ? MulticallResult<ExtractResultFromAbi, TAllowFailure>[] : TContracts extends [] ? [] : TContracts extends [infer Head extends Contract] ? [...Result, MulticallResult<ExtractResultFromAbi<Head['abi'], Head['functionName']>, TAllowFailure>] : TContracts extends [
385
+ infer Head extends Contract,
386
+ ...infer Tail extends Contract[]
387
+ ] ? MulticallResults<[
388
+ ...Tail
389
+ ], TAllowFailure, [
390
+ ...Result,
391
+ MulticallResult<ExtractResultFromAbi<Head['abi'], Head['functionName']>, TAllowFailure>
392
+ ], [
393
+ ...Depth,
394
+ 1
395
+ ]> : TContracts extends ContractConfig<infer TAbi, infer TFunctionName>[] ? MulticallResult<ExtractResultFromAbi<TAbi, TFunctionName>, TAllowFailure>[] : MulticallResult<ExtractResultFromAbi, TAllowFailure>[];
396
+
397
+ type MulticallArgs<TContracts extends ContractConfig[] = ContractConfig[], TAllowFailure extends boolean = true> = Pick<CallArgs, 'blockNumber' | 'blockTag'> & {
398
+ allowFailure?: TAllowFailure;
399
+ contracts: readonly [...MulticallContracts<TContracts>];
400
+ multicallAddress: Address;
401
+ };
402
+ type MulticallResponse<TContracts extends ContractConfig[] = ContractConfig[], TAllowFailure extends boolean = true> = MulticallResults<TContracts, TAllowFailure>;
403
+ declare function multicall<TContracts extends ContractConfig[], TAllowFailure extends boolean = true>(client: PublicClient, args: MulticallArgs<TContracts, TAllowFailure>): Promise<MulticallResponse<TContracts, TAllowFailure>>;
404
+
405
+ type ReadContractArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = Pick<CallArgs, 'blockNumber' | 'blockTag'> & ContractConfig<TAbi, TFunctionName, 'view' | 'pure'>;
406
+ type ReadContractResponse<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = ExtractResultFromAbi<TAbi, TFunctionName>;
407
+ declare function readContract<TAbi extends Abi | readonly unknown[], TFunctionName extends string>(client: PublicClient, { abi, address, args, functionName, ...callRequest }: ReadContractArgs<TAbi, TFunctionName>): Promise<ReadContractResponse<TAbi, TFunctionName>>;
408
+
409
+ type UninstallFilterArgs = {
410
+ filter: Filter<any>;
411
+ };
412
+ type UninstallFilterResponse = boolean;
413
+ declare function uninstallFilter(client: PublicClient, { filter }: UninstallFilterArgs): Promise<UninstallFilterResponse>;
414
+
415
+ type ReplacementReason = 'cancelled' | 'replaced' | 'repriced';
416
+ type ReplacementResponse<TChain extends Chain = Chain> = {
417
+ reason: ReplacementReason;
418
+ replacedTransaction: Transaction;
419
+ transaction: Transaction;
420
+ transactionReceipt: GetTransactionReceiptResponse<TChain>;
421
+ };
422
+ type WaitForTransactionReceiptResponse<TChain extends Chain = Chain> = GetTransactionReceiptResponse<TChain>;
423
+ type WaitForTransactionReceiptArgs<TChain extends Chain = Chain> = {
424
+ /** The number of confirmations (blocks that have passed) to wait before resolving. */
425
+ confirmations?: number;
426
+ /** The hash of the transaction. */
427
+ hash: Hash;
428
+ onReplaced?: (response: ReplacementResponse<TChain>) => void;
429
+ /** Polling frequency (in ms). Defaults to the client's pollingInterval config. */
430
+ pollingInterval?: number;
431
+ /** Optional timeout (in milliseconds) to wait before stopping polling. */
432
+ timeout?: number;
433
+ };
434
+ declare function waitForTransactionReceipt<TChain extends Chain>(client: PublicClient<any, TChain>, { confirmations, hash, onReplaced, pollingInterval, timeout, }: WaitForTransactionReceiptArgs<TChain>): Promise<WaitForTransactionReceiptResponse<TChain>>;
435
+
436
+ type OnBlockNumberResponse = GetBlockNumberResponse;
437
+ type OnBlockNumber = (blockNumber: OnBlockNumberResponse, prevBlockNumber: OnBlockNumberResponse | undefined) => void;
438
+ type WatchBlockNumberArgs = {
439
+ /** Whether or not to emit the missed block numbers to the callback. */
440
+ emitMissed?: boolean;
441
+ /** Whether or not to emit the latest block number to the callback when the subscription opens. */
442
+ emitOnBegin?: boolean;
443
+ /** The callback to call when a new block number is received. */
444
+ onBlockNumber: OnBlockNumber;
445
+ /** The callback to call when an error occurred when trying to get for a new block. */
446
+ onError?: (error: Error) => void;
447
+ /** Polling frequency (in ms). Defaults to Client's pollingInterval config. */
448
+ pollingInterval?: number;
449
+ };
450
+ /** @description Watches and returns incoming block numbers. */
451
+ declare function watchBlockNumber(client: PublicClient<any, any, any>, { emitOnBegin, emitMissed, onBlockNumber, onError, pollingInterval, }: WatchBlockNumberArgs): () => void;
452
+
453
+ type OnBlockResponse<TChain extends Chain = Chain, TIncludeTransactions = false> = Omit<GetBlockResponse<TChain>, TIncludeTransactions extends false ? 'transactions' : ''>;
454
+ type OnBlock<TChain extends Chain = Chain, TIncludeTransactions = false> = (block: OnBlockResponse<TChain, TIncludeTransactions>, prevBlock: OnBlockResponse<TChain, TIncludeTransactions> | undefined) => void;
455
+ type WatchBlocksArgs<TChain extends Chain = Chain> = {
456
+ /** The block tag. Defaults to "latest". */
457
+ blockTag?: BlockTag;
458
+ /** Whether or not to emit the missed blocks to the callback. */
459
+ emitMissed?: boolean;
460
+ /** Whether or not to emit the block to the callback when the subscription opens. */
461
+ emitOnBegin?: boolean;
462
+ /** The callback to call when an error occurred when trying to get for a new block. */
463
+ onError?: (error: Error) => void;
464
+ /** Polling frequency (in ms). Defaults to the client's pollingInterval config. */
465
+ pollingInterval?: number;
466
+ } & ({
467
+ /** Whether or not to include transaction data in the response. */
468
+ includeTransactions: true;
469
+ /** The callback to call when a new block is received. */
470
+ onBlock: OnBlock<TChain, true>;
471
+ } | {
472
+ /** Whether or not to include transaction data in the response. */
473
+ includeTransactions?: false;
474
+ /** The callback to call when a new block is received. */
475
+ onBlock: OnBlock<TChain>;
476
+ });
477
+ /** @description Watches and returns information for incoming blocks. */
478
+ declare function watchBlocks<TChain extends Chain, TWatchBlocksArgs extends WatchBlocksArgs<TChain>>(client: PublicClient<any, TChain>, { blockTag, emitMissed, emitOnBegin, onBlock, onError, includeTransactions, pollingInterval, }: TWatchBlocksArgs): () => void;
479
+
480
+ type OnLogsResponse$1<TAbi extends Abi | readonly unknown[] = readonly unknown[], TEventName extends string = string> = TAbi extends Abi ? Log<bigint, number, ExtractAbiEvent<TAbi, TEventName>>[] : Log[];
481
+ type OnLogs$1<TAbi extends Abi | readonly unknown[] = readonly unknown[], TEventName extends string = string> = (logs: OnLogsResponse$1<TAbi, TEventName>) => void;
482
+ type WatchContractEventArgs<TAbi extends Abi | readonly unknown[] = readonly unknown[], TEventName extends string = string> = {
483
+ /** The address of the contract. */
484
+ address?: Address | Address[];
485
+ /** Contract ABI. */
486
+ abi: Narrow<TAbi>;
487
+ args?: ExtractEventArgsFromAbi<TAbi, TEventName>;
488
+ /** Whether or not the event logs should be batched on each invocation. */
489
+ batch?: boolean;
490
+ /** Contract event. */
491
+ eventName?: ExtractEventNameFromAbi<TAbi, TEventName>;
492
+ /** The callback to call when an error occurred when trying to get for a new block. */
493
+ onError?: (error: Error) => void;
494
+ /** The callback to call when new event logs are received. */
495
+ onLogs: OnLogs$1<TAbi, TEventName>;
496
+ /** Polling frequency (in ms). Defaults to Client's pollingInterval config. */
497
+ pollingInterval?: number;
498
+ };
499
+ declare function watchContractEvent<TAbi extends Abi | readonly unknown[], TEventName extends string>(client: PublicClient, { abi, address, args, batch, eventName, onError, onLogs, pollingInterval, }: WatchContractEventArgs<TAbi, TEventName>): () => void;
500
+
501
+ type OnLogsResponse<TAbiEvent extends AbiEvent | undefined = undefined, TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = Log<bigint, number, TAbiEvent, [TAbiEvent], TEventName>[];
502
+ type OnLogs<TAbiEvent extends AbiEvent | undefined = undefined, TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = (logs: OnLogsResponse<TAbiEvent, TEventName>) => void;
503
+ type WatchEventArgs<TAbiEvent extends AbiEvent | undefined = undefined, TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = {
504
+ /** The address of the contract. */
505
+ address?: Address | Address[];
506
+ /** Whether or not the event logs should be batched on each invocation. */
507
+ batch?: boolean;
508
+ /** The callback to call when an error occurred when trying to get for a new block. */
509
+ onError?: (error: Error) => void;
510
+ /** The callback to call when new event logs are received. */
511
+ onLogs: OnLogs<TAbiEvent, TEventName>;
512
+ /** Polling frequency (in ms). Defaults to Client's pollingInterval config. */
513
+ pollingInterval?: number;
514
+ } & ({
515
+ event: TAbiEvent;
516
+ args?: MaybeExtractEventArgsFromAbi<[TAbiEvent], TEventName>;
517
+ } | {
518
+ event?: never;
519
+ args?: never;
520
+ });
521
+ declare function watchEvent<TAbiEvent extends AbiEvent | undefined, TEventName extends string | undefined>(client: PublicClient, { address, args, batch, event, onError, onLogs, pollingInterval, }: WatchEventArgs<TAbiEvent>): () => void;
522
+
523
+ type OnTransactionsResponse = Hash[];
524
+ type OnTransactions = (transactions: OnTransactionsResponse) => void;
525
+ type WatchPendingTransactionsArgs = {
526
+ /** Whether or not the transaction hashes should be batched on each invocation. */
527
+ batch?: boolean;
528
+ /** The callback to call when an error occurred when trying to get for a new block. */
529
+ onError?: (error: Error) => void;
530
+ /** The callback to call when new transactions are received. */
531
+ onTransactions: OnTransactions;
532
+ /** Polling frequency (in ms). Defaults to Client's pollingInterval config. */
533
+ pollingInterval?: number;
534
+ };
535
+ declare function watchPendingTransactions(client: PublicClient, { batch, onError, onTransactions, pollingInterval, }: WatchPendingTransactionsArgs): () => void;
536
+
537
+ type FilterType = 'transaction' | 'block' | 'event';
538
+ type Filter<TFilterType extends FilterType = 'event', TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string | undefined = undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined = MaybeExtractEventArgsFromAbi<TAbi, TEventName>> = {
539
+ id: Hex;
540
+ type: TFilterType;
541
+ } & (TFilterType extends 'event' ? TAbi extends Abi ? undefined extends TEventName ? {
542
+ abi: TAbi;
543
+ args?: never;
544
+ eventName?: never;
545
+ } : TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> ? {
546
+ abi: TAbi;
547
+ args: TArgs;
548
+ eventName: TEventName;
549
+ } : {
550
+ abi: TAbi;
551
+ args?: never;
552
+ eventName: TEventName;
553
+ } : {
554
+ abi?: never;
555
+ args?: never;
556
+ eventName?: never;
557
+ } : {});
558
+
559
+ type GetEnsAddressArgs = Prettify<Pick<ReadContractArgs, 'blockNumber' | 'blockTag'> & {
560
+ /** ENS name to get address. */
561
+ name: string;
562
+ /** Address of ENS Universal Resolver Contract */
563
+ universalResolverAddress?: Address;
564
+ }>;
565
+ type GetEnsAddressResponse = Address;
566
+ /**
567
+ * @description Gets address for ENS name.
568
+ *
569
+ * - Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
570
+ *
571
+ * @example
572
+ * const ensAddress = await getEnsAddress(publicClient, {
573
+ * name: 'wagmi-dev.eth',
574
+ * })
575
+ * // '0xd2135CfB216b74109775236E36d4b433F1DF507B'
576
+ */
577
+ declare function getEnsAddress(client: PublicClient, { blockNumber, blockTag, name, universalResolverAddress: universalResolverAddress_, }: GetEnsAddressArgs): Promise<GetEnsAddressResponse>;
578
+
579
+ type GetEnsNameArgs = Prettify<Pick<ReadContractArgs, 'blockNumber' | 'blockTag'> & {
580
+ /** Address to get ENS name for. */
581
+ address: Address;
582
+ /** Address of ENS Universal Resolver Contract. */
583
+ universalResolverAddress?: Address;
584
+ }>;
585
+ type GetEnsNameResponse = string | null;
586
+ /**
587
+ * @description Gets primary name for specified address.
588
+ *
589
+ * - Calls `reverse(bytes)` on ENS Universal Resolver Contract.
590
+ *
591
+ * @example
592
+ * const ensName = await getEnsName(publicClient, {
593
+ * address: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
594
+ * })
595
+ * // 'wagmi-dev.eth'
596
+ */
597
+ declare function getEnsName(client: PublicClient, { address, blockNumber, blockTag, universalResolverAddress: universalResolverAddress_, }: GetEnsNameArgs): Promise<GetEnsNameResponse>;
598
+
599
+ type PublicActions<TChain extends Chain = Chain> = {
600
+ call: (args: CallArgs<TChain>) => Promise<CallResponse>;
601
+ createBlockFilter: () => Promise<CreateBlockFilterResponse>;
602
+ createContractEventFilter: <TAbi extends Abi | readonly unknown[], TEventName extends string | undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined>(args: CreateContractEventFilterArgs<TAbi, TEventName, TArgs>) => Promise<CreateContractEventFilterResponse<TAbi, TEventName, TArgs>>;
603
+ createEventFilter: <TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined>(args?: CreateEventFilterArgs<TAbiEvent, TAbi, TEventName, TArgs>) => Promise<CreateEventFilterResponse<TAbiEvent, TAbi, TEventName, TArgs>>;
604
+ createPendingTransactionFilter: () => Promise<CreatePendingTransactionFilterResponse>;
605
+ estimateContractGas: <TChain extends Chain, TAbi extends Abi | readonly unknown[], TFunctionName extends string>(args: EstimateContractGasArgs<TChain, TAbi, TFunctionName>) => Promise<EstimateContractGasResponse>;
606
+ estimateGas: (args: EstimateGasArgs<TChain>) => Promise<EstimateGasResponse>;
607
+ getBalance: (args: GetBalanceArgs) => Promise<GetBalanceResponse>;
608
+ getBlock: (args: GetBlockArgs) => Promise<GetBlockResponse<TChain>>;
609
+ getBlockNumber: (args?: GetBlockNumberArgs) => Promise<GetBlockNumberResponse>;
610
+ getBlockTransactionCount: (args?: GetBlockTransactionCountArgs) => Promise<GetBlockTransactionCountResponse>;
611
+ getBytecode: (args: GetBytecodeArgs) => Promise<GetBytecodeResponse>;
612
+ getChainId: () => Promise<GetChainIdResponse>;
613
+ getEnsAddress: (args: GetEnsAddressArgs) => Promise<GetEnsAddressResponse>;
614
+ getEnsName: (args: GetEnsNameArgs) => Promise<GetEnsNameResponse>;
615
+ getFeeHistory: (args: GetFeeHistoryArgs) => Promise<GetFeeHistoryResponse>;
616
+ getFilterChanges: <TFilterType extends FilterType, TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined>(args: GetFilterChangesArgs<TFilterType, TAbiEvent, TAbi, TEventName>) => Promise<GetFilterChangesResponse<TFilterType, TAbiEvent, TAbi, TEventName>>;
617
+ getFilterLogs: <TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined>(args: GetFilterLogsArgs<TAbiEvent, TAbi, TEventName>) => Promise<GetFilterLogsResponse<TAbiEvent, TAbi, TEventName>>;
618
+ getGasPrice: () => Promise<GetGasPriceResponse>;
619
+ getLogs: <TAbiEvent extends AbiEvent | undefined>(args?: GetLogsArgs<TAbiEvent>) => Promise<GetLogsResponse<TAbiEvent>>;
620
+ getStorageAt: (args: GetStorageAtArgs) => Promise<GetStorageAtResponse>;
621
+ getTransaction: (args: GetTransactionArgs) => Promise<GetTransactionResponse<TChain>>;
622
+ getTransactionConfirmations: (args: GetTransactionConfirmationsArgs<TChain>) => Promise<GetTransactionConfirmationsResponse>;
623
+ getTransactionReceipt: (args: GetTransactionReceiptArgs) => Promise<GetTransactionReceiptResponse<TChain>>;
624
+ multicall: <TContracts extends ContractConfig[], TAllowFailure extends boolean = true>(args: MulticallArgs<TContracts, TAllowFailure>) => Promise<MulticallResponse<TContracts, TAllowFailure>>;
625
+ readContract: <TAbi extends Abi | readonly unknown[], TFunctionName extends string>(args: ReadContractArgs<TAbi, TFunctionName>) => Promise<ReadContractResponse>;
626
+ simulateContract: <TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any>(args: SimulateContractArgs<TChain, TAbi, TFunctionName>) => Promise<SimulateContractResponse<TChain, TAbi, TFunctionName>>;
627
+ uninstallFilter: (args: UninstallFilterArgs) => Promise<UninstallFilterResponse>;
628
+ waitForTransactionReceipt: (args: WaitForTransactionReceiptArgs<TChain>) => Promise<WaitForTransactionReceiptResponse<TChain>>;
629
+ watchBlockNumber: (args: WatchBlockNumberArgs) => ReturnType<typeof watchBlockNumber>;
630
+ watchBlocks: (args: WatchBlocksArgs<TChain>) => ReturnType<typeof watchBlocks>;
631
+ watchContractEvent: <TAbi extends Abi | readonly unknown[], TEventName extends string>(args: WatchContractEventArgs<TAbi, TEventName>) => ReturnType<typeof watchContractEvent>;
632
+ watchEvent: <TAbiEvent extends AbiEvent | undefined, TEventName extends string | undefined>(args: WatchEventArgs<TAbiEvent>) => ReturnType<typeof watchEvent>;
633
+ watchPendingTransactions: (args: WatchPendingTransactionsArgs) => ReturnType<typeof watchPendingTransactions>;
634
+ };
635
+
636
+ type PublicClientConfig<TTransport extends Transport = Transport, TChain extends Chain = Chain> = Pick<ClientConfig<TTransport, TChain>, 'chain' | 'key' | 'name' | 'pollingInterval' | 'transport'>;
637
+ type PublicClient<TTransport extends Transport = Transport, TChain extends Chain = Chain, TIncludeActions extends boolean = true> = Client<TTransport, TChain, PublicRequests> & (TIncludeActions extends true ? PublicActions<TChain> : {});
638
+ /**
639
+ * @description Creates a public client with a given transport.
640
+ *
641
+ * - Only has access to "public" EIP-1474 RPC methods (ie. `eth_blockNumber`, etc).
642
+ *
643
+ * @example
644
+ * import { mainnet } from 'viem/chains'
645
+ * import { createPublicClient, http } from 'viem/clients'
646
+ * const client = createPublicClient({ transport: http('https://...') })
647
+ */
648
+ declare function createPublicClient<TTransport extends Transport, TChain extends Chain>({ chain, key, name, transport, pollingInterval, }: PublicClientConfig<TTransport, TChain>): PublicClient<TTransport, TChain, true>;
649
+
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 };