Merge pull request #8 from andrew-besedin/develop

add validateTokensInput readme
This commit is contained in:
Dmitrii Kolpakov 2025-02-24 17:30:52 +07:00 committed by GitHub
commit 119cc65f12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -395,4 +395,17 @@ const alias = "alias";
## Requirements
- Correct RPC URLs for the wallet and daemon.
- Correct RPC URLs for the wallet and daemon.
# Shared logic
## Usage
### validateTokensInput util
validateTokensInput function checks whether a numeric or string value can be used as an amount for an asset with the specified DP.
```typescript
import { validateTokensInput } from "zano_web3/shared";
let isValidAmount = validateTokensInput("18446744.073709551615", 12); // true
isValidAmount = validateTokensInput("18446744.073709551616", 12); // false
```