โ† all modules
@metanet-games/

satchel

๐ŸŽ’
live on npm zero deps npm โ†— source โ†— Apache-2.0

Inventory โ€” local for a wallet-less player, real on-chain items (1Sat Ordinals) when they connect, in one merged bag.

Install

$ npm i @metanet-games/satchel

Example

import { createSatchel } from "@metanet-games/satchel";

// chain: your indexer, { list: (pubkey) => item[] }
const bag = createSatchel({ identity, store: localStorage, chain });
bag.add({ type: "potion", stackable: true, qty: 3 });
bag.add({ type: "sword", meta: { atk: 5 } });

await bag.sync();     // pulls the player's on-chain items in
bag.items();          // merged: each { โ€ฆ, origin: "local" | "chain" }

Plug it into your game

A wallet-less player collects items locally; when they connect, sync() merges their real on-chain items into the same bag, tagged by origin. Local items are yours to add and remove; on-chain ones are owned property โ€” spending an ordinal is a transaction your app makes, not a local delete.

Part of chainkit โ€” verifiable building blocks for BSV games. Verify don't trust.

๐Ÿงฉ github.com/metanet-games/chainkit ยท ๐Ÿ•น๏ธ the games ยท metanet.games