JSPM

@buff-beacon-project/curby-client

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q35884F
  • License MIT

Package Exports

  • @buff-beacon-project/curby-client

Readme

CURBy JavaScript Client

This is the official client library for the CURBy Project. It fetches and validates both the regular randomness chain and the DIRNG chain.

Quickstart

npm install @buff-beacon-project/curby-client
import { Client, DIRNGClient } from '@buff-beacon-project/curby-client'

const client = Client.create()
const randomness = await client.randomness()
const myArray = [1, 2, 3, 4, 5]
const shuffled = randomness.shuffled(myArray)
// shuffled = [3, 4, 2, 5, 1]

const dirng = DIRNGClient.create()
const latest = await dirng.latest()
console.log(`Got info for round ${latest.round}. Stage is ${latest.stage}`)

Documentation