sdk: round-3 CLI follow-ups — expiry parity, fetchCollection BigIntify fix, simulate/preview coverage (#0428-#0430)#243
Merged
Conversation
…y fix, simulate/preview coverage (#0428-#0430)
0428 listing/intent/pm-sell-intent/pm-buy-intent swapped from
duration-only durationToTimestamp to resolveExpiration (completes
the #0424 bid fix): ms-since-epoch --expiration now accepted; pm
defaults 7d→24h to match `bb prediction-markets buy/sell`; build.ts
help strings updated.
0429 new cli/utils/collection-options.ts: normalizeCollection (the
BigIntify boundary — fixes credit-tokens/pay-requests/bounties/
prediction-markets which returned RAW string-typed amounts to
bigint-comparing validators) + validateCollectionOrExit (the 7
byte-identical result-variant blocks). 9 fetchCollection + 7
validateOrExit delegated; the 2 bespoke boolean variants left
(no-churn).
0430 simulate.ts + preview.ts (previously zero specs anywhere):
ensureTxWrapper exported + unit-tested (passthrough / bare-Msg
wrap / non-object) + command-shape specs.
Build clean (no circular deps); unit 142 suites / 3092 tests;
integration 20 suites / 186 tests (the 4 newly-normalized standards
green).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 15, 2026
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
Stacked on #242 (base
feat/0422-0427-cli-followups-r2). Round-3 of the rolling CLI audit (same angles: FE-parity, producer-correctness, DRY, test-bar).listing/intent/pm-sell-intent/pm-buy-intentbuild builders still used duration-onlydurationToTimestamp— the #0424bidfix missed them. Swapped toresolveExpiration: ms-since-epoch--expirationnow accepted (parity withbb nfts list/bb intents create/bb prediction-markets). pm-sell/buy-intent default 7d→24h to match the end-user verbs' default (was a silent on-chain divergence).build.tshelp strings corrected.cli/utils/collection-options.ts.normalizeCollectionis now the single boundary-normalization point: 5 command copies BigIntify-converted the indexer response, 4 (credit-tokens, pay-requests, bounties, prediction-markets) silently did not and handed string-typed amounts to bigint-comparing validators — a latent boundary bug, now fixed for all 9.validateCollectionOrExitdedups the 7 byte-identical result-variantvalidateOrExitblocks. The 2 bespoke boolean-protocol variants (subscriptions, credit-tokens) left as-is (no-churn).simulate.ts+preview.tshad zero spec coverage anywhere.ensureTxWrapperexported + unit-tested (messages passthrough / bare-Msg wrap / non-object passthrough); command-shape specs guard flag/arg drift.Scope notes
fetchCollectionwrappers kept (they bind the file's localcallApi); only the duplicated logic (unwrap + BigIntify + the bug) is single-sourced — extracting the wrapper would force a ~50-call-site signature churn for no correctness gain (0423/0418 no-churn precedent). The 2-site bespoke booleanvalidateOrExitleft (below the dedup bar, divergent messages).Validation
tsc×2, no circular dependencies.Test plan
bun run buildcleanbun run test:unit/test:integrationgreenbb build pm-sell-intent …default expiry ≈ 24h (not 7d)bb build listing … --expiration 1798765432000accepted (ms-since-epoch)🤖 Generated with Claude Code
Stacked PRs: #242 → this.