1.1.2 • Published 4 days ago

@generationsoftware/pt-v5-cli v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 days ago

🖥️ 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 pt-v5-utils-js package to fetch and run calculations/computations for essential PoolTogether V5 tasks.

Primary CLI Commands (help)

npx @generationsoftware/pt-v5-cli help utils vaultAccounts
npx @generationsoftware/pt-v5-cli help utils concatWinners

⌨️ CLI Installation

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

Commands

Compute Vault Accounts

ptv5 utils vaultAccounts

Computes the previous draw's depositors with a non-zero balance for a PrizePool to a target output directory.

JSON is in the format required by the @GenerationSoftware/foundry-winner-calc repo to quickly winners.

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

USAGE
  $ ptv5 utils vaultAccounts --chainId 1 --outDir ./temp --prizePool '0xdd4d117723C257CEe402285D3aCF218E9A8236E1'

DESCRIPTION
  Computes the previous draw's depositors with a non-zero balance for a PrizePool to a target output directory.

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

Vaults Files (vaultAddress.json)

{
  "chainId": 10,
  "prizePoolAddress": "0xe32e5E1c5f0c80bD26Def2d0EA5008C107000d6A",
  "vaultAddress": "0xf0B19f02c63d51B69563A2b675e0160e1C34397C",
  "userAddresses": [
    "0x07967251f6db5f9d095119379bd8fc4fce60b3e1",
    "0x084039db4e3c6775eabfc59cbd3725d3d9a6d752"
    // ...
  ]
}

Status File (status.json)

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

Success

{
  "status": "SUCCESS",
  "createdAt": 1693423691768,
  "updatedAt": 1693423805132,
  "runtime": 114,
  "meta": {
    "numVaults": 7,
    "numTiers": 3,
    "numPrizeIndices": 21,
    "numAccounts": 3830
  }
}

Failure

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

Concat Winners

ptv5 utils concatWinners

Receives all of the winners by vault JSON files created by the foundry-winner-calc tool and ties them into one winners.json file. Therefore is dependent on foundry-winner-calc running prior to concatWinners being run.

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

USAGE
  $ ptv5 utils concatWinners --chainId 1 --outDir ./temp --prizePool '0xdd4d117723C257CEe402285D3aCF218E9A8236E1'

DESCRIPTION
  Ingests foundry-winner-calc output files and ties them into one winners.json file.

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

Prizes File (prizes.json)

[
  {
    "vault": "0x0bfe04201c496a9994b920deb6087a60bdadfbbb",
    "winner": "0x07967251f6db5f9d095119379bd8fc4fce60b3e1",
    "tier": 3,
    "prizeIndex": 11,
    "claimed": true,
    "amount": "1633936709514027714"
  },
  {
    "vault": "0x0bfe04201c496a9994b920deb6087a60bdadfbbb",
    "winner": "0x084039db4e3c6775eabfc59cbd3725d3d9a6d752",
    "tier": 2,
    "prizeIndex": 1,
    "claimed": false,
    "amount": "1633936709514027714"
  }
]

Status File (status.json)

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

Success

{
  "status": "SUCCESS",
  "createdAt": 1693423691768,
  "updatedAt": 1693423805132,
  "runtime": 114,
  "meta": {
    "numVaults": 7,
    "numTiers": 3,
    "numPrizeIndices": 21,
    "numAccounts": 3830
  }
}

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

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 utils vaultAccounts --chainId 80001 -o ./temp -p '0xA32C8f94191c9295634f0034eb2b0e2749e77974'
1.1.1

5 days ago

1.1.2

4 days ago

1.1.0

9 days ago

1.1.0-beta.19

9 days ago

1.1.0-beta.18

14 days ago

1.1.0-beta.17

15 days ago

1.1.0-beta.16

17 days ago

1.1.0-beta.15

18 days ago

1.1.0-beta.14

24 days ago

1.1.0-beta.13

24 days ago

1.1.0-beta.12

29 days ago

1.1.0-beta.10

1 month ago

1.1.0-beta.11

1 month ago

1.0.9

1 month ago

1.0.8

1 month ago

1.1.0-beta.9

1 month ago

1.1.0-beta.8

1 month ago

1.1.0-beta.7

1 month ago

1.1.0-beta.6

1 month ago

1.1.0-beta.5

1 month ago

1.1.0-beta.4

1 month ago

1.1.0-beta.3

1 month ago

1.1.0-beta.2

1 month ago

1.1.0-beta.1

1 month ago

1.0.7

2 months ago

1.1.0-beta.0

2 months ago

1.0.6

2 months ago

1.0.5

2 months ago

1.0.4

4 months ago

1.0.3

5 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago

0.0.1-beta.50

6 months ago

0.0.1-beta.49

6 months ago

0.0.1-beta.48

7 months ago

0.0.1-beta.47

7 months ago

0.0.1-beta.46

7 months ago

0.0.1-beta.45

8 months ago

0.0.1-beta.44

8 months ago

0.0.1-beta.43

8 months ago

0.0.1-beta.42

8 months ago

0.0.1-beta.41

8 months ago

0.0.1-beta.40

8 months ago

0.0.1-beta.39

8 months ago

0.0.1-beta.38

8 months ago

0.0.1-beta.37

8 months ago

0.0.1-beta.36

9 months ago

0.0.1-beta.35

9 months ago

0.0.1-beta.34

9 months ago

0.0.1-beta.33

9 months ago

0.0.1-beta.31

10 months ago

0.0.1-beta.30

10 months ago

0.0.1-beta.29

10 months ago

0.0.1-beta.28

10 months ago

0.0.1-beta.27

10 months ago

0.0.1-beta.26

10 months ago

0.0.1-beta.25

10 months ago

0.0.1-beta.24

10 months ago

0.0.1-beta.23

10 months ago