Describe the bug
When adding a custom network, the metamask will divide the native token amount by 10^18 to get its user representation. This is proper for Ethereum and some other blockchains.
But for some reason, the number of decimals may not always 18 for some custom network. For example, when the blockchain implement uses int64 as a type for balance, the max value is 2^63-1(+9,223,372,036,854,775,807), about 9*10^18. In this case, using 18 as the number of decimals is obviously inappropriate. Or, the native token is just designed with a smaller number of decimals, like 8.
Therefore, is it possible to support specifying decimals when adding a custom network. If not, what is the reason. Thanks for reading and looking forward to your reply.
Steps to reproduce
- Adding a custom network.
- The metamask divides the native token amount by 10^18 to get its user representation.
Error messages or log output
No response
Version
10.16.2
Build type
No response
Browser
Chrome
Operating system
MacOS
Hardware wallet
No response
Additional context
Related issues: Changing the metamask display decimal of native token
Related doc: MetaMask does not yet support chains with native currencies that do not have 18 decimals, but may do so in the future.
Describe the bug
When adding a custom network, the metamask will divide the native token amount by 10^18 to get its user representation. This is proper for Ethereum and some other blockchains.
But for some reason, the number of decimals may not always 18 for some custom network. For example, when the blockchain implement uses int64 as a type for balance, the max value is 2^63-1(+9,223,372,036,854,775,807), about 9*10^18. In this case, using 18 as the number of decimals is obviously inappropriate. Or, the native token is just designed with a smaller number of decimals, like 8.
Therefore, is it possible to support specifying decimals when adding a custom network. If not, what is the reason. Thanks for reading and looking forward to your reply.
Steps to reproduce
Error messages or log output
No response
Version
10.16.2
Build type
No response
Browser
Chrome
Operating system
MacOS
Hardware wallet
No response
Additional context
Related issues: Changing the metamask display decimal of native token
Related doc: MetaMask does not yet support chains with native currencies that do not have 18 decimals, but may do so in the future.