81trust / 100

Util Units

by Token unit converter in Documents & files

x402 APIPassing, checked 40 min ago

Converts between wei, gwei, ether and any token decimals using exact integer maths - no floating point, no silent rounding. The mistake that costs real money is being off by a thousand on decimals.

GET https://flat-rate-llm.kikoribera03.workers.dev/v1/util/units

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
40 ms typical, 40 ms slowest 5%
Last check
40 min ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X GET "https://flat-rate-llm.kikoribera03.workers.dev/v1/util/units?amount=1500000000000000000&from=wei&to=ether"
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fflat-rate-llm.kikoribera03.workers.dev%2Fv1%2Futil%2Funits
const res = await pay("https://flat-rate-llm.kikoribera03.workers.dev/v1/util/units?amount=1500000000000000000&from=wei&to=ether");
console.log(await res.json());

Example input

{
  "amount": "1500000000000000000",
  "from": "wei",
  "to": "ether"
}

Example output

{
  "amount": "1500000000000000000",
  "from": "wei",
  "result": "1.5",
  "to": "ether"
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
40 min agoPassed402473 ms$0.005
6 h agoPassed40240 ms$0.005