New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@generationsoftware/pt-v5-cli

Package Overview
Dependencies
Maintainers
2
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@generationsoftware/pt-v5-cli

PoolTogether V5 Command Line Interface

  • 0.0.1-beta.34
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-13.89%
Maintainers
2
Weekly downloads
 
Created
Source

PoolTogether Brand


PoolTogether V5 CLI

The @generationsoftware/pt-v5-cli node module package is a NODE command line interface (CLI) to interact with the PoolTogether V5 protocol. The CLI uses the v5-autotasks-library modules to fetch and run calculations/computations for essential PoolTogether V5 tasks.

Primary CLI Commands (help)

npx @generationsoftware/pt-v5-cli help compute drawPrizes

⌨️ CLI Installation

$ npm install -g @generationsoftware/pt-v5-cli
$ ptv5 COMMAND
running command...
$ ptv5 (--version)
@generationsoftware/pt-v5-cli/0.0.1-beta.34 darwin-arm64 node-v18.16.0
$ ptv5 --help [COMMAND]
USAGE
  $ ptv5 COMMAND
...

Commands

Compute Draw Prizes

ptv5 compute drawPrizes

Computes the previous draw's prizes for a PrizePool to a target output directory.

Simply pass a chainId, prizePool and outDir to compute and locally save the results.

USAGE
  $ ptv5 compute drawPrizes --chainId 1 --outDir ./temp --prizePool '0xdd4d117723C257CEe402285D3aCF218E9A8236E1'

DESCRIPTION
  Computes the previous draw's prizes for a PrizePool to a target output directory.

EXAMPLES
  $ ptv5 compute drawPrizes --chainId 1 --prizePool 0x0000000000000000000000000000000000000000 --outDir ./temp
    Running compute:drawPrizes on chainId: 1

Status File (status.json)

{
  "status": "LOADING",
  "createdAt": "11"
}

Success

{
  "status": "SUCCESS",
  "createdAt": "11",
  "updatedAt": "33",
  "runtime": "22",
  "meta": {
    "prizeLength": "10",
    "amountsTotal": "5000000"
  }
}

Failure

{
  "status": "FAILURE",
  "createdAt": "11",
  "updatedAt": "33",
  "runtime": "22",
  "error": "ErrorCode"
}

Help

ptv5 help [COMMAND]

Display help for ptv5.

USAGE
  $ ptv5 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 ptv5.

Development

Prior to publishing the CLI on npm, as this uses ESM after you run npm install (or yarn install) you will need to modify your ./node_modules/.bin/oclif and ./node_modules/.bin/oclif2 symlinks. You can use the following commands to do this:

cd node_modules/.bin &&
  rm oclif &&
  rm oclif2 &&
  ln -nfs ../oclif/bin/run.js oclif &&
  ln -nfs ../oclif/bin/run.js oclif2 &&
  cd ../oclif/bin &&
  mv dev dev.js &&
  mv run run.js

Also replace the contents of node_modules/oclif/bin/run.js with the following:

#!/usr/bin/env node --loader ts-node/esm --experimental-specifier-resolution=node

const oclif = require("@oclif/core");

oclif.run().then(require("@oclif/core/flush")).catch(require("@oclif/core/handle"));

Using the tool in dev

You can test the CLI while developing by using the following, with whichever chain / prizePool flags you want to test with:

./bin/run.js compute drawPrizes --chainId 80001 -o ./temp -p '0xA32C8f94191c9295634f0034eb2b0e2749e77974'

Keywords

FAQs

Package last updated on 17 Jul 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc