atomicDEX-API icon indicating copy to clipboard operation
atomicDEX-API copied to clipboard

Make identical name for rpc params account_id and account_index

Open dimxy opened this issue 6 months ago • 0 comments

Some HD wallet RPCs, like task::account_balance::init, have an account_index param. Other RPCs, like task::create_new_account::init, have it as account_id. If a user uses an the other param name it could be unexpected RPC behaviour, as account_id could be optional. Could we use an identical name for both params? Better to make it account_index as BIP32 calls it 'index' but could be also account_id to have fewer changes. Or just account.

I guess we could also use #[serde(alias=..)] where the param was renamed, to allow the old param name and avoid breaking change.

(Maybe also good to add #[serde(deny_unknown_fields)] to RPCs with optional params to prevent unexpected RPC behaviour there is a mistake in a param name.)

dimxy avatar Jul 04 '25 19:07 dimxy