personal

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 License: MPL-2.0 Imports: 13 Imported by: 0

README

personal

This package contains Status integraton with personal_* RPC APIs more information on these APIs can be found on the Ethereum Wiki: https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal

In web3.js these methods are located in web3.personal namespace.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidPersonalSignAccount is returned when the account passed to
	// personal_sign isn't equal to the currently selected account.
	ErrInvalidPersonalSignAccount = errors.New("invalid account as only the selected one can generate a signature")

	// ErrSignInvalidNumberOfParameters is returned when the number of parameters for personal_sign
	// is not valid.
	ErrSignInvalidNumberOfParameters = errors.New("invalid number of parameters for personal_sign (2 or 3 expected)")
)

Functions

This section is empty.

Types

type PublicAPI

type PublicAPI struct {
	// contains filtered or unexported fields
}

PublicAPI represents a set of APIs from the `web3.personal` namespace.

func NewAPI

func NewAPI(pendingSignRequests *sign.PendingRequests) *PublicAPI

NewAPI creates an instance of the personal API.

func (*PublicAPI) Recover

func (api *PublicAPI) Recover(context context.Context, rpcParams ...interface{}) (interface{}, error)

Recover is an implementation of `personal_ecRecover` or `web3.personal.ecRecover` API

func (*PublicAPI) SetRPC

func (api *PublicAPI) SetRPC(rpcClient *rpc.Client, timeout time.Duration)

SetRPC sets RPC params (client and timeout) for the API calls.

func (*PublicAPI) Sign

func (api *PublicAPI) Sign(context context.Context, rpcParams ...interface{}) (interface{}, error)

Sign is an implementation of `personal_sign` or `web3.personal.sign` API

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service represents out own implementation of personal sign operations.

func New

func New(am *accounts.Manager) *Service

New returns a new Service.

func (*Service) APIs

func (s *Service) APIs() []rpc.API

APIs returns a list of new APIs.

func (*Service) Protocols

func (s *Service) Protocols() []p2p.Protocol

Protocols returns a new protocols list. In this case, there are none.

func (*Service) Start

func (s *Service) Start(server *p2p.Server) error

Start is run when a service is started. It does nothing in this case but is required by `node.Service` interface.

func (*Service) Stop

func (s *Service) Stop() error

Stop is run when a service is stopped. It does nothing in this case but is required by `node.Service` interface.

Jump to

Keyboard shortcuts

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