This project provides a set of tools and utilities to work with Moonbirds NFTs, designed for easy integration into your applications.
- Randomizer: A function to generate random Moonbird NFTs.
- Metadata: Utilities for retrieving and managing metadata associated with Moonbirds.
- Artwork: Functions to interact with Moonbirds' art assets and layers.
To install and set up the project, run the following commands:
# Clone the repository
git clone https://github.com/CMHayden/moonbirds-art.git
# Navigate to the project directory
cd moonbirds-art
# Install the dependencies
npm install
If you're using TypeScript:
# Install TypeScript and other required packages
npm install --save-dev typescript ts-node @types/node
This section explains how to use the different features of the package.
This package requires sharp
to be installed in the consuming project. Run:
npm install sharp
Due to an issue with sharp and the client, adding it as a peer dependency was a necesity, along with a small addition to your nextconfig.ts if using next.js:
const nextConfig: NextConfig = {
webpack: (config) => {
config.externals = config.externals || [];
config.externals.push("sharp");
return config;
},
};
module.exports = nextConfig;
import { generateRandomMoonbird } from "moonbirds-art/randomizer";
const randomMoonbird = generateRandomMoonbird();
console.log(randomMoonbird);
import { getMoonbirdConfigById } from "moonbirds-art/metadata";
const moonbirdId = 12345;
try {
const config = await getMoonbirdConfigById(moonbirdId);
console.log(config);
} catch (error) {
console.error("Error:", error);
}
We welcome contributions! To contribute, please fork the repository and submit a pull request. Here's how:
- Fork the repository
- Create a feature branch (git checkout -b feature-name)
- Commit your changes (git commit -am 'Add feature')
- Push to the branch (git push origin feature-name)
- Open a pull request
- Let me know to take a look on the Moonbirds discord, or on twitter @igottheherb
This project is licensed under the MIT License.