How to use the @keepkey/device-protocol/lib/messages-cosmos_pb.CosmosGetAddress 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 / cosmos.ts View on Github external
export async function cosmosGetAddress (transport: KeepKeyTransport, msg: Core.CosmosGetAddress): Promise {
  const getAddr = new CosmosGetAddress()
  getAddr.setAddressNList(msg.addressNList)
  getAddr.setShowDisplay(msg.showDisplay !== false)
  const response = await transport.call(MessageType.MESSAGETYPE_COSMOSGETADDRESS, getAddr, Core.LONG_TIMEOUT)

  if (response.message_type === Core.Events.FAILURE) throw response

  const cosmosAddress = response.proto as CosmosAddress
  return cosmosAddress.getAddress()
}