@quiverfoundation/sdk
v0.1.0
Published
TypeScript client SDK for the Quiver randomness protocol (verifiable on-chain VRF) on Robinhood Chain
Downloads
64
Maintainers
Readme
@quiverfoundation/sdk
TypeScript client for the Quiver randomness protocol on Robinhood Chain.
pnpm add @quiverfoundation/sdk viemimport {QuiverClient, robinhoodTestnet} from "@quiverfoundation/sdk";
import {createPublicClient, createWalletClient, http} from "viem";
import {privateKeyToAccount} from "viem/accounts";
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const quiver = new QuiverClient({
coordinator: "0x…",
publicClient: createPublicClient({chain: robinhoodTestnet, transport: http()}),
walletClient: createWalletClient({account, chain: robinhoodTestnet, transport: http()}),
});
const {sequenceNumber} = await quiver.requestRandomness(provider);
const {randomNumber} = await quiver.waitForFulfillment(provider, sequenceNumber);Exports: QuiverClient; hash-chain utils (buildQuiver, commitmentOf,
revelationOf, userCommitmentOf, combineRandomValues); chains (robinhoodMainnet,
robinhoodTestnet, anvilLocal, QUIVER_CHAINS); ABIs (quiverCoordinatorAbi,
quiverConsumerAbi).
See the integration guide and API reference.
