This is a backport of Core [[https://github.com/bitcoin/bitcoin/pull/14918 | PR14918]]
In order to automate somewhat the process, I used the following commands:
```
sed -n '1h; 1!H; ${ g; s@/\* opt \*/ true,\n \+@/* opt */ true, @g; p}' -i ../src/wallet/rpc*.cpp ../src/rpc/*.cpp
sed -n '1h; 1!H; ${ g; s@/\* opt \*/ false,\n \+@/* opt */ false, @g; p}' -i ../src/wallet/rpc*.cpp ../src/rpc/*.cpp
sed -e 's@/\* opt \*/ false, /\* default_val \*/ ""@RPCArg::Optional::NO@' -i ../src/wallet/rpc*.cpp ../src/rpc/*.cpp
sed -e 's@/\* opt \*/ true, /\* default_val \*/ "null"@RPCArg::Optional::OMITTED_NAMED_ARG@' -i ../src/wallet/rpc*.cpp ../src/rpc/*.cpp
sed -e 's@/\* opt \*/ true, /\* default_val \*/@/* default */@' -i ../src/wallet/rpc*.cpp ../src/rpc/*.cpp
```