wserver

package
Version: v0.0.0-...-ce5937e Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API wallet

func NewAPI

func NewAPI(cfg *config.Config, wSvr *WalletServer) *API

NewAPI api make

func (*API) CreateWallet

func (api *API) CreateWallet(seed string, walletPass string, unlockPass string) error

CreateWallet wallet by seed

func (*API) MakeSeed

func (api *API) MakeSeed() (*ResSeed, error)

MakeSeed wallet HD seed and mnemonic

func (*API) OpenWallet

func (api *API) OpenWallet(pass string) error

OpenWallet load wallet and open

func (*API) RecoverWallet

func (api *API) RecoverWallet(mnemonic string, walletPass string, unlockPass string) error

RecoverWallet wallet by mnemonic

func (*API) WalletStatus

func (api *API) WalletStatus() (status *ResStatus, err error)

WalletStatus wallet info

type ResSeed

type ResSeed struct {
	Seed     string `json:"seed"`
	Mnemonic string `json:"mnemonic"`
}

ResSeed make seed

type ResStatus

type ResStatus struct {
	Stats string `json:"stats"` //err,nil,closed,lock,unlock
}

ResStatus

type WalletServer

type WalletServer struct {
	WtLoader *wallet.Loader
	Wt       *wallet.Wallet

	RPCSvr *server.RpcServer

	QitmeerdStatus *qJson.InfoNodeResult
	// contains filtered or unexported fields
}

WalletServer wallet api server

func NewWalletServer

func NewWalletServer(cfg *config.Config) (wSvr *WalletServer, err error)

NewWalletServer make a wallet api server

func (*WalletServer) HandleAPI

func (wSvr *WalletServer) HandleAPI(ResW http.ResponseWriter, r *http.Request, ps httprouter.Params)

HandleAPI RPC Method

func (*WalletServer) OpenWallet

func (wSvr *WalletServer) OpenWallet(pass string) error

OpenWallet load wallet and start rpc

func (*WalletServer) RegAPI

func (wSvr *WalletServer) RegAPI()

RegAPI if wallet open

func (*WalletServer) Start

func (wSvr *WalletServer) Start() error

Start server

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL