Skip to main content

About Axie gene structure

On the blockchain, an Axie’s information is stored in a 512-bit array. Each block within the 512 bits represents an Axie property. The structure looks like this:

Here's how to get genes from an Axie's ID using the Axie Infinity GraphQL:

export const getAxieGenes = async (axieId: string): Promise<string> => {
const fetcher = await fetch(
'https://graphql-gateway.axieinfinity.com/graphql',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
operationName: 'GetAxieDetail',
variables: { axieId },
query:
'query GetAxieDetail($axieId: ID!) {\n axie(axieId: $axieId) {newGenes\n}\n}',
}),
}
)
const res = await fetcher.json()
return res?.data?.axie?.newGenes
}
Was this helpful?
Happy React is loading...