Skip to content

SDK

Quote the extra RON to send with requestRandomSeed. Production ingress is the chain, not /api/vrf/request.

npm i @randoo/sdk
import { RANDOO_NETWORKS, roninCoordinatorAbi } from "@randoo/sdk";
import { createPublicClient, http } from "viem";

const net = RANDOO_NETWORKS.ronin; // same coordinator address on saigon
const client = createPublicClient({ transport: http(net.rpc) });
const estimate = await client.readContract({
  address: net.coordinator,
  abi: roninCoordinatorAbi,
  functionName: "estimateRequestRandomFee",
  args: [250_000n, 25n * 10n ** 9n],
});
// Send estimate (or more — leftover is refunded) as msg.value.

Package source is in sdk/.