monero icon indicating copy to clipboard operation
monero copied to clipboard

[FR] monero-wallet-rpc get_address and create_address should create addresses and accounts if out of range

Open elibroftw opened this issue 3 years ago • 2 comments

There should be an optional parameter for get_address so that the wallet-RPC creates the out of range accounts and addresses instead of returning an out of range error. This helps developing payments solutions and integrating monero.

It would also help if it was possible to create accounts up to a certain index, or addresses up to a certain index instead of having to make repeated calls.

elibroftw avatar Sep 07 '21 18:09 elibroftw

I think you want to use create_address ? https://monerodocs.org/interacting/monero-wallet-rpc-reference/#create_address

creating multiple addresses can be done without the use of the wallet rpc. for example using monero-python (offline address creation at specific indices)

plowsof avatar Jun 10 '22 03:06 plowsof

Back then, I had a custom algorithm that would use addresses based on availability. Now I just call create_address for a specific account, so the only thing that would be nice is if create_address(x) would create accounts up to x instead of raising an error that the account does not exist. image This is the code I have to use. That's an extra 7 lines of code to account for the edge case where the wallet opened in the RPC had not created the account which would occur if I needed to horizontally scale. I'm a person who thinks about this kind of thing, so a naive programmer would simply use create_address(IDX) without realizing this possible edge case and when they decide to horizontally scale, things would break.

elibroftw avatar Jun 10 '22 03:06 elibroftw