Error Pattern
All SDK methods returnAttestSDKResponse<T> to provide consistent error handling:
Basic Usage
Stellar Errors
Network Errors
| Error | Code | Description | Solution |
|---|---|---|---|
| Connection Failed | N/A | RPC endpoint unreachable | Check internet connection, verify endpoint URL |
| Account Not Found | 404 | Stellar account doesn’t exist | Fund account with XLM or check public key |
| Insufficient Balance | N/A | Not enough XLM for transaction | Add XLM to account |
Transaction Errors
| Error | Code | Description | Solution |
|---|---|---|---|
| Transaction Failed | tx_failed | Transaction execution failed | Check transaction parameters and account state |
| Invalid Schema UID | N/A | Schema UID format incorrect | Use 64-character hex string (transaction hash) |
| Operation Failed | op_* | Specific operation failed | Check operation-specific requirements |
Contract Errors
| Error | Code | Description | Solution |
|---|---|---|---|
| Contract Not Found | N/A | Soroban contract not deployed | Verify contract address |
| Unauthorized | N/A | Not authorized for operation | Register as authority first |
| Execution Failed | N/A | Contract execution error | Check contract state and parameters |
Solana Errors
Program Errors
| Error | Code | Description | Solution |
|---|---|---|---|
| InvalidSchema | 6000 | Schema format invalid | Fix schema content format |
| NotFound | 6001 | Attestation not found | Verify attestation UID exists |
| AlreadyRevoked | 6002 | Attestation already revoked | Check revocation status first |
| Irrevocable | 6003 | Schema doesn’t allow revocation | Use revocable schema |
| InvalidExpirationTime | 6004 | Invalid expiration timestamp | Use future timestamp |
| DataTooLarge | 6005 | Attestation data too large | Reduce data size |
| WrongAsset | 6006 | Incorrect token for levy | Use correct token mint |
| Unauthorized | 6009 | Not authorized | Register as authority |
| SchemaAlreadyExists | 6010 | Schema name taken | Use different schema name |
Network Errors
| Error | Code | Description | Solution |
|---|---|---|---|
| Insufficient Funds | -32002 | Not enough SOL | Add SOL to wallet |
| Blockhash Not Found | N/A | Transaction expired | Retry with fresh blockhash |
| Account Not Found | -32602 | Account doesn’t exist | Create account first |
| Simulation Failed | N/A | Transaction simulation failed | Check transaction validity |
Token Errors
| Error | Code | Description | Solution |
|---|---|---|---|
| Missing Token Account | N/A | Associated token account missing | Create token account |
| Insufficient Tokens | N/A | Not enough tokens for levy | Add tokens to wallet |
| Invalid Mint | N/A | Token mint not recognized | Use correct mint address |
Error Handling Patterns
Basic Error Check
Chain-Specific Handling
Retry Logic
Common Solutions
Insufficient Balance
- Stellar: Add XLM to account (minimum ~2.5 XLM for reserves)
- Solana: Add SOL to wallet (transaction fees + account rent)
Account/Attestation Not Found
- Verify addresses and UIDs are correct
- Check if account is funded (Stellar) or created (Solana)
- Confirm attestation exists on correct network
Authorization Errors
- Register wallet as authority using
registerAuthority() - Verify correct wallet is being used for operations
- Check authority permissions for specific operations
Network Issues
- Verify internet connection
- Check RPC endpoint status
- Try different RPC endpoint if available
- Implement retry logic for temporary failures
Schema/Data Format Errors
- Validate schema content format:
field:type,field:type - Ensure attestation data matches schema structure
- Check data size limits (varies by chain)
- Use proper data types for each field