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:
- Retrieve all the account mappings from the address mapper contract.
- For each account mapping query how many tokens the DAppChain account has for each of the specified contracts.
- 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.
The
account_balancesRPC method should accept a list of contract addresses (on the DAppChain) as input.ethandloomshould be accepted as aliases for the built-in contracts,ethwill be resolved toethcoin, andloomtocoin.The RPC method should:
ethandloomthe 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.