src

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TransactionCommand = cli.Command{
		Name:  "transaction",
		Usage: "do things with a transaction",
		Subcommands: []cli.Command{
			{
				Action:    CancelTransaction,
				Name:      "cancel",
				Usage:     "cancel txid",
				ArgsUsage: "<tx id>",
				Flags: []cli.Flag{
					connectionFlag,
					transactionFlag,
					timeoutFlag,
					passphraseFlag,
					privatekeyFlag,
					gaspriceFlag,
				},
				Description: `Cancel a transaction.`,
			},
			{
				Action:    UpTransaction,
				Name:      "up",
				Usage:     "up gas for a txid",
				ArgsUsage: "<tx id>",
				Flags: []cli.Flag{
					connectionFlag,
					transactionFlag,
					timeoutFlag,
					passphraseFlag,
					privatekeyFlag,
					gaspriceFlag,
				},
				Description: `Up a transaction.`,
			},
		},
	}
)

Functions

func CancelTransaction

func CancelTransaction(ctx *cli.Context) error

CancelTransaction will cancel a transaction based on the tx and pk

func EstimateGas

func EstimateGas(fromAddress common.Address, toAddress *common.Address, amount *big.Int, data []byte) (gas uint64, err error)

EstimateGas will estimate the gas cost

func GetNextNonce

func GetNextNonce(address common.Address) (nextNonce uint64, err error)

GetNextNonce Will get the next nonce for the account

func GetValidTXGasPrice

func GetValidTXGasPrice(ctx *cli.Context) (validTX *types.Transaction, gasprice int64, err error)

func LocalContext

func LocalContext() (context.Context, context.CancelFunc)

func NewTransaction

func NewTransaction(fromAddress common.Address, toAddress *common.Address, amount *big.Int, gasLimit uint64, data []byte) (tx *types.Transaction, err error)

NewTransaction will create a unsigned transaction

func NewTransactionSigned

func NewTransactionSigned(fromAddress common.Address, toAddress *common.Address, amount *big.Int, data []byte) (signedTx *types.Transaction, err error)

NewTransactionSigned creates a new transaction and signs it

func PendingNonceAt

func PendingNonceAt(address common.Address) (currentNonce uint64, err error)

PendingNonceAt will get the next pending nonce

func ProcessValidTXAndGas

func ProcessValidTXAndGas(validTX *types.Transaction, gasprice int64, minGasPrice *big.Int, cmdStr string) error

func TxFrom

func TxFrom(tx *types.Transaction) (address common.Address, err error)

func UpTransaction

func UpTransaction(ctx *cli.Context) error

UpTransaction will up the gas for transaction based on the tx and pk

Types

This section is empty.

Jump to

Keyboard shortcuts

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