hyperledger-labs/perun-node

Retrieve on-chain balance of the user

Closed this issue · 2 comments

Motivation / Context

Provide an api for the user to retrieve the on-chain balance of a user.

Description

Implement a function to retrieve the on-chain balance of a user in the ethereum package and provide an API to access this function for the user.

Should this function be made part of SessionAPI ? or should a new API be created for reading on-chain information ?. As discussed in the comments, this can directly be included in the CLI app (#98) instead of the node.

Relates to

Depends on #98.

Testing

Thread Safety

Does it make sense to add this to the node? The node is interacting with the DLT in respect to needed transactions.
This kind of information can be fetched directly using the DLT API, e.g. Metamask or other ones.
THerefore I would propose to add this as minimum to the planned CLI #98

It was indeed an open question to which API of the node (nodeAPI/sessionAPI/channelAPI) will this method belong, because I was not seeing it to readily fit into any of the above.
The motivation of to add this feature was to be able to fetch the on-chain balance in the CLI app for demo purposes. Hence moving this method completely to the planned CLI app makes more sense.
Thanks for the proposal.

Will update the issue description accordingly.