Skip to content

feat(bitgo): add support for Export txn type in prebuildTransaction#8776

Merged
mohd-kashif merged 1 commit into
masterfrom
CECHO-1029
May 14, 2026
Merged

feat(bitgo): add support for Export txn type in prebuildTransaction#8776
mohd-kashif merged 1 commit into
masterfrom
CECHO-1029

Conversation

@mohd-kashif
Copy link
Copy Markdown
Contributor

@mohd-kashif mohd-kashif commented May 14, 2026

Summary

  • Add Export, Import, and ImportToC cases to the TSS prebuildTransactionTxRequests switch for MPC cross-chain transfers
  • Add export case to the EVM populateIntent switch in mpcUtils.ts
  • Add unit tests for all new cases

Context

MPC (TSS) wallets use prebuildTransactionTxRequests which routes transaction types to the /txrequests endpoint via prebuildTxWithIntent. The existing multisig flow bypasses this switch entirely — it POSTs
directly to /tx/build where params.type is forwarded as-is. That's why multisig cross-chain works but MPC wallets hit "transaction type not supported: Export".

This PR adds the three Avalanche/Flare atomic transaction types to the TSS prebuild switch:

params.type (from caller) intentType (sent to WP) Direction
Export export C→P or P→C export
Import import Import into P-chain
ImportToC importtoc Import into C-chain

The Export case passes recipients, nonce, feeOptions, and feeToken since C-chain exports need gas pricing. Import and ImportToC only pass recipients since P-chain fees are computed server-side.

The populateIntent EVM switch also needs the export case because FLR is EVM (baseCoin.isEVM() === true), so without it the intent would throw "Unsupported intent type export" at the EVM default case.
Import and ImportToC don't need EVM cases because they originate from FLRP which is non-EVM and uses the generic fallback path.

Changes

File Change
modules/sdk-core/src/bitgo/wallet/wallet.ts Add case 'Export', case 'Import', case 'ImportToC' to prebuildTransactionTxRequests switch
modules/sdk-core/src/bitgo/utils/mpcUtils.ts Add case 'export' to EVM populateIntent switch
modules/bitgo/test/v2/unit/wallet.ts Add 4 unit tests: 3 for prebuild cases + 1 for populateIntent

Test plan

  • yarn unit-test --scope bitgo -- --grep "Export" — 3 prebuild tests pass
  • yarn unit-test --scope bitgo -- --grep "export intent" — populateIntent test passes
  • Existing wallet tests still pass (no regression)

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 14, 2026

CECHO-1029

@mohd-kashif mohd-kashif self-assigned this May 14, 2026
@mohd-kashif mohd-kashif marked this pull request as ready for review May 14, 2026 18:58
@mohd-kashif mohd-kashif requested review from a team as code owners May 14, 2026 18:58
@mohd-kashif mohd-kashif requested review from bdesoky and ranga-r2 May 14, 2026 18:58
@mohd-kashif mohd-kashif merged commit 8290517 into master May 14, 2026
22 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.

2 participants