@@ -590,12 +590,12 @@ pub struct ListReceivedByLabelItem {
590590#[ serde( deny_unknown_fields) ]
591591pub struct ListSinceBlock {
592592 /// All the transactions.
593- pub transactions : Vec < ListSinceBlockTransaction > ,
593+ pub transactions : Vec < TransactionItem > ,
594594 /// Only present if `include_removed=true`.
595595 ///
596596 /// Note: transactions that were re-added in the active chain will appear as-is in this array,
597597 /// and may thus have a positive confirmation count.
598- pub removed : Vec < ListSinceBlockTransaction > ,
598+ pub removed : Vec < TransactionItem > ,
599599 /// The hash of the block (target_confirmations-1) from the best block on the main chain.
600600 ///
601601 /// This is typically used to feed back into listsinceblock the next time you call it. So you
@@ -604,11 +604,12 @@ pub struct ListSinceBlock {
604604 pub last_block : BlockHash ,
605605}
606606
607- /// Transaction list item, part of `ListSinceBlock`.
608- // https://github.com/rust-bitcoin/rust-bitcoin/issues/3516
607+ /// Transaction item, part of `listsinceblock` and `listtransactions`.
609608#[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
610609#[ serde( deny_unknown_fields) ]
611- pub struct ListSinceBlockTransaction {
610+ pub struct TransactionItem {
611+ /// Only returns true if imported addresses were involved in transaction.
612+ pub involves_watch_only : Option < bool > ,
612613 /// The bitcoin address of the transaction.
613614 pub address : Option < Address < NetworkUnchecked > > ,
614615 /// The transaction category.
@@ -631,96 +632,64 @@ pub struct ListSinceBlockTransaction {
631632 /// Available for 'send' and 'receive' category of transactions. When it's < 0, it means the
632633 /// transaction conflicted that many blocks ago.
633634 pub confirmations : i64 ,
635+ /// Only present if the transaction's only input is a coinbase one. Only documented from v0.20 and later.
636+ pub generated : Option < bool > ,
637+ /// Whether we consider the transaction to be trusted and safe to spend from. Only present
638+ /// when the transaction has 0 confirmations (or negative confirmations, if conflicted). v0.20 and later only.
639+ pub trusted : Option < bool > ,
634640 /// The block hash containing the transaction.
635641 ///
636642 /// Available for 'send' and 'receive' category of transactions.
637- pub block_hash : BlockHash ,
643+ pub block_hash : Option < BlockHash > ,
644+ /// The block height containing the transaction. v20 and later only.
645+ pub block_height : Option < u32 > ,
638646 /// The index of the transaction in the block that includes it.
639647 ///
640648 /// Available for 'send' and 'receive' category of transactions.
641- pub block_index : u32 ,
649+ pub block_index : Option < u32 > ,
642650 /// The block time in seconds since epoch (1 Jan 1970 GMT).
643- pub block_time : u32 ,
651+ pub block_time : Option < u32 > ,
644652 /// The transaction id.
645653 ///
646654 /// Available for 'send' and 'receive' category of transactions.
647655 pub txid : Option < Txid > ,
656+ /// The hash of serialized transaction, including witness data. v24 and later only.
657+ pub wtxid : Option < Txid > ,
658+ /// Conflicting transaction ids. Only documented from v0.20 and later.
659+ pub wallet_conflicts : Option < Vec < Txid > > ,
660+ /// The txid if this tx was replaced. v23 and later only.
661+ pub replaced_by_txid : Option < Txid > ,
662+ /// The txid if this tx replaces one. v23 and later only.
663+ pub replaces_txid : Option < Txid > ,
664+ /// Transactions in the mempool that directly conflict with either this transaction or an ancestor transaction. v28 and later only.
665+ pub mempool_conflicts : Option < Vec < Txid > > ,
666+ /// If a comment to is associated with the transaction.
667+ pub to : Option < String > ,
648668 /// The transaction time in seconds since epoch (Jan 1 1970 GMT).
649669 pub time : u32 ,
650670 /// The time received in seconds since epoch (Jan 1 1970 GMT).
651671 ///
652672 /// Available for 'send' and 'receive' category of transactions.
653673 pub time_received : u32 ,
674+ /// If a comment is associated with the transaction.
675+ pub comment : Option < String > ,
654676 /// Whether this transaction could be replaced due to BIP125 (replace-by-fee);
655677 /// may be unknown for unconfirmed transactions not in the mempool
656678 pub bip125_replaceable : Bip125Replaceable ,
679+ /// Only if 'category' is 'received'. List of parent descriptors for the scriptPubKey of this coin. v24 and later only.
680+ pub parent_descriptors : Option < Vec < String > > ,
657681 /// If the transaction has been abandoned (inputs are respendable).
658682 ///
659683 /// Only available for the 'send' category of transactions.
660684 pub abandoned : Option < bool > ,
661- /// If a comment is associated with the transaction.
662- pub comment : Option < String > ,
663685 /// A comment for the address/transaction, if any.
664686 pub label : Option < String > ,
665- /// If a comment to is associated with the transaction.
666- pub to : Option < String > ,
667687}
668688
669689/// Models the result of JSON-RPC method `listtransactions`.
670690#[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
671691#[ serde( deny_unknown_fields) ]
672- pub struct ListTransactions ( pub Vec < ListTransactionsItem > ) ;
673-
674- /// Transaction list item, part of `ListTransactions`.
675- #[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
676- #[ serde( deny_unknown_fields) ]
677- pub struct ListTransactionsItem {
678- /// The bitcoin address of the transaction.
679- pub address : Address < NetworkUnchecked > ,
680- /// The transaction category.
681- pub category : TransactionCategory ,
682- /// The amount.
683- ///
684- /// This is negative for the 'send' category, and is positive for the 'receive' category.
685- #[ serde( default , with = "bitcoin::amount::serde::as_btc" ) ]
686- pub amount : SignedAmount ,
687- /// A comment for the address/transaction, if any.
688- pub label : Option < String > ,
689- /// The vout value.
690- pub vout : u32 ,
691- /// The amount of the fee in BTC.
692- ///
693- /// This is negative and only available for the 'send' category of transactions.
694- #[ serde( default , with = "bitcoin::amount::serde::as_btc" ) ]
695- pub fee : SignedAmount ,
696- /// The number of confirmations for the transaction.
697- ///
698- /// Negative confirmations indicate the transaction conflicts with the block chain.
699- pub confirmations : i64 ,
700- /// Whether we consider the outputs of this unconfirmed transaction safe to spend.
701- pub trusted : bool ,
702- /// The block hash containing the transaction.
703- pub block_hash : BlockHash ,
704- /// The index of the transaction in the block that includes it.
705- pub block_index : u32 ,
706- /// The block time in seconds since epoch (1 Jan 1970 GMT).
707- pub block_time : u32 ,
708- /// The transaction id.
709- pub txid : Txid ,
710- /// The transaction time in seconds since epoch (Jan 1 1970 GMT).
711- pub time : u32 ,
712- /// The time received in seconds since epoch (Jan 1 1970 GMT).
713- pub time_received : u32 ,
714- /// If a comment is associated with the transaction.
715- pub comment : Option < String > ,
716- /// Whether this transaction could be replaced due to BIP125 (replace-by-fee);
717- /// may be unknown for unconfirmed transactions not in the mempool
718- pub bip125_replaceable : Bip125Replaceable ,
719- /// If the transaction has been abandoned (inputs are respendable).
720- ///
721- /// Only available for the 'send' category of transactions.
722- pub abandoned : Option < bool > ,
723- }
692+ pub struct ListTransactions ( pub Vec < TransactionItem > ) ;
724693
725694/// Models the result of JSON-RPC method `listunspent`.
726695#[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
0 commit comments