From 4b143c1612c10f9ac594bf1d872a98bfa52e03dc Mon Sep 17 00:00:00 2001 From: andrewprog97 Date: Wed, 6 Nov 2024 20:17:47 +0300 Subject: [PATCH] add validateTokensInput readme --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c5d41dc..575345e 100644 --- a/README.md +++ b/README.md @@ -395,4 +395,17 @@ const alias = "alias"; ## Requirements -- Correct RPC URLs for the wallet and daemon. \ No newline at end of file +- 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 +``` \ No newline at end of file