Documentation ¶
Index ¶
- Constants
- func CheckVersion(ver VersionInfo, req VersionInfo) error
- func GetBip44bytes(bip44Path []uint32, hardenCount int) ([]byte, error)
- func ListFilecoinDevices(path []uint32)
- func NewVersionRequiredError(req VersionInfo, ver VersionInfo) error
- type LedgerFilecoin
- func (ledger *LedgerFilecoin) CheckVersion(ver VersionInfo) error
- func (ledger *LedgerFilecoin) Close() error
- func (ledger *LedgerFilecoin) GetAddressPubKeySECP256K1(bip44Path []uint32) (pubkey []byte, addrByte []byte, addrString string, err error)
- func (ledger *LedgerFilecoin) GetBip44bytes(bip44Path []uint32, hardenCount int) ([]byte, error)
- func (ledger *LedgerFilecoin) GetPublicKeySECP256K1(bip44Path []uint32) ([]byte, error)
- func (ledger *LedgerFilecoin) GetVersion() (*VersionInfo, error)
- func (ledger *LedgerFilecoin) ShowAddressPubKeySECP256K1(bip44Path []uint32) (pubkey []byte, addrByte []byte, addrString string, err error)
- func (ledger *LedgerFilecoin) SignSECP256K1(bip44Path []uint32, transaction []byte) (*SignatureAnswer, error)
- type SignatureAnswer
- type VersionInfo
- type VersionRequiredError
Constants ¶
const ( CLA = 0x06 INSGetVersion = 0 INSGetAddrSECP256K1 = 1 INSSignSECP256K1 = 2 )
const ( PayloadChunkInit = 0 PayloadChunkAdd = 1 PayloadChunkLast = 2 )
const HardenCount int = 2
Variables ¶
This section is empty.
Functions ¶
func CheckVersion ¶
func CheckVersion(ver VersionInfo, req VersionInfo) error
CheckVersion compares the current version with the required version
func ListFilecoinDevices ¶
func ListFilecoinDevices(path []uint32)
Displays existing Ledger Filecoin apps by address
func NewVersionRequiredError ¶
func NewVersionRequiredError(req VersionInfo, ver VersionInfo) error
Types ¶
type LedgerFilecoin ¶
type LedgerFilecoin struct {
// contains filtered or unexported fields
}
LedgerFilecoin represents a connection to the Ledger app
func ConnectLedgerFilecoinApp ¶
func ConnectLedgerFilecoinApp(seekingAddress string, path []uint32) (*LedgerFilecoin, error)
ConnectLedgerFilecoinApp connects to Filecoin app based on address
func FindLedgerFilecoinApp ¶
func FindLedgerFilecoinApp() (*LedgerFilecoin, error)
FindLedgerFilecoinApp finds the Filecoin app running in a Ledger device
func (*LedgerFilecoin) CheckVersion ¶
func (ledger *LedgerFilecoin) CheckVersion(ver VersionInfo) error
VersionIsSupported returns true if the App version is supported by this library
func (*LedgerFilecoin) Close ¶
func (ledger *LedgerFilecoin) Close() error
Close closes a connection with the Filecoin user app
func (*LedgerFilecoin) GetAddressPubKeySECP256K1 ¶
func (ledger *LedgerFilecoin) GetAddressPubKeySECP256K1(bip44Path []uint32) (pubkey []byte, addrByte []byte, addrString string, err error)
GetAddressPubKeySECP256K1 returns the pubkey and addresses this command does not require user confirmation
func (*LedgerFilecoin) GetBip44bytes ¶
func (ledger *LedgerFilecoin) GetBip44bytes(bip44Path []uint32, hardenCount int) ([]byte, error)
func (*LedgerFilecoin) GetPublicKeySECP256K1 ¶
func (ledger *LedgerFilecoin) GetPublicKeySECP256K1(bip44Path []uint32) ([]byte, error)
GetPublicKeySECP256K1 retrieves the public key for the corresponding bip44 derivation path this command DOES NOT require user confirmation in the device
func (*LedgerFilecoin) GetVersion ¶
func (ledger *LedgerFilecoin) GetVersion() (*VersionInfo, error)
GetVersion returns the current version of the Filecoin user app
func (*LedgerFilecoin) ShowAddressPubKeySECP256K1 ¶
func (ledger *LedgerFilecoin) ShowAddressPubKeySECP256K1(bip44Path []uint32) (pubkey []byte, addrByte []byte, addrString string, err error)
ShowAddressPubKeySECP256K1 returns the pubkey (compressed) and addresses this command requires user confirmation in the device
func (*LedgerFilecoin) SignSECP256K1 ¶
func (ledger *LedgerFilecoin) SignSECP256K1(bip44Path []uint32, transaction []byte) (*SignatureAnswer, error)
SignSECP256K1 signs a transaction using Filecoin user app this command requires user confirmation in the device
type SignatureAnswer ¶
type SignatureAnswer struct {
// contains filtered or unexported fields
}
func (*SignatureAnswer) SignatureBytes ¶
func (sa *SignatureAnswer) SignatureBytes() []byte
type VersionInfo ¶
VersionInfo contains app version information
func (VersionInfo) String ¶
func (c VersionInfo) String() string
type VersionRequiredError ¶
type VersionRequiredError struct { Found VersionInfo Required VersionInfo }
VersionRequiredError the command is not supported by this app
func (VersionRequiredError) Error ¶
func (e VersionRequiredError) Error() string