Skip to content

feat(sdk-coin-canton): forward token and make choiceArgument optional#8950

Merged
abhijeet848 merged 1 commit into
masterfrom
SCAAS-9624
Jun 5, 2026
Merged

feat(sdk-coin-canton): forward token and make choiceArgument optional#8950
abhijeet848 merged 1 commit into
masterfrom
SCAAS-9624

Conversation

@abhijeet848
Copy link
Copy Markdown
Contributor

@abhijeet848 abhijeet848 commented Jun 5, 2026

Changes:

  1. Forward token to IMS.
    Canton mint/burn commands are built server-side by IMS, which needs to know which token the command targets to resolve the registrar. A Canton token shares the base-coin wallet (tcanton), so the token cannot be inferred — it must be passed explicitly. The cantonCommand branch now forwards params.tokenName, which populateIntent maps to intent.token. Without this, IMS fails with token is required for choice context resolution.

  2. Make choiceArgument optional.
    No-argument Canton choices (e.g. CredentialOffer_AcceptFree) have an empty choiceArgument: {}. Mongoose minimize strips empty objects on persist, so rebuilding such a command forwards it to IMS without choiceArgument, which previously caused a 400. Making it optional here is the type-level half of the fix; IMS materializes {} before /prepare.

No change for existing flows — callers that don't pass tokenName are unaffected.

Ticket: SCAAS-9624

@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 5, 2026

SCAAS-9624

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Canton transaction intent construction and Canton command typing to support token-aware routing and no-argument DAML choices.

Changes:

  • Forward tokenName into cantonCommand intent creation so downstream systems can route mint/burn for Canton tokens sharing a base-coin wallet.
  • Make CantonExerciseCommand.ExerciseCommand.choiceArgument optional to allow omitting it for no-argument choices.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
modules/sdk-core/src/bitgo/wallet/wallet.ts Forwards tokenName when building cantonCommand intents via prebuildTxWithIntent.
modules/sdk-core/src/bitgo/utils/tss/baseTypes.ts Relaxes Canton exercise command typing by making choiceArgument optional.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread modules/sdk-core/src/bitgo/utils/tss/baseTypes.ts
Comment thread modules/sdk-core/src/bitgo/wallet/wallet.ts
@abhijeet848 abhijeet848 changed the title feat(canton): forward token and allow optional choiceArgument feat(sdk-core): forward token allow optional choiceArgument for canton Jun 5, 2026
@abhijeet848 abhijeet848 marked this pull request as ready for review June 5, 2026 09:15
@abhijeet848 abhijeet848 requested review from a team as code owners June 5, 2026 09:15
@abhijeet848 abhijeet848 requested a review from a team as a code owner June 5, 2026 11:43
@abhijeet848 abhijeet848 requested a review from Copilot June 5, 2026 11:43
@abhijeet848 abhijeet848 changed the title feat(sdk-core): forward token allow optional choiceArgument for canton feat(sdk-coin-canton): forward token and make choiceArgument optional Jun 5, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread modules/sdk-coin-canton/src/lib/cantonCommandBuilder.ts Outdated
@abhijeet848 abhijeet848 merged commit 3578419 into master Jun 5, 2026
22 checks passed
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.

4 participants