Transaction

Struct Transaction 

Source
pub struct Transaction {
    pub inputs: Vec<Input>,
    pub outputs: Vec<Output>,
    pub struct_metadata: Option<StructMetadata>,
    pub options: Option<TransactionOptions>,
}

Fields§

§inputs: Vec<Input>§outputs: Vec<Output>§struct_metadata: Option<StructMetadata>§options: Option<TransactionOptions>

Implementations§

Source§

impl Transaction

Source

pub fn combine_multisig_proofs( &mut self, other: &Transaction, address: &Address, ) -> RgResult<Transaction>

Source

pub fn with_pow(self) -> RgResult<Self>

Source

pub fn signable_hash_or(&self) -> Hash

Source

pub fn sponsored_time(&self) -> RgResult<i64>

Source

pub fn transaction_type(&self) -> RgResult<TransactionType>

Source

pub fn is_metadata_or_obs(&self) -> bool

Source

pub fn validate_network(&self, network: &NetworkEnvironment) -> RgResult<()>

Source

pub fn network(&self) -> RgResult<NetworkEnvironment>

Source

pub fn is_test(&self) -> bool

Source

pub fn input_of(&self, f: &UtxoId) -> Option<&Input>

Source

pub fn is_swap(&self) -> bool

Source

pub fn is_swap_fulfillment(&self) -> bool

Source

pub fn swap_fulfillment(&self) -> Option<&SwapFulfillment>

Source

pub fn swap_fulfillment_amount_and_destination_and_origin( &self, ) -> Option<(&SwapFulfillment, &CurrencyAmount, &Address, Address)>

Source

pub fn output_data(&self) -> impl Iterator<Item = &StandardData>

Source

pub fn output_request(&self) -> impl Iterator<Item = &StandardRequest>

Source

pub fn output_response(&self) -> impl Iterator<Item = &StandardResponse>

Source

pub fn swap_request(&self) -> Option<&SwapRequest>

Source

pub fn swap_request_and_amount_and_party_address( &self, ) -> Option<(&SwapRequest, &CurrencyAmount, &Address)>

Source

pub fn swap_destination(&self) -> Option<&Address>

Source

pub fn stake_request(&self) -> Option<&StakeRequest>

Source

pub fn stake_deposit_request(&self) -> Option<&StakeDeposit>

Source

pub fn stake_withdrawal_request(&self) -> Option<&StakeWithdrawal>

Source

pub fn stake_withdrawal_fulfillments( &self, ) -> impl Iterator<Item = &StakeWithdrawalFulfillment>

Source

pub fn stake_deposit_destination(&self) -> Option<&Address>

Source

pub fn stake_destination(&self) -> Option<&Address>

Source

pub fn stake_withdrawal_destination(&self) -> Option<&Address>

Source

pub fn swap_destination_currency(&self) -> Option<SupportedCurrency>

Source

pub fn external_destination_currency(&self) -> Option<SupportedCurrency>

Source

pub fn is_stake(&self) -> bool

Source

pub fn has_portfolio_request(&self) -> bool

Source

pub fn portfolio_request(&self) -> Option<&PortfolioRequest>

Source

pub fn is_metadata(&self) -> bool

Source

pub fn is_request(&self) -> bool

Source

pub fn is_deploy(&self) -> bool

Source

pub fn observation_output_index(&self) -> RgResult<i64>

Source

pub fn observation_as_utxo_id(&self) -> RgResult<UtxoId>

Source

pub fn observation_output(&self) -> RgResult<&Output>

Source

pub fn observation_output_as(&self) -> RgResult<UtxoEntry>

Source

pub fn observation(&self) -> RgResult<&Observation>

Source

pub fn observation_proof(&self) -> RgResult<&Proof>

Source

pub fn observation_public_key(&self) -> RgResult<&PublicKey>

Source

pub fn build_observation_proofs(&self) -> RgResult<Vec<ObservationProof>>

Source

pub fn with_hashes(&mut self) -> &mut Self

Source

pub fn with_signable_hash(&mut self) -> Result<&mut Self, ErrorInfo>

Source

pub fn add_proof_per_input(&mut self, proof: &Proof) -> &Transaction

Source

pub fn utxo_inputs(&self) -> impl Iterator<Item = &UtxoId>

Source

pub fn fixed_utxo_ids_of_inputs(&self) -> Result<Vec<UtxoId>, ErrorInfo>

Source

pub fn input_utxo_ids(&self) -> impl Iterator<Item = &UtxoId>

Source

pub fn output_amounts(&self) -> impl Iterator<Item = AddressBalance> + '_

Source

pub fn output_amount_total(&self) -> CurrencyAmount

Source

pub fn output_amounts_opt(&self) -> impl Iterator<Item = &CurrencyAmount>

Source

pub fn output_address_amounts_opt( &self, ) -> impl Iterator<Item = (&Address, CurrencyAmount)>

Source

pub fn output_amount_map<'a>(&'a self) -> HashMap<&'a Address, i64>

Source

pub fn non_remainder_amount_rdg(&self) -> i64

Source

pub fn non_remainder_amount_rdg_typed(&self) -> CurrencyAmount

Source

pub fn remainder_amount(&self) -> i64

Source

pub fn fee_amount(&self) -> i64

Source

pub fn first_output_external_txid(&self) -> Option<&ExternalTransactionId>

Source

pub fn output_external_txids( &self, ) -> impl Iterator<Item = &ExternalTransactionId>

Source

pub fn output_rdg_amount_of(&self, address: &Address) -> i64

Source

pub fn output_of(&self, address: &Address) -> Vec<&Output>

Source

pub fn output_of_with_index(&self, address: &Address) -> Vec<(usize, &Output)>

Source

pub fn first_peer_utxo(&self) -> RgResult<UtxoEntry>

Source

pub fn output_swap_amount_of(&self, address: &Address) -> i64

Source

pub fn has_swap_to(&self, address: &Address) -> bool

Source

pub fn output_bitcoin_address_of(&self, address: &Address) -> Option<&Address>

Source

pub fn output_index(&self, output: &Output) -> RgResult<i64>

Source

pub fn utxo_id_at(&self, index: usize) -> RgResult<UtxoId>

Source

pub fn liquidity_of(&self, a: &Address) -> Vec<(UtxoId, &StakeRequest)>

Source

pub fn stake_requests(&self) -> Vec<(UtxoId, &StakeRequest)>

Source

pub fn total_output_amount(&self) -> i64

Source

pub fn floating_inputs(&self) -> impl Iterator<Item = &FloatingUtxoId>

Source

pub fn total_input_amount(&self) -> i64

Source

pub fn total_output_amount_float(&self) -> f64

Source

pub fn output_amounts_by_product(&self) -> HashMap<ProductId, CurrencyAmount>

Source

pub fn signable_hash(&self) -> Hash

Source

pub fn signed_hash(&self) -> Hash

Source

pub fn to_utxo_entries(&self, time: u64) -> Vec<UtxoEntry>

Source

pub fn to_utxo_address(&self, address: &Address) -> Vec<UtxoEntry>

Source

pub fn utxo_outputs(&self) -> RgResult<Vec<UtxoEntry>>

Source

pub fn output_utxo_ids(&self) -> impl Iterator<Item = &UtxoId>

Source

pub fn head_utxo(&self) -> RgResult<UtxoEntry>

Source

pub fn nmd_utxo(&self) -> RgResult<UtxoEntry>

Source

pub fn height(&self) -> RgResult<i64>

Source

pub fn options(&self) -> RgResult<&TransactionOptions>

Source

pub fn salt(&self) -> RgResult<i64>

Source

pub fn peer_data(&self) -> Result<PeerMetadata, ErrorInfo>

Source

pub fn node_metadata(&self) -> Result<NodeMetadata, ErrorInfo>

Source

pub fn addresses(&self) -> Vec<Address>

👎Deprecated
Source

pub fn input_addresses(&self) -> Vec<Address>

👎Deprecated
Source

pub fn input_address_descriptor_address_or_public_key(&self) -> Vec<Address>

Source

pub fn input_address_set(&self) -> HashSet<Address>

👎Deprecated
Source

pub fn first_input_address(&self) -> Option<Address>

👎Deprecated
Source

pub fn first_input_proof_public_key(&self) -> Option<&PublicKey>

👎Deprecated
Source

pub fn first_output_non_input_or_fee(&self) -> Option<&Output>

Source

pub fn has_input_address_as_output_address(&self) -> bool

Source

pub fn has_relation_to_address(&self, a: &Address) -> bool

Source

pub fn is_outgoing(&self) -> bool

Source

pub fn first_output_address_non_input_or_fee(&self) -> Option<Address>

Source

pub fn first_output_amount(&self) -> Option<f64>

Source

pub fn first_output_amount_i64(&self) -> Option<i64>

Source

pub fn first_output_amount_typed(&self) -> Option<CurrencyAmount>

Source

pub fn first_contract_type(&self) -> Option<StandardContractType>

Trait Implementations§

Source§

impl Clone for Transaction

Source§

fn clone(&self) -> Transaction

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Transaction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Transaction

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Transaction

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for Transaction

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl HashClear for Transaction

Source§

fn hash_clear(&mut self)

Source§

impl Message for Transaction

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for Transaction

Source§

fn eq(&self, other: &Transaction) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ResolvedTransactionFeeValidator for Transaction

Source§

fn validate_resolved_fee( &self, addresses: &Vec<Address>, max_parent_time: i64, ) -> bool

Source§

impl SchemaValidationSupport for Transaction

Source§

fn validate_schema( &self, network_opt: Option<&NetworkEnvironment>, expect_signed: bool, ) -> RgResult<()>

Source§

fn validate_current_time(&self, max_delta: Option<i64>) -> RgResult<()>

Source§

impl Serialize for Transaction

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TransactionFeeValidator for Transaction

Source§

fn validate_fee(&self, addresses: &Vec<Address>) -> bool

Source§

fn validate_fee_only(&self, addresses: &Vec<Address>) -> bool

Source§

impl TransactionPowValidate for Transaction

Source§

impl WithMetadataHashableFields for Transaction

Source§

impl Eq for Transaction

Source§

impl StructuralPartialEq for Transaction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> EasyJson for T
where T: Serialize,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ProtoHashable for T
where T: HashClear + Clone + Message + Default,

Source§

fn calculate_hash(&self) -> Hash

Source§

fn div_mod(&self, bucket: usize) -> i64

Source§

impl<T> ProtoSerde for T
where T: Message + Default,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SerdeCborConverters for T
where T: Serialize + for<'a> Deserialize<'a>,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithMetadataHashable for T

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,