Skip to content

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 added 2 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.
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