Struct redgold_schema::structs::StandardData
source · pub struct StandardData {Show 19 fields
pub amount: Option<CurrencyAmount>,
pub generic_typed_value: Option<GenericTypedValue>,
pub peer_data: Option<PeerMetadata>,
pub node_metadata: Option<NodeMetadata>,
pub dynamic_node_metadata: Option<DynamicNodeMetadata>,
pub height: Option<i64>,
pub data_hash: Option<Hash>,
pub hash: Option<Hash>,
pub observation: Option<Observation>,
pub address: Option<Address>,
pub state: Option<BytesData>,
pub request: Option<BytesData>,
pub standard_request: Option<StandardRequest>,
pub liquidity_request: Option<LiquidityRequest>,
pub portfolio_info: Option<PortfolioInfo>,
pub schema_def: Option<SchemaDef>,
pub data: Option<BytesData>,
pub aggregate_state_hash: Option<Hash>,
pub external_transaction_id: Option<ExternalTransactionId>,
}Expand description
Generic data structure designed to hold arbitrary data in a common format. This should be considered supplementary to using a regular schema, not a complete substitute.
Fields§
§amount: Option<CurrencyAmount>Standard currency style field
generic_typed_value: Option<GenericTypedValue>§peer_data: Option<PeerMetadata>Where a peer (representing a person controlling multiple nodes from a cold wallet,) updates it’s metadata within a transaction
node_metadata: Option<NodeMetadata>Where an online or live node programmatically updates it’s own metadata using it’s live hot keys
dynamic_node_metadata: Option<DynamicNodeMetadata>Latest value associated with the online / hot node – updated more frequently and not necessarily tracked in every transaction, but kept here for reference.
height: Option<i64>Equivalent to ‘block height’, linear observation counter
data_hash: Option<Hash>Reference to externally resolved data
hash: Option<Hash>Pure hash reference, without necessarily being backed by any specific data.
observation: Option<Observation>Used for node transactions related to their internal observation formation, equivalent to a ‘local’ block
address: Option<Address>Used for referencing bitcoin address, kept here at top level for convenience
state: Option<BytesData>Used to store state information directly following eUTXO conventions
request: Option<BytesData>Contract style request, similar to Ethereum transaction for updating a smart contract, from an external user
standard_request: Option<StandardRequest>Contract style response, similar to above, but specifically typed to correspond to a ‘default’ schema driven request common to all contracts and available automatically in the SDK.
liquidity_request: Option<LiquidityRequest>Staking request, designed for use with the native AMM/Portfolio functions.
portfolio_info: Option<PortfolioInfo>Portfolio information, used for updating the current ‘target’ state of a portfolio
schema_def: Option<SchemaDef>Schema definition for the data, used for parsing and validation
data: Option<BytesData>Generic bytes data, used for storing arbitrary data
aggregate_state_hash: Option<Hash>For eUTXO style contracts, the hash of all state information aggregated from initial state origin. Can be re-calculated.
external_transaction_id: Option<ExternalTransactionId>A bitcoin txid for example
Implementations§
source§impl StandardData
impl StandardData
source§impl StandardData
impl StandardData
pub fn observation(o: Observation) -> Self
pub fn empty() -> Self
pub fn peer_data(pd: PeerMetadata) -> Option<Self>
pub fn amount_data(amount: u64) -> Option<Self>
Trait Implementations§
source§impl Clone for StandardData
impl Clone for StandardData
source§fn clone(&self) -> StandardData
fn clone(&self) -> StandardData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for StandardData
impl Debug for StandardData
source§impl Default for StandardData
impl Default for StandardData
source§impl<'de> Deserialize<'de> for StandardData
impl<'de> Deserialize<'de> for StandardData
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Hash for StandardData
impl Hash for StandardData
source§impl Message for StandardData
impl Message for StandardData
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where B: BufMut, Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where Self: Sized,
source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where B: BufMut, Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where Self: Sized,
source§fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where B: Buf, Self: Default,
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where B: Buf, Self: Default,
source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where B: Buf, Self: Sized,
self. Read moresource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where B: Buf, Self: Sized,
self.source§impl PartialEq for StandardData
impl PartialEq for StandardData
source§fn eq(&self, other: &StandardData) -> bool
fn eq(&self, other: &StandardData) -> bool
self and other values to be equal, and is used
by ==.