Skip to main content

Crate cosigner_client

Crate cosigner_client 

Source
Expand description

Signers for Arch Network transactions, local or through the arch-cosigner custody proxy.

ArchSignerT is the signing interface: implementors provide pubkey and sign_message, and inherit transaction assembly (sign_transaction, sign_transaction_mixed). LocalSigner signs with an in-memory keypair; RemoteSigner delegates to the proxy’s POST /v1/sign and verifies every response, or coalesces several messages into one POST /v1/sign_batch (sign_messages). ArchSigner wraps both behind one type so the deployment environment can choose the backend (ArchSigner::from_env).

§Examples

use cosigner_client::{ArchSigner, ArchSignerT, SignError};

async fn submit(
    message: arch_program::sanitized::ArchMessage,
) -> Result<arch_sdk::RuntimeTransaction, SignError> {
    let signer = ArchSigner::from_env()?;
    signer.sign_transaction(message).await
}

Structs§

BatchSigner
Coalesces concurrent single-message signing into batched proxy calls under a configurable rate budget. Implements ArchSignerT, so call sites are unchanged.
LocalSigner
Signs with an in-memory keypair via arch_sdk::sign_message_bip322.
RemoteSigner
Signs by delegating to an arch-cosigner proxy over POST /v1/sign.
SignResponse
A signature over a message’s BIP322 digest, with backend metadata.

Enums§

ArchSigner
A signer whose backend, local or remote, is chosen at runtime.
SignError
Error surface for signer construction and signing.

Traits§

ArchSignerT
Signing interface shared by local and remote backends.