cli

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: GPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnitETH = "ETH"
	UnitWEI = "WEI"

	// UnitList is array for Unit string
	// UnitList = []string{"Wei", "Ada", "Babbage", "Shannon", "Szabo", "Finney", "Ether", "Einstein", "Douglas", "Gwei"}
	UnitList []string

	// UnitString is for Unit string
	// UnitString = "Available unit: Wei, Ada, Babbage, Shannon, Szabo, Finney, Ether, Einstein, Douglas, Gwei"
	UnitString string
)

Unit

View Source
var (
	// ModeERC20 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
	ModeERC20 = "ERC20"
	// ModeERC721 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
	ModeERC721 = "ERC721"

	// UnitList is array for Unit string
	// UnitList = []string{"Wei", "Ada", "Babbage", "Shannon", "Szabo", "Finney", "Ether", "Einstein", "Douglas", "Gwei"}
	ModeERCList []string
)
View Source
var GasFail = "failed to estimate gas needed: gas required exceeds allowance or always failing transaction"

GasFail GasFail info from SuggestGasPrice

View Source
var IsDecimalString = regexp.MustCompile(`^[1-9]\d*$|^0$|^0\.\d*$|^[1-9](\d)*\.(\d)*$`).MatchString

IsDecimalString Check whether amount string is legal amount

View Source
var MinterRole = crypto.Keccak256([]byte("MINTER_ROLE")) // 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6}
View Source
var TxFailAlways = "This is a transaction that will always fail. Please check contract and parameters again."

TxFailAlways Replacement information GasFail

Functions

func InitERC

func InitERC(bc BlockChain)

func InitRPCUrl

func InitRPCUrl(bc BlockChain)

func InitUnit

func InitUnit(bc BlockChain)

func NewBatchKeyedTransactorByAccount

func NewBatchKeyedTransactorByAccount(wallet *keystore.KeyStore, account accounts.Account, networkID *big.Int) *bind.TransactOpts

func NewKeyedTransactor

func NewKeyedTransactor(key *ecdsa.PrivateKey, networkID *big.Int) *bind.TransactOpts

NewKeyedTransactor is a utility method to easily create a transaction signer from a single private key.

func NewKeyedTransactorByAccount

func NewKeyedTransactorByAccount(wallet *keystore.KeyStore, account accounts.Account, passphrase string, networkID *big.Int) *bind.TransactOpts

func NewTransactor

func NewTransactor(keyin io.Reader, passphrase string, networkID *big.Int) (*bind.TransactOpts, error)

NewTransactor is a utility method to easily create a transaction signer from an encrypted json key stream and the associated passphrase.

func TestCLIVersion

func TestCLIVersion(t *testing.T)

TestCLIVersion test cli version

Types

type BlockChain

type BlockChain int

BlockChain type

const (
	UnknownChain BlockChain = iota
	NewChain
	Ethereum
)

func (BlockChain) Init

func (bc BlockChain) Init()

func (BlockChain) String

func (bc BlockChain) String() string

type CLI

type CLI struct {
	Name string

	SimpleToken SimpleToken
	// contains filtered or unexported fields
}

CLI represents a command-line interface. This class is not threadsafe.

func NewCLI

func NewCLI() *CLI

NewCLI returns an initialized CLI

func (*CLI) BuildClient

func (cli *CLI) BuildClient() error

BuildClient BuildClient

func (*CLI) Deploy

func (cli *CLI) Deploy(address, name, symbol, baseTokenURI string, decimals uint8, totalSupply *big.Int)

Deploy deploy contract

func (*CLI) Embeddable

func (cli *CLI) Embeddable() *CLI

Embeddable returns a CLI that you can embed into your own Go programs. This is not thread-safe.

func (*CLI) Execute

func (cli *CLI) Execute()

Execute parses the command line and processes it.

func (*CLI) GetSimpleToken

func (cli *CLI) GetSimpleToken() (SimpleToken, error)

GetSimpleToken GetSimpleToken

func (*CLI) Run

func (cli *CLI) Run(args ...string) string

Run executes CLI with the given arguments. Used for testing. Not thread safe.

func (*CLI) SetPassword

func (cli *CLI) SetPassword(_passPhrase string) *CLI

SetPassword SetPassword

func (*CLI) TestCommand

func (cli *CLI) TestCommand(command string) string

TestCommand test command

type SimpleToken

type SimpleToken interface {
	// Name returns the name of the token
	Name(opts *bind.CallOpts) (string, error)

	// Symbol returns the symbol of the token
	Symbol(opts *bind.CallOpts) (string, error)

	// TotalSupply returns the total token supply
	TotalSupply(opts *bind.CallOpts) (*big.Int, error)

	// BalanceOf returns the account balance of another account with address owner
	BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error)
}

SimpleToken simpleToken interface

Jump to

Keyboard shortcuts

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