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 CryptoCurve
- type LedgerFilecoin
- func (ledger *LedgerFilecoin) CheckVersion(ver VersionInfo) error
- func (ledger *LedgerFilecoin) Close() error
- func (ledger *LedgerFilecoin) GetAddressPubKey(bip44Path []uint32, curve CryptoCurve) (pubkey []byte, addrByte []byte, addrString string, err error)
- func (ledger *LedgerFilecoin) GetAddressPubKeySECP256K1(bip44Path []uint32) (pubkey []byte, addrByte []byte, addrString string, err error)deprecated
- func (ledger *LedgerFilecoin) GetBip44bytes(bip44Path []uint32, hardenCount int) ([]byte, error)
- func (ledger *LedgerFilecoin) GetPublicKey(bip44Path []uint32, curve CryptoCurve) ([]byte, error)
- func (ledger *LedgerFilecoin) GetPublicKeySECP256K1(bip44Path []uint32) ([]byte, error)deprecated
- func (ledger *LedgerFilecoin) GetVersion() (*VersionInfo, error)
- func (ledger *LedgerFilecoin) ShowAddressPubKey(bip44Path []uint32, curve CryptoCurve) (pubkey []byte, addrByte []byte, addrString string, err error)
- func (ledger *LedgerFilecoin) ShowAddressPubKeySECP256K1(bip44Path []uint32) (pubkey []byte, addrByte []byte, addrString string, err error)deprecated
- func (ledger *LedgerFilecoin) Sign(bip44Path []uint32, transaction []byte, curve CryptoCurve) (*SignatureAnswer, error)
- func (ledger *LedgerFilecoin) SignSECP256K1(bip44Path []uint32, transaction []byte) (*SignatureAnswer, error)deprecated
- type SignatureAnswer
- type VersionInfo
- type VersionRequiredError
Constants ¶
const ( CLA = 0x06 INSGetVersion = 0 INSGetAddr = 1 INSSign = 2 INSSignDataCap = 5 INSSignClientDeal = 6 INSSignRawBytes = 7 )
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 CryptoCurve ¶ added in v1.0.0
type CryptoCurve uint64
const ( SECP256K1 CryptoCurve = iota BLS )
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) GetAddressPubKey ¶ added in v0.12.0
func (ledger *LedgerFilecoin) GetAddressPubKey(bip44Path []uint32, curve CryptoCurve) (pubkey []byte, addrByte []byte, addrString string, err error)
GetAddressPubKey returns the pubkey and addresses this command does not require user confirmation
func (*LedgerFilecoin) GetAddressPubKeySECP256K1
deprecated
func (*LedgerFilecoin) GetBip44bytes ¶
func (ledger *LedgerFilecoin) GetBip44bytes(bip44Path []uint32, hardenCount int) ([]byte, error)
func (*LedgerFilecoin) GetPublicKey ¶ added in v0.12.0
func (ledger *LedgerFilecoin) GetPublicKey(bip44Path []uint32, curve CryptoCurve) ([]byte, error)
GetPublicKey retrieves the public key for the corresponding bip44 derivation path this command DOES NOT require user confirmation in the device
func (*LedgerFilecoin) GetPublicKeySECP256K1
deprecated
func (ledger *LedgerFilecoin) GetPublicKeySECP256K1(bip44Path []uint32) ([]byte, error)
Deprecated: Use GetPublicKey instead.
func (*LedgerFilecoin) GetVersion ¶
func (ledger *LedgerFilecoin) GetVersion() (*VersionInfo, error)
GetVersion returns the current version of the Filecoin user app
func (*LedgerFilecoin) ShowAddressPubKey ¶ added in v0.12.0
func (ledger *LedgerFilecoin) ShowAddressPubKey(bip44Path []uint32, curve CryptoCurve) (pubkey []byte, addrByte []byte, addrString string, err error)
ShowAddressPubKey returns the pubkey (compressed) and addresses this command requires user confirmation in the device
func (*LedgerFilecoin) ShowAddressPubKeySECP256K1
deprecated
func (*LedgerFilecoin) Sign ¶ added in v0.12.0
func (ledger *LedgerFilecoin) Sign(bip44Path []uint32, transaction []byte, curve CryptoCurve) (*SignatureAnswer, error)
Sign signs a transaction using Filecoin user app this command requires user confirmation in the device
func (*LedgerFilecoin) SignSECP256K1
deprecated
func (ledger *LedgerFilecoin) SignSECP256K1(bip44Path []uint32, transaction []byte) (*SignatureAnswer, error)
Deprecated: Use Sign method instead.
type SignatureAnswer ¶
type SignatureAnswer struct {
// contains filtered or unexported fields
}
func (*SignatureAnswer) SignatureBytes ¶ added in v0.11.0
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