Skip to content

Latest commit

 

History

History

js

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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());