contracts-ui icon indicating copy to clipboard operation
contracts-ui copied to clipboard

`Balance` is always treated like network currency

Open wottpal opened this issue 1 year ago • 3 comments

Hey, when working with fungible token contracts (i.e. PSP-22) we've noticed that contracts-ui is statically assuming that values with the Balance type are always the native chain currency with it's decimals & token identifier.

In the PSP-22 interface, Balance is just an alias type for u128 and can have any decimal & any token identifier. And as the input field is already denominating with the networks decimals (e.g. 12) it's super confusing that it assumes the same for other tokens Balances.

Maybe adding a "Network Currency" switch that switches between networks decimals & token symbol between just the plain u128 value w/o any decimals applied would help here?

Screenshot 2023-05-04 at 17 14 33

wottpal avatar May 04 '23 15:05 wottpal