Skip to content

Commit 2f4f62a

Browse files
authored
Merge pull request #7887 from BitGo/BTC-2854.bump-public-types
feat(sdk-core): add custodial wallet support for consolidate transact…
2 parents e77ba48 + 91bdf7a commit 2f4f62a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

modules/sdk-core/src/bitgo/wallet/wallet.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,12 @@ export class Wallet implements IWallet {
705705
params: ConsolidateUnspentsOptions | FanoutUnspentsOptions = {},
706706
option = ManageUnspentsOptions.BUILD_SIGN_SEND
707707
): Promise<unknown> {
708+
if (this._wallet.type === 'custodial' && routeName === 'consolidate') {
709+
return this.initiateTransaction({ ...params, type: 'consolidate' });
710+
} else if (this._wallet.type === 'custodial' && routeName === 'fanout') {
711+
throw new Error('Fanout is not supported for custodial wallets');
712+
}
713+
708714
common.validateParams(params, [], ['walletPassphrase', 'xprv']);
709715

710716
const reqId = new RequestTracer();

0 commit comments

Comments
 (0)