HomePhabricator

RPC: Accept options as named-only parameters

Description

RPC: Accept options as named-only parameters

Summary:

Allow RPC methods which take an options parameter (importmulti, listunspent, fundrawtransaction, bumpfee, send, sendall, walletcreatefundedpsbt, simulaterawtransaction), to accept the options as named parameters, without the need for nested JSON objects.

This makes it possible to make calls like:

src/bitcoin-cli -named bumpfee txid fee_rate=10

instead of

src/bitcoin-cli -named bumpfee txid options='{"fee_rate": 10}'

RPC help is also updated to show options as top level named arguments instead of as nested objects.
`

Backport of core#26485.

Depends on D16315.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

Differential Revision: https://reviews.bitcoinabc.org/D16316

Details

Provenance
Ryan Ofsky <ryan@ofsky.org>Authored on Nov 10 2022, 16:54
FabienCommitted on Jun 10 2024, 08:00
teamcityPushed on Jun 10 2024, 08:02
Parents
rSTAGING0a7620afd89b: doc: Properly report optional RPC args
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/48205, tag: phabricator/base/48204, tag: phabricator/base/48203

Event Timeline