https://github.com/pooltogether/v4-cli
PoolTogether V4 Command Line Interface
https://github.com/pooltogether/v4-cli
cli ethereum pooltogether web3
Last synced: 2 months ago
JSON representation
PoolTogether V4 Command Line Interface
- Host: GitHub
- URL: https://github.com/pooltogether/v4-cli
- Owner: pooltogether
- License: mit
- Created: 2022-02-07T17:50:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-27T16:37:53.000Z (about 2 years ago)
- Last Synced: 2025-04-20T12:41:27.505Z (3 months ago)
- Topics: cli, ethereum, pooltogether, web3
- Language: TypeScript
- Homepage: https://github.com/pooltogether/v4-cli
- Size: 283 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 📇 PoolTogether V4 CLI

[](https://npmjs.org/package/@pooltogether/v4-cli)
[](https://npmjs.org/package/@pooltogether/v4-cli)
[](https://github.com/oclif/hello-world/blob/main/package.json)

[](http://perso.crans.org/besson/LICENSE.html)
[](https://oclif.io)The `@pooltogether/v4-cli` [node module package](https://www.npmjs.com/package/@pooltogether/v4-cli) is a NODE command line interface (CLI) to interact with the **PoolTogether V4 protocol**. The CLI uses the `v4-client-js` and `v4-utils-js` modules to fetch and run calculations/computations for essential PoolTogether V4 tasks.
Primary CLI Commands (help)
```sh
npx @pooltogether/v4-cli help compute drawPrizes
npx @pooltogether/v4-cli help compute poolPrizes
npx @pooltogether/v4-cli help compute networkPrizes
```# ⌨️ CLI Installation
```sh-session
$ npm install -g @pooltogether/v4-cli
$ ptv4 COMMAND
running command...
$ ptv4 (--version)
@pooltogether/v4-cli/0.1.11-beta.1 darwin-arm64 node-v16.17.0
$ ptv4 --help [COMMAND]
USAGE
$ ptv4 COMMAND
...
```# Commands
## Compute Draw Prizes
```sh-session
ptv4 compute drawPrizes
```Computes single Draw prizes for a PrizePool to a target output directory.
Simply pass a `chainId`, `ticket` `drawId` and `outDir` to compute and locally save the results.
```
USAGE
$ ptv4 compute drawPrizes --chainId 1 --drawId 65 --outDir ./temp --ticket '0xdd4d117723C257CEe402285D3aCF218E9A8236E1'DESCRIPTION
Computes single Draw prizes for a PrizePool to a target output directory.EXAMPLES
$ ptv4 compute drawPrizes --chainId 1 --drawId 1 --ticket 0x0000000000000000000000000000000000000000 --outDir ./temp
Running compute:drawPrizes on chainId: 1 using drawID: 1
```## Status File (status.json)
```json
{
"status": "LOADING",
"createdAt": "11"
}
```### Success
```json
{
"status": "SUCCESS",
"createdAt": "11",
"updatedAt": "33",
"runtime": "22",
"meta": {
"prizeLength": "10",
"amountsTotal": "5000000"
}
}
```### Failure
```json
{
"status": "FAILURE",
"createdAt": "11",
"updatedAt": "33",
"runtime": "22",
"error": "ErrorCode"
}
```## Compute PrizePool Prizes
Computes all historical Draw prizes for a PrizePool to a target output directory.
```sh-session
ptv4 compute poolPrizes
``````
USAGE
$ ptv4 compute poolPrizes --chainId 1 --outDir ./temp --ticket '0xdd4d117723C257CEe402285D3aCF218E9A8236E1'DESCRIPTION
Computes all historical Draw prizes for a PrizePool to a target output directory.EXAMPLES
$ ptv4 compute poolPrizes --chainId 1--ticket 0x0000000000000000000000000000000000000000 --outDir ./temp
Running compute:drawPrizes on chainId: 1 using drawID: 1
```## Compute Network of PrizePool Prizes
Computes Draw prizes for all PoolTogether V4 network PrizePools to a target output directory.
```sh-session
ptv4 compute networkPrizes
``````
USAGE
$ ptv4 compute networkPrizes --outDir ./tempDESCRIPTION
Computes Draw prizes for all PoolTogether V4 network PrizePools to a target output directory.EXAMPLES
$ ptv4 compute poolPrizes --chainId 1 --ticket 0x0000000000000000000000000000000000000000 --outDir ./temp
Running compute:drawPrizes on chainId: 1 using drawID: 1
```## Help
```sh-session
ptv4 help [COMMAND]
```Display help for ptv4.
```
USAGE
$ ptv4 help [COMMAND] [-n]ARGUMENTS
COMMAND Command to show help for.FLAGS
-n, --nested-commands Include all nested commands in the output.DESCRIPTION
Display help for ptv4.
```