signer-remote 0.4.1

Signer remote communication package.
Documentation
//! 错误类型定义
use thiserror::Error;
use reqwest::Error as ReqwestError;
use serde_json::Error as SerdeJsonError;
use signer_core::SignerError;

/// 远程服务错误类型
#[derive(Error, Debug)]
pub enum RemoteError {
    /// IO 错误
    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),
    
    /// JSON 序列化/反序列化错误
    #[error("JSON error: {source}. Reason: {reason}. Input: {input}")]
    Json {
        #[source]
        source: SerdeJsonError,
        reason: String,
        input: String,
    },
    
    /// 网络请求错误
    #[error("Network error: {0}")]
    Network(#[from] ReqwestError),
    
    /// Signer 相关错误
    #[error("Signer error: {0}")]
    Signer(#[from] SignerError),
    
    /// 配置错误
    #[error("Invalid configuration: {0}")]
    Config(String),
    
    /// 内部错误
    #[error("Internal error: {0}")]
    Internal(String),

    /// 网络连接或通信错误 (为 SignerTransferClient 添加)
    #[error("Network connection error: {0}")]
    NetworkError(String),

    /// 无效操作错误 (为 SignerTransferClient 添加)
    #[error("Invalid operation: {0}")]
    InvalidOperation(String),

    /// 序列化错误 (为 SignerTransferClient 添加)
    #[error("Serialization error: {0}")]
    SerializationError(String),
}

/// 统一的结果类型
pub type RemoteResult<T> = std::result::Result<T, RemoteError>;