neo-go
neo-go copied to clipboard
Mention token amount limits in balance readers
Is your feature request related to a problem? Please describe.
some tokens are limited in quantity. For example, NEO <= 100KK according to docs. This limit is missing in https://pkg.go.dev/github.com/nspcc-dev/neo-go/pkg/rpcclient/neo (in particular https://pkg.go.dev/github.com/nspcc-dev/[email protected]/pkg/rpcclient/neptoken#Base.BalanceOf). This complicates code checks and optimization like using fixed bitsize math instead of big integers if possible
Describe the solution you'd like
mention limits in BalanceOf
methods' docs
Describe alternatives you've considered
do not touch
Additional context
* inspired by https://github.com/nspcc-dev/neofs-node/pull/2683#discussion_r1430019625
Technically, you have NEP-17 totalSupply
to get it and that's the standard NEP-17 way. At the same time it's well-known for NEO and won't change.
@roman-khimov, i thought about checking limits against totalSupply
but this seems an overhead to me when it returns static value like for NEO