Roll · Roll

by Roll

POSTBaseSolanaPolygon

$0.001

per call · USD Coin on Base

Verifiable RNG — cryptographically-random integer(s) signed by the treasury key. Drop-in VRF for game studios. $0.001 USDC.

Endpoint

POST https://api.anchor-x402.com/v1/roll

22

Calls / 30d

8

Unique payers / 30d

Sep 9

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://api.anchor-x402.com/v1/roll", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "count": 1,
    "high": 100,
    "label": "treasure_drop_42",
    "low": 1
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://api.anchor-x402.com/v1/roll" \
  -H "Content-Type: application/json" \
  -d '{"count":1,"high":100,"label":"treasure_drop_42","low":1}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "commitment": null,
  "count": 1,
  "domain": "anchor-x402/roll/v1",
  "input_hash": "f4a1c5e3b9d8a2e0c7b4f6d9e1a3c8b5f7d2e4a9c1b6e8f3d5a7c2b4e9f1d6a8",
  "label": "treasure_drop_42",
  "range": [
    1,
    100
  ],
  "result": [
    47
  ],
  "result_hash": "8a6d1f9e4b2c7a3e5f0c9b8a4d2f6e1c3b7a5f9d2e8c4b6a1f3e7d5c9b2a4f6e",
  "scheme": "eip191",
  "signature": "0x6b3e2a7c…",
  "signer": "0x127462e296fAc1A7F5cF33bA57bB2f0FFf5cD0B6"
}

Payment details

Pay to0x127462e296fac1a7f5cf33ba57bb2f0fff5cd0b6
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase, Solana, Polygon
Schemesexact

Is this your API?

Pin it to the top of Games & Fun and the homepage with a featured placement.

Get featured →

More from Roll & similar services