func (p *walletAPI) Lock() error {
	_, err := p.rpcClient.CallAPI("lock", types.EmptyParams)
	return err
}
Lock locks the wallet
package bitshares
import (
	"fmt"
	"github.com/denkhaus/bitshares/api"
	"github.com/denkhaus/bitshares/config"
	"github.com/denkhaus/bitshares/types"
	"github.com/denkhaus/logging"
	"github.com/juju/errors"
	"github.com/pquerna/ffjson/ffjson"
)
type WalletAPI interface {
	Close() error
	Connect() error
	GetBlock(number uint64) (*types.Block, error)
	GetRelativeAccountHistory(account types.GrapheneObject, stop int64, limit int, start int64) (types.OperationRelativeHistories, error)
	GetDynamicGlobalProperties() (*types.DynamicGlobalProperties, error)
	BorrowAsset(account types.GrapheneObject, amountToBorrow string, symbolToBorrow types.GrapheneObject, amountOfCollateral string, broadcast bool) (*types.SignedTransaction, error)
	Buy(account types.GrapheneObject, base, quote types.GrapheneObject, rate string, amount string, broadcast bool) (*types.SignedTransaction, error)
	BuyEx(account types.GrapheneObject, base, quote types.GrapheneObject, rate float64, amount float64, broadcast bool) (*types.SignedTransaction, error)
	CancelOrder(orderID types.GrapheneObject, broadcast bool) (*types.SignedTransaction, error)
	Info() (*types.Info, error)
	IsLocked() (bool, error)
	ListAccountBalances(account types.GrapheneObject) (types.AssetAmounts, error)
	Lock() error
	ReadMemo(memo *types.Memo) (string, error)
	Sell(account types.GrapheneObject, base, quote types.GrapheneObject, rate string, amount string, broadcast bool) (*types.SignedTransaction, error)
	SellEx(account types.GrapheneObject, base, quote types.GrapheneObject, rate float64, amount float64, broadcast bool) (*types.SignedTransaction, error)
	SellAsset(account types.GrapheneObject, amountToSell string, symbolToSell types.GrapheneObject, minToReceive string, symbolToReceive types.GrapheneObject, timeout uint32, fillOrKill bool, broadcast bool) (*types.SignedTransaction, error)
	SignTransaction(tx *types.SignedTransaction, broadcast bool) (*types.SignedTransaction, error)
	SerializeTransaction(tx *types.SignedTransaction) (string, error)
	Unlock(password string) error
}
func NewWalletAPI(rpcEndpointURL string) WalletAPI {
	api := &walletAPI{
		rpcClient: api.NewRPCClient(rpcEndpointURL),
	}
	return api
}
type walletAPI struct {
	rpcClient api.RPCClient
}
func (p *walletAPI) Connect() error {
	if err := p.rpcClient.Connect(); err != nil {
		return errors.Annotate(err, "Connect [rpc]")
	}
	info, err := p.Info()
	if err != nil {
		return errors.Annotate(err, "Info")
	}
	if err := config.SetCurrent(info.ChainID.String()); err != nil {
		return errors.Annotate(err, "SetCurrent")
	}
	return nil
}
func (p *walletAPI) Close() error {
	if p.rpcClient != nil {
		if err := p.rpcClient.Close(); err != nil {
			return errors.Annotate(err, "Close [rpc]")
		}
		p.rpcClient = nil
	}
	return nil
}