Use Nostr emoji packs as real reusable assets

MojiSurvivor already knows how to recognize custom emoji across Nostr packs, give each media item a stable identity and filter unwanted content. This guide shows which pieces are now reusable by other apps.

import { Moji, Moderation } from '@chaoticka/nsite-loopy-sdk';
// `events` must contain actual signed events obtained from the relay client.
const data = await Moji.collectNip30Emojis(events, {
  policy: {bannedPubkeys: Moderation.BUILT_IN_NSFW_BAN_PUBKEYS}
});
console.log(data.emojis.length, data.unresolvedReferences);

parseNip30Event cryptographically verifies kind:10030 and kind:30030 events, applies opt-in/safe-mode policies, and returns unresolved a references separately for a host to fetch. Signed events are deduplicated by media identity, not shortcode. No unapproved media is fetched or previewed.

Game mechanics

deriveEmojiStatsFromHash(hash) uses the source's five leading bytes to calculate HP, movement speed, damage, behavior, experience, Mojo, power and rarity. These traits are deterministic but game-specific, and can be used independently of React/canvas.