Skip to main content
Three hooks that manage the state around quote, execute and status. They never sign or send: bring your own wallet. React 18 or later.

useRavnQuote

Fetches whenever params changes (compared by value). Pass null to skip. isExpired turns true when the quote’s expiresAt passes. It doesn’t refetch on its own: stop the user from signing and call refetch().

useRavnExecute

State around client.execute(), for when you send each execution yourself, exactly as Execution types says: send calls in order (approvals included), or on a SIGNATURE mine the approval before signing, and report your fee’s hash as txHash on /status. Simpler: let the core SDK’s executeAndTrack send it, as below.

useRavnStatus

Polls until success, refunded, failed or unknown, through expired and not_found. Pass null until you have a ref. Use 10,000 to 15,000 ms for a Bitcoin deposit. Stops on errors that can’t succeed on retry (UNAUTHORIZED, INVALID_REQUEST, QUOTE_INVALID, NOT_FOUND).

Together