Skip to content

Aurory-Game/dna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aurory DNA SDK

Welcome to the Aurory DNA SDK. This SDK is used to generate and parse Nefties' DNA.

Installation

npm i @aurory/dnajs

Examples

Generate + parse dna

import { DNAFactory, EggFactory } from "@aurory/dna";

const df = new DNAFactory();
// the first argument is an egg's mint address.
const ef = new EggsFactory("8XaR7cPaMZoMXWBWgeRcyjWRpKYpvGsPF6dMwxnV4nzK", df);
const neftyIndex = ef.hatch().archetypeKey;
const dna = df.generateNeftyDNA(neftyIndex);
const parsed = df.parse(dna);
console.log(parsed);

See ParseV2 interface for more details on df.parse's output.

Get all eggs

const eggs = EggsFactory.getAllEggs();
for (const egg of eggs) {
  const [eggPk, eggInfo] = egg;
  console.log(eggPk, eggInfo);
}

How to contribute

  • Make sure to add tests for your changes.
  • Make sure to specify the changes you made in the CHANGELOG, under the Unreleased section.
  • If a new abilities dictionary or dna schema is added, update the appropriate latest.ts file.

How to release a new version

  • Open a branch named release/vX.X.X
  • Update the version in package.json
  • Update the CHANGELOG to replace the Unreleased section with the new version