pub struct Coin {
pub owner: Address,
pub amount: u64,
pub asset_id: AssetId,
pub maturity: BlockHeight,
pub status: CoinStatus,
pub block_created: BlockHeight,
}
Expand description
Represents the user’s coin for some asset with asset_id
.
The Coin
is either CoinStatus::Spent
or CoinStatus::Unspent
. If the coin is unspent,
it can be used as an input to the transaction and can be spent up to the amount
.
After usage as an input of a transaction, the Coin
becomes CoinStatus::Spent
.
Fields§
§owner: Address
§amount: u64
§asset_id: AssetId
§maturity: BlockHeight
§status: CoinStatus
§block_created: BlockHeight
Trait Implementations§
source§impl<'de> Deserialize<'de> for Coin
impl<'de> Deserialize<'de> for Coin
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Coin, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Coin, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl GenesisCommitment for Coin
impl GenesisCommitment for Coin
source§impl Serialize for Coin
impl Serialize for Coin
source§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