Skip to content

Commit 9c73ac1

Browse files
chore(utxo-core): clean up rebase conflicts
TICKET: BTC-2047
1 parent 9232556 commit 9c73ac1

File tree

1 file changed

+0
-71
lines changed

1 file changed

+0
-71
lines changed

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

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ import { getTaprootOutputKey } from '../taproot';
5757
import {
5858
getPsbtInputProprietaryKeyVals,
5959
getPsbtInputSignatureCount,
60-
getPsbtOutputProprietaryKeyVals,
61-
ProprietaryKeySearch,
6260
ProprietaryKeySubtype,
6361
PSBT_PROPRIETARY_IDENTIFIER,
6462
} from './PsbtUtil';
@@ -1154,75 +1152,6 @@ export class UtxoPsbt<Tx extends UtxoTransaction<bigint> = UtxoTransaction<bigin
11541152
return this;
11551153
}
11561154

1157-
/**
1158-
* Adds a proprietary key value pair to PSBT output
1159-
* Default identifier is utf-8 for identifier
1160-
*/
1161-
addProprietaryKeyValToOutput(outputIndex: number, keyValueData: ProprietaryKeyValue): this {
1162-
const output = checkForOutput(this.data.outputs, outputIndex);
1163-
assert(output.unknownKeyVals);
1164-
return this.addUnknownKeyValToOutput(outputIndex, {
1165-
key: encodeProprietaryKey(keyValueData.key),
1166-
value: keyValueData.value
1167-
})
1168-
}
1169-
1170-
/**
1171-
* To search any data from proprietary key value against keydata in the PSBT outputs.
1172-
* Default identifierEncoding is utf-8 for identifier.
1173-
*/
1174-
getOutputProprietaryKeyVals(outputIndex: number, keySearch?: ProprietaryKeySearch): ProprietaryKeyValue[] {
1175-
const output = checkForOutput(this.data.outputs, outputIndex);
1176-
return getPsbtOutputProprietaryKeyVals(output, keySearch);
1177-
}
1178-
1179-
/**
1180-
* Adds or updates (if exists) proprietary key value pair to PSBT output.
1181-
* Default identifierEncoding is utf-8 for identifier.
1182-
*/
1183-
addOrUpdateProprietaryKeyValsToOutput(outputIndex: number, keyValueData: ProprietaryKeyValue): this {
1184-
const output = checkForOutput(this.data.outputs, outputIndex);
1185-
const key = encodeProprietaryKey(keyValueData.key);
1186-
const { value } = keyValueData;
1187-
if (output.unknownKeyVals?.length) {
1188-
const ukvIndex = output.unknownKeyVals.findIndex((ukv) => ukv.key.equals(key));
1189-
if (ukvIndex > -1) {
1190-
output.unknownKeyVals[ukvIndex] = { key, value };
1191-
return this;
1192-
}
1193-
}
1194-
this.addUnknownKeyValToOutput(outputIndex, {
1195-
key,
1196-
value,
1197-
});
1198-
return this;
1199-
}
1200-
1201-
/**
1202-
* To delete any data from proprietary key value in PSBT output.
1203-
* Default identifierEncoding is utf-8 for identifier.
1204-
*/
1205-
deleteProprietaryKeyValsInOutput(outputIndex: number, keysToDelete?: ProprietaryKeySearch): this {
1206-
const output = checkForOutput(this.data.outputs, outputIndex);
1207-
if (!output.unknownKeyVals?.length) {
1208-
return this;
1209-
}
1210-
if (keysToDelete && keysToDelete.subtype === undefined && Buffer.isBuffer(keysToDelete.keydata)) {
1211-
throw new Error('invalid proprietary key search filter combination. subtype is required');
1212-
}
1213-
output.unknownKeyVals = output.unknownKeyVals.filter((keyValue, i) => {
1214-
const key = decodeProprietaryKey(keyValue.key);
1215-
return !(
1216-
keysToDelete === undefined ||
1217-
(keysToDelete.identifier === key.identifier &&
1218-
(keysToDelete.subtype === undefined ||
1219-
(keysToDelete.subtype === key.subtype &&
1220-
(!Buffer.isBuffer(keysToDelete.keydata) || keysToDelete.keydata.equals(key.keydata)))))
1221-
);
1222-
});
1223-
return this;
1224-
}
1225-
12261155
private createMusig2NonceForInput(
12271156
inputIndex: number,
12281157
keyPair: BIP32Interface,

0 commit comments

Comments
 (0)