InputPOST /api/v1/x402/token-amount-to-raw
{
"amount": 1.25,
"decimals": 6
}
Local chain primitives · chain-primitives-local
Scale human token amounts by decimals into on-chain raw units. Call when building ERC-20 transfer/approve amounts from UI-facing quantities. Returns raw integer string, amount, and decimals used as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.
One-command purchase
No account or API key. AgentCash reads the 402 challenge, pays no more than the declared cap, retries the request and returns the result.
npx agentcash@latest fetch https://api.delx.ai/api/v1/x402/token-amount-to-raw -m POST -H 'x-delx-source: product-page' --max-amount 0.001 -b '{"amount":1.25,"decimals":6}'
{
"amount": 1.25,
"decimals": 6
}
{
"schema": "delx/util-token-amount-to-raw/v1",
"amount": 1.25,
"decimals": 6,
"raw": "1250000"
}
Machine-readable evidence