{"id":13656151,"url":"https://github.com/ShaneMaglangit/agp-npm","last_synced_at":"2025-04-23T17:31:23.474Z","repository":{"id":45309289,"uuid":"389829039","full_name":"ShaneMaglangit/agp-npm","owner":"ShaneMaglangit","description":"Gene parsing package for Axie Infinity.","archived":true,"fork":false,"pushed_at":"2022-08-11T17:27:59.000Z","size":707,"stargazers_count":42,"open_issues_count":1,"forks_count":12,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-29T20:37:24.252Z","etag":null,"topics":["axie","axie-infinity","javascript","node","typescript"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/agp-npm","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ShaneMaglangit.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}},"created_at":"2021-07-27T02:49:25.000Z","updated_at":"2024-10-29T15:58:59.000Z","dependencies_parsed_at":"2022-08-12T11:51:36.705Z","dependency_job_id":null,"html_url":"https://github.com/ShaneMaglangit/agp-npm","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShaneMaglangit%2Fagp-npm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShaneMaglangit%2Fagp-npm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShaneMaglangit%2Fagp-npm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShaneMaglangit%2Fagp-npm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShaneMaglangit","download_url":"https://codeload.github.com/ShaneMaglangit/agp-npm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223801024,"owners_count":17205009,"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":["axie","axie-infinity","javascript","node","typescript"],"created_at":"2024-08-02T04:00:52.121Z","updated_at":"2024-11-10T08:31:07.945Z","avatar_url":"https://github.com/ShaneMaglangit.png","language":"TypeScript","funding_links":[],"categories":["Gene parser"],"sub_categories":["Discord BOT"],"readme":"# agp-npm\n\n[![npm version](https://badge.fury.io/js/agp-npm.svg)](https://badge.fury.io/js/agp-npm)\n\nPackage `agp-npm` is a gene parsing package for Axie Infinity.\n\nThe name agp stands for \"Axie Gene Parser\" which decodes the hex representation of an Axie's gene into a human readable\nformat.\n\n## Documentation\n\nFor more detailed documentation, see [agp-npm documentation](https://shanemaglangit.github.io/agp-npm).\n\n## Install\n\nagp-npm runs on Node.js and is available as a NPM package.\n\n```sh\nnpm install agp-npm\n```\n\n## Usage\n\nTo get started, you'll first need to get the gene of an Axie in hex. You may use\nthe [Axie Infinity GraphQL endpoint](https://axie-graphql.web.app/) to get this detail. For this example, let's use the\nhex `0x11c642400a028ca14a428c20cc011080c61180a0820180604233082`\n\nLet us create an AxieGene object from the hex string that we have.\n\n**JavaScript**\n\n256 Bit Genes\n\n```javascript\nconst { AxieGene } = require(\"agp-npm/dist/axie-gene\"); // Defaults to HexType.Bit256\nconst axieGene = new AxieGene(\"0x11c642400a028ca14a428c20cc011080c61180a0820180604233082\");\n```\n\n512 Bit Genes\n\n```javascript\nconst { AxieGene, HexType } = require(\"agp-npm/dist/axie-gene\");\nconst hex = \"0x280000000000010040412090830C0000000101942040440A00010190284082040001018C2061000A000101801021400400010180204080060001018418404008\"\nconst axieGene = new AxieGene(hex, HexType.Bit512);\n```\n\n**TypeScript**\n\n256 Bit Genes\n\n```ts\nconst axieGene = new AxieGene(\"0x11c642400a028ca14a428c20cc011080c61180a0820180604233082\");\n```\n\n512 Bit Genes\n\n```ts\nconst hex = \"0x280000000000010040412090830C0000000101942040440A00010190284082040001018C2061000A000101801021400400010180204080060001018418404008\"\nconst axieGene = new AxieGene(hex, HexType.Bit512);\n```\n\n## Gene Quality\n\nYou may also get the quality of the genes directly through the AxieGene object.\n```ts\naxieGene.getGeneQuality();\n```\n\n\nThis object automatically handles the parsing of the hex value for you. You may simply use the accessors of the class to\nget the gene information that you want.\n\nHere are the properties that you can get from the AxieGene object.\n\n* [genes](https://shanemaglangit.github.io/agp-npm/classes/axie_gene.AxieGene.html#genes)\n* [cls](https://shanemaglangit.github.io/agp-npm/classes/axie_gene.AxieGene.html#cls)\n* [region](https://shanemaglangit.github.io/agp-npm/classes/axie_gene.AxieGene.html#region)\n* [tag](https://shanemaglangit.github.io/agp-npm/classes/axie_gene.AxieGene.html#tag)\n* [bodySkin](https://shanemaglangit.github.io/agp-npm/classes/axie_gene.AxieGene.html#bodySkin)\n* [pattern](https://shanemaglangit.github.io/agp-npm/classes/axie_gene.AxieGene.html#pattern)\n* [color](https://shanemaglangit.github.io/agp-npm/classes/axie_gene.AxieGene.html#color)\n* [eyes](https://shanemaglangit.github.io/agp-npm/classes/axie_gene.AxieGene.html#eyes)\n* [mouth](https://shanemaglangit.github.io/agp-npm/classes/axie_gene.AxieGene.html#mouth)\n* [ears](https://shanemaglangit.github.io/agp-npm/classes/axie_gene.AxieGene.html#ears)\n* [horn](https://shanemaglangit.github.io/agp-npm/classes/axie_gene.AxieGene.html#horn)\n* [back](https://shanemaglangit.github.io/agp-npm/classes/axie_gene.AxieGene.html#back)\n* [tail](https://shanemaglangit.github.io/agp-npm/classes/axie_gene.AxieGene.html#tail)\n\n## Go Lang Support\n\nI also released a similar package for Go. [Do check it out!](https://github.com/ShaneMaglangit/agp)\n\n## Support the Author\n\nLove this module? Feel free to buy me a coffee and motivate me to work on more stuffs like this!\n\n**Ronin Address:** ronin:789c9b253eba265f0079e3ebcaaea2503eb31bb3  \n**ETH Address:** 0x9F50E3606caf22ff5E0E03F0eb02DE3Fa2786535  \n**Paypal:** paypal.me/shanemaglangit\n\nSupport does not need to have any monetary value. I would also appreciate if you leave a star!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FShaneMaglangit%2Fagp-npm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FShaneMaglangit%2Fagp-npm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FShaneMaglangit%2Fagp-npm/lists"}