Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async press (isYes: boolean): Promise {
let decision = new ProtoMessages.DebugLinkDecision()
decision.setYesNo(isYes)
await this.transport.callDebugLink(
ProtoMessages.MessageType.MESSAGETYPE_DEBUGLINKDECISION,
decision,
DEFAULT_TIMEOUT,
/*omitLock=*/false,
/*noWait=*/true
)
}
}
public async getPublicKeys(getPublicKeys: Array): Promise> {
const publicKeys = [];
for (let i = 0; i < getPublicKeys.length; i++) {
const { coin, addressNList, curve, showDisplay, scriptType } = getPublicKeys[i];
const GPK = new Messages.GetPublicKey();
if (coin) GPK.setCoinName(coin)
GPK.setAddressNList(addressNList);
GPK.setShowDisplay(showDisplay || false)
GPK.setEcdsaCurveName(curve || "secp256k1")
GPK.setScriptType(translateInputScriptType(scriptType || BTCInputScriptType.SpendAddress))
const event = await this.transport.call(
Messages.MessageType.MESSAGETYPE_GETPUBLICKEY,
GPK,
showDisplay ? LONG_TIMEOUT : DEFAULT_TIMEOUT
) as Event
if (event.message_type === Events.FAILURE) throw event
const publicKey = event.proto as Messages.PublicKey
publicKeys.push({ xpub: publicKey.getXpub() })
}
return publicKeys;
}