Skip to content

Add React + Openfort wallet example#392

Open
joalavedra wants to merge 1 commit into
aave:mainfrom
joalavedra:examples/react-openfort
Open

Add React + Openfort wallet example#392
joalavedra wants to merge 1 commit into
aave:mainfrom
joalavedra:examples/react-openfort

Conversation

@joalavedra

Copy link
Copy Markdown

What

Adds examples/react-openfort, a runnable example showing how to supply GHO on the Aave v4 Core Hub from an Openfort embedded wallet.

Openfort React is built on wagmi + viem, so the connected embedded wallet is a standard viem WalletClient. The example signs Aave transactions through the existing @aave/react/viem adapter, mirroring the structure of examples/react-connectkit. Auth and wallet creation/recovery are handled by the prebuilt OpenfortButton modal.

Files

Same layout as the sibling React examples:

  • src/main.tsxWagmiProviderOpenfortWagmiBridgeOpenfortProviderAaveProvider, using getDefaultConfig from @openfort/react/wagmi
  • src/App.tsxOpenfortButton for sign-in; renders the form once wagmi reports a connected wallet client
  • src/SupplyForm.tsxuseSupply + useSendTransaction(walletClient) from @aave/react/viem
  • src/client.ts, index.html, tsconfig.json, vite.config.ts, .env.example, public/aave.svg

Notes

  • Requires VITE_OPENFORT_PUBLISHABLE_KEY and VITE_SHIELD_PUBLISHABLE_KEY (see .env.example and README).
  • The supply handler targets the current @aave/react@next ExecutionPlan shape (Erc20Approval with byTransaction), matching the useSupply docstring in the SDK. The committed react-connectkit/react-privy/react-thirdweb examples still use the older Erc20ApprovalRequired/transaction member and no longer type-check against the current next tag — happy to update those in this PR or a follow-up if useful.

Verified locally: tsc --noEmit passes and vite build succeeds.

🤖 Generated with Claude Code

Demonstrate supplying GHO on the Aave v4 Core Hub from an Openfort
embedded wallet. Openfort is built on wagmi + viem, so the connected
wallet is a standard viem WalletClient used with the @aave/react/viem
adapter, mirroring the react-connectkit example.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants