Struct sugar_cli::withdraw::process::Transaction
[−]Expand description
An atomic transaction
Fields
signatures: Vec<Signature, Global>A set of digital signatures of a serialized Message, signed by the
first signatures.len() keys of account_keys.
message: MessageThe message to sign.
Implementations
impl Transaction
impl Transaction
pub fn new_unsigned(message: Message) -> Transaction
pub fn new_with_payer(
instructions: &[Instruction],
payer: Option<&Pubkey>
) -> Transaction
pub fn new_signed_with_payer<T>(
instructions: &[Instruction],
payer: Option<&Pubkey>,
signing_keypairs: &T,
recent_blockhash: Hash
) -> Transaction where
T: Signers,
pub fn new_signed_with_payer<T>(
instructions: &[Instruction],
payer: Option<&Pubkey>,
signing_keypairs: &T,
recent_blockhash: Hash
) -> Transaction where
T: Signers,
pub fn new<T>(
from_keypairs: &T,
message: Message,
recent_blockhash: Hash
) -> Transaction where
T: Signers,
pub fn new<T>(
from_keypairs: &T,
message: Message,
recent_blockhash: Hash
) -> Transaction where
T: Signers,
pub fn new_with_compiled_instructions<T>(
from_keypairs: &T,
keys: &[Pubkey],
recent_blockhash: Hash,
program_ids: Vec<Pubkey, Global>,
instructions: Vec<CompiledInstruction, Global>
) -> Transaction where
T: Signers,
pub fn new_with_compiled_instructions<T>(
from_keypairs: &T,
keys: &[Pubkey],
recent_blockhash: Hash,
program_ids: Vec<Pubkey, Global>,
instructions: Vec<CompiledInstruction, Global>
) -> Transaction where
T: Signers,
Create a signed transaction
from_keypairs- The keys used to sign the transaction.keys- The keys for the transaction. These are the program state instances or lamport recipient keys.recent_blockhash- The PoH hash.program_ids- The keys that identify programs used in theinstructionvector.instructions- Instructions that will be executed atomically.
Panics
Panics when signing fails.
pub fn data(&self, instruction_index: usize) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
pub fn key(
&self,
instruction_index: usize,
accounts_index: usize
) -> Option<&Pubkey>
pub fn signer_key(
&self,
instruction_index: usize,
accounts_index: usize
) -> Option<&Pubkey>
pub fn message_data(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn message_data(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Return the serialized message data to sign.
pub fn sign<T>(&mut self, keypairs: &T, recent_blockhash: Hash) where
T: Signers,
pub fn sign<T>(&mut self, keypairs: &T, recent_blockhash: Hash) where
T: Signers,
Check keys and keypair lengths, then sign this transaction.
Panics
Panics when signing fails, use Transaction::try_sign to handle the error.
pub fn partial_sign<T>(&mut self, keypairs: &T, recent_blockhash: Hash) where
T: Signers,
pub fn partial_sign<T>(&mut self, keypairs: &T, recent_blockhash: Hash) where
T: Signers,
Sign using some subset of required keys if recent_blockhash is not the same as currently in the transaction, clear any prior signatures and update recent_blockhash
Panics
Panics when signing fails, use Transaction::try_partial_sign to handle the error.
pub fn partial_sign_unchecked<T>(
&mut self,
keypairs: &T,
positions: Vec<usize, Global>,
recent_blockhash: Hash
) where
T: Signers,
pub fn partial_sign_unchecked<T>(
&mut self,
keypairs: &T,
positions: Vec<usize, Global>,
recent_blockhash: Hash
) where
T: Signers,
Sign the transaction and place the signatures in their associated positions in signatures
without checking that the positions are correct.
Panics
Panics when signing fails, use Transaction::try_partial_sign_unchecked to handle the error.
pub fn try_sign<T>(
&mut self,
keypairs: &T,
recent_blockhash: Hash
) -> Result<(), SignerError> where
T: Signers,
pub fn try_sign<T>(
&mut self,
keypairs: &T,
recent_blockhash: Hash
) -> Result<(), SignerError> where
T: Signers,
Check keys and keypair lengths, then sign this transaction, returning any signing errors encountered
pub fn try_partial_sign<T>(
&mut self,
keypairs: &T,
recent_blockhash: Hash
) -> Result<(), SignerError> where
T: Signers,
pub fn try_partial_sign<T>(
&mut self,
keypairs: &T,
recent_blockhash: Hash
) -> Result<(), SignerError> where
T: Signers,
Sign using some subset of required keys, returning any signing errors encountered. If recent_blockhash is not the same as currently in the transaction, clear any prior signatures and update recent_blockhash
pub fn try_partial_sign_unchecked<T>(
&mut self,
keypairs: &T,
positions: Vec<usize, Global>,
recent_blockhash: Hash
) -> Result<(), SignerError> where
T: Signers,
pub fn try_partial_sign_unchecked<T>(
&mut self,
keypairs: &T,
positions: Vec<usize, Global>,
recent_blockhash: Hash
) -> Result<(), SignerError> where
T: Signers,
Sign the transaction, returning any signing errors encountered, and place the
signatures in their associated positions in signatures without checking that the
positions are correct.
pub fn get_invalid_signature() -> Signature
pub fn verify_signatures_len(&self) -> bool
pub fn verify_signatures_len(&self) -> bool
Verify the length of signatures matches the value in the message header
pub fn verify_and_hash_message(&self) -> Result<Hash, TransactionError>
pub fn verify_and_hash_message(&self) -> Result<Hash, TransactionError>
Verify the transaction and hash its message
pub fn verify_with_results(&self) -> Vec<bool, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn verify_precompiles(
&self,
feature_set: &Arc<FeatureSet>
) -> Result<(), TransactionError>
pub fn verify_precompiles(
&self,
feature_set: &Arc<FeatureSet>
) -> Result<(), TransactionError>
Verify the precompiled programs in this transaction
pub fn get_signing_keypair_positions(
&self,
pubkeys: &[Pubkey]
) -> Result<Vec<Option<usize>, Global>, TransactionError>
pub fn get_signing_keypair_positions(
&self,
pubkeys: &[Pubkey]
) -> Result<Vec<Option<usize>, Global>, TransactionError>
Get the positions of the pubkeys in account_keys associated with signing keypairs
pub fn replace_signatures(
&mut self,
signers: &[(Pubkey, Signature)]
) -> Result<(), TransactionError>
pub fn replace_signatures(
&mut self,
signers: &[(Pubkey, Signature)]
) -> Result<(), TransactionError>
Replace all the signatures and pubkeys
pub fn is_signed(&self) -> bool
Trait Implementations
impl AbiExample for Transaction
impl AbiExample for Transaction
fn example() -> Transaction
impl Clone for Transaction
impl Clone for Transaction
fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
impl Debug for Transaction
impl Debug for Transaction
impl Default for Transaction
impl Default for Transaction
fn default() -> Transaction
fn default() -> Transaction
Returns the “default value” for a type. Read more
impl<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
fn deserialize<__D>(
__deserializer: __D
) -> Result<Transaction, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Transaction, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl FromWasmAbi for Transaction
impl FromWasmAbi for Transaction
impl IntoWasmAbi for Transaction
impl IntoWasmAbi for Transaction
impl OptionFromWasmAbi for Transaction
impl OptionFromWasmAbi for Transaction
fn is_none(abi: &<Transaction as FromWasmAbi>::Abi) -> bool
fn is_none(abi: &<Transaction as FromWasmAbi>::Abi) -> bool
Tests whether the argument is a “none” instance. If so it will be
deserialized as None, and otherwise it will be passed to
FromWasmAbi. Read more
impl OptionIntoWasmAbi for Transaction
impl OptionIntoWasmAbi for Transaction
fn none() -> <Transaction as IntoWasmAbi>::Abi
fn none() -> <Transaction as IntoWasmAbi>::Abi
Returns an ABI instance indicating “none”, which JS will interpret as
the None branch of this option. Read more
impl PartialEq<Transaction> for Transaction
impl PartialEq<Transaction> for Transaction
fn eq(&self, other: &Transaction) -> bool
fn eq(&self, other: &Transaction) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
fn ne(&self, other: &Transaction) -> bool
fn ne(&self, other: &Transaction) -> bool
This method tests for !=.
impl RefFromWasmAbi for Transaction
impl RefFromWasmAbi for Transaction
type Anchor = Ref<'static, Transaction>
type Anchor = Ref<'static, Transaction>
The type that holds the reference to Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous. Read more
unsafe fn ref_from_abi(
js: <Transaction as RefFromWasmAbi>::Abi
) -> <Transaction as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi(
js: <Transaction as RefFromWasmAbi>::Abi
) -> <Transaction as RefFromWasmAbi>::Anchor
Recover a Self::Anchor from Self::Abi. Read more
impl RefMutFromWasmAbi for Transaction
impl RefMutFromWasmAbi for Transaction
type Anchor = RefMut<'static, Transaction>
type Anchor = RefMut<'static, Transaction>
Same as RefFromWasmAbi::Anchor
unsafe fn ref_mut_from_abi(
js: <Transaction as RefMutFromWasmAbi>::Abi
) -> <Transaction as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi(
js: <Transaction as RefMutFromWasmAbi>::Abi
) -> <Transaction as RefMutFromWasmAbi>::Anchor
Same as RefFromWasmAbi::ref_from_abi
impl Sanitize for Transaction
impl Sanitize for Transaction
fn sanitize(&self) -> Result<(), SanitizeError>
impl Serialize for Transaction
impl Serialize for Transaction
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Transaction
impl StructuralEq for Transaction
impl StructuralPartialEq for Transaction
Auto Trait Implementations
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
impl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
sourcefn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more