use api_types::api::{
networks::ApiNetwork,
transactions::{ApiApplicationMetadata, ApiTxStatus},
};
use chrono::{DateTime, Utc};
use rust_decimal::Decimal;
use serde::{Deserialize, Serialize};
use super::currencies::CryptoAmount;
#[derive(Debug, Serialize)]
pub struct TxList {
pub txs: Vec<TxInfo>,
}
#[derive(Debug, Serialize, Clone)]
pub struct TxInfo {
pub date: Option<String>,
pub sender: String,
pub receiver: String,
pub reference_id: String,
pub application_metadata: Option<ApiApplicationMetadata>,
pub amount: f64,
pub currency: String,
pub status: ApiTxStatus,
pub transaction_hash: Option<String>,
pub course: f64,
}
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
pub struct WalletTxInfoList {
pub transactions: Vec<WalletTransaction>,
}
#[derive(Clone)]
pub struct PurchaseDetails {
pub system_address: String,
pub amount: CryptoAmount,
pub status: ApiTxStatus,
pub network: ApiNetwork,
}
#[derive(Debug, PartialEq)]
pub struct GasCostEstimation {
pub max_fee_per_gas: u128,
pub max_priority_fee_per_gas: u128,
pub gas_limit: u64,
}
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub enum WalletTxStatus {
Pending,
Confirmed,
Conflicting,
}
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub struct WalletTxInfo {
pub date: String,
pub block_number_hash: Option<(u64, String)>,
pub transaction_hash: String,
pub sender: String,
pub receiver: String,
pub amount: CryptoAmount,
pub network_key: String,
pub status: WalletTxStatus,
pub explorer_url: Option<String>, }
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct WalletTransaction {
pub date: DateTime<Utc>,
pub block_number_hash: Option<(u64, String)>,
pub transaction_hash: String,
pub sender: String,
pub receiver: String,
pub amount: CryptoAmount,
pub network_key: String,
pub status: WalletTxStatus,
pub explorer_url: Option<String>,
pub gas_fee: Option<Decimal>,
pub is_sender: bool,
}