Conversation
2 tasks
bd2fbac to
f0f4ebc
Compare
Replace the numeric enum with a `type AddressFormat = 0 | 2 | 42` union and a matching `const AddressFormat` object. This follows the wasm-utxo convention and lets callers pass a raw SS58 prefix number directly (e.g. from DotAddressFormat in sdk-core) without a type cast. All existing call sites using AddressFormat.Polkadot / .Kusama / .Substrate continue to work unchanged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Ticket: BTC-3127
f0f4ebc to
286dd11
Compare
lcovar
approved these changes
Mar 10, 2026
davidkaplanbitgo
approved these changes
Mar 10, 2026
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
Replace
enum AddressFormatwith atype AddressFormat = 0 | 2 | 42union type +const AddressFormatnamed constants object, following the same convention used bywasm-utxo'sAddressFormat.Why
DotAddressFormatin@bitgo-beta/sdk-coreis also a numeric enum with the same values (polkadot = 0,substrate = 42). With an enum, wallet-platform consumers need anas unknown as AddressFormatcast to bridge between the two. With a union type, the raw number is directly assignable — no cast needed.What changes
types.ts:enum AddressFormat→type AddressFormat = 0 | 2 | 42+const AddressFormat = { Polkadot: 0, Kusama: 2, Substrate: 42 } as constAddressFormat.Polkadot,.Kusama,.Substrate) work unchangedsender(format: AddressFormat = AddressFormat.Polkadot)intransaction.tsworks unchangedRelated
Ticket: BTC-3117 — wasm-dot shadow mode address validation for Polkadot in wallet-platform
🤖 Generated with Claude Code