wallet

package
v1.3.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ZCNSCSmartContractAddress = "6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712e0"
	AddAuthorizerFunc         = "AddAuthorizer"
	DeleteAuthorizerFunc      = "DeleteAuthorizer"
	MintFunc                  = "mint"
	BurnFunc                  = "burn"
	// ConsensusThresh quorum required to reach consensus
	ConsensusThresh      = float64(70.0)
	BurnWzcnTicketPath   = "/v1/ether/burnticket/get"
	BurnNativeTicketPath = "/v1/0chain/burnticket/get"
)

Variables

This section is empty.

Functions

func Balance

func Balance(ctx context.Context) (int64, error)

Balance responds balance of the wallet that used.

NOTE: for using Balance you must set wallet info by running zcncore.SetWalletInfo.

Types

type Config

type Config interface {
	// LogDir returns directory to store logs.
	LogDir() string

	// LogLvl returns level of logs.
	LogLvl() string

	// BlockWorker returns address of dns server.
	BlockWorker() string

	// SignatureScheme returns signature scheme.
	SignatureScheme() string
}

Config represents config interface used for setup wallet.

type EthereumWallet

type EthereumWallet struct {
	PublicKey  *ecdsa.PublicKey
	PrivateKey *ecdsa.PrivateKey
	Address    common.Address
}

func NewEthereumWallet

func NewEthereumWallet() (*EthereumWallet, error)

type Wallet

type Wallet struct {
	ZCNWallet *zcncrypto.Wallet
}

Wallet represents a wallet that stores keys and additional info.

func CreateWallet

func CreateWallet(publicKey, privateKey []byte) *Wallet

CreateWallet creates initialized Wallet.

func NewZCNWallet

func NewZCNWallet() (*Wallet, error)

func (*Wallet) ID

func (w *Wallet) ID() string

ID returns the client id.

NOTE: client id represents hex encoded SHA3-256 hash of the raw public key.

func (*Wallet) PublicKey

func (w *Wallet) PublicKey() string

PublicKey returns the public key.

func (*Wallet) RegisterToMiners

func (w *Wallet) RegisterToMiners() error

RegisterToMiners registers wallet to the miners by executing zcncore.RegisterToMiners.

func (*Wallet) StringJSON

func (w *Wallet) StringJSON() (string, error)

StringJSON returns marshalled to JSON string Wallet.ZCNWallet.

Jump to

Keyboard shortcuts

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