Utils
aa-ethers
offers util methods to speed up your development with EthersProviderAdapter
and AccountSigner
.
Notable util methods include:
convertWalletToAccountSigner
-- converts your ethers.jsWallet
object into anSmartAccountSigner
by deriving implementations of its methods.convertEthersSignerToAccountSigner
-- converts your ethers.jsSigner
object into anSmartAccountSigner
by deriving implementations of its methods.
Usage
ts
// Wallet is a subclass of Signer, and so can be used with either convertor method
const wallet = new Wallet(process.env.PRIVATE_KEY!);
const accountSigner1 = convertWalletToAccountSigner(wallet);
// note that `signTypedData` is not supported by the Signer class, and so this util method cannot derive an implementation of said method for LocalAccountSigner
const accountSigner2 = convertEthersSignerToAccountSigner(wallet);