From c89ea9b1183591b8a9f95f7f52d9e69d95d28649 Mon Sep 17 00:00:00 2001 From: Support Bot Date: Thu, 27 Aug 2026 06:56:58 +0000 Subject: [PATCH] fix(abstract-eth): preserve version zero for CCR signing Pass wallet version zero from CCR build responses into the transaction builder. This allows self-serve signing for legacy version zero wallets, whose recovery requests currently lose the version because zero is falsy. Ticket: SPT-270 Session-Id: e7756c81-cf6f-4700-8037-6aa3f1482e1b Task-Id: d02d4750-f978-47bb-8037-8ba604d7ef62 --- modules/abstract-eth/src/abstractEthLikeNewCoins.ts | 2 +- modules/sdk-coin-ethlike/test/unit/ethlikeCoin.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/abstract-eth/src/abstractEthLikeNewCoins.ts b/modules/abstract-eth/src/abstractEthLikeNewCoins.ts index 16223616db..49aca4fc8f 100644 --- a/modules/abstract-eth/src/abstractEthLikeNewCoins.ts +++ b/modules/abstract-eth/src/abstractEthLikeNewCoins.ts @@ -1706,7 +1706,7 @@ export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin implem const txBuilder = this.getTransactionBuilder(params.common) as TransactionBuilder; const txHex = buildResponse.txHex; txBuilder.from(txHex); - if (buildResponse.walletVersion) { + if (buildResponse.walletVersion !== undefined) { // If walletVersion is provided, set it in the txBuilder txBuilder.walletVersion(buildResponse.walletVersion); } diff --git a/modules/sdk-coin-ethlike/test/unit/ethlikeCoin.ts b/modules/sdk-coin-ethlike/test/unit/ethlikeCoin.ts index 6567a2c895..45c9be86c0 100644 --- a/modules/sdk-coin-ethlike/test/unit/ethlikeCoin.ts +++ b/modules/sdk-coin-ethlike/test/unit/ethlikeCoin.ts @@ -60,6 +60,7 @@ describe('EthLike coin tests', function () { const recoveryId = '0x1234567890abcdef'; nock(bitgo.microservicesUrl(`/api/recovery/v1/crosschain`)).get(`/${recoveryId}/buildtx`).reply(200, { txHex: mockData.ccr[coin.name].txHex, + walletVersion: 0, }); const walletPassphrase = TestBitGo.V2.TEST_RECOVERY_PASSCODE as string; const params = { @@ -75,6 +76,7 @@ describe('EthLike coin tests', function () { const recoveryId = '0x1234567890abcdef'; nock(bitgo.microservicesUrl(`/api/recovery/v1/crosschain`)).get(`/${recoveryId}/buildtx`).reply(200, { txHex: mockData.ccr[coin.name].txHex, + walletVersion: 0, }); nock(bitgo.microservicesUrl(`/api/recovery/v1/crosschain`)).post(`/${recoveryId}/sign`).reply(200, { coin: coin.name, @@ -96,6 +98,7 @@ describe('EthLike coin tests', function () { const recoveryId = '0x1234567890abcdef'; nock(bitgo.microservicesUrl(`/api/recovery/v1/crosschain`)).get(`/${recoveryId}/buildtx`).reply(200, { txHex: mockData.ccr[coin.name].txHex, + walletVersion: 0, }); const params = { recoveryId, @@ -112,7 +115,7 @@ describe('EthLike coin tests', function () { coin: coin.name, txHex: mockData.ccr[coin.name].txHex, txid: mockData.ccr[coin.name].txid, - walletVersion: 1, + walletVersion: 0, }; nock(bitgo.microservicesUrl(`/api/recovery/v1/crosschain`))