pk_...) and the SDK installed.
Let the customer pick a market
RenderEarn with no destination to show the market selector. The customer chooses a market, a funding source, and an amount.
Deposit into a market you choose
Most products offer a fixed set of markets. Encode the market’s deposit call and pass it asto.calldata, with TRAILS_HYDRATE_PLACEHOLDER_AMOUNT where the amount goes. At execution, the placeholder is replaced with the amount that actually arrived, so the deposit uses every token that landed after fees.
paymentMethod="CREDIT_DEBIT_CARD". For more on encoding destination calls, see contract calls on arrival.
Find markets
useEarnMarkets lists markets you can offer, filtered by chain, provider, and type, and sorted by rate. It requires TrailsProvider; see React hooks.
Show a customer’s positions
useEarnBalances returns a wallet’s positions on one or more chains. It reads public state and does not need a connected wallet.
From your server
To deposit without the widget, quote an intent withdestinationCallData set to the encoded deposit. See quotes and execution.