vechain-sdk-js icon indicating copy to clipboard operation
vechain-sdk-js copied to clipboard

💡 [BREAKING CHANGES] Get Account :: Utility functions

Open darrenvechain opened this issue 8 months ago • 4 comments

Summary

It would be nice if getAccount returned a class or an object with some utility functions built in so it is easier to debug and read account balances etc.

Current code:

// Returns {balance, energy, hasCode}
const account = await client.accounts.getAccount(account)

Basic Example

It would be nice to have some extra functions such as:

const account = await client.accounts.getAccount(account)
console.log(account.parsedVet()) //if my VET balance is `0x43c33c1937564800000`, then it prints `20000`

darrenvechain avatar Jun 19 '24 12:06 darrenvechain