cli

package
v0.0.0-...-0b06f50 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: BSD-3-Clause Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TxFlags struct {
	URI           string
	MainnetURI    string
	ContractAddr  string
	ChainID       string
	PrivFile      string
	HsmConfigFile string
	Algo          string
	CallerChainID string
}

Functions

func AddContractCallFlags

func AddContractCallFlags(flagSet *flag.FlagSet, callFlags *ContractCallFlags)

AddContractCallFlags adds flags to the given flag set that are used when calling a mutable method on a Go contract.

func AddContractStaticCallFlags

func AddContractStaticCallFlags(flagSet *flag.FlagSet, callFlags *ContractCallFlags)

AddContractStaticCallFlags adds flags to the given flag set that are used when calling a static method on a Go contract.

func CallContract

func CallContract(defaultAddr string, method string, params proto.Message, result interface{}) error

func CallContractWithFlags

func CallContractWithFlags(callFlags *ContractCallFlags, defaultAddr string, method string, params proto.Message, result interface{}) error

func ContractCallCommand

func ContractCallCommand(name string) *cobra.Command

ContractCallCommand is deprecated in favor of CallContractWithFlags / StaticCallContractWithFlags

func ContractResolveCommand

func ContractResolveCommand() *cobra.Command

func GetSigner

func GetSigner(privFile, hsmConfigFile, algo string) (auth.Signer, error)

func ParseAddress

func ParseAddress(s, chainID string) (diadem.Address, error)

ParseAddress attempts to parse the given string into an address, if the resulting address doesn't have a chain ID the given chain ID will be used instead.

func ParseAmount

func ParseAmount(s string) (*diadem.BigUInt, error)

func ParseBytes

func ParseBytes(s string) ([]byte, error)

func ResolveAccountAddress

func ResolveAccountAddress(address string, chainFlags *ContractCallFlags) (diadem.Address, error)

ResolveAccountAddress attempts to parse the given string into the address of a user account. If the chain ID on the parsed address doesn't match the chain ID specified in chainFlags then the address is resolved to an on-chain address via the address mapper.

func ResolveAddress

func ResolveAddress(s, chainID, URI string) (diadem.Address, error)

ResolveAddress attempts to parse the given string into an address, if that fails it assumes the string corresponds to a contract name and attempts to obtain the corresponding contract address.

func ResolveContract

func ResolveContract(callFlags *ContractCallFlags, defaultAddr string) (*client.Contract, error)

func StaticCallContract

func StaticCallContract(defaultAddr string, method string, params proto.Message, result interface{}) error

func StaticCallContractWithFlags

func StaticCallContractWithFlags(callFlags *ContractCallFlags, defaultAddr string, method string, params proto.Message, result interface{}) error

Types

type ContractCallFlags

type ContractCallFlags struct {
	URI           string
	ContractAddr  string
	ChainID       string
	PrivFile      string
	HsmConfigFile string
	Algo          string
}

Jump to

Keyboard shortcuts

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