Skip to content

feat: MomoSwap NFT queue settle/refund, drop graduation, unwrap_cook - #13

Merged
fibanachos merged 2 commits into
mainfrom
feat/momoswap-gaps
Oct 27, 2026
Merged

fibanachos merged 2 commits into
mainfrom
feat/momoswap-gaps

Conversation

@fibanachos

@fibanachos fibanachos commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Closes the gaps between cookie-mcp and the transactions MomoSwap's API builds. Tools: 73 → 76.

New tools

  • nft_drop_settle: after a drop graduates at its target, each mint is a request a keeper settles. If the keeper never does, the buyer was stuck: the tool even said "it can only be refunded" but offered no way to do it. This pushes the drop's FIFO mint queue up to the wallet's own request, at most 5 heads per call. For each head it asks for /v1/nft/tx/settle-mint, and if MomoSwap refuses, /v1/nft/tx/refund-mint. When both refuse, the settle reason is shown. Heads ahead of ours pay out to their own buyers. The caller pays fees only: a settle's rent is repaid in the same instruction, and a refund may open the buyer's wCOOK account.
  • nft_drop_graduate: /v1/nft/tx/graduate for a sold-out drop (permissionless).
  • unwrap_cook: closes the wallet's wCOOK account and returns its balance as native COOK. This is where launchpad referral earnings and NFT sell-backs collect. It's built locally (one CloseAccount on our own account) and simulated with a zero-spend budget.

Safety

  • verify.ts gets three kinds, settle / refund / graduate, with this wallet held to the settler / caller / signer slot. Every PDA is re-derived from the vendored IDL as before.
  • Spend budgets: settle = fee + item rent, refund = fee, graduate = fee. When the head is our own request, the item or the refund has to arrive.

Not added

  • /v1/nft/tx/buy-many: item k of a batch can't be simulated before k−1 lands, so nft_drop_mint keeps building one fresh /tx/buy per item.

Docs

README now says MomoSwap launches NFT collections too (intro and "What it can do"), and documents the new tools. CHANGELOG has an Unreleased entry.

Verification

  • yarn test green (868 tests), smoke --strict OK with 76 tools.
  • New unit tests: refund and graduate transactions built from the IDL (accepted, wrong request PDA, someone else authorising, another drop, wrong kind), plus the budgets, holderExit for sold-out, and unwrapPlan.
  • The three routes were probed live on 2026-10-27. They answer with the expected contract: 409 "No mint is waiting to settle." and "has not sold out: 141 of 444 minted".
  • No transaction signed on chain yet. No drop currently has a mint queue or is sold out.

@fibanachos
fibanachos merged commit f9496b9 into main Oct 27, 2026
1 check passed
@fibanachos
fibanachos deleted the feat/momoswap-gaps branch October 27, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant