The web app talks to Ghost’s relayer over HTTPS JSON. Both prepare and submit require a gas note.
| UI | API |
|---|---|
| Credits top-up | POST /v1/gas/credits/deposit |
| Send | POST /v1/gas/prepare + /v1/gas/submit |
POST /v1/gas/credits/quote
Preview how much USDC credit a deposit of a given mint/amount would create after haircut and protocol fee.
POST /v1/gas/credits/deposit
After the user transfers to the treasury (with memo/commitment), submit the signature so Ghost can verify and issue a gas note.
POST /v1/gas/prepare
Build an unsigned sponsored transfer. Requires gasNote plus from, to, mint, amount. Relayer is feePayer.
POST /v1/gas/submit
Submit the user-signed transaction with the same gasNote. Relayer co-signs, broadcasts, and debits the note.
Sponsored transactions are fail-closed: only allowlisted instruction shapes, fee caps, and rate limits. Deposits require a fresh, matching treasury transfer — risky Token-2022 shapes are rejected.
Production hosts publish their relayer origin separately from the UI origin (for example an api subdomain). Point clients at the host you trust; do not assume a public free relayer.