Skip to content

feat(sdk-api): add registerToken method to BitGoAPI#8367

Open
manas-at-bitgo wants to merge 1 commit intomasterfrom
feat/ams-register-token-cshld-89
Open

feat(sdk-api): add registerToken method to BitGoAPI#8367
manas-at-bitgo wants to merge 1 commit intomasterfrom
feat/ams-register-token-cshld-89

Conversation

@manas-at-bitgo
Copy link
Copy Markdown
Contributor

Summary

  • Adds registerToken(coinConfig, coinConstructor) method to BitGoAPI in modules/sdk-api/src/bitgoAPI.ts
  • Delegates directly to GlobalCoinFactory.registerToken — idempotent, does not affect existing statics coins
  • Enables runtime registration of AMS-sourced tokens without requiring statics library updates or releases
  • Uses Parameters<CoinFactory['registerToken']>[0] for the coin config type (no new direct dep on @bitgo/statics)

Test plan

  • Unit test: sdk.coin(name) resolves correctly after registerToken
  • Unit test: calling registerToken twice for the same token does not throw (idempotency)
  • Unit test: existing statics coins are unaffected after registerToken calls
  • Full unit-test suite passes (114 tests)

Closes CSHLD-89

Adds a `registerToken(coinConfig, coinConstructor)` method to `BitGoAPI`
that delegates to `GlobalCoinFactory.registerToken`. Enables runtime
registration of AMS-sourced tokens without requiring statics library
updates. Method is idempotent and does not affect existing statics coins.

Closes CSHLD-89 / AMS-15

Co-Authored-By: Paperclip <noreply@paperclip.ing>
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