viem 0.2.0-0-2-0.20230328T054201 → 0.2.0-0-2-0.20230328T231949
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abi.d.ts +3 -3
- package/dist/abi.js +2 -2
- package/dist/abi.mjs +1 -1
- package/dist/accounts/index.d.ts +4 -4
- package/dist/accounts/index.js +17 -17
- package/dist/accounts/index.mjs +2 -2
- package/dist/{chain-4af995bf.d.ts → chain-5b28fc53.d.ts} +2 -2
- package/dist/{chain-40443542.d.ts → chain-e9b996ff.d.ts} +1 -1
- package/dist/chains.d.ts +3 -3
- package/dist/chains.js +63 -63
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-OW7TKT7L.js → chunk-564BCC7H.js} +3 -5
- package/dist/chunk-564BCC7H.js.map +1 -0
- package/dist/{chunk-UK6FAD4V.mjs → chunk-7QEOFHC7.mjs} +2 -2
- package/dist/{chunk-DFMQLPHS.mjs → chunk-BJ5KRDTG.mjs} +2 -2
- package/dist/{chunk-FZPFAAOJ.js → chunk-CXE4XSMF.js} +19 -19
- package/dist/{chunk-43HQD3IL.js → chunk-D3ALNUWN.js} +6 -6
- package/dist/{chunk-HYEOQX7O.mjs → chunk-UCZWRYV5.mjs} +3 -5
- package/dist/{chunk-HYEOQX7O.mjs.map → chunk-UCZWRYV5.mjs.map} +1 -1
- package/dist/contract.d.ts +8 -8
- package/dist/contract.js +2 -2
- package/dist/contract.mjs +1 -1
- package/dist/{createClient-1f19be8d.d.ts → createClient-e52de308.d.ts} +2 -2
- package/dist/{eip1193-210ab776.d.ts → eip1193-9080db42.d.ts} +1 -1
- package/dist/{encodeFunctionResult-a252fba1.d.ts → encodeFunctionResult-47ad60ed.d.ts} +1 -1
- package/dist/{encodePacked-a9464e97.d.ts → encodePacked-35c796fb.d.ts} +1 -1
- package/dist/ens.d.ts +5 -5
- package/dist/ens.js +3 -3
- package/dist/ens.mjs +2 -2
- package/dist/ethers.d.ts +2 -2
- package/dist/ethers.js +4 -4
- package/dist/ethers.mjs +2 -2
- package/dist/{formatAbiItem-6ed70dbd.d.ts → formatAbiItem-d9e801dd.d.ts} +1 -1
- package/dist/{getAbiItem-1ff0f41a.d.ts → getAbiItem-1d94ae0e.d.ts} +1 -1
- package/dist/index.d.ts +15 -15
- package/dist/index.js +91 -91
- package/dist/index.mjs +2 -2
- package/dist/{parseAccount-8e131c73.d.ts → parseAccount-4209fa24.d.ts} +1 -1
- package/dist/{parseGwei-5e2a8e87.d.ts → parseGwei-3c8f21f1.d.ts} +5 -5
- package/dist/public.d.ts +5 -5
- package/dist/public.js +2 -2
- package/dist/public.mjs +1 -1
- package/dist/{test-e28db435.d.ts → test-f3d06763.d.ts} +4 -4
- package/dist/test.d.ts +5 -5
- package/dist/test.js +2 -2
- package/dist/test.mjs +1 -1
- package/dist/{typedData-848139b1.d.ts → typedData-42b43450.d.ts} +1 -1
- package/dist/utils/index.d.ts +15 -15
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/wallet.d.ts +5 -5
- package/dist/wallet.js +2 -2
- package/dist/wallet.mjs +1 -1
- package/dist/{createPublicClient-fd8b1349.d.ts → watchPendingTransactions-80e93b17.d.ts} +211 -216
- package/dist/window.d.ts +2 -2
- package/package.json +1 -1
- package/dist/chunk-OW7TKT7L.js.map +0 -1
- /package/dist/{chunk-UK6FAD4V.mjs.map → chunk-7QEOFHC7.mjs.map} +0 -0
- /package/dist/{chunk-DFMQLPHS.mjs.map → chunk-BJ5KRDTG.mjs.map} +0 -0
- /package/dist/{chunk-FZPFAAOJ.js.map → chunk-CXE4XSMF.js.map} +0 -0
- /package/dist/{chunk-43HQD3IL.js.map → chunk-D3ALNUWN.js.map} +0 -0
@@ -1,8 +1,8 @@
|
|
1
|
-
import {
|
2
|
-
import { a as
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { A as Account, T as TypedDataDefinition, J as JsonRpcAccount } from './typedData-
|
1
|
+
import { a as Transport, b as ClientConfig, C as Client } from './createClient-e52de308.js';
|
2
|
+
import { C as Chain, a4 as ExtractFormatter, ab as Formatters, ac as Formatter, a5 as Formatted, c as Block, R as RpcBlock, T as Transaction, O as TransactionReceipt, z as RpcTransactionReceipt, I as TransactionType, D as RpcTransactionRequest, P as TransactionRequest, H as Hex, ad as GetChain, h as ExtractConstructorArgsFromAbi, ae as MergeIntersectionProperties, a as Hash, af as GetValue, g as ContractConfig, ag as IsUndefined, ah as MaybeExtractEventArgsFromAbi, p as ExtractResultFromAbi, ai as Prettify, f as BlockTag, aj as MaybeAbiEventName, e as BlockNumber, m as ExtractEventNameFromAbi, F as FeeHistory, L as Log, a6 as FormattedTransaction, a7 as TransactionFormatter, k as ExtractEventArgsFromAbi } from './chain-5b28fc53.js';
|
3
|
+
import { W as WalletPermission, a as WatchAssetParams, R as Requests, P as PublicRequests } from './eip1193-9080db42.js';
|
4
|
+
import { Abi, Narrow, Address, TypedData, AbiEvent, ExtractAbiEvent } from 'abitype';
|
5
|
+
import { A as Account, T as TypedDataDefinition, J as JsonRpcAccount } from './typedData-42b43450.js';
|
6
6
|
|
7
7
|
type BlockFormatter<TChain extends Chain | undefined = Chain> = TChain extends Chain ? ExtractFormatter<TChain, 'block', NonNullable<Formatters['block']>> : Formatters['block'];
|
8
8
|
type FormattedBlock<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, Block>;
|
@@ -32,30 +32,13 @@ type FormattedTransactionRequest$1<TFormatter extends Formatter | undefined = Fo
|
|
32
32
|
declare function formatTransactionRequest(transactionRequest: Partial<TransactionRequest>): RpcTransactionRequest;
|
33
33
|
declare const defineTransactionRequest: <TFormat extends Formatter<Partial<TransactionRequest<bigint, number>>, Partial<RpcTransactionRequest> & {
|
34
34
|
[key: string]: unknown;
|
35
|
-
}>, TExclude extends ("value" | "
|
35
|
+
}>, TExclude extends ("value" | "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" | "from" | "accessList" | "to" | "data" | "gas" | "nonce")[] = []>({ exclude, format: formatOverride, }: {
|
36
36
|
exclude?: TExclude | undefined;
|
37
37
|
format?: TFormat | undefined;
|
38
38
|
}) => (data: Partial<TransactionRequest<bigint, number>> & {
|
39
39
|
[key: string]: unknown;
|
40
40
|
}) => RpcTransactionRequest & ReturnType<TFormat> & { [K in TExclude[number]]: never; };
|
41
41
|
|
42
|
-
type FormattedCall<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Omit<Formatted<TFormatter, TransactionRequest, true>, 'from'>, TransactionRequest>;
|
43
|
-
type CallParameters<TChain extends Chain | undefined = Chain | undefined> = FormattedCall<TransactionRequestFormatter<TChain>> & {
|
44
|
-
account?: Account | Address;
|
45
|
-
} & ({
|
46
|
-
/** The balance of the account at a block number. */
|
47
|
-
blockNumber?: bigint;
|
48
|
-
blockTag?: never;
|
49
|
-
} | {
|
50
|
-
blockNumber?: never;
|
51
|
-
/** The balance of the account at a block tag. */
|
52
|
-
blockTag?: BlockTag;
|
53
|
-
});
|
54
|
-
type CallReturnType = {
|
55
|
-
data: Hex | undefined;
|
56
|
-
};
|
57
|
-
declare function call<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, args: CallParameters<TChain>): Promise<CallReturnType>;
|
58
|
-
|
59
42
|
type AddChainParameters = {
|
60
43
|
chain: Chain;
|
61
44
|
};
|
@@ -93,16 +76,11 @@ type SendTransactionParameters<TChain extends Chain | undefined = Chain | undefi
|
|
93
76
|
type SendTransactionReturnType = Hash;
|
94
77
|
declare function sendTransaction<TChain extends Chain | undefined, TAccount extends Account | undefined, TChainOverride extends Chain | undefined>(client: WalletClient<Transport, TChain, TAccount>, args: SendTransactionParameters<TChain, TAccount, TChainOverride>): Promise<SendTransactionReturnType>;
|
95
78
|
|
96
|
-
type SignMessageParameters<TAccount extends Account | undefined = Account | undefined> = GetAccountParameter<TAccount> &
|
97
|
-
/** @deprecated – `data` will be removed in 0.2.0; use `message` instead. */
|
98
|
-
data: string;
|
99
|
-
message?: never;
|
100
|
-
} | {
|
101
|
-
data?: never;
|
79
|
+
type SignMessageParameters<TAccount extends Account | undefined = Account | undefined> = GetAccountParameter<TAccount> & {
|
102
80
|
message: string;
|
103
|
-
}
|
81
|
+
};
|
104
82
|
type SignMessageReturnType = Hex;
|
105
|
-
declare function signMessage<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: WalletClient<Transport, TChain, TAccount>, { account: account_,
|
83
|
+
declare function signMessage<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: WalletClient<Transport, TChain, TAccount>, { account: account_, message, }: SignMessageParameters<TAccount>): Promise<SignMessageReturnType>;
|
106
84
|
|
107
85
|
type SignTypedDataParameters<TTypedData extends TypedData | {
|
108
86
|
[key: string]: unknown;
|
@@ -127,6 +105,207 @@ type WriteContractParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunct
|
|
127
105
|
type WriteContractReturnType = SendTransactionReturnType;
|
128
106
|
declare function writeContract<TChain extends Chain | undefined, TAccount extends Account | undefined, TAbi extends Abi | readonly unknown[], TFunctionName extends string, TChainOverride extends Chain | undefined = undefined>(client: WalletClient<Transport, TChain, TAccount>, { abi, address, args, functionName, ...request }: WriteContractParameters<TAbi, TFunctionName, TChain, TAccount, TChainOverride>): Promise<WriteContractReturnType>;
|
129
107
|
|
108
|
+
type GetAccountParameter<TAccount extends Account | undefined = Account | undefined> = IsUndefined<TAccount> extends true ? {
|
109
|
+
account: Account | Address;
|
110
|
+
} : {
|
111
|
+
account?: Account | Address;
|
112
|
+
};
|
113
|
+
type ParseAccount<TAccount extends Account | Address | undefined> = (TAccount extends Account ? TAccount : never) | (TAccount extends Address ? JsonRpcAccount : never) | (TAccount extends undefined ? undefined : never);
|
114
|
+
|
115
|
+
type FilterType = 'transaction' | 'block' | 'event';
|
116
|
+
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>> = {
|
117
|
+
id: Hex;
|
118
|
+
type: TFilterType;
|
119
|
+
} & (TFilterType extends 'event' ? TAbi extends Abi ? undefined extends TEventName ? {
|
120
|
+
abi: TAbi;
|
121
|
+
args?: never;
|
122
|
+
eventName?: never;
|
123
|
+
} : TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> ? {
|
124
|
+
abi: TAbi;
|
125
|
+
args: TArgs;
|
126
|
+
eventName: TEventName;
|
127
|
+
} : {
|
128
|
+
abi: TAbi;
|
129
|
+
args?: never;
|
130
|
+
eventName: TEventName;
|
131
|
+
} : {
|
132
|
+
abi?: never;
|
133
|
+
args?: never;
|
134
|
+
eventName?: never;
|
135
|
+
} : {});
|
136
|
+
|
137
|
+
type MAXIMUM_DEPTH = 20;
|
138
|
+
type Contract<TAbi extends Abi | readonly unknown[] = Abi | readonly unknown[], TFunctionName extends string = string> = {
|
139
|
+
abi: TAbi;
|
140
|
+
functionName: TFunctionName;
|
141
|
+
};
|
142
|
+
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] ? [
|
143
|
+
...Result,
|
144
|
+
ContractConfig<Head['abi'], Head['functionName']> & TProperties
|
145
|
+
] : TContracts extends [
|
146
|
+
infer Head extends Contract,
|
147
|
+
...infer Tail extends Contract[]
|
148
|
+
] ? MulticallContracts<[
|
149
|
+
...Tail
|
150
|
+
], TProperties, [
|
151
|
+
...Result,
|
152
|
+
ContractConfig<Head['abi'], Head['functionName']> & TProperties
|
153
|
+
], [
|
154
|
+
...Depth,
|
155
|
+
1
|
156
|
+
]> : unknown[] extends TContracts ? TContracts : TContracts extends ContractConfig<infer TAbi, infer TFunctionName>[] ? (ContractConfig<TAbi, TFunctionName> & TProperties)[] : (ContractConfig & TProperties)[];
|
157
|
+
type MulticallResult<Result, TAllowFailure extends boolean = true> = TAllowFailure extends true ? ({
|
158
|
+
error?: undefined;
|
159
|
+
result: Result;
|
160
|
+
status: 'success';
|
161
|
+
} | {
|
162
|
+
error: Error;
|
163
|
+
result?: undefined;
|
164
|
+
status: 'error';
|
165
|
+
}) : Result;
|
166
|
+
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 [
|
167
|
+
infer Head extends Contract,
|
168
|
+
...infer Tail extends Contract[]
|
169
|
+
] ? MulticallResults<[
|
170
|
+
...Tail
|
171
|
+
], TAllowFailure, [
|
172
|
+
...Result,
|
173
|
+
MulticallResult<ExtractResultFromAbi<Head['abi'], Head['functionName']>, TAllowFailure>
|
174
|
+
], [
|
175
|
+
...Depth,
|
176
|
+
1
|
177
|
+
]> : TContracts extends ContractConfig<infer TAbi, infer TFunctionName>[] ? MulticallResult<ExtractResultFromAbi<TAbi, TFunctionName>, TAllowFailure>[] : MulticallResult<ExtractResultFromAbi, TAllowFailure>[];
|
178
|
+
|
179
|
+
type GetTransportConfig<TTransport extends Transport> = ReturnType<TTransport>['config'];
|
180
|
+
|
181
|
+
type GetEnsAddressParameters = Prettify<Pick<ReadContractParameters, 'blockNumber' | 'blockTag'> & {
|
182
|
+
/** ENS name to get address. */
|
183
|
+
name: string;
|
184
|
+
/** Address of ENS Universal Resolver Contract */
|
185
|
+
universalResolverAddress?: Address;
|
186
|
+
}>;
|
187
|
+
type GetEnsAddressReturnType = Address;
|
188
|
+
/**
|
189
|
+
* @description Gets address for ENS name.
|
190
|
+
*
|
191
|
+
* - Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
|
192
|
+
* - Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.
|
193
|
+
*/
|
194
|
+
declare function getEnsAddress<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { blockNumber, blockTag, name, universalResolverAddress: universalResolverAddress_, }: GetEnsAddressParameters): Promise<GetEnsAddressReturnType>;
|
195
|
+
|
196
|
+
type GetEnsNameParameters = Prettify<Pick<ReadContractParameters, 'blockNumber' | 'blockTag'> & {
|
197
|
+
/** Address to get ENS name for. */
|
198
|
+
address: Address;
|
199
|
+
/** Address of ENS Universal Resolver Contract. */
|
200
|
+
universalResolverAddress?: Address;
|
201
|
+
}>;
|
202
|
+
type GetEnsNameReturnType = string | null;
|
203
|
+
/**
|
204
|
+
* @description Gets primary name for specified address.
|
205
|
+
*
|
206
|
+
* - Calls `reverse(bytes)` on ENS Universal Resolver Contract.
|
207
|
+
*
|
208
|
+
* @example
|
209
|
+
* const ensName = await getEnsName(publicClient, {
|
210
|
+
* address: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
|
211
|
+
* })
|
212
|
+
* // 'wagmi-dev.eth'
|
213
|
+
*/
|
214
|
+
declare function getEnsName<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { address, blockNumber, blockTag, universalResolverAddress: universalResolverAddress_, }: GetEnsNameParameters): Promise<GetEnsNameReturnType>;
|
215
|
+
|
216
|
+
type PublicActions<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined> = {
|
217
|
+
call: (args: CallParameters<TChain>) => Promise<CallReturnType>;
|
218
|
+
createBlockFilter: () => Promise<CreateBlockFilterReturnType>;
|
219
|
+
createContractEventFilter: <TAbi extends Abi | readonly unknown[], TEventName extends string | undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined>(args: CreateContractEventFilterParameters<TAbi, TEventName, TArgs>) => Promise<CreateContractEventFilterReturnType<TAbi, TEventName, TArgs>>;
|
220
|
+
createEventFilter: <TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined>(args?: CreateEventFilterParameters<TAbiEvent, TAbi, TEventName, TArgs>) => Promise<CreateEventFilterReturnType<TAbiEvent, TAbi, TEventName, TArgs>>;
|
221
|
+
createPendingTransactionFilter: () => Promise<CreatePendingTransactionFilterReturnType>;
|
222
|
+
estimateContractGas: <TChain extends Chain | undefined, TAbi extends Abi | readonly unknown[], TFunctionName extends string>(args: EstimateContractGasParameters<TAbi, TFunctionName, TChain>) => Promise<EstimateContractGasReturnType>;
|
223
|
+
estimateGas: (args: EstimateGasParameters<TChain>) => Promise<EstimateGasReturnType>;
|
224
|
+
getBalance: (args: GetBalanceParameters) => Promise<GetBalanceReturnType>;
|
225
|
+
getBlock: (args?: GetBlockParameters) => Promise<GetBlockReturnType<TChain>>;
|
226
|
+
getBlockNumber: (args?: GetBlockNumberParameters) => Promise<GetBlockNumberReturnType>;
|
227
|
+
getBlockTransactionCount: (args?: GetBlockTransactionCountParameters) => Promise<GetBlockTransactionCountReturnType>;
|
228
|
+
getBytecode: (args: GetBytecodeParameters) => Promise<GetBytecodeReturnType>;
|
229
|
+
getChainId: () => Promise<GetChainIdReturnType>;
|
230
|
+
getEnsAddress: (args: GetEnsAddressParameters) => Promise<GetEnsAddressReturnType>;
|
231
|
+
getEnsName: (args: GetEnsNameParameters) => Promise<GetEnsNameReturnType>;
|
232
|
+
getFeeHistory: (args: GetFeeHistoryParameters) => Promise<GetFeeHistoryReturnType>;
|
233
|
+
getFilterChanges: <TFilterType extends FilterType, TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined>(args: GetFilterChangesParameters<TFilterType, TAbiEvent, TAbi, TEventName>) => Promise<GetFilterChangesReturnType<TFilterType, TAbiEvent, TAbi, TEventName>>;
|
234
|
+
getFilterLogs: <TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined>(args: GetFilterLogsParameters<TAbiEvent, TAbi, TEventName>) => Promise<GetFilterLogsReturnType<TAbiEvent, TAbi, TEventName>>;
|
235
|
+
getGasPrice: () => Promise<GetGasPriceReturnType>;
|
236
|
+
getLogs: <TAbiEvent extends AbiEvent | undefined>(args?: GetLogsParameters<TAbiEvent>) => Promise<GetLogsReturnType<TAbiEvent>>;
|
237
|
+
getStorageAt: (args: GetStorageAtParameters) => Promise<GetStorageAtReturnType>;
|
238
|
+
getTransaction: (args: GetTransactionParameters) => Promise<GetTransactionReturnType<TChain>>;
|
239
|
+
getTransactionConfirmations: (args: GetTransactionConfirmationsParameters<TChain>) => Promise<GetTransactionConfirmationsReturnType>;
|
240
|
+
getTransactionCount: (args: GetTransactionCountParameters) => Promise<GetTransactionCountReturnType>;
|
241
|
+
getTransactionReceipt: (args: GetTransactionReceiptParameters) => Promise<GetTransactionReceiptReturnType<TChain>>;
|
242
|
+
multicall: <TContracts extends ContractConfig[], TAllowFailure extends boolean = true>(args: MulticallParameters<TContracts, TAllowFailure>) => Promise<MulticallReturnType<TContracts, TAllowFailure>>;
|
243
|
+
readContract: <TAbi extends Abi | readonly unknown[], TFunctionName extends string>(args: ReadContractParameters<TAbi, TFunctionName>) => Promise<ReadContractReturnType<TAbi, TFunctionName>>;
|
244
|
+
simulateContract: <TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any, TChainOverride extends Chain | undefined = undefined>(args: SimulateContractParameters<TAbi, TFunctionName, TChain, TChainOverride>) => Promise<SimulateContractReturnType<TAbi, TFunctionName, TChain, TChainOverride>>;
|
245
|
+
uninstallFilter: (args: UninstallFilterParameters) => Promise<UninstallFilterReturnType>;
|
246
|
+
waitForTransactionReceipt: (args: WaitForTransactionReceiptParameters<TChain>) => Promise<WaitForTransactionReceiptReturnType<TChain>>;
|
247
|
+
watchBlockNumber: (args: WatchBlockNumberParameters) => WatchBlockNumberReturnType;
|
248
|
+
watchBlocks: (args: WatchBlocksParameters<TTransport, TChain>) => WatchBlocksReturnType;
|
249
|
+
watchContractEvent: <TAbi extends Abi | readonly unknown[], TEventName extends string>(args: WatchContractEventParameters<TAbi, TEventName>) => WatchContractEventReturnType;
|
250
|
+
watchEvent: <TAbiEvent extends AbiEvent | undefined>(args: WatchEventParameters<TAbiEvent>) => WatchEventReturnType;
|
251
|
+
watchPendingTransactions: (args: WatchPendingTransactionsParameters<TTransport>) => WatchPendingTransactionsReturnType;
|
252
|
+
};
|
253
|
+
|
254
|
+
type WalletClientConfig<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccountOrAddress extends Account | Address | undefined = Account | Address | undefined> = Pick<ClientConfig<TTransport, TChain>, 'chain' | 'key' | 'name' | 'pollingInterval' | 'transport'> & {
|
255
|
+
/** The Account to use for the Wallet Client. This will be used for Actions that require an account as an argument. */
|
256
|
+
account?: TAccountOrAddress;
|
257
|
+
};
|
258
|
+
type WalletClient<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined, TIncludeActions extends boolean = true> = Prettify<Client<TTransport, Requests, TChain> & (TIncludeActions extends true ? WalletActions<TChain, TAccount> : unknown) & {
|
259
|
+
/** The Account to use for the Wallet Client. */
|
260
|
+
account: TAccount;
|
261
|
+
}>;
|
262
|
+
/**
|
263
|
+
* @description Creates a wallet client with a given transport.
|
264
|
+
*/
|
265
|
+
declare function createWalletClient<TTransport extends Transport, TChain extends Chain | undefined = undefined, TAccountOrAddress extends Account | Address | undefined = undefined>({ account, chain, transport, key, name, pollingInterval, }: WalletClientConfig<TTransport, TChain, TAccountOrAddress>): WalletClient<TTransport, TChain, TAccountOrAddress extends Address ? Prettify<JsonRpcAccount<TAccountOrAddress>> : TAccountOrAddress, true>;
|
266
|
+
|
267
|
+
type WalletActions<TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined> = {
|
268
|
+
addChain: (args: AddChainParameters) => Promise<void>;
|
269
|
+
deployContract: <TAbi extends Abi | readonly unknown[], TChainOverride extends Chain | undefined>(args: DeployContractParameters<TAbi, TChain, TAccount, TChainOverride>) => Promise<DeployContractReturnType>;
|
270
|
+
getAddresses: () => Promise<GetAddressesReturnType>;
|
271
|
+
getChainId: () => Promise<GetChainIdReturnType>;
|
272
|
+
getPermissions: () => Promise<GetPermissionsReturnType>;
|
273
|
+
requestAddresses: () => Promise<RequestAddressesReturnType>;
|
274
|
+
requestPermissions: (args: RequestPermissionsParameters) => Promise<RequestPermissionsReturnType>;
|
275
|
+
sendTransaction: <TChainOverride extends Chain | undefined>(args: SendTransactionParameters<TChain, TAccount, TChainOverride>) => Promise<SendTransactionReturnType>;
|
276
|
+
signMessage: (args: SignMessageParameters<TAccount>) => Promise<SignMessageReturnType>;
|
277
|
+
signTypedData: <TTypedData extends TypedData | {
|
278
|
+
[key: string]: unknown;
|
279
|
+
}, TPrimaryType extends string>(args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>) => Promise<SignTypedDataReturnType>;
|
280
|
+
switchChain: (args: SwitchChainParameters) => Promise<void>;
|
281
|
+
watchAsset: (args: WatchAssetParameters) => Promise<WatchAssetReturnType>;
|
282
|
+
writeContract: <TAbi extends Abi | readonly unknown[], TFunctionName extends string, TChainOverride extends Chain | undefined>(args: WriteContractParameters<TAbi, TFunctionName, TChain, TAccount, TChainOverride>) => Promise<WriteContractReturnType>;
|
283
|
+
};
|
284
|
+
|
285
|
+
type PublicClientConfig<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined> = Pick<ClientConfig<TTransport, TChain>, 'chain' | 'key' | 'name' | 'pollingInterval' | 'transport'>;
|
286
|
+
type PublicClient<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TIncludeActions extends boolean = true> = Prettify<Client<TTransport, PublicRequests, TChain> & (TIncludeActions extends true ? PublicActions<TTransport, TChain> : unknown)>;
|
287
|
+
/**
|
288
|
+
* @description Creates a public client with a given transport.
|
289
|
+
*/
|
290
|
+
declare function createPublicClient<TTransport extends Transport, TChain extends Chain | undefined = undefined>({ chain, key, name, transport, pollingInterval, }: PublicClientConfig<TTransport, TChain>): PublicClient<TTransport, TChain, true>;
|
291
|
+
|
292
|
+
type FormattedCall<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Omit<Formatted<TFormatter, TransactionRequest, true>, 'from'>, TransactionRequest>;
|
293
|
+
type CallParameters<TChain extends Chain | undefined = Chain | undefined> = FormattedCall<TransactionRequestFormatter<TChain>> & {
|
294
|
+
account?: Account | Address;
|
295
|
+
} & ({
|
296
|
+
/** The balance of the account at a block number. */
|
297
|
+
blockNumber?: bigint;
|
298
|
+
blockTag?: never;
|
299
|
+
} | {
|
300
|
+
blockNumber?: never;
|
301
|
+
/** The balance of the account at a block tag. */
|
302
|
+
blockTag?: BlockTag;
|
303
|
+
});
|
304
|
+
type CallReturnType = {
|
305
|
+
data: Hex | undefined;
|
306
|
+
};
|
307
|
+
declare function call<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, args: CallParameters<TChain>): Promise<CallReturnType>;
|
308
|
+
|
130
309
|
type SimulateContractParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any, TChain extends Chain | undefined = Chain | undefined, TChainOverride extends Chain | undefined = undefined> = Omit<CallParameters<TChainOverride extends Chain ? TChainOverride : TChain>, 'to' | 'data' | 'value'> & {
|
131
310
|
chain?: TChainOverride;
|
132
311
|
} & ContractConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'> & {
|
@@ -463,48 +642,6 @@ type GetTransactionReceiptParameters = {
|
|
463
642
|
type GetTransactionReceiptReturnType<TChain extends Chain | undefined = Chain | undefined> = FormattedTransactionReceipt<TransactionReceiptFormatter<TChain>>;
|
464
643
|
declare function getTransactionReceipt<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { hash }: GetTransactionReceiptParameters): Promise<Formatted<TransactionReceiptFormatter<TChain>, TransactionReceipt<bigint, number, "success" | "reverted", TransactionType>, false, false>>;
|
465
644
|
|
466
|
-
type MAXIMUM_DEPTH = 20;
|
467
|
-
type Contract<TAbi extends Abi | readonly unknown[] = Abi | readonly unknown[], TFunctionName extends string = string> = {
|
468
|
-
abi: TAbi;
|
469
|
-
functionName: TFunctionName;
|
470
|
-
};
|
471
|
-
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] ? [
|
472
|
-
...Result,
|
473
|
-
ContractConfig<Head['abi'], Head['functionName']> & TProperties
|
474
|
-
] : TContracts extends [
|
475
|
-
infer Head extends Contract,
|
476
|
-
...infer Tail extends Contract[]
|
477
|
-
] ? MulticallContracts<[
|
478
|
-
...Tail
|
479
|
-
], TProperties, [
|
480
|
-
...Result,
|
481
|
-
ContractConfig<Head['abi'], Head['functionName']> & TProperties
|
482
|
-
], [
|
483
|
-
...Depth,
|
484
|
-
1
|
485
|
-
]> : unknown[] extends TContracts ? TContracts : TContracts extends ContractConfig<infer TAbi, infer TFunctionName>[] ? (ContractConfig<TAbi, TFunctionName> & TProperties)[] : (ContractConfig & TProperties)[];
|
486
|
-
type MulticallResult<Result, TAllowFailure extends boolean = true> = TAllowFailure extends true ? ({
|
487
|
-
error?: undefined;
|
488
|
-
result: Result;
|
489
|
-
status: 'success';
|
490
|
-
} | {
|
491
|
-
error: Error;
|
492
|
-
result?: undefined;
|
493
|
-
status: 'error';
|
494
|
-
}) : Result;
|
495
|
-
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 [
|
496
|
-
infer Head extends Contract,
|
497
|
-
...infer Tail extends Contract[]
|
498
|
-
] ? MulticallResults<[
|
499
|
-
...Tail
|
500
|
-
], TAllowFailure, [
|
501
|
-
...Result,
|
502
|
-
MulticallResult<ExtractResultFromAbi<Head['abi'], Head['functionName']>, TAllowFailure>
|
503
|
-
], [
|
504
|
-
...Depth,
|
505
|
-
1
|
506
|
-
]> : TContracts extends ContractConfig<infer TAbi, infer TFunctionName>[] ? MulticallResult<ExtractResultFromAbi<TAbi, TFunctionName>, TAllowFailure>[] : MulticallResult<ExtractResultFromAbi, TAllowFailure>[];
|
507
|
-
|
508
645
|
type MulticallParameters<TContracts extends ContractConfig[] = ContractConfig[], TAllowFailure extends boolean = true> = Pick<CallParameters, 'blockNumber' | 'blockTag'> & {
|
509
646
|
allowFailure?: TAllowFailure;
|
510
647
|
contracts: Narrow<readonly [...MulticallContracts<TContracts>]>;
|
@@ -683,146 +820,4 @@ type WatchPendingTransactionsParameters<TTransport extends Transport = Transport
|
|
683
820
|
type WatchPendingTransactionsReturnType = () => void;
|
684
821
|
declare function watchPendingTransactions<TTransport extends Transport, TChain extends Chain | undefined>(client: PublicClient<TTransport, TChain>, { batch, onError, onTransactions, poll: poll_, pollingInterval, }: WatchPendingTransactionsParameters<TTransport>): () => void;
|
685
822
|
|
686
|
-
|
687
|
-
account: Account | Address;
|
688
|
-
} : {
|
689
|
-
account?: Account | Address;
|
690
|
-
};
|
691
|
-
type ParseAccount<TAccount extends Account | Address | undefined> = (TAccount extends Account ? TAccount : never) | (TAccount extends Address ? JsonRpcAccount : never) | (TAccount extends undefined ? undefined : never);
|
692
|
-
|
693
|
-
type FilterType = 'transaction' | 'block' | 'event';
|
694
|
-
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>> = {
|
695
|
-
id: Hex;
|
696
|
-
type: TFilterType;
|
697
|
-
} & (TFilterType extends 'event' ? TAbi extends Abi ? undefined extends TEventName ? {
|
698
|
-
abi: TAbi;
|
699
|
-
args?: never;
|
700
|
-
eventName?: never;
|
701
|
-
} : TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> ? {
|
702
|
-
abi: TAbi;
|
703
|
-
args: TArgs;
|
704
|
-
eventName: TEventName;
|
705
|
-
} : {
|
706
|
-
abi: TAbi;
|
707
|
-
args?: never;
|
708
|
-
eventName: TEventName;
|
709
|
-
} : {
|
710
|
-
abi?: never;
|
711
|
-
args?: never;
|
712
|
-
eventName?: never;
|
713
|
-
} : {});
|
714
|
-
|
715
|
-
type GetTransportConfig<TTransport extends Transport> = ReturnType<TTransport>['config'];
|
716
|
-
|
717
|
-
type GetEnsAddressParameters = Prettify<Pick<ReadContractParameters, 'blockNumber' | 'blockTag'> & {
|
718
|
-
/** ENS name to get address. */
|
719
|
-
name: string;
|
720
|
-
/** Address of ENS Universal Resolver Contract */
|
721
|
-
universalResolverAddress?: Address;
|
722
|
-
}>;
|
723
|
-
type GetEnsAddressReturnType = Address;
|
724
|
-
/**
|
725
|
-
* @description Gets address for ENS name.
|
726
|
-
*
|
727
|
-
* - Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
|
728
|
-
* - Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.
|
729
|
-
*/
|
730
|
-
declare function getEnsAddress<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { blockNumber, blockTag, name, universalResolverAddress: universalResolverAddress_, }: GetEnsAddressParameters): Promise<GetEnsAddressReturnType>;
|
731
|
-
|
732
|
-
type GetEnsNameParameters = Prettify<Pick<ReadContractParameters, 'blockNumber' | 'blockTag'> & {
|
733
|
-
/** Address to get ENS name for. */
|
734
|
-
address: Address;
|
735
|
-
/** Address of ENS Universal Resolver Contract. */
|
736
|
-
universalResolverAddress?: Address;
|
737
|
-
}>;
|
738
|
-
type GetEnsNameReturnType = string | null;
|
739
|
-
/**
|
740
|
-
* @description Gets primary name for specified address.
|
741
|
-
*
|
742
|
-
* - Calls `reverse(bytes)` on ENS Universal Resolver Contract.
|
743
|
-
*
|
744
|
-
* @example
|
745
|
-
* const ensName = await getEnsName(publicClient, {
|
746
|
-
* address: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
|
747
|
-
* })
|
748
|
-
* // 'wagmi-dev.eth'
|
749
|
-
*/
|
750
|
-
declare function getEnsName<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { address, blockNumber, blockTag, universalResolverAddress: universalResolverAddress_, }: GetEnsNameParameters): Promise<GetEnsNameReturnType>;
|
751
|
-
|
752
|
-
type PublicActions<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined> = {
|
753
|
-
call: (args: CallParameters<TChain>) => Promise<CallReturnType>;
|
754
|
-
createBlockFilter: () => Promise<CreateBlockFilterReturnType>;
|
755
|
-
createContractEventFilter: <TAbi extends Abi | readonly unknown[], TEventName extends string | undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined>(args: CreateContractEventFilterParameters<TAbi, TEventName, TArgs>) => Promise<CreateContractEventFilterReturnType<TAbi, TEventName, TArgs>>;
|
756
|
-
createEventFilter: <TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined>(args?: CreateEventFilterParameters<TAbiEvent, TAbi, TEventName, TArgs>) => Promise<CreateEventFilterReturnType<TAbiEvent, TAbi, TEventName, TArgs>>;
|
757
|
-
createPendingTransactionFilter: () => Promise<CreatePendingTransactionFilterReturnType>;
|
758
|
-
estimateContractGas: <TChain extends Chain | undefined, TAbi extends Abi | readonly unknown[], TFunctionName extends string>(args: EstimateContractGasParameters<TAbi, TFunctionName, TChain>) => Promise<EstimateContractGasReturnType>;
|
759
|
-
estimateGas: (args: EstimateGasParameters<TChain>) => Promise<EstimateGasReturnType>;
|
760
|
-
getBalance: (args: GetBalanceParameters) => Promise<GetBalanceReturnType>;
|
761
|
-
getBlock: (args?: GetBlockParameters) => Promise<GetBlockReturnType<TChain>>;
|
762
|
-
getBlockNumber: (args?: GetBlockNumberParameters) => Promise<GetBlockNumberReturnType>;
|
763
|
-
getBlockTransactionCount: (args?: GetBlockTransactionCountParameters) => Promise<GetBlockTransactionCountReturnType>;
|
764
|
-
getBytecode: (args: GetBytecodeParameters) => Promise<GetBytecodeReturnType>;
|
765
|
-
getChainId: () => Promise<GetChainIdReturnType>;
|
766
|
-
getEnsAddress: (args: GetEnsAddressParameters) => Promise<GetEnsAddressReturnType>;
|
767
|
-
getEnsName: (args: GetEnsNameParameters) => Promise<GetEnsNameReturnType>;
|
768
|
-
getFeeHistory: (args: GetFeeHistoryParameters) => Promise<GetFeeHistoryReturnType>;
|
769
|
-
getFilterChanges: <TFilterType extends FilterType, TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined>(args: GetFilterChangesParameters<TFilterType, TAbiEvent, TAbi, TEventName>) => Promise<GetFilterChangesReturnType<TFilterType, TAbiEvent, TAbi, TEventName>>;
|
770
|
-
getFilterLogs: <TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined>(args: GetFilterLogsParameters<TAbiEvent, TAbi, TEventName>) => Promise<GetFilterLogsReturnType<TAbiEvent, TAbi, TEventName>>;
|
771
|
-
getGasPrice: () => Promise<GetGasPriceReturnType>;
|
772
|
-
getLogs: <TAbiEvent extends AbiEvent | undefined>(args?: GetLogsParameters<TAbiEvent>) => Promise<GetLogsReturnType<TAbiEvent>>;
|
773
|
-
getStorageAt: (args: GetStorageAtParameters) => Promise<GetStorageAtReturnType>;
|
774
|
-
getTransaction: (args: GetTransactionParameters) => Promise<GetTransactionReturnType<TChain>>;
|
775
|
-
getTransactionConfirmations: (args: GetTransactionConfirmationsParameters<TChain>) => Promise<GetTransactionConfirmationsReturnType>;
|
776
|
-
getTransactionCount: (args: GetTransactionCountParameters) => Promise<GetTransactionCountReturnType>;
|
777
|
-
getTransactionReceipt: (args: GetTransactionReceiptParameters) => Promise<GetTransactionReceiptReturnType<TChain>>;
|
778
|
-
multicall: <TContracts extends ContractConfig[], TAllowFailure extends boolean = true>(args: MulticallParameters<TContracts, TAllowFailure>) => Promise<MulticallReturnType<TContracts, TAllowFailure>>;
|
779
|
-
readContract: <TAbi extends Abi | readonly unknown[], TFunctionName extends string>(args: ReadContractParameters<TAbi, TFunctionName>) => Promise<ReadContractReturnType<TAbi, TFunctionName>>;
|
780
|
-
simulateContract: <TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any, TChainOverride extends Chain | undefined = undefined>(args: SimulateContractParameters<TAbi, TFunctionName, TChain, TChainOverride>) => Promise<SimulateContractReturnType<TAbi, TFunctionName, TChain, TChainOverride>>;
|
781
|
-
uninstallFilter: (args: UninstallFilterParameters) => Promise<UninstallFilterReturnType>;
|
782
|
-
waitForTransactionReceipt: (args: WaitForTransactionReceiptParameters<TChain>) => Promise<WaitForTransactionReceiptReturnType<TChain>>;
|
783
|
-
watchBlockNumber: (args: WatchBlockNumberParameters) => WatchBlockNumberReturnType;
|
784
|
-
watchBlocks: (args: WatchBlocksParameters<TTransport, TChain>) => WatchBlocksReturnType;
|
785
|
-
watchContractEvent: <TAbi extends Abi | readonly unknown[], TEventName extends string>(args: WatchContractEventParameters<TAbi, TEventName>) => WatchContractEventReturnType;
|
786
|
-
watchEvent: <TAbiEvent extends AbiEvent | undefined>(args: WatchEventParameters<TAbiEvent>) => WatchEventReturnType;
|
787
|
-
watchPendingTransactions: (args: WatchPendingTransactionsParameters<TTransport>) => WatchPendingTransactionsReturnType;
|
788
|
-
};
|
789
|
-
|
790
|
-
type WalletClientConfig<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccountOrAddress extends Account | Address | undefined = Account | Address | undefined> = Pick<ClientConfig<TTransport, TChain>, 'chain' | 'key' | 'name' | 'pollingInterval' | 'transport'> & {
|
791
|
-
/** The Account to use for the Wallet Client. This will be used for Actions that require an account as an argument. */
|
792
|
-
account?: TAccountOrAddress;
|
793
|
-
};
|
794
|
-
type WalletClient<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined, TIncludeActions extends boolean = true> = Prettify<Client<TTransport, Requests, TChain> & (TIncludeActions extends true ? WalletActions<TChain, TAccount> : unknown) & {
|
795
|
-
/** The Account to use for the Wallet Client. */
|
796
|
-
account: TAccount;
|
797
|
-
}>;
|
798
|
-
/**
|
799
|
-
* @description Creates a wallet client with a given transport.
|
800
|
-
*/
|
801
|
-
declare function createWalletClient<TTransport extends Transport, TChain extends Chain | undefined = undefined, TAccountOrAddress extends Account | Address | undefined = undefined>({ account, chain, transport, key, name, pollingInterval, }: WalletClientConfig<TTransport, TChain, TAccountOrAddress>): WalletClient<TTransport, TChain, TAccountOrAddress extends Address ? Prettify<JsonRpcAccount<TAccountOrAddress>> : TAccountOrAddress, true>;
|
802
|
-
|
803
|
-
type WalletActions<TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined> = {
|
804
|
-
addChain: (args: AddChainParameters) => Promise<void>;
|
805
|
-
deployContract: <TAbi extends Abi | readonly unknown[], TChainOverride extends Chain | undefined>(args: DeployContractParameters<TAbi, TChain, TAccount, TChainOverride>) => Promise<DeployContractReturnType>;
|
806
|
-
getAddresses: () => Promise<GetAddressesReturnType>;
|
807
|
-
getChainId: () => Promise<GetChainIdReturnType>;
|
808
|
-
getPermissions: () => Promise<GetPermissionsReturnType>;
|
809
|
-
requestAddresses: () => Promise<RequestAddressesReturnType>;
|
810
|
-
requestPermissions: (args: RequestPermissionsParameters) => Promise<RequestPermissionsReturnType>;
|
811
|
-
sendTransaction: <TChainOverride extends Chain | undefined>(args: SendTransactionParameters<TChain, TAccount, TChainOverride>) => Promise<SendTransactionReturnType>;
|
812
|
-
signMessage: (args: SignMessageParameters<TAccount>) => Promise<SignMessageReturnType>;
|
813
|
-
signTypedData: <TTypedData extends TypedData | {
|
814
|
-
[key: string]: unknown;
|
815
|
-
}, TPrimaryType extends string>(args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>) => Promise<SignTypedDataReturnType>;
|
816
|
-
switchChain: (args: SwitchChainParameters) => Promise<void>;
|
817
|
-
watchAsset: (args: WatchAssetParameters) => Promise<WatchAssetReturnType>;
|
818
|
-
writeContract: <TAbi extends Abi | readonly unknown[], TFunctionName extends string, TChainOverride extends Chain | undefined>(args: WriteContractParameters<TAbi, TFunctionName, TChain, TAccount, TChainOverride>) => Promise<WriteContractReturnType>;
|
819
|
-
};
|
820
|
-
|
821
|
-
type PublicClientConfig<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined> = Pick<ClientConfig<TTransport, TChain>, 'chain' | 'key' | 'name' | 'pollingInterval' | 'transport'>;
|
822
|
-
type PublicClient<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TIncludeActions extends boolean = true> = Prettify<Client<TTransport, PublicRequests, TChain> & (TIncludeActions extends true ? PublicActions<TTransport, TChain> : unknown)>;
|
823
|
-
/**
|
824
|
-
* @description Creates a public client with a given transport.
|
825
|
-
*/
|
826
|
-
declare function createPublicClient<TTransport extends Transport, TChain extends Chain | undefined = undefined>({ chain, key, name, transport, pollingInterval, }: PublicClientConfig<TTransport, TChain>): PublicClient<TTransport, TChain, true>;
|
827
|
-
|
828
|
-
export { writeContract as $, SimulateContractReturnType as A, BlockFormatter as B, CallParameters as C, WatchContractEventParameters as D, EstimateGasParameters as E, FormattedBlock as F, GetTransportConfig as G, createContractEventFilter as H, estimateContractGas as I, getBytecode as J, getStorageAt as K, multicall as L, MulticallParameters as M, readContract as N, OnLogsFn as O, PublicClient as P, simulateContract as Q, ReadContractParameters as R, SendTransactionParameters as S, TransactionReceiptFormatter as T, watchContractEvent as U, DeployContractParameters as V, WalletClient as W, DeployContractReturnType as X, WriteContractParameters as Y, WriteContractReturnType as Z, deployContract as _, PublicClientConfig as a, OnTransactionsFn as a$, GetEnsAddressParameters as a0, GetEnsNameParameters as a1, getEnsAddress as a2, getEnsName as a3, call as a4, createBlockFilter as a5, createEventFilter as a6, createPendingTransactionFilter as a7, estimateGas as a8, getBalance as a9, GetBalanceParameters as aA, GetBalanceReturnType as aB, GetBlockParameters as aC, GetBlockNumberParameters as aD, GetBlockNumberReturnType as aE, GetBlockReturnType as aF, GetBlockTransactionCountParameters as aG, GetBlockTransactionCountReturnType as aH, GetFeeHistoryParameters as aI, GetFeeHistoryReturnType as aJ, GetFilterChangesParameters as aK, GetFilterChangesReturnType as aL, GetFilterLogsParameters as aM, GetFilterLogsReturnType as aN, GetGasPriceReturnType as aO, GetTransactionParameters as aP, GetTransactionConfirmationsParameters as aQ, GetTransactionConfirmationsReturnType as aR, GetTransactionCountParameters as aS, GetTransactionCountReturnType as aT, GetTransactionReceiptParameters as aU, GetTransactionReceiptReturnType as aV, GetTransactionReturnType as aW, OnBlock as aX, OnBlockNumberFn as aY, OnBlockNumberParameter as aZ, OnBlockParameter as a_, getBlock as aa, getBlockNumber as ab, getBlockNumberCache as ac, getBlockTransactionCount as ad, getChainId as ae, getFeeHistory as af, getFilterChanges as ag, getFilterLogs as ah, getLogs as ai, getGasPrice as aj, getTransaction as ak, getTransactionConfirmations as al, getTransactionCount as am, getTransactionReceipt as an, uninstallFilter as ao, waitForTransactionReceipt as ap, watchBlockNumber as aq, watchBlocks as ar, watchEvent as as, watchPendingTransactions as at, CallReturnType as au, CreateBlockFilterReturnType as av, CreateEventFilterParameters as aw, CreateEventFilterReturnType as ax, CreatePendingTransactionFilterReturnType as ay, EstimateGasReturnType as az, WalletClientConfig as b, OnTransactionsParameter as b0, ReplacementReason as b1, ReplacementReturnType as b2, UninstallFilterParameters as b3, UninstallFilterReturnType as b4, WaitForTransactionReceiptParameters as b5, WaitForTransactionReceiptReturnType as b6, WatchBlockNumberParameters as b7, WatchBlocksParameters as b8, WatchPendingTransactionsParameters as b9, addChain as ba, getAddresses as bb, getPermissions as bc, requestAddresses as bd, requestPermissions as be, sendTransaction as bf, signMessage as bg, signTypedData as bh, switchChain as bi, watchAsset as bj, AddChainParameters as bk, FormattedTransactionRequest as bl, GetPermissionsReturnType as bm, GetAddressesReturnType as bn, RequestAddressesReturnType as bo, RequestPermissionsReturnType as bp, SendTransactionReturnType as bq, SignMessageParameters as br, SignMessageReturnType as bs, SignTypedDataParameters as bt, SignTypedDataReturnType as bu, SwitchChainParameters as bv, WatchAssetParameters as bw, WatchAssetReturnType as bx, createPublicClient as c, createWalletClient as d, ParseAccount as e, FormattedTransactionReceipt as f, FormattedTransactionRequest$1 as g, TransactionRequestFormatter as h, defineBlock as i, defineTransactionReceipt as j, defineTransactionRequest as k, formatBlock as l, formatTransactionRequest as m, GetAccountParameter as n, CreateContractEventFilterParameters as o, CreateContractEventFilterReturnType as p, EstimateContractGasParameters as q, EstimateContractGasReturnType as r, GetBytecodeParameters as s, GetBytecodeReturnType as t, GetStorageAtParameters as u, GetStorageAtReturnType as v, MulticallReturnType as w, OnLogsParameter as x, ReadContractReturnType as y, SimulateContractParameters as z };
|
823
|
+
export { OnTransactionsParameter as $, AddChainParameters as A, GetLogsParameters as B, CallParameters as C, DeployContractParameters as D, EstimateGasParameters as E, GetLogsReturnType as F, GetAddressesReturnType as G, GetPermissionsReturnType as H, GetStorageAtParameters as I, GetStorageAtReturnType as J, GetTransactionConfirmationsParameters as K, GetTransactionCountParameters as L, GetTransactionConfirmationsReturnType as M, GetTransactionCountReturnType as N, GetTransactionParameters as O, GetTransactionReceiptParameters as P, GetTransactionReceiptReturnType as Q, GetTransactionReturnType as R, MulticallParameters as S, MulticallReturnType as T, OnBlock as U, OnBlockNumberFn as V, OnBlockNumberParameter as W, OnBlockParameter as X, OnLogsFn as Y, OnLogsParameter as Z, OnTransactionsFn as _, CallReturnType as a, GetEnsAddressParameters as a$, ReadContractParameters as a0, ReadContractReturnType as a1, ReplacementReason as a2, ReplacementReturnType as a3, RequestAddressesReturnType as a4, RequestPermissionsReturnType as a5, SendTransactionParameters as a6, SendTransactionReturnType as a7, SignMessageParameters as a8, SignMessageReturnType as a9, createWalletClient as aA, GetTransportConfig as aB, ParseAccount as aC, BlockFormatter as aD, FormattedBlock as aE, FormattedTransactionReceipt as aF, FormattedTransactionRequest$1 as aG, TransactionReceiptFormatter as aH, TransactionRequestFormatter as aI, defineBlock as aJ, defineTransactionReceipt as aK, defineTransactionRequest as aL, formatBlock as aM, formatTransactionRequest as aN, GetAccountParameter as aO, EstimateContractGasParameters as aP, EstimateContractGasReturnType as aQ, createContractEventFilter as aR, estimateContractGas as aS, getBytecode as aT, getStorageAt as aU, multicall as aV, readContract as aW, simulateContract as aX, watchContractEvent as aY, deployContract as aZ, writeContract as a_, SimulateContractParameters as aa, SimulateContractReturnType as ab, SwitchChainParameters as ac, UninstallFilterParameters as ad, UninstallFilterReturnType as ae, WaitForTransactionReceiptParameters as af, WaitForTransactionReceiptReturnType as ag, WatchAssetParameters as ah, WatchAssetReturnType as ai, WatchBlockNumberParameters as aj, WatchBlockNumberReturnType as ak, WatchBlocksParameters as al, WatchBlocksReturnType as am, WatchContractEventParameters as an, WatchContractEventReturnType as ao, WatchEventParameters as ap, WatchEventReturnType as aq, WatchPendingTransactionsParameters as ar, WatchPendingTransactionsReturnType as as, WriteContractParameters as at, WriteContractReturnType as au, PublicClient as av, PublicClientConfig as aw, WalletClient as ax, WalletClientConfig as ay, createPublicClient as az, CreateBlockFilterReturnType as b, GetEnsNameParameters as b0, getEnsAddress as b1, getEnsName as b2, call as b3, createBlockFilter as b4, createEventFilter as b5, createPendingTransactionFilter as b6, estimateGas as b7, getBalance as b8, getBlock as b9, signTypedData as bA, switchChain as bB, watchAsset as bC, FormattedTransactionRequest as bD, SignTypedDataParameters as bE, SignTypedDataReturnType as bF, getBlockNumber as ba, getBlockNumberCache as bb, getBlockTransactionCount as bc, getChainId as bd, getFeeHistory as be, getFilterChanges as bf, getFilterLogs as bg, getLogs as bh, getGasPrice as bi, getTransaction as bj, getTransactionConfirmations as bk, getTransactionCount as bl, getTransactionReceipt as bm, uninstallFilter as bn, waitForTransactionReceipt as bo, watchBlockNumber as bp, watchBlocks as bq, watchEvent as br, watchPendingTransactions as bs, addChain as bt, getAddresses as bu, getPermissions as bv, requestAddresses as bw, requestPermissions as bx, sendTransaction as by, signMessage as bz, CreateContractEventFilterParameters as c, CreateContractEventFilterReturnType as d, CreateEventFilterParameters as e, CreateEventFilterReturnType as f, CreatePendingTransactionFilterReturnType as g, DeployContractReturnType as h, EstimateGasReturnType as i, GetBalanceParameters as j, GetBalanceReturnType as k, GetBlockNumberParameters as l, GetBlockNumberReturnType as m, GetBlockParameters as n, GetBlockReturnType as o, GetBlockTransactionCountParameters as p, GetBlockTransactionCountReturnType as q, GetBytecodeParameters as r, GetBytecodeReturnType as s, GetFeeHistoryParameters as t, GetFeeHistoryReturnType as u, GetFilterChangesParameters as v, GetFilterChangesReturnType as w, GetFilterLogsParameters as x, GetFilterLogsReturnType as y, GetGasPriceReturnType as z };
|
package/dist/window.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { R as Requests, E as Events } from './eip1193-
|
1
|
+
import { R as Requests, E as Events } from './eip1193-9080db42.js';
|
2
2
|
import 'abitype';
|
3
|
-
import './chain-
|
3
|
+
import './chain-5b28fc53.js';
|
4
4
|
import '@wagmi/chains';
|
5
5
|
|
6
6
|
type WindowProvider = Requests & Events;
|