rpc: wallet: Add snake_case aliases for listunspent options #36785

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2611-wallet-snake-rpc-options changing 5 files +59 −38
  1. maflcko commented at 7:08 PM on November 5, 2026: member

    This concludes the snake_case aliases for all wallet option objects or named args.

    Deprecation can be done in the future, in a few releases.

  2. DrahtBot renamed this:
    rpc: wallet: Add snake_case aliases for listunspent options
    rpc: wallet: Add snake_case aliases for listunspent options
    on Nov 5, 2026
  3. DrahtBot added the label RPC/REST/ZMQ on Nov 5, 2026
  4. DrahtBot commented at 7:08 PM on November 5, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK Zippo76, willcl-ark

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #36743 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36743.svg"></sub> ([RFC] build: build with -Wmissing-declarations/prototypes by fanquake)
    • #35302 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35302.svg"></sub> (Silent Payments: Sending (take 2) by Eunovo)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. rpc: wallet: Add snake_case aliases for listunspent options
    And use it in one test.
    fab4cb51b4
  6. refactor: Re-use a single GetOptionWithAlias
    This does not change any behavior, but makes possible future deprecation
    easier.
    facf53acf4
  7. maflcko force-pushed on Nov 5, 2026
  8. DrahtBot added the label CI failed on Nov 5, 2026
  9. maflcko commented at 7:16 PM on November 5, 2026: member

    <details><summary>rendered schema and doc diff</summary>

    diff --git a/getopenrpcinfo.full.json b/getopenrpcinfo.full.json
    index ee8225f..1e3d368 100644
    --- a/getopenrpcinfo.full.json
    +++ b/getopenrpcinfo.full.json
    @@ -11685 +11685 @@
    -                            "minimumAmount": {
    +                            "minimum_amount": {
    @@ -11697 +11697 @@
    -                            "maximumAmount": {
    +                            "maximum_amount": {
    @@ -11709 +11709 @@
    -                            "maximumCount": {
    +                            "maximum_count": {
    @@ -11714 +11714 @@
    -                            "minimumSumAmount": {
    +                            "minimum_sum_amount": {
    diff --git a/listunspent b/listunspent
    index 0fe30b3..cde15ac 100644
    --- a/listunspent
    +++ b/listunspent
    @@ -20,4 +20,4 @@ Named Arguments:
    -minimumAmount                (numeric or string, optional, default="0.00") Minimum value of each UTXO in BTC
    -maximumAmount                (numeric or string, optional, default=unlimited) Maximum value of each UTXO in BTC
    -maximumCount                 (numeric, optional, default=unlimited) Maximum number of UTXOs
    -minimumSumAmount             (numeric or string, optional, default=unlimited) Minimum sum value of all UTXOs in BTC
    +minimum_amount               (numeric or string, optional, default="0.00") Minimum value of each UTXO in BTC
    +maximum_amount               (numeric or string, optional, default=unlimited) Maximum value of each UTXO in BTC
    +maximum_count                (numeric, optional, default=unlimited) Maximum number of UTXOs
    +minimum_sum_amount           (numeric or string, optional, default=unlimited) Minimum sum value of all UTXOs in BTC
    @@ -60,2 +60,2 @@ Examples:
    -> bitcoin-cli listunspent 6 9999999 '[]' true '{ "minimumAmount": 0.005 }'
    -> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "listunspent", "params": [6, 9999999, [] , true, { "minimumAmount": 0.005 } ]}' -H 'content-type: application/json' http://127.0.0.1:8332/
    +> bitcoin-cli listunspent 6 9999999 '[]' true '{ "minimum_amount": 0.005 }'
    +> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "listunspent", "params": [6, 9999999, [] , true, { "minimum_amount": 0.005 } ]}' -H 'content-type: application/json' http://127.0.0.1:8332/
    

    </details>

  10. DrahtBot removed the label CI failed on Nov 5, 2026
  11. fanquake added this to the milestone 33.0 on Nov 6, 2026
  12. fanquake commented at 10:44 AM on November 6, 2026: member

    Put this on 33.0 given #36489 is already in. Should do this all in one cycle.

  13. Zippo76 commented at 9:31 PM on November 9, 2026: none

    tACK facf53acf4

    Tested on macOS 27.2 arm64 against master 4ef7904c39. The modified wallet_listtransactions.py test fails on master with Unknown named parameter minimum_amount and passes with this PR. Manually checked all four aliases, both inside query_options and via bitcoin-cli -named. Each produces the same filtering results as its camelCase counterpart. Supplying both spellings is rejected in both forms. In query_options, the error says “Do not set both.” With -named, it reports “Unknown named parameter” for the camelCase alias, consistent with the generic named-argument handling already used by existing aliases.

    snake_case          camelCase         query_options  -named  both spellings
    minimum_amount      minimumAmount     same results   same    rejected
    maximum_amount      maximumAmount     same results   same    rejected
    maximum_count       maximumCount      same results   same    rejected
    minimum_sum_amount  minimumSumAmount  same results   same    rejected
    

    Also checked fundrawtransaction with change_position and changePosition: behaviour matches master, including the error when both are supplied.

  14. fanquake requested review from willcl-ark on Nov 10, 2026
  15. willcl-ark approved
  16. willcl-ark commented at 2:52 PM on November 10, 2026: member

    ACK facf53acf43cb392d3af72ef837a4b825ed31406

  17. fanquake merged this on Nov 10, 2026
  18. fanquake closed this on Nov 10, 2026

Milestone
33.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-11-10 20:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me