Documentation
¶
Overview ¶
Package validate provides input validation functions for the obol CLI. Each function returns nil on success or a descriptive error.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Price ¶
Price validates a paid decimal price string exactly (no float parsing): plain digits with an optional single '.', at most 18 fractional digits (the most any ERC-20 token has), greater than zero and at most schemas.MaxPriceWholeTokens. Signs, exponents, Inf/NaN, commas and currency symbols are rejected. Free routes use gate=free, not a zero price.
func PriceForToken ¶ added in v0.17.0
PriceForToken is Price limited to the settlement token's decimals, e.g. "0.0000001" is rejected for USDC (6 decimals) with "max 6 decimal places for USDC".
Types ¶
This section is empty.