Viem Extension for Mantle Chain
- Simplifies cross L1 & L2 interactions
- Seamless extension to Viem
- TypeScript ready
- Test suite running against forked Ethereum network
// import modules
import { walletActionsL1 } from '@mantleio/viem'
import { mantle } from '@mantleio/viem/chains'
import { createWalletClient, custom } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { mainnet } from 'viem/chains'
// create wallet clients
export const walletClientL1 = createWalletClient({
chain: mainnet,
transport: custom(window.ethereum),
}).extend(walletActionsL1())
// perform an action
const hash = await walletClientL1.depositMNT({
account,
request: {
amount: parseEther('1'),
},
targetChain: mantle,
})
If you're interested in contributing, please read the contributing docs before submitting a pull request.
MIT License