Errors
Every error code the Plaza API returns and every error the Plaza program raises.
The error envelope
Every failed API response has one shape. Branch on code; show message.
{
"error": {
"code": "CHAIN_REFUSED",
"message": "The program refused the root.",
"retryable": false,
"stage": "confirmation",
"programError": {
"programId": "Ag4v61FJpf422HEeftGvJoxmzMmQikgVDTZT5E1D9uYe",
"name": "RootOutsideWindow"
}
}
}error.codestringrequired- The stable code, from the table below.
error.messagestringrequired- A sentence a UI can show.
error.retryablebooleanrequired- Whether the same request can succeed later.
error.stagestringrequired- Where the flow failed:
validation,auth,read,upload,build,wallet,co_sign,simulation,sendorconfirmation. error.fieldErrorsRecord<string, string[]>- Messages per request field, on
VALIDATION_ERROR. error.programError{ programId, name, number? }- The program that refused and its error name, on
SIMULATION_FAILEDandCHAIN_REFUSED. error.retryAfterSecondsinteger- On
RATE_LIMITED. error.requestIdstring- Quote it when reporting a failure.
API error codes
| Code | HTTP | Stage | Retry | Raised when |
|---|---|---|---|---|
VALIDATION_ERROR | 400 | validation | no | A field failed its schema; fieldErrors names each field. Also a relayed token withdrawal whose destination has no token account for the mint. |
UNAUTHORIZED | 401 | auth | no | A management build was asked for by a wallet that is not the authority. |
ORIGIN_NOT_ALLOWED | 403 | validation | no | A browser request came from an origin the API does not serve. |
NOT_FOUND | 404 | read | no | No set, root, venue, transaction or receipt under that key. |
PROGRAM_UNAVAILABLE | 409 | build | yes | The Plaza program could not be read. |
CONFIGURATION_REQUIRED | 409 | build | no | The operator has not configured something the route needs, such as the fee rate in production. |
IDEMPOTENCY_CONFLICT | 409 | send | no | A submission repeats an earlier one with different bytes. |
TRANSACTION_EXPIRED | 409 | confirmation | no | The blockhash passed lastValidBlockHeight before the transaction landed. Build again. |
PAYLOAD_TOO_LARGE | 413 | validation | no | The body is over the size limit. |
UNSUPPORTED_MEDIA_TYPE | 415 | validation | no | The body is not application/json. |
SIMULATION_FAILED | 422 | simulation | no | The transaction failed simulation. programError names the program error when there is one. A SOL payout that would leave an account under the rent-exempt minimum fails here with "A payout would leave its account below the rent-exempt minimum. Withdraw more or fund the destination first." |
CHAIN_REFUSED | 422 | confirmation | no | The program refused the transaction on chain. programError carries its name, as listed under Program errors. |
RATE_LIMITED | 429 | read | yes | Too many requests. retryAfterSeconds says when to try again. |
INTERNAL_ERROR | 500 | read | yes | The API failed for a reason of its own. |
UPSTREAM_UNAVAILABLE | 502 | read | yes | The RPC, the Rings indexer or the prover did not answer. |
NOT_READY | 503 | read | yes | The live API is not yet wired to the program for this route, or a set's leaves have no verified manifest behind them yet. |
BUILD_FAILED | 422 | build | no | The transaction could not be built from the inputs. |
WALLET_REJECTED | 400 | wallet | no | The wallet declined to sign. |
SEND_FAILED | 502 | send | yes | The RPC did not accept the transaction. |
Program errors
Anchor custom errors, raised by the Plaza program. Through the API they arrive as SIMULATION_FAILED or CHAIN_REFUSED with programError.programId set to the Plaza program and programError.name set to the name below. Codes 6000 and up are reused by every Anchor program, so match on the program id as well as the number.
| Code | Name | Message | Raised when |
|---|---|---|---|
| 6000 | TreeFull | Deposit tree is full. | The deposit tree holds 4,294,967,296 labels already. |
| 6001 | DepositLabelChanged | Deposit slot or counter changed before execution. | The slot or deposit counter at execution differs from the one the label was computed with. Build the deposit again. |
| 6002 | InvalidWire | Unexpected SPP wire data or accounts. | The SPP instruction data or remaining accounts are not in the shape Plaza expects. |
| 6003 | VenueRefused | This venue does not accept the proven ASP. | The destination is a venue that doesn't accept the proven set. |
| 6004 | RootOutsideWindow | The root is outside this ASP's window. | The proven root is not among the ASP's recent roots, because newer roots pushed it out or the ASP cleared its window. For a ragequit, the proven root is neither the deposit tree's current root nor one its last 32 deposits replaced. Prove again against a current root. |
| 6005 | InvalidBinding | The proof statement differs from the spend. | The proof's nullifier, outputs, exit label or intent don't match this spend. |
| 6006 | InvalidProof | Membership proof verification failed. | The Groth16 proof doesn't verify. |
| 6007 | InvalidSettlement | The escrow credit differs from the withdrawal. | The payout escrow didn't receive exactly the withdrawal amount from SPP. |
| 6008 | InvalidConfig | Invalid fee or root window. | Fee above 10,000 bps, or a root window outside 1 to 32. |
| 6009 | InvalidManifest | Invalid manifest. | Empty or oversized name or manifest URI. |
| 6010 | InvalidSets | Invalid accepted set list. | More than 32 accepted sets, or one listed twice. |