ClaimModal returns a failed or rejected EVM deposit to the user, on the chain it came from. The user pastes the deposit’s transaction hash; the modal looks it up and asks your app to authorize the refund.
No wallet is involved, and there is no source chain to pick — the hash is looked up across every chain, so a deposit that landed on a chain your deposit flow doesn’t offer is still claimable.
New in v0.9.0, on the
./claim subpath. Applies to deposits in failed or rejected
status; see troubleshooting for the dashboard equivalent.Why your app authorizes it
Deposit accounts are service-managed, so no user wallet can sign for a refund, and an exchange-funded deposit has no signable sender either. Only your app knows which of its users a deposit belongs to, sorefundEndpoint points at something you control.
Two shapes, depending on where that endpoint lives:
- Your own route (same-origin)
- A deposit-widget-proxy (cross-origin)
The browser’s session cookie travels with the request, so your route authenticates the user the way it always does. No token needed — omit
getUserToken.Implementing the endpoint
@rhinestone/deposit-modal/server exports createRefundHandler, which does everything except decide who the caller is. It verifies the deposit belongs to the recipient you name before spending your API key.
(Request) => Promise<Response>, so it mounts in any fetch-based runtime — Next.js route handlers, Hono, Bun.serve, Cloudflare Workers.
authorize
Return the deposit recipient the caller owns, ornull to reject with 401.
depositRecipient does not decide where money goes. The handler lists deposits settling to it and rejects a txHash that isn’t among them — that’s the whole job. One value covers every deposit account the user has, since the account salt includes the target chain and token.
Set refundDestination whenever you already know where the user’s money should go. Without it the page picks, and it could pick anything.
Request body
The modal POSTs aRefundRequest. It comes from the page, so treat it as untrusted.
Props reference
Required
Authorization
Prefills
Backend
Display
Callbacks
Lifecycle events
ClaimLifecycleEvent shares no variants with the deposit or withdraw unions, so don’t reuse a handler across them.