Skip to content

feat(statics): add dynamic Canton token construction - #9502

Merged
hrishikeshjain merged 2 commits into
masterfrom
CHALO-1299
Aug 17, 2026
Merged

feat(statics): add dynamic Canton token construction#9502
hrishikeshjain merged 2 commits into
masterfrom
CHALO-1299

Conversation

@hrishikeshjain

Copy link
Copy Markdown
Contributor

Summary

  • Keystone change for AMS-driven Canton token onboarding: createToken now has a canton case mapping AmsTokenConfigcantonToken(...), so AMS-supplied Canton tokens no longer resolve to undefined for every runtime consumer (wallet-platform, retail, IMS, client-admin).
  • Added optional baseUrl to AmsTokenConfig so the registrar endpoint survives the AMS→SDK hop.
  • Wired canton into networkFeatureMapForTokens (previously unwired CANTON_TOKEN_FEATURES), so createTokenMapUsingTrimmedConfigDetails no longer silently skips canton.
  • Exported getFormattedCantonTokens (was module-private) for use by registerWithCoinMap.

Test plan

  • Added tcanton:faketoken fixture (with baseUrl + compound contractAddress) to reducedTokenConfigForAllChains in test/unit/resources/amsTokenConfig.ts
  • createTokenMapUsingTrimmedConfigDetails builds the Canton token with baseUrl preserved, verified via the existing "form base coin for tokens of all the chains" test
  • Full statics unit suite passes (33905 passing)
  • tsc --noEmit passes
  • eslint passes (no new errors)

TICKET: CHALO-1299

Adds the canton case to createToken so AMS-supplied Canton tokens
resolve at runtime instead of silently dropping. Wires baseUrl through
AmsTokenConfig, adds the canton entry to networkFeatureMapForTokens,
and exports getFormattedCantonTokens for registerWithCoinMap.
TICKET: CHALO-1299
@linear-code

Copy link
Copy Markdown
Contributor

CHALO-1299

davidkaplanbitgo
davidkaplanbitgo previously approved these changes Aug 14, 2026

@davidkaplanbitgodavidkaplanbitgo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

BTC changes are fine

s84krish
s84krish previously approved these changes Aug 14, 2026

@s84krishs84krish left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wallets owned files look good

Marzooqa
Marzooqa previously approved these changes Aug 17, 2026

@MarzooqaMarzooqa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wp changes lg

@bhavidhingra

Copy link
Copy Markdown
Contributor

@hrishikeshjain Commit msg says verifyTransaction hardening "left for follow-up (release-blocking, needs confirmation of wallet-platform's txParams shape)". Reviewer's likely challenge: "if it's release-blocking, why merge now?"

Comment threadmodules/sdk-coin-canton/src/register.ts Outdated
Adds registerWithCoinMap(sdk, coinMap) so a dynamically-onboarded
Canton token from AMS can be registered into a running SDK instance
without a statics release, mirroring the SOL registerWithCoinMap
pattern. Wires CantonToken.createTokenConstructors into
registerCoinConstructors so GlobalCoinFactory resolves canton/tcanton
tokens from the coin map at process start.
Nothing calls registerWithCoinMap yet, so no dynamic Canton token is
reachable until wallet-platform/AMS wiring (CHALO-1301/1303/1304)
lands and the rollout flags flip. verifyTransaction hardening for
accept/reject/withdraw/wallet-init is tracked separately as CHALO-1308
and gates production rollout, not this increment.
TICKET: CHALO-1300
@hrishikeshjain

Copy link
Copy Markdown
ContributorAuthor

@bhavidhingra fair challenge — reworded the commit message to be clearer. The distinction I meant: this PR only adds capability (`registerWithCoinMap` + factory wiring), nothing calls it yet, and no dynamic Canton token is reachable in production until wallet-platform/AMS wiring (CHALO-1301/1303/1304) lands and the rollout flags flip. `verifyTransaction` hardening is release-blocking for the overall rollout, not for merging this increment — it's tracked separately as CHALO-1308.

@hrishikeshjain
hrishikeshjain merged commit a63f22e into masterAug 17, 2026
39 of 41 checks passed
Sign up for freeto 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.

5 participants

@hrishikeshjain@bhavidhingra@davidkaplanbitgo@s84krish@Marzooqa