-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FA token support #213
Comments
Thinking about all this again. Given how tightly integrated the
Tez is limited to Int64, so there isn't any advantage to using BigInt there. The only question comes for FA Tokens which are arbitrary length natural numbers. Although I think Decimal may be sufficiently large, for any reasonable usecases |
Turns out FA1.2 tokens (and FA2 onwards) do have decimal places even though the specification doesn't require a definition for it. They will follow exactly the same pattern as Tez. They will only be represented by 1 natural number, with a piece of metadata indicating how many decimal places exist. The tokens will have variable decimal places however.
It would be great to have a Tez subclass, or alias that has a configurable decimal place. It should follow all the same logic (e.g. passing in a string will be the rpc representation, passing in a double would be the higher order representation).
Other requirements:
Being able to multiply Tez and NativeToken if they are separate objects) by a
double
orDecimal
. Giving the ability to be able to display the local currency value of the token without having to cast to other objects.Being able to add Tez and NativeToken together (if they are separate objects). To have the ability to multiply all of the Tez and Tokens by their local currency amount, and then add all of them together to get a wallet/account total. Again without having to cast to intermediate objects. Leading rounding/truncation issues.
The text was updated successfully, but these errors were encountered: