paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

Create Balances RPC #8752

Open apopiak opened 3 years ago

apopiak commented 3 years ago

The account data (and with it the accounts storage) has changed a few times in the last year which has lead to some confusion for readers (e.g. wallets, exchanges) that did not react to the metadata changes quickly. It would be useful to have a balances RPC endpoint that returns the balance of a user account independent of the underlying storage (and that changes less frequently). We basically want to expose similar functions to free_balance via RPC. Suggested RPC endpoints:

xlc commented 3 years ago

Is it possible to make those RPC a subscription in order to support subscribe balance changes?

zachanon commented 3 years ago

Hello, I see no one is assigned to this. I would like to hack on this issue, is there any etiquette I must know? Shall I just begin writing tests and code?

apopiak commented 3 years ago

Cool that you want to contribute! I think it's fine to just start hacking and open a PR. I would suggest opening a draft PR early to get feedback on the general design so you are less likely to paint yourself into a corner. You're probably aware but there's a contributing guide here. Feel free to tag me in the PR. Maybe @shawntabrizi and @xlc would also be willing to pitch in. If you want to go the subscription route (which will make this a bit more complex AFAICT) maybe this PR might help as a reference: https://github.com/paritytech/substrate/pull/5732