Struct avalanche_types::txs::utxo::Utxo
source · pub struct Utxo {
pub utxo_id: Id,
pub asset_id: Id,
pub transfer_output: Option<Output>,
pub stakeable_lock_out: Option<StakeableLockOut>,
}
Expand description
Do not parse the internal tests. ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/vms/components/avax#UTXO TODO: implement ordering?
Fields§
§utxo_id: Id
§asset_id: Id
§transfer_output: Option<Output>
AvalancheGo loads “avax.UTXO” object from the db and defines the “out” field as an interface “Out verify.State”.
The underlying type is one of the following:
“*secp256k1fx.TransferOutput” ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/vms/secp256k1fx#TransferOutput
“*platformvm.StakeableLockOut” which embeds “*secp256k1fx.TransferOutput” ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/vms/platformvm#StakeableLockOut
MUST: only one of the following can be “Some”.
stakeable_lock_out: Option<StakeableLockOut>
Implementations§
source§impl Utxo
impl Utxo
pub fn default() -> Self
sourcepub fn from_hex(d: &str) -> Result<Self>
pub fn from_hex(d: &str) -> Result<Self>
Parses the raw hex-encoded data from the “getUTXOs” API.
sourcepub fn unpack(d: &[u8]) -> Result<Self>
pub fn unpack(d: &[u8]) -> Result<Self>
Parses raw bytes to “Utxo”. It assumes the data are already decoded from “hex”. ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/vms/components/avax#UTXO
Trait Implementations§
source§impl<'de> Deserialize<'de> for Utxo
impl<'de> Deserialize<'de> for Utxo
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<'de> DeserializeAs<'de, Utxo> for Hex0xUtxo
impl<'de> DeserializeAs<'de, Utxo> for Hex0xUtxo
source§fn deserialize_as<D>(deserializer: D) -> Result<Utxo, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<Utxo, D::Error>where D: Deserializer<'de>,
source§impl PartialEq<Utxo> for Utxo
impl PartialEq<Utxo> for Utxo
source§impl SerializeAs<Utxo> for Hex0xUtxo
impl SerializeAs<Utxo> for Hex0xUtxo
source§fn serialize_as<S>(x: &Utxo, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(x: &Utxo, serializer: S) -> Result<S::Ok, S::Error>where S: Serializer,
impl Eq for Utxo
impl StructuralEq for Utxo
impl StructuralPartialEq for Utxo
Auto Trait Implementations§
impl RefUnwindSafe for Utxo
impl Send for Utxo
impl Sync for Utxo
impl Unpin for Utxo
impl UnwindSafe for Utxo
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request