|
1 | 1 | use crate::bitcoin::{ |
2 | | - Address, Amount, BlockHash, DescriptorId, HashableOutPoint, OutPoint, Script, Transaction, |
3 | | - TxOut, Txid, FeeRate |
| 2 | + Address, Amount, BlockHash, DescriptorId, FeeRate, HashableOutPoint, OutPoint, Script, |
| 3 | + Transaction, TxOut, Txid, |
4 | 4 | }; |
5 | 5 | use crate::descriptor::Descriptor; |
6 | 6 | use crate::error::{CreateTxError, RequestBuilderError}; |
@@ -1305,15 +1305,30 @@ impl From<bdk_wallet::ChangeSet> for ChangeSet { |
1305 | 1305 | } |
1306 | 1306 | } |
1307 | 1307 |
|
| 1308 | +/// Details about a transaction affecting the wallet (relevant and canonical). |
1308 | 1309 | #[derive(uniffi::Record, Debug, Clone)] |
1309 | 1310 | pub struct TxDetails { |
| 1311 | + /// The transaction id. |
1310 | 1312 | pub txid: Arc<Txid>, |
| 1313 | + /// The sum of the transaction input amounts that spend from previous outputs tracked by this |
| 1314 | + /// wallet. |
1311 | 1315 | pub sent: Arc<Amount>, |
| 1316 | + /// The sum of the transaction outputs that send to script pubkeys tracked by this wallet. |
1312 | 1317 | pub received: Arc<Amount>, |
| 1318 | + /// The fee paid for the transaction. Note that to calculate the fee for a transaction with |
| 1319 | + /// inputs not owned by this wallet you must manually insert the TxOut(s) into the tx graph |
| 1320 | + /// using the insert_txout function. If those are not available, the field will be `None`. |
1313 | 1321 | pub fee: Option<Arc<Amount>>, |
| 1322 | + /// The fee rate paid for the transaction. Note that to calculate the fee rate for a |
| 1323 | + /// transaction with inputs not owned by this wallet you must manually insert the TxOut(s) into |
| 1324 | + /// the tx graph using the insert_txout function. If those are not available, the field will be |
| 1325 | + /// `None`. |
1314 | 1326 | pub fee_rate: Option<Arc<FeeRate>>, |
| 1327 | + /// The net effect of the transaction on the balance of the wallet. |
1315 | 1328 | pub balance_delta: i64, |
| 1329 | + /// The position of the transaction in the chain. |
1316 | 1330 | pub chain_position: ChainPosition, |
| 1331 | + /// The complete `Transaction`. |
1317 | 1332 | pub tx: Arc<Transaction>, |
1318 | 1333 | } |
1319 | 1334 |
|
|
0 commit comments