Socket
Socket
Sign inDemoInstall

@generationsoftware/pt-v5-utils-js-beta

Package Overview
Dependencies
11
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @generationsoftware/pt-v5-utils-js-beta

(BETA) Utility library for PoolTogether v5 computations.


Version published
Weekly downloads
0
Maintainers
3
Created
Weekly downloads
 

Readme

Source

PoolTogether Brand


🧰 Javascript Utility Library - PoolTogether V5

📖 Documentation

Compute

The @pooltogether/v5-utils-js node module package provides computations for the PoolTogether v5 protocol.

High-order operations like processing subgraphs and chain state (draws, winners, etc..) is included in the compute namespaced functions.

🖥️ Computations:

Consume subgraph and protocol chain state to return computed outcomes:

Create Issue to request new features.
Open Pull Request adhering to Contribution guidelines.

💾 Installation

This project is available as an NPM package:

npm install @pooltogether/v5-utils-js
yarn add @pooltogether/v5-utils-js

The repo can be cloned from Github for contributions.

git clone https://github.com/pooltogether/v5-utils-js

🏆 Quickstart (Contracts Blob)

Getting the list of contracts for a specific network is easy using the downloadContractsBlob(chainId) function.

Currently supports:

  • Optimism Goerli (testnet)
  • Goerli (testnet)
import { downloadContractsBlob } from "@pooltogether/v5-utils-js";

async function main() {
  const contracts = await downloadContractsBlob(chainId);
}
main();

🏆 Quickstart (Draw Results)

computeDrawWinners(provider, contracts, chainId) computes and returns a JSON blob of all previous draw winner's Claim objects for each tier of a prize pool, grouped by vault.

import { computeDrawWinners } from "@pooltogether/v5-utils-js";

// Compute Winners for the last Draw
const winners = computeDrawWinners(provider, contracts, chainId);

// Returns Claim[]:
//
// interface Claim {
//   vault: string;
//   winner: string;
//   tier: number;
//   prizeIndex: number;
//   claimed?: boolean;
// }
//

FAQs

Last updated on 22 Oct 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc