feat(walrus): use codegen config arguments - #1166
Draft
hayes-mysten wants to merge 7 commits into
Draft
Conversation
… object Adds a configArguments option to @mysten/codegen that maps Move types and package addresses to keys of a runtime config object. Matched function parameters become optional in generated arguments and resolve from a typed per-function config slice instead; generic types require resolver functions that receive the matched parameter's instantiation. Also treats 0x2::accumulator::AccumulatorRoot as a well-known auto-injected object. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…guments - Make the generated config property optional; missing values fail with the descriptive resolveConfigArgument error instead of a TypeError - Defer the name-matcher-on-nameless-params error until the matcher would actually win, so shared global blocks survive bytecode summaries; degrade bare-matcher double matches on nameless signatures to warn-and-skip - Route resolver-context type tags through type-origin/MVR addresses and normalize hex tags at runtime, so resolvers see consistent canonical tags - Add call-site metadata (packageAddress/module/function/parameter) to ConfigResolverContext and validate resolver return values - Harden the matcher parser (bracket balance, identifier/address validation, dedicated partial-instantiation error) and reject prototype-polluting keys - Error on unresolved package-scoped matchers, validate package entries against the run's packages, and warn on keys that match nothing - Guard applyConfigArguments against argument holes and inherited properties - Rename matcher field name -> parameterName, resolveConfigArg -> resolveConfigArgument, generated file config-args.ts -> config-arguments.ts; restrict generated interfaces to the package's own package key - Tuple-form matched suffixes become genuinely optional elements - Expand tests (172 passing) and rewrite the configArguments docs section Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ization) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Matchers no longer contain package addresses (codegen output must work across networks). Types are identified as module::Type, scoped to the declaring package's own block, qualified with a package identifier from the packages config (@myapp/core::pool::Pool) for cross-package references, or with the chain-stable framework addresses 0x1-0x3. The CLI resolves each run package's root address up front so matchers can reference any package in the run; matcher typos error in the run of the package they target, replacing the unresolved-key warn/aggregate machinery. Global-block matchers must be package-qualified. Also reformat the create-dapp template utils file that was failing prettier:check. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…lver context
- Function matchers ({ function: 'module::fn', parameterName | parameterIndex })
configure a single function parameter directly, with the type derived from
the signature; the parameter can be inferred for single-argument functions.
Highest matcher specificity, scoped/qualified like type matchers.
- One config key may declare an array of matchers (multiple types); any key
that can resolve more than one binding (multiple matchers, a generic, or
multiple parameters in one signature) is typed resolver-only in generated
config slices and interfaces. This replaces the bare-matcher-two-params
hard error: multi-matches are legal and disambiguated in the resolver.
- ConfigResolverContext gains parameterIndex, so nameless (bytecode)
positions are distinguishable in resolvers.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A config key with multiple matchers (e.g. several functions) that all bind the same concrete type keeps a plain config value; only keys spanning multiple distinct types, or binding a generic, are typed resolver-only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hayes-mysten
temporarily deployed
to
sui-typescript-aws-kms-test-env
July 22, 2026 23:12 — with
GitHub Actions
Inactive
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
|
hayes-mysten
force-pushed
the
codegen-config-arguments
branch
5 times, most recently
from
August 17, 2026 03:06
eb429d7 to
85977c1
Compare
An error occurred while trying to automatically change base from
codegen-config-arguments
to
fix/codegen-resolve-mvr
August 17, 2026 04:05
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.
Description
Adopts the codegen
configArgumentssupport for Walrus.wal_exchange::Exchangeexplicit because the SDK config stores plural exchange IDs and a single generated config value would be ambiguous.Test plan
pnpm install --frozen-lockfilepnpm turbo build --filter=@mysten/codegenpnpm --filter @mysten/walrus codegenpnpm --filter @mysten/walrus lint:fixpnpm turbo build --filter=@mysten/walruspnpm --filter @mysten/walrus testpnpm --filter @mysten/walrus lintgit diff --check -- packages/walrusAI Assistance Notice