Skip to content

Commit

Permalink
Merge pull request #4005 from BitGo/BTC-subType-psbt
Browse files Browse the repository at this point in the history
feat: use psbt for prebuild when wallet is distributedCustody
  • Loading branch information
lcovar authored Oct 20, 2023
2 parents e8b3c2f + 10f5e1a commit f65ff46
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 f65ff46

Please sign in to comment.