Skip to content

feat(sdk-coin-canton): add runtime registration via registerWithCoinMap - #9503

Merged
hrishikeshjain merged 1 commit into
CHALO-1299from
CHALO-1300
Aug 14, 2026
Merged

feat(sdk-coin-canton): add runtime registration via registerWithCoinMap#9503
hrishikeshjain merged 1 commit into
CHALO-1299from
CHALO-1300

Conversation

@hrishikeshjain

Copy link
Copy Markdown
Contributor

Stacked on #9502 (CHALO-1299 — statics keystone).

Summary

  • sdk-coin-canton/src/register.ts: added registerWithCoinMap(sdk, coinMap), mirroring sdk-coin-sol's pattern — resolves Canton tokens (hardcoded + AMS-dynamic) from a coin map and registers them into both the SDK instance and GlobalCoinFactory.
  • bitgo/src/v2/coinFactory.ts: wired CantonToken.createTokenConstructors([...tokens.bitcoin.canton.tokens, ...tokens.testnet.canton.tokens]) into registerCoinConstructors (the SOL analog). Note: getTokenConstructor's canton/tcanton case already existed — no change needed there.

Explicitly out of scope (by design)

  • verifyTransaction hardening for TransferAccept/TransferReject/TransferAcknowledge/TransferOfferWithdrawn/WalletInitialization — these still return true unconditionally. Deferred per discussion: this is flagged release-blocking in the TDD (WCI-820 regression class) and needs confirmation of what txParams wallet-platform actually sends for these flows before changing behavior. Tracked as follow-up.
  • Builder decoupling was verified, not changed — transferBuilder.ts and friends already treat tokenName/contractAddress as opaque strings with no coins.get() assertion, so dynamically-registered tokens already flow through.

Test plan

  • Added test/unit/register.ts (mirrors sdk-coin-sol/test/unit/register.ts): register/registerWithCoinMap register base coins + tokens, dynamic tokens reach GlobalCoinFactory, no-op when coin map has no Canton tokens
  • Full sdk-coin-canton unit suite passes (329 passing)
  • tsc --noEmit passes for sdk-coin-canton; bitgo typecheck shows only pre-existing unrelated errors (Sepeth export, pendingApproval test) confirmed present without this diff
  • eslint clean on changed files

TICKET: CHALO-1300

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
@linear-code

linear-code Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

CHALO-1300

@hrishikeshjain
hrishikeshjain marked this pull request as ready for review August 14, 2026 09:50
@hrishikeshjain
hrishikeshjain requested review from a team as code owners August 14, 2026 09:50
@hrishikeshjain
hrishikeshjain merged commit 674cc9e into CHALO-1299 Aug 14, 2026
2 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.

1 participant