etopay_sdk/types/
transactions.rs

1use api_types::api::{
2    networks::ApiNetwork,
3    transactions::{ApiApplicationMetadata, ApiTxStatus},
4};
5use etopay_wallet::types::CryptoAmount;
6use serde::Serialize;
7
8/// Transaction list
9#[derive(Debug, Serialize)]
10pub struct TxList {
11    /// List of transaction info
12    pub txs: Vec<TxInfo>,
13}
14
15/// Transaction info
16#[derive(Debug, Serialize, Clone)]
17pub struct TxInfo {
18    /// Tx creation date, if available
19    pub date: Option<String>,
20    /// sender of the transaction
21    pub sender: String,
22    /// receiver of the transaction
23    pub receiver: String,
24    /// etopay reference id for the transaction
25    pub reference_id: String,
26    /// Application specific metadata attached to the tx
27    pub application_metadata: Option<ApiApplicationMetadata>,
28    /// Amount of transfer
29    pub amount: f64,
30    /// Currency of transfer
31    pub currency: String,
32    /// Status of the transfer
33    pub status: ApiTxStatus,
34    /// The transaction hash on the network
35    pub transaction_hash: Option<String>,
36    /// Exchange rate
37    pub course: f64,
38}
39
40/// Purchase details
41#[derive(Clone)]
42pub struct PurchaseDetails {
43    /// The sender address where the fees goes to.
44    pub system_address: String,
45    /// The amount to be paid.
46    pub amount: CryptoAmount,
47    /// The status of transaction
48    pub status: ApiTxStatus,
49    /// The network that the transaction is sent in
50    pub network: ApiNetwork,
51}