ledger_thorchain_go

package module
v0.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

ledger-thorchain-go

Forked from ledger-cosmos-go

Get source

Apart from cloning, be sure you install dep dependency management tool https://github.com/golang/dep

Documentation

Overview

THORChain uses same CLA (0x55) as Cosmos app, so okay to use cosmos/ledger-go for transport

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckVersion added in v0.9.8

func CheckVersion(ver VersionInfo, req VersionInfo) error

CheckVersion compares the current version with the required version

func GetBip32bytesv1 added in v0.12.0

func GetBip32bytesv1(bip32Path []uint32, hardenCount int) ([]byte, error)

func GetBip32bytesv2 added in v0.12.0

func GetBip32bytesv2(bip44Path []uint32, hardenCount int) ([]byte, error)

func NewVersionRequiredError added in v0.12.0

func NewVersionRequiredError(req VersionInfo, ver VersionInfo) error

Types

type LedgerTHORChain added in v0.12.0

type LedgerTHORChain struct {
	// contains filtered or unexported fields
}

LedgerTHORChain represents a connection to the THORChain app in a Ledger Nano S/X device

func FindLedgerCosmosUserApp added in v0.9.3

func FindLedgerCosmosUserApp() (*LedgerTHORChain, error)

Compatibility with Cosmos apps calling convention

func FindLedgerTHORChainUserApp added in v0.12.0

func FindLedgerTHORChainUserApp() (*LedgerTHORChain, error)

FindLedgerTHORChainUserApp finds a THORChain user app running in a ledger device

func (*LedgerTHORChain) CheckVersion added in v0.12.0

func (ledger *LedgerTHORChain) CheckVersion(ver VersionInfo) error

VersionIsSupported returns true if the App version is supported by this library

func (*LedgerTHORChain) Close added in v0.12.0

func (ledger *LedgerTHORChain) Close() error

Close closes a connection with the THORChain user app

func (*LedgerTHORChain) GetAddressPubKeySECP256K1 added in v0.12.0

func (ledger *LedgerTHORChain) GetAddressPubKeySECP256K1(bip32Path []uint32, hrp string) (pubkey []byte, addr string, err error)

GetAddressPubKeySECP256K1 returns the pubkey (compressed) and address (bech( this command requires user confirmation in the device

func (*LedgerTHORChain) GetBip32bytes added in v0.12.0

func (ledger *LedgerTHORChain) GetBip32bytes(bip32Path []uint32, hardenCount int) ([]byte, error)

func (*LedgerTHORChain) GetPublicKeySECP256K1 added in v0.12.0

func (ledger *LedgerTHORChain) GetPublicKeySECP256K1(bip32Path []uint32) ([]byte, error)

GetPublicKeySECP256K1 retrieves the public key for the corresponding bip32 derivation path (compressed) this command DOES NOT require user confirmation in the device

func (*LedgerTHORChain) GetVersion added in v0.12.0

func (ledger *LedgerTHORChain) GetVersion() (*VersionInfo, error)

GetVersion returns the current version of the THORChain user app

func (*LedgerTHORChain) SignSECP256K1 added in v0.12.0

func (ledger *LedgerTHORChain) SignSECP256K1(bip32Path []uint32, transaction []byte) ([]byte, error)

SignSECP256K1 signs a transaction using THORChain user app this command requires user confirmation in the device

type VersionInfo

type VersionInfo struct {
	AppMode uint8
	Major   uint8
	Minor   uint8
	Patch   uint8
}

VersionInfo contains app version information

func (VersionInfo) String added in v0.9.8

func (c VersionInfo) String() string

type VersionRequiredError added in v0.12.0

type VersionRequiredError struct {
	Found    VersionInfo
	Required VersionInfo
}

VersionRequiredError the command is not supported by this app

func (VersionRequiredError) Error added in v0.12.0

func (e VersionRequiredError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL