Add React + Openfort wallet example#392
Open
joalavedra wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/viemadapter, mirroring the structure ofexamples/react-connectkit. Auth and wallet creation/recovery are handled by the prebuiltOpenfortButtonmodal.Files
Same layout as the sibling React examples:
src/main.tsx—WagmiProvider→OpenfortWagmiBridge→OpenfortProvider→AaveProvider, usinggetDefaultConfigfrom@openfort/react/wagmisrc/App.tsx—OpenfortButtonfor sign-in; renders the form once wagmi reports a connected wallet clientsrc/SupplyForm.tsx—useSupply+useSendTransaction(walletClient)from@aave/react/viemsrc/client.ts,index.html,tsconfig.json,vite.config.ts,.env.example,public/aave.svgNotes
VITE_OPENFORT_PUBLISHABLE_KEYandVITE_SHIELD_PUBLISHABLE_KEY(see.env.exampleand README).@aave/react@nextExecutionPlanshape (Erc20ApprovalwithbyTransaction), matching theuseSupplydocstring in the SDK. The committedreact-connectkit/react-privy/react-thirdwebexamples still use the olderErc20ApprovalRequired/transactionmember and no longer type-check against the currentnexttag — happy to update those in this PR or a follow-up if useful.Verified locally:
tsc --noEmitpasses andvite buildsucceeds.🤖 Generated with Claude Code