From 91bdf7a0548129b9070c7b52d0411ef38081f597 Mon Sep 17 00:00:00 2001 From: David Kaplan Date: Mon, 12 Jan 2026 11:06:36 -0500 Subject: [PATCH] feat(sdk-core): add custodial wallet support for consolidate transactions Add handling for custodial wallets in the manageUnspents method: - For consolidate operations on custodial wallets, use initiateTransaction - Explicitly block fanout operations on custodial wallets BTC-2854 --- modules/sdk-core/src/bitgo/wallet/wallet.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/sdk-core/src/bitgo/wallet/wallet.ts b/modules/sdk-core/src/bitgo/wallet/wallet.ts index 688cbc6ffd..5f600dc158 100644 --- a/modules/sdk-core/src/bitgo/wallet/wallet.ts +++ b/modules/sdk-core/src/bitgo/wallet/wallet.ts @@ -705,6 +705,12 @@ export class Wallet implements IWallet { params: ConsolidateUnspentsOptions | FanoutUnspentsOptions = {}, option = ManageUnspentsOptions.BUILD_SIGN_SEND ): Promise { + if (this._wallet.type === 'custodial' && routeName === 'consolidate') { + return this.initiateTransaction({ ...params, type: 'consolidate' }); + } else if (this._wallet.type === 'custodial' && routeName === 'fanout') { + throw new Error('Fanout is not supported for custodial wallets'); + } + common.validateParams(params, [], ['walletPassphrase', 'xprv']); const reqId = new RequestTracer();