Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add account_balances RPC method to unsafe RPC interface on nodes #1624

Open
enlight opened this issue Mar 19, 2020 · 0 comments
Open

Add account_balances RPC method to unsafe RPC interface on nodes #1624

enlight opened this issue Mar 19, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@enlight
Copy link
Contributor

enlight commented Mar 19, 2020

The account_balances RPC method should accept a list of contract addresses (on the DAppChain) as input. eth and loom should be accepted as aliases for the built-in contracts, eth will be resolved to ethcoin, and loom to coin.

The RPC method should:

  1. Retrieve all the account mappings from the address mapper contract.
  2. For each account mapping query how many tokens the DAppChain account has for each of the specified contracts.
  3. Return a plain JSON response containing all the balances in this format:
    "accounts": {
      "eth:0xdeadbeef": {
        "eth": "1000000000",
        "loom": "20000",
        "eth:0xwhatever": "0"
      },
      "eth:0xdeadfeeb": {
        "eth": "0",
        "loom": "10000000",
        "eth:0xwhatever": "100"
      }
    }
    Aside from eth and loom the contract addresses in the response should be the foreign address, this means the input contract addresses will need to be mapped to a foreign address via the contract mappings stored in the gateway contract.
@enlight enlight added the enhancement New feature or request label Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants