openzeppelin_relayer/domain/relayer/solana/rpc/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! This module implements the Solana RPC functionality.

mod methods;
pub use methods::*;

mod handler;
pub use handler::*;

use log::error;
use thiserror::Error;

use crate::{
    models::{SignerError, SolanaEncodingError},
    services::SolanaProviderError,
};

#[derive(Debug, Error)]
#[allow(dead_code)]
pub enum SolanaRpcError {
    #[error("Unsupported method: {0}")]
    UnsupportedMethod(String),
    #[error("BadRequest: {0}")]
    BadRequest(String),
    #[error("Feature fetch error: {0}")]
    FeatureFetch(String),
    #[error("Invalid params: {0}")]
    InvalidParams(String),
    #[error("Unsupported Fee token error: {0}")]
    UnsupportedFeeToken(String),
    #[error("Estimation Error: {0}")]
    Estimation(String),
    #[error("Insufficient funds: {0}")]
    InsufficientFunds(String),
    #[error("Transaction preparation error: {0}")]
    TransactionPreparation(String),
    #[error("Preparation error: {0}")]
    Preparation(String),
    #[error("Signature error: {0}")]
    Signature(String),
    #[error("Token fetch error: {0}")]
    TokenFetch(String),
    #[error("Token Account error: {0}")]
    TokenAccount(String),
    #[error("Send error: {0}")]
    Send(String),
    #[error("Transaction validation error: {0}")]
    SolanaTransactionValidation(#[from] SolanaTransactionValidationError),
    #[error("Signing error: {0}")]
    Signing(#[from] SignerError),
    #[error("Encoding error: {0}")]
    Encoding(#[from] SolanaEncodingError),
    #[error("Provider error: {0}")]
    Provider(#[from] SolanaProviderError),
    #[error("Token error: {0}")]
    Token(#[from] TokenError),
    #[error("Internal error: {0}")]
    Internal(String),
}