Eve library

Avatar & Cosmetic NFT Service

Other

Revision 1

On this page

The avatar cosmetic service constructs fully layered avatars and mints them as NFTs. It integrates with asset libraries, generative color harmonization, and storage providers.

Pipeline#

  1. Asset loader – pulls the base avatar and cosmetic PNG/SVG layers.
  2. Layer composer – merges layers into a single composite image.
  3. Palette generator – harmonizes color accents for metadata + UI.
  4. Storage – uploads composite + thumbnail assets (e.g., IPFS).
  5. Metadata builder – emits ERC-721 metadata with cosmetic traits.
  6. Minter – submits to on-chain mint adapter.

Usage#

ts
import { createAvatarCosmeticService } from './service';

const service = createAvatarCosmeticService({
  assetLoader,
  layerComposer,
  paletteGenerator,
  storage,
  metadataBuilder,
  minter,
});

const minted = await service.mintAvatar({
  seekerName: 'Rowan',
  baseAvatarId: 'celestial-fluid',
  cosmetics: [
    { assetId: 'halo', intensity: 'luminous' },
    { assetId: 'robes', colorway: 'midnight' },
  ],
  theme: 'night sky sanctuary',
});

Tests#

bash
npx jest --config apps/lilith/svc-avatar-cosmetic/jest.config.cjs --runInBand