@ravn/sdk call that benefits from React state: quote
fetching with expiry tracking, execute as an async action, and status as a poll. You still bring
your own wallet; these hooks never sign or send anything.
peer dependency
Requires React 18 or later.
peer dependency
Create one
RavnClient and pass it to every hook.useRavnQuote
params changes (compared by value, not by reference, so a fresh object
literal on every render is fine), and sets isExpired on its own timer when quote.expiresAt
passes: no polling, one setTimeout per quote. Pass params: null to skip fetching, for
example when the amount hasn’t been entered yet.
Does not auto-refetch on expiry. Silently re-pricing behind the user’s back is worse than
telling them to ask again, so call
refetch() yourself in response to isExpired.QuoteDTO | null
boolean
boolean
True once
quote.expiresAt has passed. Stop letting the user sign, and call refetch().() => void
useRavnExecute
client.execute(). Branch on the returned executionType and hand
it to whatever signer you already have: wagmi, ethers, a hardware wallet. Same contract as the
Quickstart.
(params: ExecuteParams) => Promise<ExecutionDTO>
Also throws on failure. Handle the rejection or read
error, whichever fits your flow.ExecutionDTO | null
boolean
unknown
useRavnStatus
GET /status until the status leaves pending/processing:
expired, success, refunded, failed, not_found, and unknown all stop the poll. Pass
params: null to not poll at all, for example before execution has produced a ref.
Keeps polling through a transient network or
5xx error. Stops immediately on a permanent one,
UNAUTHORIZED, INVALID_REQUEST, QUOTE_INVALID, or NOT_FOUND, since retrying with the same
arguments can never turn one of those into success.StatusDTO | null
boolean
unknown

