npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lottery-vrf-sdk

v2.0.1

Published

TypeScript SDK for Orao VRF

Readme

Lottery VRF SDK

This is an sdk, connect to the Lottery VRF program on Solana.

Draw

An user can draw a random number from the VRF. Each time he draws, a new random number PDA account is generated to store the random number, using ORAO VRF.

import { Keypair, PublicKey } from "@solana/web3.js";
import { LotteryDrawClient } from "../src";


export const getWallet = (
) => {
  return Keypair.fromSecretKey(
    Uint8Array.from(require(`/root/.config/solana/id.json`))
  );
};

async function main() {
  const keypair = getWallet();
  const client = new LotteryDrawClient(keypair);


  const txHash = await client.draw();
  console.log(`Transaction: ${txHash}`);
}

main();
User: GyPcdYe7JrM3W172JecLvS9xUEScjQWhARHyYqT9mj8J, draw round: 2
Transaction: fyZ5op2N5RrEE4U9sMmyzkmvRQdTYxu1hkwV3VVnzW67goxvWSoovzScFrg5Tew91aJ1AV53qD6naDZ4mgNFYUs

For each round user draw, a draw PDA account in the program is creataed to store the associated information

Get Draw

This function, get the draw information from the program. Then, it will wait for the VRF to be fulfilled and return the draw information, including the randomness data.

import { Keypair, PublicKey } from "@solana/web3.js";
import { LotteryDrawClient } from "../src";

async function main() {
  const client = new LotteryDrawClient();
  const draw = await client.getDraw(new PublicKey("GyPcdYe7JrM3W172JecLvS9xUEScjQWhARHyYqT9mj8J"), 2);

  console.log("Drawer: ", draw.drawer.toBase58());
  console.log("Round: ", draw.round);
  console.log("Randomness: ", draw.randomness);
  console.log("Randomness Account: ", draw.randomnessAccount.toBase58());

  // Get randomness data in biguint64LE format
  const randomness = Buffer.from(draw.randomness).readBigUInt64LE();
  console.log("Randomness in biguint64LE LE: ", randomness.toString());
}

main();
➜  orao-vrf-sdk git:(main) ✗ ts-node examples/getDraw.ts 
Drawer:  8ekXR9PUuUUwmupGFLw3xTo1BFeRdescCGdwqMpK2swg
Round:  <BN: 2>
Randomness:  Uint8Array(64) [
  191,   0, 106, 104, 237, 215, 175,  44,  47,  56, 242,
    6, 104, 156,  42,  99, 136, 251, 222,  21,  41, 141,
   12,  27, 223, 126, 235, 114, 148,  49,  97, 140, 100,
  138, 221,  50,  30,  79, 253,  35,  86, 153, 233, 180,
  240,  17,  66,  99,   3, 182, 206, 202, 149,  17, 115,
  114, 151, 114, 200,  99,  15,   1,  77,   9
]
Randomness Account:  8REuCAFtP4FA7vsXE8Qtw2JuLrgozLNKWGXZUUDHCsPj
Randomness in biguint64LE LE:  3220029673252192447