How to use the @keepkey/device-protocol/lib/messages_pb.GetCoinTable 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 / keepkey.ts View on Github external
public async getNumCoins (): Promise {
    const getCoinTable = new Messages.GetCoinTable()
    const response = await this.transport.call(Messages.MessageType.MESSAGETYPE_GETCOINTABLE, getCoinTable) as Event
    if(response.message_type === Events.FAILURE) throw event
    return (response.proto as Messages.CoinTable).getNumCoins()
  }
github shapeshift / hdwallet / packages / hdwallet-keepkey / src / keepkey.ts View on Github external
public async getCoinTable (start: number = 0, end: number = start + 10): Promise {
    const getCoinTable = new Messages.GetCoinTable()
    getCoinTable.setStart(start)
    getCoinTable.setEnd(end)
    const response = await this.transport.call(Messages.MessageType.MESSAGETYPE_GETCOINTABLE, getCoinTable) as Event
    if(response.message_type === Events.FAILURE) throw event
    const coinTable = response.message as Messages.CoinTable.AsObject
    return coinTable.tableList
  }