Skip to content

fix(sdk-coin-polyx): fix address creation flow for Polyx - #9407

Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
fix/CECHO-58-polyx-address-creation-flow
Draft

fix(sdk-coin-polyx): fix address creation flow for Polyx#9407
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
fix/CECHO-58-polyx-address-creation-flow

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown
Contributor

What

  • Override requiresWalletInitializationTransaction() in Polyx to return true, so the SDK wallet layer knows Polymesh requires an on-chain DID registration before an address can receive funds
  • Fix TransactionBuilderFactory.getWalletInitializationBuilder() to return a RegisterDidWithCDDBuilder instead of throwing NotImplementedError, enabling the SDK to build the CDD registration transaction
  • Remove the now-unused NotImplementedError import from transactionBuilderFactory.ts
  • Add unit tests verifying both behaviors for polyx and tpolyx

Why

  • The Polymesh chain requires a cddRegisterDidWithCdd (CDD DID registration) transaction to be submitted before a wallet address can receive funds. Without requiresWalletInitializationTransaction() returning true, the SDK wallet layer skipped the initialization step entirely. Without getWalletInitializationBuilder() 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.
  • This matches the pattern used by other coins that require on-chain initialization (Canton, Starknet).

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 a RegisterDidWithCDDBuilder instance for both polyx and tpolyx
  • requiresWalletInitializationTransaction() returns true for both polyx and tpolyx

Ticket: CECHO-58

🤖 Generated with Ralph

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

linear-code Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

CECHO-58

@ralph-bitgo
ralph-bitgo Bot force-pushed the fix/CECHO-58-polyx-address-creation-flow branch from 24d357a to 9affced Compare August 4, 2026 08:36
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