pub struct Transaction {Show 20 fields
pub info: Option<Value>,
pub id: String,
pub txid: Option<String>,
pub timestamp: Option<i64>,
pub datetime: Option<String>,
pub network: Option<String>,
pub address: Option<String>,
pub address_to: Option<String>,
pub address_from: Option<String>,
pub tag: Option<String>,
pub tag_to: Option<String>,
pub tag_from: Option<String>,
pub transaction_type: TransactionType,
pub amount: Decimal,
pub currency: String,
pub status: TransactionStatus,
pub updated: Option<i64>,
pub internal: Option<bool>,
pub comment: Option<String>,
pub fee: Option<TransactionFee>,
}Expand description
Transaction record for deposits and withdrawals.
Fields§
§info: Option<Value>Raw exchange response data.
id: StringExchange-assigned transaction ID.
txid: Option<String>Blockchain transaction hash.
timestamp: Option<i64>Transaction timestamp in milliseconds.
datetime: Option<String>ISO 8601 datetime string.
network: Option<String>Network or chain name (e.g., ERC20, TRC20).
address: Option<String>Blockchain address.
address_to: Option<String>Destination address for withdrawals.
address_from: Option<String>Source address for deposits.
tag: Option<String>Address memo or tag.
tag_to: Option<String>Destination address tag.
tag_from: Option<String>Source address tag.
transaction_type: TransactionTypeTransaction type (deposit or withdrawal).
amount: DecimalTransaction amount.
currency: StringCurrency code.
status: TransactionStatusTransaction status.
updated: Option<i64>Last update timestamp in milliseconds.
internal: Option<bool>Whether this is an internal transfer.
comment: Option<String>Additional notes or comments.
fee: Option<TransactionFee>Transaction fee details.
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn new(
id: String,
transaction_type: TransactionType,
amount: Decimal,
currency: String,
status: TransactionStatus,
) -> Transaction
pub fn new( id: String, transaction_type: TransactionType, amount: Decimal, currency: String, status: TransactionStatus, ) -> Transaction
Creates a new transaction record.
Sourcepub fn is_deposit(&self) -> bool
pub fn is_deposit(&self) -> bool
Returns true if this is a deposit transaction.
Sourcepub fn is_withdrawal(&self) -> bool
pub fn is_withdrawal(&self) -> bool
Returns true if this is a withdrawal transaction.
Sourcepub fn is_internal(&self) -> bool
pub fn is_internal(&self) -> bool
Returns true if this is an internal transfer.
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Returns true if the transaction is completed successfully.
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Returns true if the transaction is pending confirmation.
Sourcepub fn is_canceled(&self) -> bool
pub fn is_canceled(&self) -> bool
Returns true if the transaction was canceled.
Trait Implementations§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more