Documentation ¶
Index ¶
- Constants
- func ConvertLocalKeyInfo(key *types.KeyInfo) *crypto.KeyInfo
- func ConvertRemoteKeyInfo(key *crypto.KeyInfo) *types.KeyInfo
- func GetKeyType(p address.Protocol) types.KeyType
- func SetupRemoteWallet(info string) (wallet.WalletIntersection, error)
- type APIInfo
- type IWallet
- type WalletAPIAdapter
- func (c *WalletAPIAdapter) WalletDelete(ctx context.Context, addr address.Address) error
- func (c *WalletAPIAdapter) WalletExport(ctx context.Context, a address.Address) (*types.KeyInfo, error)
- func (c *WalletAPIAdapter) WalletHas(ctx context.Context, addr address.Address) (bool, error)
- func (c *WalletAPIAdapter) WalletImport(ctx context.Context, ki *types.KeyInfo) (address.Address, error)
- func (c *WalletAPIAdapter) WalletList(ctx context.Context) ([]address.Address, error)
- func (c *WalletAPIAdapter) WalletNew(ctx context.Context, keyType types.KeyType) (address.Address, error)
- func (c *WalletAPIAdapter) WalletSign(ctx context.Context, signer address.Address, toSign []byte, meta types.MsgMeta) (*wallet.Signature, error)
Constants ¶
View Source
const ( ServiceToken = "Authorization" WalletStrategyToken = "StrategyToken" )
Variables ¶
This section is empty.
Functions ¶
func GetKeyType ¶
func SetupRemoteWallet ¶
func SetupRemoteWallet(info string) (wallet.WalletIntersection, error)
Types ¶
type APIInfo ¶ added in v0.9.7
APIInfo parse URL string to
func ParseAPIInfo ¶ added in v0.9.7
func (APIInfo) AuthHeader ¶ added in v0.9.7
type IWallet ¶ added in v0.9.7
type IWallet interface { WalletNew(context.Context, types.KeyType) (address.Address, error) WalletHas(ctx context.Context, address address.Address) (bool, error) WalletList(ctx context.Context) ([]address.Address, error) WalletSign(ctx context.Context, signer address.Address, toSign []byte, meta types.MsgMeta) (*wallet.Signature, error) WalletExport(ctx context.Context, addr address.Address) (*types.KeyInfo, error) WalletImport(context.Context, *types.KeyInfo) (address.Address, error) WalletDelete(context.Context, address.Address) error }
func NewWalletRPC ¶ added in v0.9.7
func NewWalletRPC(ctx context.Context, addr string, requestHeader http.Header) (IWallet, jsonrpc.ClientCloser, error)
NewWalletRPC RPCClient returns an RPC client connected to a node @addr reference ./httpparse/ParseApiInfo() @requestHeader reference ./httpparse/ParseApiInfo()
type WalletAPIAdapter ¶ added in v0.9.7
type WalletAPIAdapter struct { Internal struct { WalletNew func(ctx context.Context, kt types.KeyType) (address.Address, error) `perm:"admin"` WalletHas func(ctx context.Context, address address.Address) (bool, error) `perm:"write"` WalletList func(ctx context.Context) ([]address.Address, error) `perm:"write"` WalletSign func(ctx context.Context, signer address.Address, toSign []byte, meta types.MsgMeta) (*wallet.Signature, error) `perm:"sign"` WalletExport func(ctx context.Context, addr address.Address) (*types.KeyInfo, error) `perm:"admin"` WalletImport func(ctx context.Context, ki *types.KeyInfo) (address.Address, error) `perm:"admin"` WalletDelete func(ctx context.Context, addr address.Address) error `perm:"admin"` } }
wallet API permissions constraints
func (*WalletAPIAdapter) WalletDelete ¶ added in v0.9.7
func (c *WalletAPIAdapter) WalletDelete(ctx context.Context, addr address.Address) error
func (*WalletAPIAdapter) WalletExport ¶ added in v0.9.7
func (*WalletAPIAdapter) WalletHas ¶ added in v0.9.7
func (c *WalletAPIAdapter) WalletHas(ctx context.Context, addr address.Address) (bool, error)
func (*WalletAPIAdapter) WalletImport ¶ added in v0.9.7
func (*WalletAPIAdapter) WalletList ¶ added in v0.9.7
func (c *WalletAPIAdapter) WalletList(ctx context.Context) ([]address.Address, error)
Click to show internal directories.
Click to hide internal directories.