viem-ethers-bridge
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Viem => Ethers.js bridge

Motivations

Without a doubt, I think that viem will shortly replace ethers.js as the reference web3 base library. While the tooling with wagmi is very useful for dApp developers, some third-party services will still only accept ethers.js objects.

This package allow to convert a viem WalletClient to a ethers.js v5 Signer.

Example

import { createWalletClient, custom } from 'viem';
import { WagmiSigner } from 'viem-ethers-bridge';
import { mainnet } from 'viem/chains';

const client = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum),
});

const signer = new WagmiSigner(client);
// signer instanceof Signer === true

Package Sidebar

Install

npm i viem-ethers-bridge

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

93.6 kB

Total Files

24

Last publish

Collaborators

  • mathieu-bour