pub struct RemoteSigner { /* private fields */ }Expand description
Signs by delegating to an arch-cosigner proxy over POST /v1/sign.
Every response is verified before it is returned: the response’s
arch_account_pubkey must equal the configured pubkey,
and the signature must BIP322-verify for the exact submitted message under
that key (DEFAULT-then-ALL sighash, the validator’s order). A failed check
is SignError::Verification.
sign_message retries Proxy errors with
status 502 and transport failures (Proxy with status None) up to the
configured retry count, with exponential backoff. Every other error,
including a 503 from an unavailable proxy or infrastructure in front of
it, returns on first occurrence.
Implementations§
Source§impl RemoteSigner
impl RemoteSigner
Sourcepub fn new(url: &str, token: &str, role: &str, pubkey: Pubkey) -> Self
pub fn new(url: &str, token: &str, role: &str, pubkey: Pubkey) -> Self
Creates a signer for role at the proxy base url, verifying every
response against pubkey.
Defaults: network Bitcoin, 35 s request timeout, 2 retries, intent “unlabeled”, 250 ms retry backoff.
Sourcepub fn with_network(self, network: Network) -> Self
pub fn with_network(self, network: Network) -> Self
Returns this signer with network used for response verification.
Sourcepub fn with_intent(self, intent: &str) -> Self
pub fn with_intent(self, intent: &str) -> Self
Returns this signer with the intent label recorded in the proxy’s audit log.
Sourcepub fn with_retries(self, retries: u32) -> Self
pub fn with_retries(self, retries: u32) -> Self
Returns this signer with the retry budget for retryable errors.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Returns this signer with the per-request HTTP timeout.
Trait Implementations§
Source§impl ArchSignerT for RemoteSigner
impl ArchSignerT for RemoteSigner
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,
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,
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,
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,
messages, returning one result per input in
input order. Read moreSource§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<'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,
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,
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,
Source§impl Clone for RemoteSigner
impl Clone for RemoteSigner
Source§fn clone(&self) -> RemoteSigner
fn clone(&self) -> RemoteSigner
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more