{"_id":"@chanceprotocol/draw-results","name":"@chanceprotocol/draw-results","dist-tags":{"latest":"1.1.0"},"versions":{"1.1.0":{"name":"@chanceprotocol/draw-results","version":"1.1.0","dependencies":{"@actions/core":"^1.6.0","@chanceprotocol/v4-cli":"0.1.11-beta.1","cross-spawn":"^7.0.3"},"license":"ISC","devDependencies":{"chai":"^4.3.4","mocha":"^9.1.3"},"scripts":{"test":"mocha test/*.js"},"description":"<p align=\"center\">   <a href=\"https://github.com/pooltogether/pooltogether--brand-assets\">     <img src=\"https://github.com/pooltogether/pooltogether--brand-assets/blob/977e03604c49c63314450b5d432fe57d34747c66/logo/pooltogether-logo--purple-gradient.png?r","_id":"@chanceprotocol/draw-results@1.1.0","_integrity":"sha512-aVL04XZbJimz1CU1pgTnBG+sNk7fObRpVK+HH3Ql58ZHZyneHmXVxBNn6JLzjuYe65w2Keb98HhuSzuHrf0+rA==","_resolved":"/tmp/05c716dbe3098ab56af6e28bafde5535/chanceprotocol-draw-results-1.1.0.tgz","_from":"file:chanceprotocol-draw-results-1.1.0.tgz","_nodeVersion":"16.15.1","_npmVersion":"9.6.5","dist":{"integrity":"sha512-aVL04XZbJimz1CU1pgTnBG+sNk7fObRpVK+HH3Ql58ZHZyneHmXVxBNn6JLzjuYe65w2Keb98HhuSzuHrf0+rA==","shasum":"5a30ebc93ba714bd3b848a2d5519c77dc3459872","tarball":"https://registry.npmjs.org/@chanceprotocol/draw-results/-/draw-results-1.1.0.tgz","fileCount":10,"unpackedSize":21712,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoyFE5LpG1BINo7ppZQUYOa30dVYhhXrb6EjS5YhDVRwIgXDKv1xQjW+pRnLULH8Snpe1Wfvme1NC/VJW9+z7apAc="}]},"_npmUser":{"name":"chanceprotocol","email":"chance@netixsol.com"},"directories":{},"maintainers":[{"name":"chanceprotocol","email":"chance@netixsol.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/draw-results_1.1.0_1692257189855_0.7703733920727796"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-17T07:26:29.790Z","1.1.0":"2023-08-17T07:26:30.010Z","modified":"2023-08-17T07:26:30.286Z"},"maintainers":[{"name":"chanceprotocol","email":"chance@netixsol.com"}],"description":"<p align=\"center\">   <a href=\"https://github.com/pooltogether/pooltogether--brand-assets\">     <img src=\"https://github.com/pooltogether/pooltogether--brand-assets/blob/977e03604c49c63314450b5d432fe57d34747c66/logo/pooltogether-logo--purple-gradient.png?r","license":"ISC","readme":"<p align=\"center\">\n  <a href=\"https://github.com/pooltogether/pooltogether--brand-assets\">\n    <img src=\"https://github.com/pooltogether/pooltogether--brand-assets/blob/977e03604c49c63314450b5d432fe57d34747c66/logo/pooltogether-logo--purple-gradient.png?raw=true\" alt=\"PoolTogether Brand\" style=\"max-width:100%;\" width=\"400\">\n  </a>\n</p>\n\n<br />\n\n# V4 Draw Results\n\n![Draw Calculator CLI](https://github.com/pooltogether/v4-draw-results/actions/workflows/cron.yml/badge.svg)\n![Unit Tests](https://github.com/pooltogether/v4-draw-results/actions/workflows/unit_test.yaml/badge.svg)\n\n[![Netlify Status](https://api.netlify.com/api/v1/badges/27b08c1f-abf1-4e39-ba86-60bd8584302d/deploy-status)](https://app.netlify.com/sites/eager-fermat-3a8c47/deploys)\n\n## Description\n\nThis repository serves as a layer above the [v4-cli](https://github.com/pooltogether/v4-cli) and stores the result of drawPrize compute command execution.\n\nThe CLI is instantiated periodically from the [cron workflow](./.github/workflows/cron.yml). This workflow checks if the most recent `drawId` for a network is greater than the last committed `drawId`, and if so, runs the [v4-cli](https://github.com/pooltogether/v4-cli).\n\nThis data serves as the data source for the hosted [Netlify API](https://api.pooltogether.com/prizes/137/0x8141bcfbcee654c5de17c4e2b2af26b67f9b9056/draw/12/prizes.json). More information on how to use this API can be found [here](https://dev.pooltogether.com/protocol/api/prize-api).\n\n## Adding a new Prize Pool\n\n1. Add a workflow step to commit prize files if they were created. For example:\n\n```yaml\n- name: Commit files for [newPrizePool]\n  if: steps.runDrawCalcCLI.outputs.[newPrizePool]CliToolRan == 'true'\n  run: |\n    git config --local user.email \"41898282+github-actions[bot]@users.noreply.github.com\"\n    git config --local user.name \"github-actions[bot]\"\n    git pull\n    git add ./api/prizes/[newPrizePoolChainId]/\n    git commit -m \"Add draw for [newPrizePool] draw ${{steps.runDrawCalcCLI.outputs.[newPrizePool]DrawId}}\"\n```\n\n## Data Structure\n\nThe generated file structure is:\n\n```\nv4-draw-results\n│   README.md\n│   package.json\n│   ...\n└───api\n    └───prizes\n        └───1 (chainId for mainnet)\n            │    └─── 0xb9a179dca5a7bf5f8b9e088437b3a85ebb495efe (Prize Distributor address)\n            │           └─── draw\n            │                └─── 1\n            │                     │   0xa123..json\n            │                     │   0xa124..json\n            │                     │   ...\n            │                     │   prizes.json\n            │                     │   status.json\n            |\n            │                └─── 2\n            │               ...\n        └───137 (chainId for polygon)\n            └─── 0x8141bcfbcee654c5de17c4e2b2af26b67f9b9056 (Prize Distributor address)\n            │           └─── draw\n            │                └─── 1\n            │                     │    0xa123..json\n            │                     │    0xa124..json\n            │                     │    ...\n            │                     │    prizes.json\n            │                     │    status.json\n            |\n            │                └─── 2\n            │           ...\n        └───43114 (chainId for avalanche)\n            └─── 0x83332f908f403ce795d90f677ce3f382fe73f3d1 (Prize Distributor address)\n            │           └─── draw\n            │                └─── 67\n            │                     │    0xa123..json\n            │                     │    0xa124..json\n            │                     │    ...\n            │                     │    prizes.json\n            │                     │    status.json\n            |\n            │                └─── 68\n            │           ...\n\n\n```\n\n| File         | Description                                          |\n| ------------ | ---------------------------------------------------- |\n| 0xa123..json | Data for a winning address for a draw                |\n| prizes.json  | Index file including all winners for draw            |\n| status.json  | Metadata about the CLI run (status and time elapsed) |\n\nWhere `prizes.json` is an index of all the individual address files and `status.json` includes .\n\nThe file structure is according to Prize Distributor address (not by Ticket) is because a Ticket can mave multiple associated Prize Distributors.\n**NOTE** : The use of lower case strings for addresses.\n\n### Examples\n\nFor example:\n\n1. `./api/prizes/1/0xb9a179dca5a7bf5f8b9e088437b3a85ebb495efe/draw/1/prizes.json`\n   will display all prizes for chainId = 1 (Ethereum Mainnet) for Prize Distributor (address: `0xb9a179dca5a7bf5f8b9e088437b3a85ebb495efe`) for draw 1.\n\n   This is also viewable at the [Netlify API](https://api.pooltogether.com/prizes/1/0xb9a179dca5a7bf5f8b9e088437b3a85ebb495efe/draw/1/prizes.json).\n\n1. `./api/prizes/137/0x8141bcfbcee654c5de17c4e2b2af26b67f9b9056/draw/12/prizes.json`\n   will display all prizes for chainId = 137 (Polygon/Matic) for Prize Distributor (address: `0x8141bcfbcee654c5de17c4e2b2af26b67f9b9056`) for draw 12.\n\n   This is also viewable at the [Netlify API](https://api.pooltogether.com/prizes/137/0x8141bcfbcee654c5de17c4e2b2af26b67f9b9056/draw/12/prizes.json).\n\n1. `./api/prizes/43114/0x83332f908f403ce795d90f677ce3f382fe73f3d1/draw/70/prizes.json`\n   will display all prizes for chainId = 43114 (Avalanche) for Prize Distributor (address: `0x83332f908f403ce795d90f677ce3f382fe73f3d1`) for draw 70.\n\n   This is also viewable at the [Netlify API](https://api.pooltogether.com/prizes/43114/0x83332f908f403ce795d90f677ce3f382fe73f3d1/draw/70/prizes.json).\n","readmeFilename":"README.md"}