Read the snapshot. Ask for unsigned transactions. A human signs them in their own wallet. No server, no key, no MCP.
script/snapshot.js rewrites it, and the weekly workflow commits that same file.plan(wallet, target, snapshot).ideas(wallet, snapshot).{
block: number,
owners: ["0x…"],
math: [["id", ownerIndex]],
rgb: [["id", ownerIndex, r, g, b]],
toon: [["id", ownerIndex, word, face, rgb]],
words: { "id": "text" },
faces: { "id": "text" },
wordOwners: [ownerIndex],
faceOwners: [ownerIndex],
blocked: ["0x…"],
blockedDone: true
}
Ids are decimal strings. ownerIndex indexes owners, which are lowercase. A used channel is an r, g, or b on an RGB row. wordOwners[id] and faceOwners[id] are the holders. WORD and FACE ids run from 0. blocked lists holders that revert MATH's 2300-gas payout. blockedDone is true when that list was scanned.
AGENT.plan(wallet, target, snapshot)
AGENT.plan(wallet, "3", snap)
AGENT.plan(wallet, { math: "3" }, snap)
AGENT.plan(wallet, { r: "1", g: "2", b: "4" }, snap)
AGENT.plan(wallet, { math: "1", word: "2", face: "3", rgb: "4" }, snap)
In the browser, load abi.js, planner.js, eth.js, then plan.js. AGENT is the global. The workshop page already loads them. In Node, from site/:
const AGENT = require('./plan')
const snap = JSON.parse(fs.readFileSync('./index.json', 'utf8'))
AGENT.plan(wallet, '3', snap)
The result is JSON. v is 1.
{
ok, kind, target, block, wallet, exists,
txs: [{ to, data, value }],
royalty, shares: [{ id, holder, wei, owned }],
owned, note
}
value is hex wei. MATH sends 0.002 ETH. RGB sends 0.03 ETH. TOON sends 0x0. royalty and each share's wei are decimal wei, the part holders receive, not gas. The top-level owned list is ids this address already holds in the snapshot, before any mint in the plan. A share's owned is true when this address will hold that input by the time it is paid: already in the snapshot, or minted by an earlier transaction in this plan. It is false when someone else holds it, and null only when the WORD or FACE owner index is missing. shares.holder is who is paid: the snapshot owner, or this wallet when the plan mints that input earlier. The contract pays whoever holds the input at send time. When an RGB plan uses a channel order other than R, then G, then B, note ends with that order.
ok: false means the snapshot shows the call reverting (a channel already used, a TOON part already used, a missing MATH or RGB, a WORD or FACE the signer does not hold, or a MATH input held by an address in blocked). The transactions are still returned. exists: true means that target is already minted, so txs is empty. A TOON plan is ok: true when the signer holds the MATH, WORD, FACE, and RGB.
IDEAS.ideas(wallet, snapshot)
wallet is a 0x address. The zero address returns []. Moldemort takes a pasted address or ENS name, resolves the name, then calls this. With a wallet connected, that field is hidden and the account is used. snapshot is the same object as plan. No chain calls inside ideas.
At most one math, one rgb, and one toon, cheapest royalty first, then smallest value sent. Each item is { kind, target, ok, cost, sent, plan }. cost is the royalty in wei. sent is the sum of tx value. Both are BigInt. plan is the AGENT.plan result. Already minted targets are omitted. An ok: false plan is still returned.
const IDEAS = require('./ideas')
IDEAS.ideas(wallet, snap)
In the browser, load suggest.js, eth.js, plan.js, then ideas.js. IDEAS is the global. The workshop page already loads them.
load it fills the mint, rgb, or toon form from an ok plan. A human signs. A MATH plan with more than one transaction has no load.
plan does not.blocked lists them when blockedDone is true. A route that still names one comes back ok: false.value is only the msg.value.block. It lags mainnet until the next snapshot.MATH, RGB, TOON, and the renderers have no admin key and no upgrade.