Skip to content

Add missing transaction categories #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions types/src/model/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ pub enum AddressPurpose {
/// The category of a transaction.
#[derive(Copy, Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
pub enum TransactionCategory {
/// Transaction is a send.
/// Transactions sent.
Send,
/// Transactions is a receive.
/// Non-coinbase transactions received.
Receive,
/// Coinbase transactions received with more than 100 confirmations.
Generate,
/// Coinbase transactions received with 100 or fewer confirmations.
Immature,
/// Orphaned coinbase transactions received.
Orphan,
}

/// Whether this transaction can be RBF'ed.
Expand Down
3 changes: 3 additions & 0 deletions types/src/v17/wallet/into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ impl TransactionCategory {
match self {
V::Send => M::Send,
V::Receive => M::Receive,
V::Generate => M::Generate,
V::Immature => M::Immature,
V::Orphan => M::Orphan,
}
}
}
Expand Down
10 changes: 8 additions & 2 deletions types/src/v17/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ pub enum AddressPurpose {
#[derive(Copy, Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum TransactionCategory {
/// Transaction is a send.
/// Transactions sent.
Send,
/// Transactions is a receive.
/// Non-coinbase transactions received.
Receive,
/// Coinbase transactions received with more than 100 confirmations.
Copy link
Member

@tcharding tcharding Mar 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to merge this but just flagging that now there are docs in v17 that came from a later version of Core. We have an outstanding issue #59 that describes how the re-exports include docs so version specific types have the 'wrong' docs on them.

Generate,
/// Coinbase transactions received with 100 or fewer confirmations.
Immature,
/// Orphaned coinbase transactions received.
Orphan,
}

/// Whether this transaction can be RBF'ed.
Expand Down