mfers
v1.3.1
Published
quick and easy access to mfers metadata
Downloads
34
Maintainers
Readme
Overview
- Access trait metadata for all mfers
- Metadata compressed from 7.5MB ~> 75kB
- Isomorphic: works on both NodeJS and browser
Looking for JSON data files? Check here
Install
Via NPM:
npm install mfers
NodeJS
// ES6 Syntax
import { mfers, traits, MFERS_CONTRACT } from 'mfers';
// CJS syntax
const { mfers, traits, MFERS_CONTRACT } = require('mfers');
Browser Module (via skypack):
import { mfers, traits, MFERS_CONTRACT } from 'https://cdn.skypack.dev/mfers';
API
mfers
An ordered array of mfer metadata. Index in array = mfer token id (mfer #3664 ~> mfer[3664]
)
Each mfer provides traits
, colors
, and description
import { mfers } from 'mfers';
mfers[3664]
// {
// i: 3664,
// traits: {
// "background": "blue",
// "type": "plain mfer",
// "eyes": "3D glasses",
// "mouth": "smile",
// "headphones": "gold headphones",
// "hat over headphones": "hoodie",
// "smoke": "cig white"
// },
// colors: [
// '#000000', '#ffffff', '#353535', '#191919',
// '#141414', '#e2aa46', '#c48d2e', '#e59f5f',
// '#7dd0ff', '#313131', '#558aff', '#1350d8',
// '#b90000', '#ff2222', '#fa3434'
// ],
// description: "a simple hand-drawn stick figure wearing
// 3D glasses with red and blue lenses with a soft smile
// and smoking a cig. They have no hair, are wearing
// gold headphones, and are wearing a dark gray hoodie
// with the hood up over the headphones"
// }
traits
An object containing all possible variations for each trait
import { traits } from 'mfers';
Object.keys(traits)
// ~> [ "chain", "hat over headphones", "short hair", ... ]
traits['chain']
// ~> [ "silver chain", "gold chain" ]
traits['hat over headphones']
// ~> [ "cowboy hat", "top hat", "hoodie", "pilot helmet" ]
colors
An object containing an array of colors for each trait variant (not including 1/1's). Output array is sorted by number of pixels the color occupies in the layer.
import { colors } from 'mfers';
colors['headphones']['pink headphones']
// ~> [ "#ff9295", "#000000", "#ff7174"]
colors['background']['graveyard']
// ~> [ "#7c7c7c", "#090908", "#a7a7a5", "#ffc954", "#686867"]
colors['eyes']['purple shades']
// ~> [ "#000000", "#952791", "#6b2768", "#f147eb"]
describe_traits(mfer_traits)
A function that describes arbitrary trait combinations using plain english, ideal for LLMs and GPTs. This was used for MferGPT
MFERS_CONTRACT
Contract address for mfers
import { MFERS_CONTRACT } from 'mfers';
MFERS_CONTRACT
// ~> "0x79fcdef22feed20eddacbb2587640e45491b757f"
Why?
mfers is an NFT collection that lives on the Ethereum blockchain with metadata stored on IPFS. Instead of manually downloading and parsing 10k JSON files, you can just import this library! The metadata is stored in a compressed format, reducing the network payload by 100x (7.5 MB ~> 75 kB)
Use Case Inspiration
- Tailored media generators
- (for example, mfer heads)
- mfer dapp theming (color schemes + trait-specific designs)
- Derivative projects
- Sniping aesthetic trait combinations
Acknowledgements
mfers (by sartoshi) is a cc0 project, giving creators and developers the freedom to build things like this. Enjoy mfers ~