Skip to content

Commit 4eae3e5

Browse files
fix(sdk-core): remove AddKeychainOptions annotation that excluded prv
The recipientKeychainParams object in createParticipantKeychain used a prv field not present in AddKeychainOptions. Remove the explicit type annotation so TypeScript infers the broader object literal type, and inline the webauthnDevices conditional to keep the declaration atomic. Ticket: WAL-761
1 parent 18a642a commit 4eae3e5

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

  • modules/sdk-core/src/bitgo/utils/tss/ecdsa

modules/sdk-core/src/bitgo/utils/tss/ecdsa/ecdsa.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ export class EcdsaUtils extends BaseEcdsaUtils {
394394
);
395395

396396
const prv = JSON.stringify(recipientCombinedKey.signingMaterial);
397-
const recipientKeychainParams: AddKeychainOptions = {
397+
const recipientKeychainParams = {
398398
source: recipient,
399399
keyType: 'tss' as KeyType,
400400
commonKeychain: bitgoKeychain.commonKeychain,
@@ -404,21 +404,21 @@ export class EcdsaUtils extends BaseEcdsaUtils {
404404
password: passphrase,
405405
}),
406406
originalPasscodeEncryptionCode,
407+
webauthnDevices:
408+
webauthnInfo && recipientIndex === 1
409+
? [
410+
{
411+
otpDeviceId: webauthnInfo.otpDeviceId,
412+
prfSalt: webauthnInfo.prfSalt,
413+
encryptedPrv: this.bitgo.encrypt({
414+
input: prv,
415+
password: webauthnInfo.passphrase,
416+
}),
417+
},
418+
]
419+
: undefined,
407420
};
408421

409-
if (webauthnInfo && recipientIndex === 1) {
410-
recipientKeychainParams.webauthnDevices = [
411-
{
412-
otpDeviceId: webauthnInfo.otpDeviceId,
413-
prfSalt: webauthnInfo.prfSalt,
414-
encryptedPrv: this.bitgo.encrypt({
415-
input: prv,
416-
password: webauthnInfo.passphrase,
417-
}),
418-
},
419-
];
420-
}
421-
422422
const keychains = this.baseCoin.keychains();
423423
return recipientIndex === 1
424424
? await keychains.add(recipientKeychainParams)

0 commit comments

Comments
 (0)