Skip to main content
The Viem library has first-class support for Abstract by providing a set of extensions to interact with paymasters, smart contract wallets, and more. This page will walk through how to configure Viem to utilize Abstract’s features.
Ensure you have the following installed on your machine:
  • Node.js v18.0.0 or later.
  • You’ve already created a JavaScript project, (e.g. using CRA or Next.js).
  • Viem library version 2.21.25 or later installed.

1. Installation

Install the viem package.

2. Client Configuration

Configure your Viem client using abstractTestnet as the chain and extend it with eip712WalletActions.
Learn more on the official viem documentation.

Reading Blockchain Data

Use a public client to fetch data from the blockchain via an RPC.

Sending Transactions

Use a wallet client to send transactions to the blockchain.

Paymasters

Viem has native support for Abstract paymasters. Provide the paymaster and paymasterInput fields when sending a transaction. View Viem documentation.

Smart Contract Wallets

Viem also has native support for using smart contract wallets. This means you can submit transactions from a smart contract wallet by providing a smart wallet account as the account field to the client. View Viem documentation.