cmd

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigChainFileName = "config.yaml"
	DefaultWalletFileName      = "wallet.json"
)
View Source
const (
	OptionHash            = "hash"          // OptionHash hash passed to cmd
	OptionAmount          = "amount"        // OptionAmount amount passed to cmd
	OptionToken           = "token"         // OptionToken token in SAS passed to cmd
	OptionRetries         = "retries"       // OptionRetries retries
	OptionConfigFolder    = "path"          // OptionConfigFolder config folder
	OptionChainConfigFile = "chain_config"  // OptionChainConfigFile sdk config filename
	OptionMnemonic        = "mnemonic"      // OptionMnemonic bridge config filename
	OptionKeyPassword     = "password"      // OptionKeyPassword bridge config filename
	OptionAccountIndex    = "account_index" // OptionAccountIndex ethereum account index
	OptionAddressIndex    = "address_index" // OptionAddressIndex ethereum address index
	OptionBip32           = "bip32"         // OptionBip32 use bip32 derivation path
	OptionClientKey       = "client_key"
	OptionClientID        = "client_id"
	OptionEthereumAddress = "ethereum_address"
	OptionURL             = "url"
	OptionMinStake        = "min_stake"
	OptionMaxStake        = "max_stake"
	OptionNumDelegates    = "num_delegates"
	OptionServiceCharge   = "service_charge"
	OptionWalletFile      = "wallet"
)
View Source
const (
	DefaultRetries = 60
)

Variables

View Source
var CfmChainLength int
View Source
var VersionStr string

Functions

func AppendOptions added in v1.1.0

func AppendOptions(opts []*Option, command *cobra.Command)

func Execute

func Execute()

func ExitWithError

func ExitWithError(v ...interface{})

func GetAmount added in v1.0.4

func GetAmount(args []*Arg) uint64

func GetChainConfigFile added in v1.1.0

func GetChainConfigFile(args []*Arg) string

func GetClientID added in v1.2.0

func GetClientID(args []*Arg) string

func GetClientKey added in v1.2.0

func GetClientKey(args []*Arg) string

func GetConfigDir added in v1.1.0

func GetConfigDir() string

func GetConfigFolder added in v1.1.0

func GetConfigFolder(args []*Arg) string

func GetEthereumAddress added in v1.2.0

func GetEthereumAddress(args []*Arg) string

func GetHash added in v1.0.4

func GetHash(args []*Arg) string

func GetMaxStake added in v1.2.0

func GetMaxStake(args []*Arg) int64

func GetMinStake added in v1.2.0

func GetMinStake(args []*Arg) int64

func GetNumDelegates added in v1.2.0

func GetNumDelegates(args []*Arg) int

func GetRetries added in v1.1.0

func GetRetries(args []*Arg) int

func GetServiceCharge added in v1.2.0

func GetServiceCharge(args []*Arg) float64

func GetToken added in v1.1.4

func GetToken(args []*Arg) float64

func GetURL added in v1.2.0

func GetURL(args []*Arg) string

func GetWalletFile added in v1.2.0

func GetWalletFile(args []*Arg) string

func InstallDLLs added in v1.10.0

func InstallDLLs()

func PrintError added in v1.0.2

func PrintError(v ...interface{})

func VerifyEthereumTransaction added in v1.0.4

func VerifyEthereumTransaction(args ...*Arg)

func WithoutWallet added in v1.1.4

func WithoutWallet(c *cobra.Command) *cobra.Command

WithoutWallet wallet information is unnecessary for this command. ~/.zcn/wallet.json will not be checked

func WithoutZCNCore added in v1.1.4

func WithoutZCNCore(c *cobra.Command) *cobra.Command

WithoutZCNCore zcncore package is unnecessary for this command. it will be asked to initialize zcncore via zcncore.Init

Types

type Arg added in v1.0.4

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

type Command added in v1.0.4

type Command func(...*Arg)

type CommandWithBridge added in v1.1.0

type CommandWithBridge func(*zcnbridge.BridgeClient, ...*Arg)

type OnJSONInfoCb added in v1.0.2

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

func NewJSONInfoCB added in v1.0.2

func NewJSONInfoCB(val interface{}) (cb *OnJSONInfoCb)

func (*OnJSONInfoCb) OnInfoAvailable added in v1.0.2

func (ojsonic *OnJSONInfoCb) OnInfoAvailable(op int, status int,
	info string, errMsg string)

func (*OnJSONInfoCb) Waiting added in v1.0.2

func (ojsonic *OnJSONInfoCb) Waiting() (err error)

Wait for info.

type Option added in v1.0.4

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

func WithAmount added in v1.1.0

func WithAmount(usage string) *Option

func WithHash added in v1.1.0

func WithHash(usage string) *Option

func WithRetries added in v1.1.0

func WithRetries(usage string) *Option

func WithToken added in v1.1.4

func WithToken(usage string) *Option

type StatusBar

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

type ZCNStatus

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

func NewZCNStatus added in v1.0.2

func NewZCNStatus() (zcns *ZCNStatus)

func (*ZCNStatus) Begin added in v1.0.2

func (zcns *ZCNStatus) Begin()

func (*ZCNStatus) OnAuthComplete

func (zcn *ZCNStatus) OnAuthComplete(t *zcncore.Transaction, status int)

func (*ZCNStatus) OnAuthorizeSendComplete

func (zcn *ZCNStatus) OnAuthorizeSendComplete(status int, toClienID string, val int64, desc string, creationDate int64, signature string)

func (*ZCNStatus) OnBalanceAvailable

func (zcn *ZCNStatus) OnBalanceAvailable(status int, value int64, info string)

func (*ZCNStatus) OnInfoAvailable

func (zcn *ZCNStatus) OnInfoAvailable(Op int, status int, config string, err string)

func (*ZCNStatus) OnNonceAvailable added in v1.1.2

func (zcn *ZCNStatus) OnNonceAvailable(status int, nonce int64, info string)

func (*ZCNStatus) OnSetupComplete

func (zcn *ZCNStatus) OnSetupComplete(status int, err string)

func (*ZCNStatus) OnTransactionComplete

func (zcn *ZCNStatus) OnTransactionComplete(t *zcncore.Transaction, status int)

func (*ZCNStatus) OnVerifyComplete

func (zcn *ZCNStatus) OnVerifyComplete(t *zcncore.Transaction, status int)

func (*ZCNStatus) OnVoteComplete

func (zcn *ZCNStatus) OnVoteComplete(status int, proposal string, err string)

OnVoteComplete callback when a multisig vote is completed

func (*ZCNStatus) OnWalletCreateComplete

func (zcn *ZCNStatus) OnWalletCreateComplete(status int, wallet string, err string)

func (*ZCNStatus) Wait added in v1.0.2

func (zcns *ZCNStatus) Wait()

Jump to

Keyboard shortcuts

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