Skip to content

Add accounts_representatives rpc #3409

@tombertrand

Description

@tombertrand

Summary

Would like to be able to request more than one representative account at a time. Currently using multiple times https://docs.nano.org/commands/rpc-protocol/#account_representative while it may be more optimal to add another RPC that behaves like accounts_balances where it's possible to get multiple balances / representatives in a single request.

Goal would be to

Request:

{
  "action": "accounts_representatives",
  "accounts": [
    "nano_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3", 
    "nano_3i1aq1cchnmbn9x5rsbap8b15akfh7wj7pwskuzi7ahz8oq6cobd99d4r3b7"
    ]
}

Response:

{
  "representatives" : {
    "nano_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3": "nano_repaddress1",
    "nano_3i1aq1cchnmbn9x5rsbap8b15akfh7wj7pwskuzi7ahz8oq6cobd99d4r3b7": "nano_repaddress2"
  }
}

What problem would be solved by this feature?

Greatly reduce the amount of RPC request needed to get the representatives from a large chunk of accounts.

Are there any previous requests for this feature?

Was unable to find other requests.

Do you have a suggested solution?

If the rpc behaves the same was as the get multiple accounts_balances that would be perfect.

If this feature is approved, would you be willing to submit a pull request with the solution?

I would not

Possible solution

No response

Supporting files

No response

Metadata

Metadata

Assignees

Labels

documentationThis item indicates the need for or supplies updated or expanded documentationenhancementrpcChanges related to Remote Procedure Calls

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions