Documentation ¶
Overview ¶
Package modules is to warpped the API provided by each module of IRITA
Index ¶
- func FromTmPubKey(Algo string, pubKey tmcrypto.PubKey) commoncryptotypes.PubKey
- func NewBaseClient(cfg sdktypes.ClientConfig, encodingConfig sdktypes.EncodingConfig, ...) sdktypes.BaseClient
- func NewGRPCClient(url string, options ...grpc.DialOption) types.GRPCClient
- func NewLocker(size int) *locker
- func NewRPCClient(cfg sdktypes.ClientConfig, cdc *commoncodec.LegacyAmino, ...) sdk.TmClient
- type AccountQuery
- type Client
- type KeyManager
- func (k KeyManager) Add(name, password string) (string, string, types.Error)
- func (k KeyManager) Delete(name, password string) error
- func (k KeyManager) Export(name, password string) (armor string, err error)
- func (k KeyManager) Find(name, password string) (tmcrypto.PubKey, types.AccAddress, error)
- func (k KeyManager) Import(name, password, armor string) (string, error)
- func (k KeyManager) Insert(name, password string) (string, string, error)
- func (k KeyManager) Recover(name, password, mnemonic, hdPath string) (string, error)
- func (k KeyManager) Sign(name, password string, data []byte) ([]byte, tmcrypto.PubKey, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromTmPubKey ¶
func FromTmPubKey(Algo string, pubKey tmcrypto.PubKey) commoncryptotypes.PubKey
func NewBaseClient ¶
func NewBaseClient(cfg sdktypes.ClientConfig, encodingConfig sdktypes.EncodingConfig, logger log.Logger) sdktypes.BaseClient
NewBaseClient return the baseClient for every sub modules
func NewGRPCClient ¶
func NewGRPCClient(url string, options ...grpc.DialOption) types.GRPCClient
func NewLocker ¶
func NewLocker(size int) *locker
NewLocker implement the function of lock, can lock resources according to conditions
func NewRPCClient ¶
func NewRPCClient(cfg sdktypes.ClientConfig, cdc *commoncodec.LegacyAmino, txDecoder sdk.TxDecoder, logger log.Logger, ) sdk.TmClient
Types ¶
type AccountQuery ¶
type AccountQuery struct { sdk.Queries sdk.GRPCClient log.Logger cache.Cache Km sdk.KeyManager // contains filtered or unexported fields }
Must be used with locker, otherwise there are thread safety issues
func (AccountQuery) QueryAccount ¶
func (a AccountQuery) QueryAccount(address string) (sdk.BaseAccount, sdk.Error)
func (AccountQuery) QueryAddress ¶
func (a AccountQuery) QueryAddress(name, password string) (sdk.AccAddress, sdk.Error)
func (AccountQuery) QueryAndRefreshAccount ¶
func (a AccountQuery) QueryAndRefreshAccount(address string) (sdk.BaseAccount, sdk.Error)
type Client ¶
type Client interface { Add(name, password string) (address string, mnemonic string, err types.Error) Recover(name, password, mnemonic string) (address string, err types.Error) RecoverWithHDPath(name, password, mnemonic, hdPath string) (address string, err types.Error) Import(name, password, privKeyArmor string) (address string, err types.Error) Export(name, password string) (privKeyArmor string, err types.Error) Delete(name, password string) types.Error Show(name, password string) (string, types.Error) }
func NewKeysClient ¶
func NewKeysClient(cfg types.ClientConfig, keyManager types.KeyManager) Client
type KeyManager ¶
func (KeyManager) Delete ¶
func (k KeyManager) Delete(name, password string) error
func (KeyManager) Export ¶
func (k KeyManager) Export(name, password string) (armor string, err error)
func (KeyManager) Find ¶
func (k KeyManager) Find(name, password string) (tmcrypto.PubKey, types.AccAddress, error)
func (KeyManager) Insert ¶
func (k KeyManager) Insert(name, password string) (string, string, error)
Click to show internal directories.
Click to hide internal directories.