Skip to content

Commit d46aa92

Browse files
Merge pull request #6703 from BitGo/BTC-2385
change types for functions that dont need to be UtxoPsbt
2 parents 01475ec + 851458d commit d46aa92

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

modules/utxo-core/src/bip322/toSign.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function buildToSignPsbt(message: string, addressDetails: AddressDetails,
4646
}
4747

4848
// Add the message as a proprietary key value to the PSBT so we can verify it later
49-
addBip322ProofMessage(psbt as bitgo.UtxoPsbt, 0, Buffer.from(message));
49+
addBip322ProofMessage(psbt, 0, Buffer.from(message));
5050

5151
// Set the output
5252
psbt.addOutput({

modules/utxo-core/src/bip322/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as utxolib from '@bitgo/utxo-lib';
22

3-
export function addBip322ProofMessage(psbt: utxolib.bitgo.UtxoPsbt, inputIndex: number, message: Buffer): void {
3+
export function addBip322ProofMessage(psbt: utxolib.Psbt, inputIndex: number, message: Buffer): void {
44
utxolib.bitgo.addProprietaryKeyValuesFromUnknownKeyValues(psbt, 'input', inputIndex, {
55
key: {
66
identifier: utxolib.bitgo.PSBT_PROPRIETARY_IDENTIFIER,

modules/utxo-lib/src/bitgo/ProprietaryKeyValUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { PsbtInput, PsbtOutput } from 'bip174/src/lib/interfaces';
22
import { decodeProprietaryKey, encodeProprietaryKey, ProprietaryKey } from 'bip174/src/lib/proprietaryKeyVal';
3-
import { UtxoPsbt } from './UtxoPsbt';
3+
import { Psbt } from '../';
44

55
/**
66
* Psbt proprietary keydata object search fields.
@@ -88,7 +88,7 @@ export function updateProprietaryKeyValuesFromUnknownKeyValues(
8888
}
8989

9090
export function addProprietaryKeyValuesFromUnknownKeyValues(
91-
psbt: UtxoPsbt,
91+
psbt: Psbt,
9292
entry: string,
9393
index: number,
9494
keyValueData: ProprietaryKeyValue

modules/utxo-lib/src/bitgo/wallet/Psbt.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { checkForInput } from 'bip174/src/lib/utils';
55
import { BIP32Interface } from 'bip32';
66
import * as bs58check from 'bs58check';
77
import { UtxoPsbt } from '../UtxoPsbt';
8+
import { Psbt } from '../../';
89
import { UtxoTransaction } from '../UtxoTransaction';
910
import {
1011
createOutputScript2of3,
@@ -495,7 +496,7 @@ export function isTransactionWithKeyPathSpendInput(
495496
* We do all the matching of the (tap)bip32Derivations masterFingerprint to the fingerprint of the
496497
* extendedPubkey.
497498
*/
498-
export function addXpubsToPsbt(psbt: UtxoPsbt, rootWalletKeys: RootWalletKeys): void {
499+
export function addXpubsToPsbt(psbt: Psbt, rootWalletKeys: RootWalletKeys): void {
499500
const safeRootWalletKeys = new RootWalletKeys(
500501
rootWalletKeys.triple.map((bip32) => bip32.neutered()) as Triple<BIP32Interface>,
501502
rootWalletKeys.derivationPrefixes

0 commit comments

Comments
 (0)