Conversation
…y (#0382) Adds `bb cli build transfer` — an interactive walkthrough for MsgTransferTokens that fetches the collection + sender outgoing + recipient incoming approvals, displays them as a numbered list, and walks the user through picking prioritizedApprovals, enabling the per-level only-check scopes, opting into precalculateBalancesFromApproval when an approval defines predeterminedBalances, and (when not precalculated) specifying the transfer amount + tokenIds. Output is the same /tokenization.MsgTransferTokens shape the existing build_transfer MCP tool produces, so it flows through the shared emit() pipeline — auto-validate, --simulate, --deploy-with-browser all work unchanged. The CREATE-only --deploy-with-burner path will fail with its existing clear error. Any prompt can be short-circuited with a flag (--collection-id / --from / --to / --amount / --token-ids), and --yes skips every prompt for script/CI use (default amount=1, all valid token IDs, no prioritization, no precalc). Includes 11 unit tests for the pure helpers (token-id-spec parsing, index list parsing, candidate extraction, summary tag flagging). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…Multiplier, auto-validate/simulate Second-pass polish on the build transfer walkthrough: - Lenient yes/no parsing (isYes accepts y/Y/yes/YES with whitespace). - Reject "Mint" as the To address — only valid as From. - Heads-up block before precalc/balances when picked approvals carry payment / must-own side conditions, so the user can ctrl-c out before producing a tx that'll fail at sign time. - scalingMultiplier prompt during precalculation — important for consuming N predetermined steps in one tx. - Renumber the precalc candidate list 1..N (was reusing the prior candidate-list index, confusing). - Always emit prioritizedApprovals: [] (was conditionally omitted) to satisfy the validator's "explicitly specified" warning. - Extend emit() so transfer txs flow through auto-validate (and auto-simulate when --simulate is set). Validate now confirms structural correctness on the transfer path; simulate hits /api/v0/simulate for end-to-end gas + event preview. - Tightened --yes docstring (was claiming behavior the code didn't do). - 2 new tests for isYes (13 total). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
bb cli build transfer— an interactive walkthrough that takes the hardest part of building a transfer (picking which approval to consume) and turns it into a numbered-list prompt.Implements autopilot ticket #0382.
What it does
collectionId,from,to(or pulls from flags).predetermined,payment,must-own,backed.prioritizedApprovalsby index (comma-separated, blank to skip).onlyCheckPrioritized<Level>Approvals.predeterminedBalances, prompts whether to delegate balance computation viaprecalculateBalancesFromApproval.amount(default 1) andtokenIds(default all valid)./tokenization.MsgTransferTokenspayload.Output flows through the existing
emit()pipeline, so--simulate/--deploy-with-browser/ auto-validate all just work.--deploy-with-burneris CREATE-only and will fail with its existing clear error.Flag short-circuits
Every prompt can be short-circuited:
--yesskips every prompt for scripts/CI: no prioritization, no precalc, default amount=1, default tokenIds=all valid.Tests
11 new unit tests cover the pure helpers (token-id-spec parsing, index list parsing, candidate extraction, summary tag flagging). The interactive readline loop + network calls aren't unit-tested — verified manually via
--helpsmoke afternpm run build.Test plan
npm run buildclean (608 files, no circular deps).jest src/cli/utils/walkthrough-transfer.spec.ts— 11/11 pass.bb cli build transfer --helprenders the new options.bb cli build transfer --yes --collection-id <id> --from bb1... --to bb1...produces a structurally-valid MsgTransferTokens (emit()auto-validate should green-light it).Out of scope
🤖 Generated with Claude Code