pub struct LocalSigner { /* private fields */ }Expand description
Signs with an in-memory keypair via arch_sdk::sign_message_bip322.
Implementations§
Source§impl LocalSigner
impl LocalSigner
Sourcepub fn new(keypair: UntweakedKeypair) -> Self
pub fn new(keypair: UntweakedKeypair) -> Self
Wraps an in-memory keypair, with the network defaulting to Bitcoin.
Sourcepub fn from_key_file(path: &str) -> Result<Self, SignError>
pub fn from_key_file(path: &str) -> Result<Self, SignError>
Loads a keypair from a file in arch_sdk::with_secret_key_file
format: a hex-encoded secret key or a JSON byte array.
Never generates or writes a key.
§Errors
SignError::Config when the file is unreadable or does not parse
as a secret key.
Sourcepub fn with_network(self, network: Network) -> Self
pub fn with_network(self, network: Network) -> Self
Returns this signer with network used for BIP322 digests.
Trait Implementations§
Source§impl ArchSignerT for LocalSigner
impl ArchSignerT for LocalSigner
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,
Signs the message’s BIP322 digest. Read more
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,
Signs every message in
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,
Signs a transaction whose only required signer is this signer. Read more
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,
Signs a transaction with this signer plus local cosigner keypairs. Read more
Source§impl Clone for LocalSigner
impl Clone for LocalSigner
Source§fn clone(&self) -> LocalSigner
fn clone(&self) -> LocalSigner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LocalSigner
impl RefUnwindSafe for LocalSigner
impl Send for LocalSigner
impl Sync for LocalSigner
impl Unpin for LocalSigner
impl UnsafeUnpin for LocalSigner
impl UnwindSafe for LocalSigner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more