Functions
ViemExtension method
viem module
Provides methods to create viem clients.
The reference types below are simplified for the sake of readability. See the
type specification for details.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
🚀 Stablecoin Accounts are live! Learn more
ViemExtension methodViemExtension(): Extension<IViemExtension>
viem module| Property | Type | Description |
|---|---|---|
createPublicClient | (params: { chain: Chain }) => PublicClient | Creates a public viem client to interact with the given chain. |
createWalletClient | (params: { wallet: BaseWallet, chain?: Chain }) => WalletClient | Creates a wallet viem client to interact with the given wallet address. |
IViemExtension typeimport {
Account,
Chain,
CustomTransport,
PublicClient,
PublicClientConfig,
WalletClient,
WalletClientConfig,
} from 'viem'
type PublicClientConfigDynamic<C extends Chain | undefined> = Omit<
PublicClientConfig<CustomTransport, C>,
'transport'
> & { chain: NonNullable<PublicClientConfig<CustomTransport, C>['chain']> }
type WalletClientConfigDynamic<C extends Chain | undefined> = Omit<
WalletClientConfig<CustomTransport, C>,
'transport' | 'account'
> & { wallet: BaseWallet }
type IViemExtension = {
viem: {
createPublicClient: <C extends Chain | undefined = undefined>(
params: PublicClientConfigDynamic<C>
) => PublicClient<CustomTransport, C>
createWalletClient: <C extends Chain | undefined = undefined>(
params: WalletClientConfigDynamic<C>
) => WalletClient<CustomTransport, C, Account>
}
}
Was this page helpful?