feat(statics): add dynamic Canton token construction - #9502
Open
hrishikeshjain wants to merge 2 commits into
Open
feat(statics): add dynamic Canton token construction#9502hrishikeshjain wants to merge 2 commits into
hrishikeshjain wants to merge 2 commits into
Conversation
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
Contributor
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. verifyTransaction hardening is left for a follow-up (release-blocking, needs confirmation of wallet-platform's txParams shape for accept/reject/withdraw/wallet-init flows before changing behavior). TICKET: CHALO-1300
4 tasks
hrishikeshjain
marked this pull request as ready for review
August 14, 2026 09:47
hrishikeshjain
force-pushed
the
CHALO-1299
branch
from
August 14, 2026 09:52
674cc9e to
914c185
Compare
davidkaplanbitgo
approved these changes
Aug 14, 2026
davidkaplanbitgo
left a comment
Contributor
There was a problem hiding this comment.
BTC changes are fine
s84krish
approved these changes
Aug 14, 2026
s84krish
left a comment
Contributor
There was a problem hiding this comment.
wallets owned files look good
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createTokennow has acantoncase mappingAmsTokenConfig→cantonToken(...), so AMS-supplied Canton tokens no longer resolve toundefinedfor every runtime consumer (wallet-platform, retail, IMS, client-admin).baseUrltoAmsTokenConfigso the registrar endpoint survives the AMS→SDK hop.cantonintonetworkFeatureMapForTokens(previously unwiredCANTON_TOKEN_FEATURES), socreateTokenMapUsingTrimmedConfigDetailsno longer silently skips canton.getFormattedCantonTokens(was module-private) for use byregisterWithCoinMap.Test plan
tcanton:faketokenfixture (withbaseUrl+ compoundcontractAddress) toreducedTokenConfigForAllChainsintest/unit/resources/amsTokenConfig.tscreateTokenMapUsingTrimmedConfigDetailsbuilds the Canton token withbaseUrlpreserved, verified via the existing "form base coin for tokens of all the chains" testtsc --noEmitpasseseslintpasses (no new errors)TICKET: CHALO-1299