Versions in this module Expand all Collapse all v0 v0.1.1 Jan 11, 2022 Changes in this version + const KDefault + const KNamePrefix + var ErrNoAPI = fmt.Errorf("no filecoin api connected") + func ActSigType(typ KeyType) crypto.SigType + type Driver interface + Balance func(context.Context, address.Address) (fil.BigInt, error) + DefaultAddress func() address.Address + ExportKey func(context.Context, address.Address) (*KeyInfo, error) + ImportKey func(context.Context, *KeyInfo) (address.Address, error) + List func() ([]address.Address, error) + NewKey func(context.Context, KeyType) (address.Address, error) + SetDefaultAddress func(address.Address) error + Sign func(context.Context, address.Address, []byte) (*crypto.Signature, error) + Signers func() map[KeyType]Signer + Transfer func(ctx context.Context, from address.Address, to address.Address, amount string) error + Verify func(context.Context, address.Address, []byte, *crypto.Signature) (bool, error) + func NewFromKeystore(ks keystore.Keystore, opts ...Option) Driver + type Key struct + Address address.Address + PublicKey []byte + func NewKeyFromKeyInfo(ki KeyInfo) (*Key, error) + func NewKeyFromLibp2p(pk ci.PrivKey, sigs map[KeyType]Signer) (*Key, error) + func (k *Key) Bytes() ([]byte, error) + func (k *Key) Equals(ki ci.Key) bool + func (k *Key) GetPublic() ci.PubKey + func (k *Key) Raw() ([]byte, error) + func (k *Key) Sign(data []byte) ([]byte, error) + func (k *Key) Type() pb.KeyType + func (k *Key) Verify(data []byte, sig []byte) (bool, error) + type KeyInfo struct + KType KeyType + PrivateKey []byte + func (k *KeyInfo) FromBytes(data []byte) error + func (k *KeyInfo) ToBytes() ([]byte, error) + type KeyType string + const KTBLS + const KTSecp256k1 + type KeystoreWallet struct + func (w *KeystoreWallet) Balance(ctx context.Context, addr address.Address) (fil.BigInt, error) + func (w *KeystoreWallet) DefaultAddress() address.Address + func (w *KeystoreWallet) ExportKey(_ context.Context, addr address.Address) (*KeyInfo, error) + func (w *KeystoreWallet) ImportKey(_ context.Context, k *KeyInfo) (address.Address, error) + func (w *KeystoreWallet) List() ([]address.Address, error) + func (w *KeystoreWallet) NewKey(ctx context.Context, kt KeyType) (address.Address, error) + func (w *KeystoreWallet) SetDefaultAddress(addr address.Address) error + func (w *KeystoreWallet) Sign(ctx context.Context, addr address.Address, msg []byte) (*crypto.Signature, error) + func (w *KeystoreWallet) Signers() map[KeyType]Signer + func (w *KeystoreWallet) Transfer(ctx context.Context, from address.Address, to address.Address, amount string) error + func (w *KeystoreWallet) Verify(ctx context.Context, k address.Address, msg []byte, sig *crypto.Signature) (bool, error) + type Option func(kw *KeystoreWallet) + func WithConfidence(c uint64) Option + func WithFilAPI(f fil.API) Option + type Signer interface + GenPrivate func() ([]byte, error) + Sign func(pk []byte, msg []byte) ([]byte, error) + ToPublic func(pk []byte) ([]byte, error) + Verify func(sig []byte, a address.Address, msg []byte) error + func KeyTypeSig(typ KeyType, sigs map[KeyType]Signer) (Signer, error) + func SigTypeSig(st crypto.SigType, sigs map[KeyType]Signer) (Signer, error)