Setup
string
Self-serve or enterprise key. Omit for the anonymous tier: it works immediately, at a lower rate limit. See Authentication.
string
Default
https://ravn.exchange/api/v1.function
Swap in your own
fetch (React Native, a test double). Defaults to the global fetch.Full example
Quote, execute, and track a swap end to end.execution.executionType also branches to
TRANSACTION or SIGNATURE; see the Quickstart for the full switch.
Methods
Every method throwsRavnApiError on a non-2xx response; see Errors below. Field
meanings match the API Reference pages linked from each method.
getQuote
POST /quote. Omitting destinationAddress/refundAddress
returns a preview-only quote, so check quote.executable before calling execute.
execute
POST /execute. Branch on executionType exactly as in the
Quickstart. This client doesn’t sign or send anything for you.
submitSignature
POST /submit-signature. Only for SIGNATURE-type
executions. Returns the statusRef to poll getStatus with.
getStatus
GET /status. ref is the statusRef from execute (for
DEPOSIT) or from submitSignature (for SIGNATURE), matching the Full example above.
Errors
Every non-2xx response throws aRavnApiError, never a raw fetch or JSON error:
string
Human-readable, and can change. Don’t branch on it.
unknown
Present on some codes, for example the failed fields on
INVALID_REQUEST.object
requestId and version, when the API returned an envelope at all.
