diff --git a/modules/express/src/clientRoutes.ts b/modules/express/src/clientRoutes.ts index 8b520f5384..62e96d9ef9 100755 --- a/modules/express/src/clientRoutes.ts +++ b/modules/express/src/clientRoutes.ts @@ -826,7 +826,7 @@ function createSendParams(req: express.Request) { } function createTSSSendParams(req: express.Request) { - if (req.config.externalSignerUrl !== undefined) { + if (req.config?.externalSignerUrl !== undefined) { const coin = req.bitgo.coin(req.params.coin); if (coin.getMPCAlgorithm() === MPCType.EDDSA) { return { diff --git a/modules/express/test/unit/clientRoutes/consolidateAccount.ts b/modules/express/test/unit/clientRoutes/consolidateAccount.ts index 7cb7cc6e50..2ef7553f75 100644 --- a/modules/express/test/unit/clientRoutes/consolidateAccount.ts +++ b/modules/express/test/unit/clientRoutes/consolidateAccount.ts @@ -104,6 +104,25 @@ describe('Consolidate account', () => { consolidationStub.should.be.calledOnceWith(body); }); + it('should pass the apiVersion param to bitgo api consolidate/build', async () => { + const result = { success: [], failure: [] }; + const body = { apiVersion: 'full' }; + const { bitgoStub, consolidationStub } = createConsolidateMocks(result, true, true); + const mockRequest = { + bitgo: bitgoStub, + params: { + coin: 'tsol', + id: '23423423423423', + }, + body, + }; + + await handleV2ConsolidateAccount(mockRequest as express.Request & typeof mockRequest).should.be.resolvedWith( + result + ); + consolidationStub.should.be.calledOnceWith(body); + }); + it('should return 202 when some transactions fail', async () => { const result = { success: [0], failure: [0] }; const body = 'testbody'; diff --git a/modules/sdk-core/src/bitgo/wallet/wallet.ts b/modules/sdk-core/src/bitgo/wallet/wallet.ts index 0a0823672a..0e597094f6 100644 --- a/modules/sdk-core/src/bitgo/wallet/wallet.ts +++ b/modules/sdk-core/src/bitgo/wallet/wallet.ts @@ -200,6 +200,7 @@ export class Wallet implements IWallet { 'validToBlock', 'preview', 'keepAlive', + 'apiVersion', ]; }