Skip to main content

ArchSignerT

Trait ArchSignerT 

Source
pub trait ArchSignerT: Send + Sync {
    // Required methods
    fn pubkey(&self) -> Pubkey;
    fn sign_message<'life0, 'life1, 'async_trait>(
        &'life0 self,
        message: &'life1 ArchMessage,
    ) -> Pin<Box<dyn Future<Output = Result<SignResponse, SignError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn sign_messages<'life0, 'life1, 'async_trait>(
        &'life0 self,
        messages: &'life1 [ArchMessage],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Result<SignResponse, SignError>>, SignError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn sign_transaction<'life0, 'async_trait>(
        &'life0 self,
        message: ArchMessage,
    ) -> Pin<Box<dyn Future<Output = Result<RuntimeTransaction, SignError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn sign_transaction_mixed<'life0, 'life1, 'async_trait>(
        &'life0 self,
        message: ArchMessage,
        local_cosigners: &'life1 [UntweakedKeypair],
    ) -> Pin<Box<dyn Future<Output = Result<RuntimeTransaction, SignError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Signing interface shared by local and remote backends.

Implementors supply pubkey and sign_message; the transaction-assembly methods are provided. Object-safe: &dyn ArchSignerT works.

Required Methods§

Source

fn pubkey(&self) -> Pubkey

Returns the Arch account key this signer signs for.

Source

fn sign_message<'life0, 'life1, 'async_trait>( &'life0 self, message: &'life1 ArchMessage, ) -> Pin<Box<dyn Future<Output = Result<SignResponse, SignError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Signs the message’s BIP322 digest.

§Errors

SignError::Signing when producing the signature fails. RemoteSigner also returns SignError::Proxy and SignError::Verification as described on its type documentation.

Provided Methods§

Source

fn sign_messages<'life0, 'life1, 'async_trait>( &'life0 self, messages: &'life1 [ArchMessage], ) -> Pin<Box<dyn Future<Output = Result<Vec<Result<SignResponse, SignError>>, SignError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Signs every message in messages, returning one result per input in input order.

A per-item failure does not fail its neighbours. The default implementation signs sequentially; RemoteSigner overrides it with a single POST /v1/sign_batch round trip, which costs one request against the role’s Turnkey rate limit instead of one per message.

Each signature is verified against the message it was requested for, in both implementations.

§Errors

SignError as the whole-request outcome: authentication, transport, a batch larger than the proxy accepts, or a response that cannot be mapped back to the requested messages. Per-item failures are in the returned vector.

Source

fn sign_transaction<'life0, 'async_trait>( &'life0 self, message: ArchMessage, ) -> Pin<Box<dyn Future<Output = Result<RuntimeTransaction, SignError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Signs a transaction whose only required signer is this signer.

§Errors

As for sign_transaction_mixed with no cosigners.

Source

fn sign_transaction_mixed<'life0, 'life1, 'async_trait>( &'life0 self, message: ArchMessage, local_cosigners: &'life1 [UntweakedKeypair], ) -> Pin<Box<dyn Future<Output = Result<RuntimeTransaction, SignError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Signs a transaction with this signer plus local cosigner keypairs.

Each of the first num_required_signatures entries of message.account_keys receives a signature at its own position: this signer’s key is signed via sign_message, a cosigner key is signed with its keypair, and the assembled RuntimeTransaction carries the signatures in account_keys order.

§Errors

Propagates sign_message errors; SignError::Signing when a required key matches neither this signer nor a cosigner, or when a cosigner signature fails.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§