Ready-made component for earning rewards
EarnPage
component uses provided APIs to fetch partners and display them.
You need to provide user
so that the component can fetch the user’s join status.
If the user has not joined, it prompts them to sign up for Turtle.
If no user is provided, it will prompt a login modal.
wagmi
) and provide an adapter for it, but you can use any EVM library with a custom adapter@tanstack/react-query
) - Required for data fetching@rainbow-me/rainbowkit
) but you can use any wallet connection solution@turtledev/react
) - Required for theming (this is the only one we provide)"use client"
directive. For other React frameworks, this directive is not
needed.projectId
from Reown (formerly WalletConnect):
Advanced Wagmi Config (Reference)
signMessage
, sendTransaction
,
changeNetwork
, and network
. The EarnPage component is library-agnostic and
only requires these functions to work.(network: Network) => Promise<void>
(message: string) => Promise<string>
(transaction: Transaction<Network>) => Promise<string>
(error: Error) => void
TurtleProvider
to apply theming.
We recommend wrapping somewhere in your app, like in App.tsx
, but you can wrap it in any component.
themeConfig
prop accepts a TurtleThemeConfig
object with the following structure:
Error: Hook must be inside provider (e.g., 'useAccount' hook must be inside 'WagmiProvider')
WagmiProvider
) is configured correctly"use client"
directive in Next.jsError: 'RainbowKit requires a projectId'
projectId
is missing or invalid in your RainbowKit configuration:"YOUR_PROJECT_ID"
with your actual project IDHydration errors in Next.js
"use client"
directivessr: false
for the widget componentNetwork/Chain configuration issues