Skip to content

SIP: PTB Type Argument Interpolation#68

Open
92GC wants to merge 3 commits intosui-foundation:mainfrom
92GC:sip-ptb-type-interpolation
Open

SIP: PTB Type Argument Interpolation#68
92GC wants to merge 3 commits intosui-foundation:mainfrom
92GC:sip-ptb-type-interpolation

Conversation

@92GC
Copy link

@92GC 92GC commented Jan 5, 2026

Summary

Extend PTBs to allow type arguments to reference Result values from prior commands. Currently type arguments must be string literals, preventing "publish-and-use" in a single transaction.

The Problem

const ptb = new Transaction();
const [upgradeCap] = ptb.publish({ modules, dependencies });

// FAILS - can't interpolate Result into type argument
ptb.moveCall({
  typeArguments: [`${???}::my_coin::MY_COIN`],
});

The Solution

const pub = ptb.publish({ modules, dependencies });
ptb.moveCall({
  typeArguments: [ptb.typeFromResult(pub, "my_coin", "MY_COIN")],
});

No Move language or bytecode verifier changes needed—only the PTB executor.

92GC and others added 3 commits January 5, 2026 21:22
Enables type arguments in PTB commands to reference Results from prior commands,
allowing publish-and-use in a single transaction.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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