Documentation
¶
Index ¶
- Constants
- Variables
- func Execute(contract string, amount *big.Int, bytecode []byte) error
- func ExecuteAndResponse(contract string, amount *big.Int, bytecode []byte) (*iotexapi.SendActionResponse, error)
- func Match(in string, matchType string) string
- func ParsedAuthList() ([]types.SetCodeAuthorization, error)
- func Read(contract address.Address, amount string, bytecode []byte) (string, error)
- func RegisterAuthFlags(cmd *cobra.Command)
- func RegisterWriteCommand(cmd *cobra.Command)
- func SendAction(elp action.Envelope, signer string) error
- func SendActionAndResponse(elp action.Envelope, signer string) (*iotexapi.SendActionResponse, error)
- func SendRaw(selp *iotextypes.Action) error
- func SendRawAndRespond(selp *iotextypes.Action) (*iotexapi.SendActionResponse, error)
- func SignAndSendEthTx(signer string, build EthTxBuilder) error
- func Signer() (address string, err error)
- type EthTxBuilder
Constants ¶
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 ¶
var ActionCmd = &cobra.Command{ Use: "action", Short: config.TranslateInLang(_actionCmdShorts, config.UILanguage), }
ActionCmd represents the action command
var Stake2Cmd = &cobra.Command{ Use: "stake2", Short: config.TranslateInLang(_stake2CmdShorts, config.UILanguage), }
Stake2Cmd represent stake2 command
var Xrc20Cmd = &cobra.Command{ Use: "xrc20", Short: config.TranslateInLang(_xrc20CmdShorts, config.UILanguage), }
Xrc20Cmd represent xrc20 standard command-line
Functions ¶
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 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 RegisterAuthFlags ¶ added in v2.4.2
RegisterAuthFlags registers --auth (repeatable) and --evm-chain-id on a write command that should accept EIP-7702 authorizations. Call after RegisterWriteCommand.
func RegisterWriteCommand ¶
RegisterWriteCommand registers action flags for command
func SendAction ¶
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 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.
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).
Source Files
¶
- action.go
- actionclaim.go
- actiondeploy.go
- actiondeposit.go
- actioneth.go
- actionhash.go
- actioninvoke.go
- actionread.go
- actionsendraw.go
- actionsignauth.go
- actiontransfer.go
- stake2.go
- stake2Transfer.go
- stake2Withdraw.go
- stake2activate.go
- stake2add.go
- stake2change.go
- stake2create.go
- stake2endorse.go
- stake2migrate.go
- stake2reclaim.go
- stake2register.go
- stake2release.go
- stake2renew.go
- stake2transfer_ownership.go
- stake2update.go
- xrc20.go
- xrc20allowance.go
- xrc20approve.go
- xrc20balanceof.go
- xrc20const.go
- xrc20totalsupply.go
- xrc20transfer.go
- xrc20transferfrom.go