ChainAccount has getBalances and getBalance on its interface, but both of these are unimplemented.
Description of the Design
getBalances() should be implemented on CosmosOrchestrationAccount and LocalOrchestrationAccount
TBD. A potential path is to rename the current getBalance -> getPurseBalance and have the LOA use the LCA's .query method to make cosmos level queries.
TBD. From a layering perspective, I'd argue that ChainAccount should not implement these interfaces. It should only be responsible for the Connection/Channel lifecycle and sending / receiving messages. Figuring out balances (a specific message to send) should be part of OrchestrationAccount layer.
What is the Problem Being Solved?
This ticket captures three related items:
CosmosOrchestrationAccount and LocalOrchestrationAccount do not have the
getBalances
interface implemented (only getBalance).LocalOrchestrationAccount
uses thegetBalance
method fromvats/localchain.js
, which calls out to vbank. This presents a challenge if the caller is trying to work with an asset that's not recognized by vbank: https://github.com/Agoric/agoric-sdk/blob/b5cf8bd51585df36a72b65d7a1d66babd358b316/packages/vats/src/localchain.js#L113-L117 Also, it doesn't seemBank
(vbank) has an interface for enumerating purses. The implementation may require iterating over every known asset, which is not ideal.ChainAccount has
getBalances
andgetBalance
on its interface, but both of these are unimplemented.Description of the Design
getBalances()
should be implemented onCosmosOrchestrationAccount
andLocalOrchestrationAccount
TBD. A potential path is to rename the current
getBalance
->getPurseBalance
and have the LOA use the LCA's.query
method to make cosmos level queries.TBD. From a layering perspective, I'd argue that
ChainAccount
should not implement these interfaces. It should only be responsible for the Connection/Channel lifecycle and sending / receiving messages. Figuring out balances (a specific message to send) should be part ofOrchestrationAccount
layer.Security Considerations
Scaling Considerations
Test Plan
Upgrade Considerations