pub struct Signer { /* private fields */ }
Expand description
A transaction signer for Soroban operations.
The Signer manages an Ed25519 key pair and provides methods to sign Stellar transactions. It handles the conversion between various key formats used in the Stellar ecosystem and implements the Stellar transaction signing protocol.
Implementations§
Source§impl Signer
impl Signer
Sourcepub fn new(signing_key: SigningKey) -> Self
pub fn new(signing_key: SigningKey) -> Self
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Sourcepub fn account_id(&self) -> AccountId
pub fn account_id(&self) -> AccountId
Sourcepub fn sign_transaction(
&self,
tx: &Transaction,
network_id: &Hash,
) -> Result<DecoratedSignature, SorobanHelperError>
pub fn sign_transaction( &self, tx: &Transaction, network_id: &Hash, ) -> Result<DecoratedSignature, SorobanHelperError>
Signs a transaction with this signer’s private key.
§Parameters
tx
- The transaction to signnetwork_id
- The network ID hash
§Returns
A decorated signature that can be attached to the transaction
§Errors
Returns:
SorobanHelperError::XdrEncodingFailed
if the transaction payload cannot be encodedSorobanHelperError::SigningFailed
if there is an error creating the signature
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Signer
impl RefUnwindSafe for Signer
impl Send for Signer
impl Sync for Signer
impl Unpin for Signer
impl UnwindSafe for Signer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more