transformEIP1193Provider
function transforms a standard EIP1193 provider
into an Abstract Global Wallet (AGW) compatible provider.
This allows you to use existing wallet providers with Abstract Global Wallet.
Import
Usage
Parameters
An object containing the following properties:
Returns
AnEIP1193Provider
instance with modified behavior for specific JSON-RPC methods to be compatible with the Abstract Global Wallet.
How it works
ThetransformEIP1193Provider
function wraps the original provider and intercepts specific Ethereum JSON-RPC methods:
eth_accounts
: Returns the smart account address along with the original signer address.eth_signTransaction
andeth_sendTransaction
:- If the transaction is from the original signer, it passes through to the original provider.
- If it’s from the smart account, it uses the AGW client to handle the transaction.