@generationsoftware/pt-v5-utils-js v1.1.8
🧰 Javascript Utility Library - PoolTogether V5
Calculations, Computations and Core Logic
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 computations
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:
- Sepolia (testnet)
- Mumbai (testnet)
- Goerli (testnet) (outdated!)
import { downloadContractsBlob } from "@pooltogether/v5-utils-js";
async function main() {
const contracts = await downloadContractsBlob(chainId);
}
main();
🏆 Quickstart (Draw Results)
computeDrawWinners(provider, contracts, chainId, filterAutoClaimDisabled?: boolean)
computes and returns a JSON blob of winner's Claim objects for each tier of a prize pool, grouped by vault for the previous draw.
import { computeDrawWinners } from "@pooltogether/v5-utils-js";
// Compute Winners for the last Draw
const winners = computeDrawWinners(provider, contracts, chainId, filterAutoClaimDisabled?: boolean);
📖 Documentation
Namespaces
7 days ago
11 days ago
11 days ago
11 days ago
11 days ago
14 days ago
14 days ago
14 days ago
14 days ago
17 days ago
19 days ago
19 days ago
24 days ago
25 days ago
26 days ago
26 days ago
28 days ago
28 days ago
28 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
4 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago