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:
0src/bitcoin-cli -named bumpfee txid fee_rate=10
instead of
0src/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.
0@@ -15,16 +15,17 @@
1
2 Arguments:
3 1. txid (string, required) The txid to be bumped
4-2. options (json object, optional)
5+2. options (json object, optional) Options object that can be used to pass named arguments, listed below.
6+
7+Named Arguments:
8- {
9- "conf_target": n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks
10+conf_target (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks
11
12- "fee_rate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation)
13+fee_rate (numeric or string, optional, default=not set, fall back to wallet fee estimation)
14 Specify a fee rate in sat/vB instead of relying on the built-in fee estimator.
15 Must be at least 1.000 sat/vB higher than the current transaction fee rate.
16 WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB.
17
18- "replaceable": bool, (boolean, optional, default=true) Whether the new transaction should still be
19+replaceable (boolean, optional, default=true) Whether the new transaction should still be
20 marked bip-125 replaceable. If true, the sequence numbers in the transaction will
21 be left unchanged from the original. If false, any input sequence numbers in the
22 original transaction that were less than 0xfffffffe will be increased to 0xfffffffe
23@@ -32,11 +33,10 @@
24 still be replaceable in practice, for example if it has unconfirmed ancestors which
25 are replaceable).
26
27- "estimate_mode": "str", (string, optional, default="unset") The fee estimate mode, must be one of (case insensitive):
28+estimate_mode (string, optional, default="unset") The fee estimate mode, must be one of (case insensitive):
29 "unset"
30 "economical"
31 "conservative"
32- }
33
34 Result:
35 { (json object)
Review suggestion: To understand this PR, it is probably easiest to review the commits in reverse order because the last commit shows the external API changes, the middle commit shows the internal API changes, and the first commit contains the low-level implementation.