23 lines
795 B
Plaintext
23 lines
795 B
Plaintext
# Client [Setting up your Viem Client]
|
|
|
|
To use the experimental functionality of Viem, you must extend your existing (or new) Viem Client with experimental Actions.
|
|
|
|
## Extensions
|
|
|
|
### `eip5792Actions`
|
|
|
|
A suite of [EIP-5792 Wallet Actions](https://github.com/ethereum/EIPs/blob/815028dc634463e1716fc5ce44c019a6040f0bef/EIPS/eip-5792.md) for suited for development with wallet's that support batch transactions.
|
|
|
|
```ts
|
|
import { createPublicClient, createWalletClient, http } from 'viem'
|
|
import { mainnet } from 'viem/chains'
|
|
import { eip5792Actions } from 'viem/experimental' // [!code focus]
|
|
|
|
const walletClient = createWalletClient({
|
|
chain: mainnet,
|
|
transport: custom(window.ethereum!),
|
|
}).extend(eip5792Actions()) // [!code focus]
|
|
|
|
const id = await walletClient.sendCalls({/* ... */})
|
|
```
|