Documentation ¶
Index ¶
- Variables
- type IWallet
- type WalletAPI
- func (walletAPI *WalletAPI) HasPassword(Context context.Context) bool
- func (walletAPI *WalletAPI) Locked(ctx context.Context, password string) error
- func (walletAPI *WalletAPI) SetPassword(Context context.Context, password string) error
- func (walletAPI *WalletAPI) UnLocked(ctx context.Context, password string) error
- func (walletAPI *WalletAPI) WalletAddresses() []address.Address
- func (walletAPI *WalletAPI) WalletBalance(ctx context.Context, addr address.Address) (abi.TokenAmount, error)
- func (walletAPI *WalletAPI) WalletDefaultAddress() (address.Address, error)
- func (walletAPI *WalletAPI) WalletExport(addr address.Address, password string) (*crypto.KeyInfo, error)
- func (walletAPI *WalletAPI) WalletHas(ctx context.Context, addr address.Address) (bool, error)
- func (walletAPI *WalletAPI) WalletImport(key *crypto.KeyInfo) (address.Address, error)
- func (walletAPI *WalletAPI) WalletNewAddress(protocol address.Protocol) (address.Address, error)
- func (walletAPI *WalletAPI) WalletSetDefault(_ context.Context, addr address.Address) error
- func (walletAPI *WalletAPI) WalletSign(ctx context.Context, k address.Address, msg []byte, meta wallet.MsgMeta) (*crypto.Signature, error)
- func (walletAPI *WalletAPI) WalletSignMessage(ctx context.Context, k address.Address, msg *types.UnsignedMessage) (*types.SignedMessage, error)
- func (walletAPI *WalletAPI) WalletState(Context context.Context) int
- type WalletSubmodule
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoDefaultFromAddress = errors.New("unable to determine a default walletModule address")
Functions ¶
This section is empty.
Types ¶
type IWallet ¶ added in v0.9.1
type IWallet interface { WalletSign(ctx context.Context, k address.Address, msg []byte, meta wallet.MsgMeta) (*crypto.Signature, error) WalletExport(addr address.Address, password string) (*crypto.KeyInfo, error) WalletImport(key *crypto.KeyInfo) (address.Address, error) WalletHas(ctx context.Context, addr address.Address) (bool, error) WalletNewAddress(protocol address.Protocol) (address.Address, error) WalletBalance(ctx context.Context, addr address.Address) (abi.TokenAmount, error) //not exists in remote WalletDefaultAddress() (address.Address, error) //not exists in remote WalletAddresses() []address.Address WalletSetDefault(_ context.Context, addr address.Address) error //not exists in remote WalletSignMessage(ctx context.Context, k address.Address, msg *types.UnsignedMessage) (*types.SignedMessage, error) }
type WalletAPI ¶
type WalletAPI struct {
// contains filtered or unexported fields
}
func (*WalletAPI) HasPassword ¶ added in v0.9.4
func (*WalletAPI) SetPassword ¶ added in v0.9.1
func (*WalletAPI) WalletAddresses ¶
func (walletAPI *WalletAPI) WalletAddresses() []address.Address
WalletAddresses gets addresses from the walletModule
func (*WalletAPI) WalletBalance ¶
func (walletAPI *WalletAPI) WalletBalance(ctx context.Context, addr address.Address) (abi.TokenAmount, error)
WalletBalance returns the current balance of the given wallet address.
func (*WalletAPI) WalletDefaultAddress ¶
SetWalletDefaultAddress set the specified address as the default in the config.
func (*WalletAPI) WalletExport ¶
func (walletAPI *WalletAPI) WalletExport(addr address.Address, password string) (*crypto.KeyInfo, error)
WalletExport returns the KeyInfos for the given walletModule addresses
func (*WalletAPI) WalletImport ¶
WalletImport adds a given set of KeyInfos to the walletModule
func (*WalletAPI) WalletNewAddress ¶
WalletNewAddress generates a new walletModule address
func (*WalletAPI) WalletSetDefault ¶
SetWalletDefaultAddress set the specified address as the default in the config.
func (*WalletAPI) WalletSign ¶
func (*WalletAPI) WalletSignMessage ¶
func (walletAPI *WalletAPI) WalletSignMessage(ctx context.Context, k address.Address, msg *types.UnsignedMessage) (*types.SignedMessage, error)
type WalletSubmodule ¶
type WalletSubmodule struct { Chain *chain.ChainSubmodule Wallet *wallet.Wallet Signer types.Signer Config *config.ConfigModule // contains filtered or unexported fields }
WalletSubmodule enhances the `Node` with a "wallet" and FIL transfer capabilities.
func NewWalletSubmodule ¶
func NewWalletSubmodule(ctx context.Context, cfg *config.ConfigModule, repo walletRepo, chain *chain.ChainSubmodule, password string) (*WalletSubmodule, error)
NewWalletSubmodule creates a new storage protocol submodule.
func (*WalletSubmodule) API ¶
func (wallet *WalletSubmodule) API() *WalletAPI
Click to show internal directories.
Click to hide internal directories.