pub struct Transfer {
pub id: i64,
pub currency: String,
pub amount: f64,
pub fee: f64,
pub address: String,
pub transaction_id: Option<String>,
pub state: TransferState,
pub created_timestamp: i64,
pub updated_timestamp: i64,
pub confirmed_timestamp: Option<i64>,
pub transfer_type: Option<String>,
}Expand description
Transfer information
Fields§
§id: i64Transfer ID
currency: StringCurrency being transferred
amount: f64Transfer amount
fee: f64Transfer fee
address: StringDestination address
transaction_id: Option<String>Blockchain transaction ID
state: TransferStateCurrent transfer state
created_timestamp: i64Creation timestamp (milliseconds since Unix epoch)
updated_timestamp: i64Last update timestamp (milliseconds since Unix epoch)
confirmed_timestamp: Option<i64>Confirmation timestamp (milliseconds since Unix epoch)
transfer_type: Option<String>Transfer type description
Implementations§
Source§impl Transfer
impl Transfer
Sourcepub fn new(
id: i64,
currency: String,
amount: f64,
fee: f64,
address: String,
created_timestamp: i64,
) -> Self
pub fn new( id: i64, currency: String, amount: f64, fee: f64, address: String, created_timestamp: i64, ) -> Self
Create a new transfer
Sourcepub fn with_transaction_id(self, tx_id: String) -> Self
pub fn with_transaction_id(self, tx_id: String) -> Self
Set transaction ID
Sourcepub fn with_state(self, state: TransferState) -> Self
pub fn with_state(self, state: TransferState) -> Self
Set transfer state
Sourcepub fn is_confirmed(&self) -> bool
pub fn is_confirmed(&self) -> bool
Check if transfer is confirmed
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Check if transfer is cancelled
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Check if transfer is pending
Sourcepub fn net_amount(&self) -> f64
pub fn net_amount(&self) -> f64
Get net amount (amount - fee)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Transfer
impl<'de> Deserialize<'de> for Transfer
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Transfer
Auto Trait Implementations§
impl Freeze for Transfer
impl RefUnwindSafe for Transfer
impl Send for Transfer
impl Sync for Transfer
impl Unpin for Transfer
impl UnwindSafe for Transfer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more