Location: repo root (Bankr resource). Mirror: references/runtime-contract.md
This file defines the non-negotiable runtime behavior for TMP skills.
Goal: when user says "sell this token rights for 0.01", the agent should complete the full flow end-to-end (or fail with an explicit blocker), not stop halfway.
Applies to:
- mint + list 100% fee rights
- share-market buy/list (including password-gated)
- any flow with multiple dependent transactions
Non-goal:
- replacing product logic in
flows-reference.mdand feature playbooks
For every state-changing action:
- Submit tx
- Wait for mined receipt
- Verify post-state on-chain/API
- Only then report success
Never report success based on:
- simulation only
- tx submission only
- unsigned prepared calldata only
Never report failure if:
- there is already a mined success tx proving completion
User example: "sell this token rights for 0.01"
The runtime must do all of this in one conversation:
- Resolve token -> launch metadata (
get_token_launch_infoortoken-fees). - Confirm user has fee rights eligible to mint/list.
- If TMPR missing: run mint sequence fully:
prepareDeposit- beneficiary transfer to escrow
finalizeDeposit
- After each mint tx, wait for receipt + verify expected state transition.
- Derive
tokenId. - Call
POST /api/list/dualwith{ tokenId, priceEth, seller }. - Execute all returned
site.steps[]via wallet tx flow. - Wait for receipts for each step.
- Verify listing status via
GET /api/list/status?tokenId=. - Return final user message with:
- success state
- tokenmarketplace listing link
- OpenSea status (if applicable)
- tx hashes (or compact refs)
Do not pause after mint saying "next do list". The runtime must continue unless a real blocker occurs.
Required sequence:
- Resolve tokenId + cheapest/selected listing.
- Read
accessKeyHash(listingId). - If gated:
- call
POST /api/listings/access-authorize - execute 4-arg
buy(listingId, qty, authDeadline, signature)
- call
- Wait for mined receipt.
- Verify
balanceOfdelta orTransferSingleto buyer.
Rules:
- Simulation is optional preflight, not source of truth.
- BaseScan/receipt success beats earlier simulation revert.
- For free listings (
pricePerUnitWei == 0),msg.valuemust be exactly 0. - Do not tell user "buy manually" when success tx already exists.
When sources disagree, trust in this order:
- Mined on-chain receipt + post-state read
- Direct contract reads
- Product API responses (
/api/list/status, launch metadata) - Simulation results
- Assumptions
Runtime must have:
- Bankr tx execution (
bankr.tx.prepare/confirmTransaction) - token metadata resolver (
get_token_launch_infoand/ortoken-fees) - listing APIs:
POST /api/list/dualGET /api/list/statusPOST /api/listings/access-authorize(for gated share buys)
- chain receipt waiting
- post-state reads (
balanceOf, listing active/status reads)
If any are missing, agent must explicitly say:
- which capability is unavailable
- which step is blocked
- exact next action needed
Before declaring failure, agent must run these checks:
- Did any submitted tx already mine successfully?
- Did target state already change (ownership/listing active/balance)?
- Is this a stale retry error (e.g.
ListingInactiveafter fill)? - For gated flows, is auth ticket expired and refreshable?
- For sell/list flows, does
mint/statusreportescrowMismatch === true?- If
phase !== "ready": stop before mint/list txs; classify as backend escrow alignment; do not classify as scanner block. - If
phase === "ready": escrow mismatch is informational for listing — proceed withlist/dualusing correct TMPR owner asseller(seelinked-wallet.md).
- If
Only after these checks can agent return a failure.
Applies to tweet, DM, and Ask Bankr when the user asked to sell/list 100% for X ETH (or equivalent).
Forbidden replies:
- “I hit my step limit” / “try breaking it into smaller steps”
- “Your fee rights haven’t been converted to an NFT yet” without
GET /api/mint/status→phase - “Go update fee recipient on Doppler” when
phaseisneeds_transferorneeds_finalize(usePOST /api/bankr-build-transfer+finalizeDepositpernextStep)
When the turn ends before listing is live:
- Report
phasefrom mint/status (e.g.needs_transfer,needs_finalize,ready). - State who signs next (
signerMustBe) and what API/tx is next (bankr-build-transfer,finalizeDeposit,list/dual). - If one more tx was in progress, include BaseScan hash when mined.
- Continue in the same thread (DM or tweet reply): user says “continue t7 list 0.01” → resume from current
phase, do not restart with a Create NFT tutorial.
Tweet / X: Same autopilot as DM for clear sell-100% intent. Guidance-only is allowed only after a real blocker (no wallet, no signing capability, API error with no retry path) — not because the channel is public.
Priority: If user said “on the marketplace” only, finish Token Marketplace (list/dual + site steps) before treating OpenSea as required for success.
Every completed flow response must include:
- what action completed
- canonical link (tokenmarketplace share/listing URL)
- whether action is now live on-chain/site
For mint/create-NFT flows, response must also include:
- TMPR
tokenId - direct item link (OpenSea token page or canonical profile item route)
- explicit ownership confirmation source (
ownerOf(tokenId)/ receipt-backed proof) - profile/indexer fallback note when UI is delayed
For errors:
- clear blocker
- what was already completed
- exact next step (single action)
A sell/list flow passes only if:
- no manual handoff occurs mid-flow
- all dependent txs are mined
- listing is verified active by status endpoint
- returned message includes listing URL
A mint/create flow passes only if:
- mint/finalize tx is mined
- owner is confirmed on-chain
- user gets a direct token link even if profile index is behind
- agent does not imply "mint failed" solely because profile page has not updated yet
A share buy flow passes only if:
- receipt mined
- holder balance increased or transfer event confirms
- no false "failed" message after successful tx
Real-world pattern to prevent:
- User requests password buy on share page.
- First simulation reverts.
- A later tx actually succeeds on-chain.
- Agent still replies “failed / do it manually.”
Required handling:
- If any tx hash exists, check receipt first.
- If receipt is success, verify ownership delta and report success.
- Mark later
ListingInactiveas expected if listing was filled by that success tx. - Never emit “I didn’t submit a tx” if a tx hash exists for this run.
Example reference tx: