Using Smart Wallets
Smart wallets in Openfort are your primary interface for blockchain interactions. Once an embedded wallet is set up, a smart wallet is automatically created and associated for your user.
Getting an EIP-1193 provider
All of Openfort's wallets can export a standard EIP-1193 provider object. This allows your app to request signatures and transactions from the wallet, using familiar JSON-RPC requests like personal_sign
or eth_sendTransaction
.
To get a wallet's EIP-1193 provider, use the openfort getEthereumProvider
method:
main.tsx
import openfort from "./openfortConfig"
// This example assumes you have already checked that Openfort 'embeddedState' is
// `ready` and the user is `authenticated`
const provider = await openfort.embeddedWallet.getEthereumProvider();
When requesting signatures and transactions from the wallet, you can either choose to interface with the EIP-1193 provider directly, or to pass it to a library like wagmi
or viem
.