action

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Pending action is in the action pool but not executed by blockchain
	Pending actionState = iota
	// Executed action has been run and recorded on blockchain
	Executed
)

Variables

View Source
var ActionCmd = &cobra.Command{
	Use:   "action",
	Short: config.TranslateInLang(_actionCmdShorts, config.UILanguage),
}

ActionCmd represents the action command

View Source
var Stake2Cmd = &cobra.Command{
	Use:   "stake2",
	Short: config.TranslateInLang(_stake2CmdShorts, config.UILanguage),
}

Stake2Cmd represent stake2 command

View Source
var Xrc20Cmd = &cobra.Command{
	Use:   "xrc20",
	Short: config.TranslateInLang(_xrc20CmdShorts, config.UILanguage),
}

Xrc20Cmd represent xrc20 standard command-line

Functions

func Execute

func Execute(contract string, amount *big.Int, bytecode []byte) error

Execute sends signed execution transaction to blockchain

func ExecuteAndResponse

func ExecuteAndResponse(contract string, amount *big.Int, bytecode []byte) (*iotexapi.SendActionResponse, error)

ExecuteAndResponse sends signed execution transaction to blockchain and with response and error return. When --auth is supplied (registered on `contract invoke` only — never on `contract deploy`), the action is rebuilt as an EIP-7702 SetCodeTx and dispatched via the TX_CONTAINER path; in that case the helper handles its own output and returns (nil, nil) so the caller does not double-print.

func Match

func Match(in string, matchType string) string

Match returns human readable expression

func ParsedAuthList added in v2.4.2

func ParsedAuthList() ([]types.SetCodeAuthorization, error)

ParsedAuthList decodes the current --auth flag values into typed authorizations. Returns nil when the flag was not given — caller treats that as "stay on the legacy path".

func Read

func Read(contract address.Address, amount string, bytecode []byte) (string, error)

Read reads smart contract on IoTeX blockchain

func RegisterAuthFlags added in v2.4.2

func RegisterAuthFlags(cmd *cobra.Command)

RegisterAuthFlags registers --auth (repeatable) and --evm-chain-id on a write command that should accept EIP-7702 authorizations. Call after RegisterWriteCommand.

func RegisterWriteCommand

func RegisterWriteCommand(cmd *cobra.Command)

RegisterWriteCommand registers action flags for command

func SendAction

func SendAction(elp action.Envelope, signer string) error

SendAction sends signed action to blockchain

func SendActionAndResponse

func SendActionAndResponse(elp action.Envelope, signer string) (*iotexapi.SendActionResponse, error)

SendActionAndResponse sends signed action to blockchain with response and error return

func SendRaw

func SendRaw(selp *iotextypes.Action) error

SendRaw sends raw action to blockchain

func SendRawAndRespond

func SendRawAndRespond(selp *iotextypes.Action) (*iotexapi.SendActionResponse, error)

SendRawAndRespond sends raw action to blockchain with response and error return

func SignAndSendEthTx added in v2.4.2

func SignAndSendEthTx(signer string, build EthTxBuilder) error

SignAndSendEthTx is the shared write path for SetCodeTx (and any future modern-tx-type extension). The caller supplies a builder closure that constructs and signs a go-ethereum tx; this helper handles key loading, nonce / chain-id discovery, TX_CONTAINER wrapping, confirmation, and gRPC SendAction.

func Signer

func Signer() (address string, err error)

Signer returns signer's address

Types

type EthTxBuilder added in v2.4.2

type EthTxBuilder func(senderECKey *ecdsa.PrivateKey, nonce uint64, evmChainID *big.Int) (*types.Transaction, error)

EthTxBuilder constructs and signs a go-ethereum *types.Transaction.

func SetCodeTxBuilder added in v2.4.2

func SetCodeTxBuilder(to common.Address, value, gasPrice *big.Int, gasLimit uint64, data []byte, auths []types.SetCodeAuthorization) EthTxBuilder

SetCodeTxBuilder returns an EthTxBuilder that produces a signed EIP-7702 SetCodeTx. gasPrice is used for BOTH GasTipCap and GasFeeCap (the simplification keeps the existing --gas-price UX working for both legacy and SetCodeTx paths).

Jump to

Keyboard shortcuts

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