Skip to content

Conversation

@d4rp4t
Copy link
Collaborator

@d4rp4t d4rp4t commented Jan 12, 2026

cashubtc/nuts#325

Summary by CodeRabbit

  • New Features
    • Added active status indicator and input fee metrics to keyset API responses for enhanced data visibility.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

📝 Walkthrough

Walkthrough

Adds two optional properties to the KeysetItemResponse class within the API models: Active (boolean) and InputFeePpk (unsigned long) with appropriate JSON serialization metadata.

Changes

Cohort / File(s) Summary
API Response Properties
DotNut/ApiModels/GetKeysResponse.cs
Added Active property (bool?) with JSON mapping to "active". Added InputFeePpk property (ulong?) with JSON mapping to "input_fee_ppk" and conditional null serialization.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰✨ Two new fields hop into the response,
Active and InputFeePpk, no remorsefulness!
Properties so clean, with JSON so neat,
The API now shines, the change is complete! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding two new properties ('active' flag and 'input_fee_ppk') to the GetKeysResponse model.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd2c43a and 339fd07.

📒 Files selected for processing (1)
  • DotNut/ApiModels/GetKeysResponse.cs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-11T17:55:03.188Z
Learnt from: d4rp4t
Repo: Kukks/DotNut PR: 23
File: DotNut/Abstractions/Interfaces/IMintQuoteBuilder.cs:1-32
Timestamp: 2026-01-11T17:55:03.188Z
Learning: In the DotNut codebase, PubKey and PrivKey are defined as internal types in the DotNut namespace (DotNut/PubKey.cs and DotNut/PrivKey.cs), not from NBitcoin.Secp256k1. For files in child namespaces (e.g., DotNut.Abstractions) that reference these types, add an explicit 'using DotNut;' directive at the top. This applies to all DotNut.* .cs files that reference these types; do not assume a global using will bring them in.

Applied to files:

  • DotNut/ApiModels/GetKeysResponse.cs
🔇 Additional comments (1)
DotNut/ApiModels/GetKeysResponse.cs (1)

13-15: Inconsistent serialization behavior for nullable Active property.

Active is missing [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)], unlike InputFeePpk and FinalExpiry. This means when Active is null, it will serialize as "active": null rather than being omitted from the JSON output.

If this is intentional (e.g., to distinguish "unknown" from "not provided"), the current code is correct. If Active should behave like the other nullable properties (omitted when null), add the attribute:

Suggested change for consistency
+        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
         [JsonPropertyName("active")] public bool? Active { get; set; } // nullable until wider adoption

Please confirm the intended serialization behavior for the Active property when null.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@d4rp4t d4rp4t merged commit 91baed0 into Kukks:master Jan 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant