{"id":16095689,"url":"https://github.com/rigwild/anons-s2-secret-nft","last_synced_at":"2026-03-18T17:54:10.753Z","repository":{"id":50537604,"uuid":"519368474","full_name":"rigwild/anons-s2-secret-nft","owner":"rigwild","description":"Rarity rankings for Anons S2 \"The Army\" NFTs on Secret Network 💸","archived":false,"fork":false,"pushed_at":"2023-09-26T23:28:19.000Z","size":131351,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-18T19:50:21.822Z","etag":null,"topics":["anons","blockchain","nft","non-fungible-token","ranking","rankings","rarity","secret-network"],"latest_commit_sha":null,"homepage":"https://anons2.rigwild.dev","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rigwild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-29T22:56:55.000Z","updated_at":"2023-02-13T14:49:12.000Z","dependencies_parsed_at":"2023-09-27T04:14:41.094Z","dependency_job_id":null,"html_url":"https://github.com/rigwild/anons-s2-secret-nft","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"95571bcbdbea92e55870c8d0fd3a2fa50df0bc03"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigwild%2Fanons-s2-secret-nft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigwild%2Fanons-s2-secret-nft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigwild%2Fanons-s2-secret-nft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigwild%2Fanons-s2-secret-nft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rigwild","download_url":"https://codeload.github.com/rigwild/anons-s2-secret-nft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393573,"owners_count":20931813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anons","blockchain","nft","non-fungible-token","ranking","rankings","rarity","secret-network"],"created_at":"2024-10-09T17:07:50.710Z","updated_at":"2026-02-09T12:02:10.720Z","avatar_url":"https://github.com/rigwild.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anons S2 NFT Rarity Scores\n\nThis project contains some rarity scores for each Anons S2 \"The Army\" NFTs from [anons.army](https://anons.army/) on [Secret Network](https://scrt.network/).\n\nAnons S1 \"OGs\" NFTs rarity scores: [rigwild/anons-secret-nft](https://github.com/rigwild/anons-secret-nft).\n\nThe rarity score is calculed following [these formulas (`Rarity Score: How is it Calculated?` section)](https://raritytools.medium.com/ranking-rarity-understanding-rarity-calculation-methods-86ceaeb9b98c#2942). A rarity score can be calculated in a lot of different ways with each their specific strengths and flaws. **This is not an official ranking.**\n\nAny traits that is set to `No` is renamed to `None`. `None` is treated as any other trait, **it counts in the scores!** An NFT with all traits to `None` would then be very rare.\n\nThe count of traits rarity is calculated, but the scores and ranks without it are also provided. You can toggle it in the website.\n\n⭐ Star the project! ⭐\n\n## Website\n\nA website is available at [anons2.rigwild.dev](https://anons2.rigwild.dev/)\n\n![website screenshot](./screenshot.webp)\n\n## Raw Rarity Scores\n\n- Human-readable version: [`_output_results.log`](./_output_results.log)\n- JSON:\n  - [`_output_elementsNullTraitsAsNone.json`](./_output_elementsNullTraitsAsNone.json): Elements with `null` traits set to `none`\n  - [`_output_rarity.json`](./_output_rarity.json): Rarity scores\n  - [`_output_elementsWithRarity.json`](./_output_elementsWithRarity.json): Elements with its rarity\n\n## Reproduce calculations\n\n```sh\npnpm install\npnpm build\npnpm exportScores\n```\n\nIf the generated [`_output_elementsWithRarity.json`](./_output_elementsWithRarity.json) file has not changed, you are sure I did not cheat by manually editing it!\n\nSHA256 hashes:\n\n```\n$ sha256sum _*\n8c35038d7aba18972083e0061c920c2882ab8a6d1d6d2f7789720001a2b3a8c3  _input_elements.json\nbd8942b362c78224c550dd56eb08afbb2ffd7e5cb0de5d749f1dd8ebac74644e  _output_elementsNullTraitsAsNone.json\n8467442c7e1293e92aa21832407e5c4e203cc192a698a6732af049a9d9cbbe5e  _output_elementsWithRarity.json\n7ffb062f7ad2523cdc4959ddeb07a3afb9b5821e5c97d78d874a7a6abedf8c04  _output_rarity.json\n4a4b4ae7a5777db681427eb1cba383919b95044610d86eb7ac2adbd7a1f730f3  _output_results.log\n```\n\n**Note:** Your hashes may be different if you just updated the data, as some nft were probably revealed since my hashes were produced.\n\n## Update rarity scores and website\n\nDownload the latest data from the API, calculate the rarity from scratch and update the website.\n\n```sh\npnpm i -g zx @squoosh/cli\n\nexport ELEMENTS_API_URI='https://rest-api.anons.army/api/anons/s2'\nzx ./scripts/updateWebsite.mjs\n```\n\n## Get rankings of NFTs list\n\n```sh\nELEMENTS='1300 1523 187 755 780 870'\nELEMENTS='1300,1523 187| 755 -780;870' # any format, parameters are cleaned!\nzx scripts/getRanking.mjs $ELEMENTS ; zx scripts/getRanking.mjs $ELEMENTS | clipboard\n```\n\nOutput (+ copied to clipboard):\n\n```\n   187: Ranked   98 of 592 - score  77.08995339\n   755: Ranked  265 of 592 - score  62.45316002\n   780: Ranked  186 of 592 - score  67.95338584\n   870: Ranked  435 of 592 - score  50.10635172\n  1300: Ranked  493 of 592 - score  45.18967711\n  1523: Ranked   77 of 592 - score  80.58123589\n\n⭐ Star https://github.com/rigwild/anons-s2-secret-nft\n```\n\n## Reuse this project for your NFT collection\n\nThis project is open source. You can reuse it for your own project! ✌\n\nThe only requirements are:\n\n- Mention my pseudo in your license\n- Mention in your README that this was initially built by me, with a link to this repo.\n- Mention in your website that this was initially built by me, with a link to this repo.\n\nThe code is as generic as possible, you only need to import your data in `_input_elements.json` (with the same format), edit [`./types.ts`](./types.ts) with your traits and change some texts in the website.\n\nYou may need to edit stuff if your NFTs collection doesn't have a \"reveal\" feature (`element.revealed: 1`).\n\n### Deploy\n\nRun with Node.js 16. To do this on [Cloudflare Pages](https://pages.cloudflare.com/), set the `NODE_ENV` environment variable to `16` (see [Language support and tools](https://developers.cloudflare.com/pages/platform/build-configuration/#language-support-and-tools)).\n\nBuild command: `cd vite-project \u0026\u0026 npm install -D \u0026\u0026 npm run build`\n\nBuild output directory: `/vite-project/dist`\n\n### Automatically update the website\n\nCreate a Cloudflare Worker.\n\n```js\naddEventListener('fetch', event =\u003e {\n  event.respondWith(handleRequest(event.request).catch(err =\u003e new Response(err.stack, { status: 500 })))\n})\n\n/**\n * @param {Request} request\n * @returns {Promise\u003cResponse\u003e}\n */\nasync function handleRequest(request) {\n  const _output_rarity = await ranks.get('_output_rarity.json')\n  const _output_elementsNullTraitsAsNone = await ranks.get('_output_elementsNullTraitsAsNone.json')\n  return new Response(\n    `{\"_output_rarity\":${_output_rarity},\"_output_elementsNullTraitsAsNone\":${_output_elementsNullTraitsAsNone}}`,\n    {\n      headers: {\n        'Content-Type': 'application/json',\n        'Access-Control-Allow-Origin': '*',\n        'Cache-Control': 'max-age=600' // Cache client-side for 10 minutes\n      }\n    }\n  )\n}\n```\n\nStore the data into a Cloudflare Workers KV namespace. This script will update the data every 10 minutes.\n\n```sh\nELEMENTS_API_URI='https://rest-api.anons.army/api/anons/s2' \\\nCLOUDFLARE_ACCOUNT_ID=\u003cCLOUDFLARE_ACCOUNT_ID\u003e \\\nCLOUDFLARE_API_KEY=\u003cCLOUDFLARE_API_KEY\u003e \\\nCLOUDFLARE_NAMESPACE_ID=\u003cCLOUDFLARE_NAMESPACE_ID\u003e \\\nzx ./scripts/updateCloudflareWorkersKV.mjs\n```\n\nThen configure your worker service by binding the KV namespace to it with the variable `ranks`.\n\nWhen deploying the website, set the `VITE_API_URI` environment variable to your worker API endpoint.\n\nVoilà! The website will auto update every 10 minutes. Keep in mind that new images will be fetched using the element `imageUrl` and uncompressed.\nIt is a good idea to update the website sometimes so users load the compressed images instead of the remote ones.\n\n## License\n\n[The MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frigwild%2Fanons-s2-secret-nft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frigwild%2Fanons-s2-secret-nft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frigwild%2Fanons-s2-secret-nft/lists"}