wallet

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountID    = "accountID"
	AccountIndex = "index"
)

Variables

This section is empty.

Functions

func InitTxRouterWithWallet

func InitTxRouterWithWallet(r util.TxRouter, wallet Wallet)

Types

type Account

type Account struct {
	*util.FabricClientBase
	// contains filtered or unexported fields
}

func (*Account) Create

func (s *Account) Create(rw web.ResponseWriter, req *web.Request)

func (*Account) Delete

func (s *Account) Delete(rw web.ResponseWriter, req *web.Request)

func (*Account) ExportKey

func (s *Account) ExportKey(rw web.ResponseWriter, req *web.Request)

func (*Account) ImportKey

func (s *Account) ImportKey(rw web.ResponseWriter, req *web.Request)

func (*Account) List

func (s *Account) List(rw web.ResponseWriter, req *web.Request)

func (*Account) LoadPrivKey

func (s *Account) LoadPrivKey() (crypto.Signer, error)

func (*Account) ParseParameters

func (s *Account) ParseParameters(rw web.ResponseWriter,
	req *web.Request, next web.NextMiddlewareFunc)

func (*Account) PublicKeyToAddress

func (s *Account) PublicKeyToAddress(rw web.ResponseWriter, req *web.Request)

func (*Account) Query

func (s *Account) Query(rw web.ResponseWriter, req *web.Request)

func (*Account) QueryChild

func (s *Account) QueryChild(rw web.ResponseWriter, req *web.Request)

func (*Account) SetPersistFlag

func (s *Account) SetPersistFlag(f bool)

func (*Account) Update

func (s *Account) Update(rw web.ResponseWriter, req *web.Request)

type AccountRouter

type AccountRouter struct {
	*web.Router
}

func CreateAccountRouter

func CreateAccountRouter(root *web.Router, path string) AccountRouter

func (AccountRouter) BuildPrivkeyRoutes

func (r AccountRouter) BuildPrivkeyRoutes()

func (AccountRouter) BuildRoutes

func (r AccountRouter) BuildRoutes()

func (AccountRouter) Init

func (r AccountRouter) Init(wallet Wallet) AccountRouter

type Wallet

type Wallet interface {

	// Create private key
	// NewPrivKey(accountID string) (*abcrypto.PrivateKey, error)
	NewPrivKey(accountID string) (abcrypto.Signer, error)

	// Import private key
	ImportPrivKey(accountID string, privkey string) error

	// Import private key
	// ImportPrivateKey(accountID string, privkey *abcrypto.PrivateKey) error
	ImportPrivateKey(accountID string, privkey abcrypto.Signer) error

	// Load private key
	// LoadPrivKey(accountID string) (*abcrypto.PrivateKey, error)
	LoadPrivKey(accountID string) (abcrypto.Signer, error)

	// Remove private key
	RemovePrivKey(accountID string) error

	// Rename account id
	Rename(old string, new string) error

	// List all private keys
	// ListAll() (map[string]*abcrypto.PrivateKey, error)
	ListAll() (map[string]abcrypto.Signer, error)

	// Read private keys from file
	Load() error

	// Write private keys to file
	Persist() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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