ledger_cosmos_go

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

README

ledger-cosmos-go

CircleCI Build status

This project is work in progress. Some aspects are subject to change.

Get source

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

ledger-cosmos-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckVersion

func CheckVersion(ver VersionInfo, req VersionInfo) bool

CheckVersion compares the current version with the required version

func GetBip32bytes

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

Types

type LedgerCosmos

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

LedgerCosmos represents a connection to the Cosmos app in a Ledger Nano S device

func FindLedgerCosmosUserApp

func FindLedgerCosmosUserApp() (*LedgerCosmos, error)

FindLedgerCosmosUserApp finds a Cosmos user app running in a ledger device

func (*LedgerCosmos) Close

func (ledger *LedgerCosmos) Close() error

Close closes a connection with the Cosmos user app

func (*LedgerCosmos) GetPublicKeySECP256K1

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

GetPublicKeySECP256K1 retrieves the public key for the corresponding bip32 derivation path

func (*LedgerCosmos) GetVersion

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

GetVersion returns the current version of the Cosmos user app

func (*LedgerCosmos) Hash

func (ledger *LedgerCosmos) Hash(transaction []byte) ([]byte, error)

Hash returns the hash for the transaction (only enabled in test mode apps)

func (*LedgerCosmos) ShowAddressSECP256K1

func (ledger *LedgerCosmos) ShowAddressSECP256K1(bip32Path []uint32, hrp string) error

ShowAddressSECP256K1 shows the address for the corresponding bip32 derivation path

func (*LedgerCosmos) SignSECP256K1

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

SignSECP256K1 signs a transaction using Cosmos user app

func (*LedgerCosmos) TestGetPublicKeySECP256K1

func (ledger *LedgerCosmos) TestGetPublicKeySECP256K1() ([]byte, error)

TestGetPublicKeySECP256K1 (only enabled in test mode apps)

func (*LedgerCosmos) TestSignSECP256K1

func (ledger *LedgerCosmos) TestSignSECP256K1(transaction []byte) ([]byte, error)

TestSignSECP256K1 (only enabled in test mode apps)

type LedgerTendermintValidator

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

Validator app

func FindLedgerTendermintValidatorApp

func FindLedgerTendermintValidatorApp() (*LedgerTendermintValidator, error)

FindLedgerCosmosValidatorApp finds a Cosmos validator app running in a ledger device

func (*LedgerTendermintValidator) Close

func (ledger *LedgerTendermintValidator) Close() error

Close closes a connection with the Cosmos user app

func (*LedgerTendermintValidator) GetPublicKeyED25519

func (ledger *LedgerTendermintValidator) GetPublicKeyED25519(bip32Path []uint32) ([]byte, error)

GetPublicKeyED25519 retrieves the public key for the corresponding bip32 derivation path

func (*LedgerTendermintValidator) GetVersion

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

GetVersion returns the current version of the Cosmos user app

func (*LedgerTendermintValidator) SignED25519

func (ledger *LedgerTendermintValidator) SignED25519(bip32Path []uint32, message []byte) ([]byte, error)

SignSECP256K1 signs a message/vote using the Tendermint validator app

type VersionInfo

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

VersionInfo contains app version information

func RequiredCosmosUserAppVersion

func RequiredCosmosUserAppVersion() VersionInfo

RequiredCosmosUserAppVersion indicates the minimum required version of the Cosmos app

func RequiredTendermintValidatorAppVersion

func RequiredTendermintValidatorAppVersion() VersionInfo

RequiredCosmosUserAppVersion indicates the minimum required version of the Tendermint app

func (VersionInfo) String

func (c VersionInfo) String() string

Jump to

Keyboard shortcuts

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