Skip to content

feat: Allow asset id string overload for ft post-condition - #1888

Open
jannik-stacks wants to merge 5 commits into
mainfrom
worktree-fix-allow-assetid
Open

jannik-stacks wants to merge 5 commits into
mainfrom
worktree-fix-allow-assetid

Conversation

@jannik-stacks

Copy link
Copy Markdown
Collaborator
  • allow single <addr>.<name>::<asset> notation as single string in Pc. builder

@jannik-stacks
jannik-stacks requested a review from a team September 15, 2026 11:08
@jannik-stacks
jannik-stacks enabled auto-merge (squash) September 15, 2026 11:09
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Public API Surface Changes

No changes detected in the public API surface.


Updated 2026-10-07 14:05:20 UTC

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Complete asset validation and tests for the new overload are needed.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Adds a single-string asset identifier overload to the fungible-token post-condition builder.

Changes:

  • Adds ft(asset) while preserving ft(contractId, tokenName).
  • Normalizes both overloads into an AssetString.
File Description
packages/​transactions/​src/​pc.ts Extends the FT post-condition builder API.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

ft(...args: [AssetString] | [ContractIdString, string]): FungiblePostCondition {
const asset: AssetString = args.length === 1 ? args[0] : `${args[0]}::${args[1]}`;

const [contractId] = asset.split('::') as [ContractIdString, ...string[]];
* ⚠ Amount of fungible tokens is denoted in the smallest unit of the token
* @param asset - The asset identifier of the fungible token. Formatted as `<contract-address>.<contract-name>::<token-name>`.
*/
ft(asset: AssetString): FungiblePostCondition;

This branch has not been deployed

No deployments
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.

3 participants