fix(sdk-coin-polyx): fix address creation flow for Polyx - #9407
Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Draft
fix(sdk-coin-polyx): fix address creation flow for Polyx#9407bitgo-ai-agent-dev[bot] wants to merge 1 commit into
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Conversation
Before this change, `TransactionBuilderFactory.getWalletInitializationBuilder()` threw `NotImplementedError` and `Polyx.requiresWalletInitializationTransaction()` inherited the base class default of `false`. Together these caused the wallet initialization transaction to never be built or enqueued, so the CDD DID-registration step was skipped and address creation subsequently failed because the chain initialization was never triggered. Fix: route `getWalletInitializationBuilder()` to the existing `getRegisterDidWithCDDBuilder()` implementation, and override `requiresWalletInitializationTransaction()` to return `true` on the `Polyx` coin class (inherited by `Tpolyx`). This matches the pattern used by other coins that require on-chain initialization (Canton, Starknet) and correctly signals to the SDK wallet layer that a CDD registration transaction must be submitted before an address can receive funds. Add unit tests verifying both behaviors for polyx and tpolyx. Ticket: CECHO-58 Session-Id: 0594e2d8-7ed3-4626-ad92-ec5f2f0d5f8c Task-Id: 3a7836f7-b547-445f-9860-54583a5ab35f
Contributor
ralph-bitgo
Bot
force-pushed
the
fix/CECHO-58-polyx-address-creation-flow
branch
from
August 4, 2026 08:36
24d357a to
9affced
Compare
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.
What
requiresWalletInitializationTransaction()inPolyxto returntrue, so the SDK wallet layer knows Polymesh requires an on-chain DID registration before an address can receive fundsTransactionBuilderFactory.getWalletInitializationBuilder()to return aRegisterDidWithCDDBuilderinstead of throwingNotImplementedError, enabling the SDK to build the CDD registration transactionNotImplementedErrorimport fromtransactionBuilderFactory.tspolyxandtpolyxWhy
cddRegisterDidWithCdd(CDD DID registration) transaction to be submitted before a wallet address can receive funds. WithoutrequiresWalletInitializationTransaction()returningtrue, the SDK wallet layer skipped the initialization step entirely. WithoutgetWalletInitializationBuilder()returning the correct builder, no initialization transaction could be constructed even if the check passed. Together these caused the address creation flow to fail silently.Test plan
BITGOJS_TEST_PASSWORD=test yarn workspace @bitgo/sdk-coin-polyx run unit-test— 256 tests pass, 2 pending (pre-existing skipped tests)getWalletInitializationBuilder()returns aRegisterDidWithCDDBuilderinstance for bothpolyxandtpolyxrequiresWalletInitializationTransaction()returnstruefor bothpolyxandtpolyxTicket: CECHO-58
🤖 Generated with Ralph