Skip to content

Commit

Permalink
feat: use psbt for prebuild when wallet is distributedCustody
Browse files Browse the repository at this point in the history
When the wallet is of type distributed custody want to always use 'psbt'
as the transaction format.

Ticket: BTC-558
  • Loading branch information
lcovar committed Oct 20, 2023
1 parent e8b3c2f commit 10f5e1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/abstract-utxo/src/abstractUtxoCoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,11 @@ export abstract class AbstractUtxoCoin extends BaseCoin {
};
}

async getExtraPrebuildParams(buildParams: ExtraPrebuildParamsOptions): Promise<any> {
async getExtraPrebuildParams(buildParams: ExtraPrebuildParamsOptions & { wallet: Wallet }): Promise<any> {
if (buildParams.wallet.subType() === 'distributedCustody') {
return { txFormat: 'psbt' };
}

return {};
}

Expand Down
5 changes: 5 additions & 0 deletions modules/sdk-core/src/bitgo/wallet/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import {
ShareWalletOptions,
SimulateWebhookOptions,
SubmitTransactionOptions,
SubWalletType,
SweepOptions,
TransferBySequenceIdOptions,
TransferCommentOptions,
Expand Down Expand Up @@ -251,6 +252,10 @@ export class Wallet implements IWallet {
return this._wallet.multisigType;
}

subType(): SubWalletType | undefined {
return this._wallet.subType;
}

/**
* Get the label (name) for this wallet
*/
Expand Down

0 comments on commit 10f5e1a

Please sign in to comment.