How to use the @keepkey/device-protocol/lib/messages_pb.MessageType function in @keepkey/device-protocol

To help you get started, we’ve selected a few @keepkey/device-protocol examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shapeshift / hdwallet / packages / hdwallet-keepkey / src / debuglink.ts View on Github external
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
      )
    }
}
github shapeshift / hdwallet / packages / hdwallet-keepkey / src / keepkey.ts View on Github external
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;
  }