Skip to main content

WalletAccess

Trait WalletAccess 

Source
pub trait WalletAccess: Send + Sync {
    // Required methods
    fn supported_chains(&self) -> Vec<ChainType>;
    fn account(&self, network: &str) -> Result<Account, PayError>;
    fn sign_payload(
        &self,
        scheme: &str,
        network: &str,
        payload: &str,
    ) -> Result<String, PayError>;
}
Expand description

Trait abstracting wallet access for payment operations.

Each method takes a CAIP-2 network identifier (e.g. "eip155:8453", "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp") to identify the chain.

The private key NEVER leaves the implementation — all signing happens inside the wallet.

Required Methods§

Source

fn supported_chains(&self) -> Vec<ChainType>

Chain families this wallet can operate on.

Source

fn account(&self, network: &str) -> Result<Account, PayError>

Get the account for a CAIP-2 network.

Source

fn sign_payload( &self, scheme: &str, network: &str, payload: &str, ) -> Result<String, PayError>

Sign a payment payload for the given scheme and network.

The payload format depends on the scheme:

  • "exact": EIP-712 typed data JSON (EVM chains)

Returns the signature as a hex string with 0x prefix.

Implementors§