1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use crate::{
common::{
fuel_asm::Word,
fuel_tx::{
Address,
AssetId,
},
},
model::BlockHeight,
};
#[cfg(graphql)]
use async_graphql::Enum;
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
pub struct Coin {
pub owner: Address,
pub amount: Word,
pub asset_id: AssetId,
pub maturity: BlockHeight,
pub status: CoinStatus,
pub block_created: BlockHeight,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Copy, Clone, Eq, PartialOrd, PartialEq)]
#[repr(u8)]
pub enum CoinStatus {
Unspent,
Spent,
}