pub struct UnsignedTransaction { /* private fields */ }Expand description
An unsigned transaction with the chain hash baked in.
Created by [UnsignedTransaction::build]. Contains everything
needed to produce signable bytes without a client reference.
Implementations§
Source§impl UnsignedTransaction
impl UnsignedTransaction
Sourcepub fn to_bytes(&self) -> SDKResult<Vec<u8>>
pub fn to_bytes(&self) -> SDKResult<Vec<u8>>
Serialize into the bytes that must be signed.
Borsh-serializes the transaction and appends the chain hash (32 bytes) as a domain separator.
Sourcepub fn builder<'f1>() -> UnsignedTransactionBuilder<'f1>
pub fn builder<'f1>() -> UnsignedTransactionBuilder<'f1>
Build an unsigned transaction.
The returned UnsignedTransaction contains the chain hash, so
to_bytes() produces signable bytes
without needing a client reference.
§Example
ⓘ
let unsigned = UnsignedTransaction::builder()
.call_message(call_msg)
.max_fee(10_000_000)
.client(&client)
.build()?;
let signable = unsigned.to_bytes()?;
let signature: [u8; 64] = external_signer.sign(&signable);
let pub_key: [u8; 32] = external_signer.public_key();
let signed = Transaction::from_parts(unsigned, signature, pub_key);Auto Trait Implementations§
impl Freeze for UnsignedTransaction
impl RefUnwindSafe for UnsignedTransaction
impl Send for UnsignedTransaction
impl Sync for UnsignedTransaction
impl Unpin for UnsignedTransaction
impl UnsafeUnpin for UnsignedTransaction
impl UnwindSafe for UnsignedTransaction
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