wallet

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: Apache-2.0, MIT Imports: 10 Imported by: 41

Documentation

Overview

Code generated by github.com/filecoin-project/venus/venus-devtool/api-gen. DO NOT EDIT.

Code generated by github.com/filecoin-project/venus/venus-devtool/api-gen. DO NOT EDIT.

Index

Constants

View Source
const APINamespace = "wallet.IFullAPI"
View Source
const MajorVersion = 0
View Source
const MethodNamespace = "Filecoin"

Variables

This section is empty.

Functions

This section is empty.

Types

type ICommon

type ICommon interface {
	// Auth
	AuthVerify(ctx context.Context, token string) ([]auth.Permission, error) //perm:read
	AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error)    //perm:admin

	// Version provides information about API provider
	Version(context.Context) (types.Version, error) //perm:read

	LogList(context.Context) ([]string, error)         //perm:read
	LogSetLevel(context.Context, string, string) error //perm:write
}

type ICommonStruct

type ICommonStruct struct {
	Internal struct {
		AuthNew     func(ctx context.Context, perms []auth.Permission) ([]byte, error) `perm:"admin"`
		AuthVerify  func(ctx context.Context, token string) ([]auth.Permission, error) `perm:"read"`
		LogList     func(context.Context) ([]string, error)                            `perm:"read"`
		LogSetLevel func(context.Context, string, string) error                        `perm:"write"`
		Version     func(context.Context) (types.Version, error)                       `perm:"read"`
	}
}

func (*ICommonStruct) AuthNew

func (s *ICommonStruct) AuthNew(p0 context.Context, p1 []auth.Permission) ([]byte, error)

func (*ICommonStruct) AuthVerify

func (s *ICommonStruct) AuthVerify(p0 context.Context, p1 string) ([]auth.Permission, error)

func (*ICommonStruct) LogList

func (s *ICommonStruct) LogList(p0 context.Context) ([]string, error)

func (*ICommonStruct) LogSetLevel

func (s *ICommonStruct) LogSetLevel(p0 context.Context, p1 string, p2 string) error

func (*ICommonStruct) Version

func (s *ICommonStruct) Version(p0 context.Context) (types.Version, error)

type IFullAPI

type IFullAPI interface {
	ILocalStrategy
	ILocalWallet
	ICommon
	IWalletEvent
}

func NewIFullAPIRPC

func NewIFullAPIRPC(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (IFullAPI, jsonrpc.ClientCloser, error)

NewIFullAPIRPC creates a new httpparse jsonrpc remotecli.

type ILocalStrategy

type ILocalStrategy interface {
	IStrategyVerify
	IStrategy
}

type ILocalStrategyStruct

type ILocalStrategyStruct struct {
	IStrategyVerifyStruct
	IStrategyStruct
}

type ILocalWallet

type ILocalWallet interface {
	IWallet
	IWalletLock
}

type ILocalWalletStruct

type ILocalWalletStruct struct {
	IWalletStruct
	IWalletLockStruct
}

type IStrategy

type IStrategy interface {
	// NewMsgTypeTemplate create a msgType template
	NewMsgTypeTemplate(ctx context.Context, name string, codes []int) error //perm:admin
	// NewMethodTemplate create a method template
	NewMethodTemplate(ctx context.Context, name string, methods []string) error //perm:admin
	// NewKeyBindCustom create a keyBind with custom msyTypes and methods
	NewKeyBindCustom(ctx context.Context, name string, address address.Address, codes []int, methods []wallet.MethodName) error //perm:admin
	// NewKeyBindFromTemplate create a keyBind form msgType template and method template
	NewKeyBindFromTemplate(ctx context.Context, name string, address address.Address, mttName, mtName string) error //perm:admin
	// NewGroup create a group to group multiple keyBinds together
	NewGroup(ctx context.Context, name string, keyBindNames []string) error //perm:admin
	// NewStToken generate a random token from group
	NewStToken(ctx context.Context, groupName string) (token string, err error) //perm:admin
	// GetMsgTypeTemplate get a msgType template by name
	GetMsgTypeTemplate(ctx context.Context, name string) (*wallet.MsgTypeTemplate, error) //perm:admin
	// GetMethodTemplateByName get a method template by name
	GetMethodTemplateByName(ctx context.Context, name string) (*wallet.MethodTemplate, error) //perm:admin
	// GetKeyBindByName get a keyBind by name
	GetKeyBindByName(ctx context.Context, name string) (*wallet.KeyBind, error) //perm:admin
	// GetKeyBinds list keyBinds by address
	GetKeyBinds(ctx context.Context, address address.Address) ([]*wallet.KeyBind, error) //perm:admin
	// GetGroupByName get a group by name
	GetGroupByName(ctx context.Context, name string) (*wallet.Group, error) //perm:admin
	// GetWalletTokensByGroup list strategy tokens under the group
	GetWalletTokensByGroup(ctx context.Context, groupName string) ([]string, error) //perm:admin
	// GetWalletTokenInfo get group details by token
	GetWalletTokenInfo(ctx context.Context, token string) (*wallet.GroupAuth, error) //perm:admin
	// ListGroups list groups' simple information
	ListGroups(ctx context.Context, fromIndex, toIndex int) ([]*wallet.Group, error) //perm:admin
	// ListKeyBinds list keyBinds' details
	ListKeyBinds(ctx context.Context, fromIndex, toIndex int) ([]*wallet.KeyBind, error) //perm:admin
	// ListMethodTemplates list method templates' details
	ListMethodTemplates(ctx context.Context, fromIndex, toIndex int) ([]*wallet.MethodTemplate, error) //perm:admin
	// ListMsgTypeTemplates list msgType templates' details
	ListMsgTypeTemplates(ctx context.Context, fromIndex, toIndex int) ([]*wallet.MsgTypeTemplate, error) //perm:admin

	// AddMsgTypeIntoKeyBind append msgTypes into keyBind
	AddMsgTypeIntoKeyBind(ctx context.Context, name string, codes []int) (*wallet.KeyBind, error) //perm:admin
	// AddMethodIntoKeyBind append methods into keyBind
	AddMethodIntoKeyBind(ctx context.Context, name string, methods []string) (*wallet.KeyBind, error) //perm:admin
	// RemoveMsgTypeFromKeyBind remove msgTypes form keyBind
	RemoveMsgTypeFromKeyBind(ctx context.Context, name string, codes []int) (*wallet.KeyBind, error) //perm:admin
	// RemoveMethodFromKeyBind remove methods from keyBind
	RemoveMethodFromKeyBind(ctx context.Context, name string, methods []string) (*wallet.KeyBind, error) //perm:admin

	// RemoveMsgTypeTemplate delete msgType template by name
	RemoveMsgTypeTemplate(ctx context.Context, name string) error //perm:admin
	// RemoveGroup delete group by name
	RemoveGroup(ctx context.Context, name string) error //perm:admin
	// RemoveMethodTemplate delete method template by name
	RemoveMethodTemplate(ctx context.Context, name string) error //perm:admin
	// RemoveKeyBind delete keyBind by name
	RemoveKeyBind(ctx context.Context, name string) error //perm:admin
	// RemoveKeyBindByAddress delete some keyBinds by address
	RemoveKeyBindByAddress(ctx context.Context, address address.Address) (int64, error) //perm:admin
	// RemoveStToken delete strategy token
	RemoveStToken(ctx context.Context, token string) error //perm:admin
}

type IStrategyStruct

type IStrategyStruct struct {
	Internal struct {
		AddMethodIntoKeyBind     func(ctx context.Context, name string, methods []string) (*wallet.KeyBind, error)                               `perm:"admin"`
		AddMsgTypeIntoKeyBind    func(ctx context.Context, name string, codes []int) (*wallet.KeyBind, error)                                    `perm:"admin"`
		GetGroupByName           func(ctx context.Context, name string) (*wallet.Group, error)                                                   `perm:"admin"`
		GetKeyBindByName         func(ctx context.Context, name string) (*wallet.KeyBind, error)                                                 `perm:"admin"`
		GetKeyBinds              func(ctx context.Context, address address.Address) ([]*wallet.KeyBind, error)                                   `perm:"admin"`
		GetMethodTemplateByName  func(ctx context.Context, name string) (*wallet.MethodTemplate, error)                                          `perm:"admin"`
		GetMsgTypeTemplate       func(ctx context.Context, name string) (*wallet.MsgTypeTemplate, error)                                         `perm:"admin"`
		GetWalletTokenInfo       func(ctx context.Context, token string) (*wallet.GroupAuth, error)                                              `perm:"admin"`
		GetWalletTokensByGroup   func(ctx context.Context, groupName string) ([]string, error)                                                   `perm:"admin"`
		ListGroups               func(ctx context.Context, fromIndex, toIndex int) ([]*wallet.Group, error)                                      `perm:"admin"`
		ListKeyBinds             func(ctx context.Context, fromIndex, toIndex int) ([]*wallet.KeyBind, error)                                    `perm:"admin"`
		ListMethodTemplates      func(ctx context.Context, fromIndex, toIndex int) ([]*wallet.MethodTemplate, error)                             `perm:"admin"`
		ListMsgTypeTemplates     func(ctx context.Context, fromIndex, toIndex int) ([]*wallet.MsgTypeTemplate, error)                            `perm:"admin"`
		NewGroup                 func(ctx context.Context, name string, keyBindNames []string) error                                             `perm:"admin"`
		NewKeyBindCustom         func(ctx context.Context, name string, address address.Address, codes []int, methods []wallet.MethodName) error `perm:"admin"`
		NewKeyBindFromTemplate   func(ctx context.Context, name string, address address.Address, mttName, mtName string) error                   `perm:"admin"`
		NewMethodTemplate        func(ctx context.Context, name string, methods []string) error                                                  `perm:"admin"`
		NewMsgTypeTemplate       func(ctx context.Context, name string, codes []int) error                                                       `perm:"admin"`
		NewStToken               func(ctx context.Context, groupName string) (token string, err error)                                           `perm:"admin"`
		RemoveGroup              func(ctx context.Context, name string) error                                                                    `perm:"admin"`
		RemoveKeyBind            func(ctx context.Context, name string) error                                                                    `perm:"admin"`
		RemoveKeyBindByAddress   func(ctx context.Context, address address.Address) (int64, error)                                               `perm:"admin"`
		RemoveMethodFromKeyBind  func(ctx context.Context, name string, methods []string) (*wallet.KeyBind, error)                               `perm:"admin"`
		RemoveMethodTemplate     func(ctx context.Context, name string) error                                                                    `perm:"admin"`
		RemoveMsgTypeFromKeyBind func(ctx context.Context, name string, codes []int) (*wallet.KeyBind, error)                                    `perm:"admin"`
		RemoveMsgTypeTemplate    func(ctx context.Context, name string) error                                                                    `perm:"admin"`
		RemoveStToken            func(ctx context.Context, token string) error                                                                   `perm:"admin"`
	}
}

func (*IStrategyStruct) AddMethodIntoKeyBind

func (s *IStrategyStruct) AddMethodIntoKeyBind(p0 context.Context, p1 string, p2 []string) (*wallet.KeyBind, error)

func (*IStrategyStruct) AddMsgTypeIntoKeyBind

func (s *IStrategyStruct) AddMsgTypeIntoKeyBind(p0 context.Context, p1 string, p2 []int) (*wallet.KeyBind, error)

func (*IStrategyStruct) GetGroupByName

func (s *IStrategyStruct) GetGroupByName(p0 context.Context, p1 string) (*wallet.Group, error)

func (*IStrategyStruct) GetKeyBindByName

func (s *IStrategyStruct) GetKeyBindByName(p0 context.Context, p1 string) (*wallet.KeyBind, error)

func (*IStrategyStruct) GetKeyBinds

func (s *IStrategyStruct) GetKeyBinds(p0 context.Context, p1 address.Address) ([]*wallet.KeyBind, error)

func (*IStrategyStruct) GetMethodTemplateByName

func (s *IStrategyStruct) GetMethodTemplateByName(p0 context.Context, p1 string) (*wallet.MethodTemplate, error)

func (*IStrategyStruct) GetMsgTypeTemplate

func (s *IStrategyStruct) GetMsgTypeTemplate(p0 context.Context, p1 string) (*wallet.MsgTypeTemplate, error)

func (*IStrategyStruct) GetWalletTokenInfo

func (s *IStrategyStruct) GetWalletTokenInfo(p0 context.Context, p1 string) (*wallet.GroupAuth, error)

func (*IStrategyStruct) GetWalletTokensByGroup

func (s *IStrategyStruct) GetWalletTokensByGroup(p0 context.Context, p1 string) ([]string, error)

func (*IStrategyStruct) ListGroups

func (s *IStrategyStruct) ListGroups(p0 context.Context, p1, p2 int) ([]*wallet.Group, error)

func (*IStrategyStruct) ListKeyBinds

func (s *IStrategyStruct) ListKeyBinds(p0 context.Context, p1, p2 int) ([]*wallet.KeyBind, error)

func (*IStrategyStruct) ListMethodTemplates

func (s *IStrategyStruct) ListMethodTemplates(p0 context.Context, p1, p2 int) ([]*wallet.MethodTemplate, error)

func (*IStrategyStruct) ListMsgTypeTemplates

func (s *IStrategyStruct) ListMsgTypeTemplates(p0 context.Context, p1, p2 int) ([]*wallet.MsgTypeTemplate, error)

func (*IStrategyStruct) NewGroup

func (s *IStrategyStruct) NewGroup(p0 context.Context, p1 string, p2 []string) error

func (*IStrategyStruct) NewKeyBindCustom

func (s *IStrategyStruct) NewKeyBindCustom(p0 context.Context, p1 string, p2 address.Address, p3 []int, p4 []wallet.MethodName) error

func (*IStrategyStruct) NewKeyBindFromTemplate

func (s *IStrategyStruct) NewKeyBindFromTemplate(p0 context.Context, p1 string, p2 address.Address, p3, p4 string) error

func (*IStrategyStruct) NewMethodTemplate

func (s *IStrategyStruct) NewMethodTemplate(p0 context.Context, p1 string, p2 []string) error

func (*IStrategyStruct) NewMsgTypeTemplate

func (s *IStrategyStruct) NewMsgTypeTemplate(p0 context.Context, p1 string, p2 []int) error

func (*IStrategyStruct) NewStToken

func (s *IStrategyStruct) NewStToken(p0 context.Context, p1 string) (string, error)

func (*IStrategyStruct) RemoveGroup

func (s *IStrategyStruct) RemoveGroup(p0 context.Context, p1 string) error

func (*IStrategyStruct) RemoveKeyBind

func (s *IStrategyStruct) RemoveKeyBind(p0 context.Context, p1 string) error

func (*IStrategyStruct) RemoveKeyBindByAddress

func (s *IStrategyStruct) RemoveKeyBindByAddress(p0 context.Context, p1 address.Address) (int64, error)

func (*IStrategyStruct) RemoveMethodFromKeyBind

func (s *IStrategyStruct) RemoveMethodFromKeyBind(p0 context.Context, p1 string, p2 []string) (*wallet.KeyBind, error)

func (*IStrategyStruct) RemoveMethodTemplate

func (s *IStrategyStruct) RemoveMethodTemplate(p0 context.Context, p1 string) error

func (*IStrategyStruct) RemoveMsgTypeFromKeyBind

func (s *IStrategyStruct) RemoveMsgTypeFromKeyBind(p0 context.Context, p1 string, p2 []int) (*wallet.KeyBind, error)

func (*IStrategyStruct) RemoveMsgTypeTemplate

func (s *IStrategyStruct) RemoveMsgTypeTemplate(p0 context.Context, p1 string) error

func (*IStrategyStruct) RemoveStToken

func (s *IStrategyStruct) RemoveStToken(p0 context.Context, p1 string) error

type IStrategyVerify

type IStrategyVerify interface {
	// Verify verify the address strategy permissions
	Verify(ctx context.Context, address address.Address, msgType types.MsgType, msg *types.Message) error //perm:admin
	// ScopeWallet get the wallet scope
	ScopeWallet(ctx context.Context) (*wallet.AddressScope, error) //perm:admin
	// ContainWallet Check if it is visible to the wallet
	ContainWallet(ctx context.Context, address address.Address) bool //perm:admin
}

type IStrategyVerifyStruct

type IStrategyVerifyStruct struct {
	Internal struct {
		ContainWallet func(ctx context.Context, address address.Address) bool                                             `perm:"admin"`
		ScopeWallet   func(ctx context.Context) (*wallet.AddressScope, error)                                             `perm:"admin"`
		Verify        func(ctx context.Context, address address.Address, msgType types.MsgType, msg *types.Message) error `perm:"admin"`
	}
}

func (*IStrategyVerifyStruct) ContainWallet

func (s *IStrategyVerifyStruct) ContainWallet(p0 context.Context, p1 address.Address) bool

func (*IStrategyVerifyStruct) ScopeWallet

func (*IStrategyVerifyStruct) Verify

type IWallet

type IWallet interface {
	WalletNew(ctx context.Context, kt types.KeyType) (address.Address, error)                                             //perm:admin
	WalletHas(ctx context.Context, address address.Address) (bool, error)                                                 //perm:read
	WalletList(ctx context.Context) ([]address.Address, error)                                                            //perm:read
	WalletSign(ctx context.Context, signer address.Address, toSign []byte, meta types.MsgMeta) (*crypto.Signature, error) //perm:sign
	WalletExport(ctx context.Context, addr address.Address) (*types.KeyInfo, error)                                       //perm:admin
	WalletImport(ctx context.Context, ki *types.KeyInfo) (address.Address, error)                                         //perm:admin
	WalletDelete(ctx context.Context, addr address.Address) error                                                         //perm:admin
}

type IWalletEvent

type IWalletEvent interface {
	AddSupportAccount(ctx context.Context, supportAccount string) error  //perm:admin
	AddNewAddress(ctx context.Context, newAddrs []address.Address) error //perm:admin
}

type IWalletEventStruct

type IWalletEventStruct struct {
	Internal struct {
		AddNewAddress     func(ctx context.Context, newAddrs []address.Address) error `perm:"admin"`
		AddSupportAccount func(ctx context.Context, supportAccount string) error      `perm:"admin"`
	}
}

func (*IWalletEventStruct) AddNewAddress

func (s *IWalletEventStruct) AddNewAddress(p0 context.Context, p1 []address.Address) error

func (*IWalletEventStruct) AddSupportAccount

func (s *IWalletEventStruct) AddSupportAccount(p0 context.Context, p1 string) error

type IWalletLock

type IWalletLock interface {
	// SetPassword do it first after program setup
	SetPassword(ctx context.Context, password string) error //perm:admin
	// unlock the wallet and enable IWallet logic
	Unlock(ctx context.Context, password string) error //perm:admin
	// lock the wallet and disable IWallet logic
	Lock(ctx context.Context, password string) error //perm:admin
	// show lock state
	LockState(ctx context.Context) bool //perm:admin
	// VerifyPassword verify that the passwords are consistent
	VerifyPassword(ctx context.Context, password string) error //perm:admin
}

type IWalletLockStruct

type IWalletLockStruct struct {
	Internal struct {
		Lock           func(ctx context.Context, password string) error `perm:"admin"`
		LockState      func(ctx context.Context) bool                   `perm:"admin"`
		SetPassword    func(ctx context.Context, password string) error `perm:"admin"`
		Unlock         func(ctx context.Context, password string) error `perm:"admin"`
		VerifyPassword func(ctx context.Context, password string) error `perm:"admin"`
	}
}

func (*IWalletLockStruct) Lock

func (s *IWalletLockStruct) Lock(p0 context.Context, p1 string) error

func (*IWalletLockStruct) LockState

func (s *IWalletLockStruct) LockState(p0 context.Context) bool

func (*IWalletLockStruct) SetPassword

func (s *IWalletLockStruct) SetPassword(p0 context.Context, p1 string) error

func (*IWalletLockStruct) Unlock

func (s *IWalletLockStruct) Unlock(p0 context.Context, p1 string) error

func (*IWalletLockStruct) VerifyPassword

func (s *IWalletLockStruct) VerifyPassword(p0 context.Context, p1 string) error

type IWalletStruct

type IWalletStruct struct {
	Internal struct {
		WalletDelete func(ctx context.Context, addr address.Address) error                                                           `perm:"admin"`
		WalletExport func(ctx context.Context, addr address.Address) (*types.KeyInfo, error)                                         `perm:"admin"`
		WalletHas    func(ctx context.Context, address address.Address) (bool, error)                                                `perm:"read"`
		WalletImport func(ctx context.Context, ki *types.KeyInfo) (address.Address, error)                                           `perm:"admin"`
		WalletList   func(ctx context.Context) ([]address.Address, error)                                                            `perm:"read"`
		WalletNew    func(ctx context.Context, kt types.KeyType) (address.Address, error)                                            `perm:"admin"`
		WalletSign   func(ctx context.Context, signer address.Address, toSign []byte, meta types.MsgMeta) (*crypto.Signature, error) `perm:"sign"`
	}
}

func (*IWalletStruct) WalletDelete

func (s *IWalletStruct) WalletDelete(p0 context.Context, p1 address.Address) error

func (*IWalletStruct) WalletExport

func (s *IWalletStruct) WalletExport(p0 context.Context, p1 address.Address) (*types.KeyInfo, error)

func (*IWalletStruct) WalletHas

func (s *IWalletStruct) WalletHas(p0 context.Context, p1 address.Address) (bool, error)

func (*IWalletStruct) WalletImport

func (s *IWalletStruct) WalletImport(p0 context.Context, p1 *types.KeyInfo) (address.Address, error)

func (*IWalletStruct) WalletList

func (s *IWalletStruct) WalletList(p0 context.Context) ([]address.Address, error)

func (*IWalletStruct) WalletNew

func (s *IWalletStruct) WalletNew(p0 context.Context, p1 types.KeyType) (address.Address, error)

func (*IWalletStruct) WalletSign

func (s *IWalletStruct) WalletSign(p0 context.Context, p1 address.Address, p2 []byte, p3 types.MsgMeta) (*crypto.Signature, error)

Jump to

Keyboard shortcuts

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