You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current implementation of the topUpBalance function, the balance is calculated incorrectly because it's being multiplied by a floating-point value and not converted to the smallest TON unit. This leads to an "Invalid number" error when sending transfers.
Error Description:
The error occurs in the following line when trying to send the transaction:
Error: Invalid number
This happens because the amount is not being properly converted into nanoTONs, which is required for accurate transfer in TON.
Suggested Fix:
The issue can be resolved by using the toNano() function to convert the floating-point value into nanoTONs (smallest unit of TON). This will ensure the amount is in the correct format and prevent the "Invalid number" error.
Here's an example of how the amount calculation should be corrected:
In the current implementation of the topUpBalance function, the balance is calculated incorrectly because it's being multiplied by a floating-point value and not converted to the smallest TON unit. This leads to an "Invalid number" error when sending transfers.
Error Description:
The error occurs in the following line when trying to send the transaction:
Error: Invalid number
This happens because the amount is not being properly converted into nanoTONs, which is required for accurate transfer in TON.
Suggested Fix:
The issue can be resolved by using the toNano() function to convert the floating-point value into nanoTONs (smallest unit of TON). This will ensure the amount is in the correct format and prevent the "Invalid number" error.
Here's an example of how the amount calculation should be corrected:
In the current implementation of the topUpBalance function, the balance is calculated incorrectly because it's being multiplied by a floating-point value and not converted to the smallest TON unit. This leads to an "Invalid number" error when sending transfers.
Error Description:
The error occurs in the following line when trying to send the transaction:
This happens because the amount is not being properly converted into nanoTONs, which is required for accurate transfer in TON.
Suggested Fix:
The issue can be resolved by using the toNano() function to convert the floating-point value into nanoTONs (smallest unit of TON). This will ensure the amount is in the correct format and prevent the "Invalid number" error.
Here's an example of how the amount calculation should be corrected:
The text was updated successfully, but these errors were encountered: