@@ -57,8 +57,6 @@ import { getTaprootOutputKey } from '../taproot';
57
57
import {
58
58
getPsbtInputProprietaryKeyVals ,
59
59
getPsbtInputSignatureCount ,
60
- getPsbtOutputProprietaryKeyVals ,
61
- ProprietaryKeySearch ,
62
60
ProprietaryKeySubtype ,
63
61
PSBT_PROPRIETARY_IDENTIFIER ,
64
62
} from './PsbtUtil' ;
@@ -1154,75 +1152,6 @@ export class UtxoPsbt<Tx extends UtxoTransaction<bigint> = UtxoTransaction<bigin
1154
1152
return this ;
1155
1153
}
1156
1154
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
-
1226
1155
private createMusig2NonceForInput (
1227
1156
inputIndex : number ,
1228
1157
keyPair : BIP32Interface ,
0 commit comments