pub struct SolanaOffchainTransaction {
pub signed_message: Vec<u8>,
pub chain_hash: [u8; 32],
pub pubkey: [u8; 32],
pub signature: [u8; 64],
}Expand description
A Solana offchain transaction ready for sequencer submission.
Use this for external Solana wallets that should display readable JSON
instead of Borsh bytes. Sign UnsignedTransaction::to_message_bytes,
assemble with SolanaOffchainTransaction::from_parts, then submit via
Client::send_offchain_transaction.
Fields§
§signed_message: Vec<u8>JSON message bytes signed by the Solana wallet.
chain_hash: [u8; 32]Chain hash required by the current Solana offchain Borsh envelope.
pubkey: [u8; 32]Solana Ed25519 public key.
signature: [u8; 64]Ed25519 signature over signed_message.
Implementations§
Source§impl SolanaOffchainTransaction
impl SolanaOffchainTransaction
Sourcepub fn from_parts(
tx: UnsignedTransaction,
signature: [u8; 64],
pubkey: [u8; 32],
) -> SDKResult<Self>
pub fn from_parts( tx: UnsignedTransaction, signature: [u8; 64], pubkey: [u8; 32], ) -> SDKResult<Self>
Assemble a Solana offchain transaction from an unsigned transaction, a 64-byte Ed25519 signature, and a 32-byte public key.
Use after signing the bytes from
UnsignedTransaction::to_message_bytes.
Trait Implementations§
Source§impl BorshDeserialize for SolanaOffchainTransaction
impl BorshDeserialize for SolanaOffchainTransaction
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl Clone for SolanaOffchainTransaction
impl Clone for SolanaOffchainTransaction
Source§fn clone(&self) -> SolanaOffchainTransaction
fn clone(&self) -> SolanaOffchainTransaction
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 moreSource§impl Debug for SolanaOffchainTransaction
impl Debug for SolanaOffchainTransaction
Source§impl PartialEq for SolanaOffchainTransaction
impl PartialEq for SolanaOffchainTransaction
Source§fn eq(&self, other: &SolanaOffchainTransaction) -> bool
fn eq(&self, other: &SolanaOffchainTransaction) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for SolanaOffchainTransaction
impl StructuralPartialEq for SolanaOffchainTransaction
Auto Trait Implementations§
impl Freeze for SolanaOffchainTransaction
impl RefUnwindSafe for SolanaOffchainTransaction
impl Send for SolanaOffchainTransaction
impl Sync for SolanaOffchainTransaction
impl Unpin for SolanaOffchainTransaction
impl UnsafeUnpin for SolanaOffchainTransaction
impl UnwindSafe for SolanaOffchainTransaction
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.