ledger

package
v0.0.0-...-0c944f3 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APDU

type APDU struct {
	CLA    byte   // 0xED for Elrond
	INS    byte   // Instruction
	P1, P2 byte   // Parameters
	LC     byte   // Data length
	DATA   []byte // Data
}

type NanoS

type NanoS struct {
	ContractData  uint8
	Account       uint32
	AddressIndex  uint32
	AppVersion    string
	LedgerVersion string
	// contains filtered or unexported fields
}

func OpenNanoS

func OpenNanoS() (*NanoS, error)

OpenNanoS establishes the connection to the device

func (*NanoS) Exchange

func (n *NanoS) Exchange(cmd byte, p1, p2, lc byte, data []byte) (resp []byte, err error)

Exchange sends a command to the device and returns the response

func (*NanoS) GetAddress

func (n *NanoS) GetAddress(account uint32, index uint32) (pubkey []byte, err error)

GetAddress retrieves from device the address based on account and address index

func (*NanoS) GetAddressWithAuthToken

func (n *NanoS) GetAddressWithAuthToken(account uint32, index uint32, token string) (string, string, error)

GetAddressWithAuthToken retrieves the address from the device, alongside with the signature for auth token

func (*NanoS) GetAddressWithoutConfirmation

func (n *NanoS) GetAddressWithoutConfirmation(account uint32, index uint32) (pubkey []byte, err error)

GetAddressWithoutConfirmation retrieves from device the address based on account and address index (without confirmation on device)

func (*NanoS) GetConfiguration

func (n *NanoS) GetConfiguration() error

GetConfiguration retrieves from device its configuration

func (*NanoS) GetVersion

func (n *NanoS) GetVersion() error

GetVersion retrieves from device the app version

func (*NanoS) ProvideESDTInfo

func (n *NanoS) ProvideESDTInfo(info []byte) error

func (*NanoS) SetAddress

func (n *NanoS) SetAddress(account uint32, index uint32) error

SetAddress sets the account and address index

func (*NanoS) SignMsg

func (n *NanoS) SignMsg(msg string) (sig []byte, err error)

SignMsg sends a message to the device and returns the signature

func (*NanoS) SignTx

func (n *NanoS) SignTx(txData []byte) (sig []byte, err error)

SignTx sends a json marshalized transaction to the device and returns the signature

func (*NanoS) SignTxHash

func (n *NanoS) SignTxHash(txData []byte) (sig []byte, err error)

SignTxHash sends a transaction hash to the device and returns the signature

Jump to

Keyboard shortcuts

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