@orao-network/solana-vrf
v0.4.0
Published
ORAO Verifiable Random Function for Solana.
Downloads
156
Readme
VRF v2 JS SDK
Library to interact with orao-vrf
smart contract on Solana network.
Provides interface to request for a verifiable randomness (Ed25519 Signature) on the Solana network.
Usage examples
CPI example tests are based on this SDK.
Randomness request
const provider = AnchorProvider.env();
const vrf = new Orao(provider);
// Request using a random seed.
const [seed, tx] = await vrf.request().rpc();
console.log("Your transaction is " + tx);
// Await fulfilled randomness (default commitment is "finalized"):
const randomness = await vrf.waitFulfilled(seed);
console.log("Your randomness is " + randomness.fulfilled());