Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateIntrinsicGas(baseIntrinsicGas uint64, payloadGas uint64, payloadSize uint64) (uint64, error)
- func CheckSpecialAddress(act Action) bool
- func CheckTransferAddress(act Action) error
- func DecodeEtherTx(rawData string) (*types.Transaction, error)
- func EffectiveGasTip(tx TxDynamicGas, baseFee *big.Int) (*big.Int, error)
- func EthRawToContainer(chainID uint32, rawString string) (*iotextypes.ActionCore, error)
- func ExtractTypeSigPubkey(tx *types.Transaction) (iotextypes.Encoding, []byte, crypto.PublicKey, error)
- func FromProtoBlobTxSideCar(pb *iotextypes.BlobTxSidecar) (*types.BlobTxSidecar, error)
- func IsSystemAction(act *SealedEnvelope) bool
- func IsValidCandidateName(s string) bool
- func LoadErrorDescription(err error) string
- func MsgHash(sigType string, msg []byte) ([]byte, error)
- func NewConsignJSON(sigType, recipient, sig string, bucketIdx, nonce uint64) ([]byte, error)
- func NewConsignMsg(sigType, recipient string, bucketIdx, nonce uint64) ([]byte, error)
- func NewEthSigner(txType iotextypes.Encoding, chainID uint32) (types.Signer, error)
- func RawTxToSignedTx(rawTx *types.Transaction, signer types.Signer, sig []byte) (*types.Transaction, error)
- func RecoverPubkeyFromEccSig(sigType string, msg, sig []byte) (crypto.PublicKey, error)
- func ToProtoSideCar(sidecar *types.BlobTxSidecar) *iotextypes.BlobTxSidecar
- type AbstractAction
- func (act *AbstractAction) BasicActionSize() uint32
- func (act *AbstractAction) ChainID() uint32
- func (act *AbstractAction) Gas() uint64
- func (act *AbstractAction) GasFeeCap() *big.Int
- func (act *AbstractAction) GasPrice() *big.Int
- func (act *AbstractAction) GasTipCap() *big.Int
- func (act *AbstractAction) Nonce() uint64
- func (act *AbstractAction) SanityCheck() error
- func (act *AbstractAction) SetGasLimit(val uint64)
- func (act *AbstractAction) SetGasPrice(val *big.Int)
- func (act *AbstractAction) SetNonce(val uint64)
- type AccessListTx
- func (tx *AccessListTx) AccessList() types.AccessList
- func (tx *AccessListTx) BlobGas() uint64
- func (tx *AccessListTx) BlobGasFeeCap() *big.Int
- func (tx *AccessListTx) BlobHashes() []common.Hash
- func (tx *AccessListTx) BlobTxSidecar() *types.BlobTxSidecar
- func (tx *AccessListTx) ChainID() uint32
- func (tx *AccessListTx) EffectiveGasPrice(_ *big.Int) *big.Int
- func (tx *AccessListTx) Gas() uint64
- func (tx *AccessListTx) GasFeeCap() *big.Int
- func (tx *AccessListTx) GasPrice() *big.Int
- func (tx *AccessListTx) GasTipCap() *big.Int
- func (tx *AccessListTx) Nonce() uint64
- func (tx *AccessListTx) SanityCheck() error
- func (tx *AccessListTx) TxType() uint32
- type Action
- type BlobTx
- func (tx *BlobTx) AccessList() types.AccessList
- func (tx *BlobTx) BlobGas() uint64
- func (tx *BlobTx) BlobGasFeeCap() *big.Int
- func (tx *BlobTx) BlobHashes() []common.Hash
- func (tx *BlobTx) BlobTxSidecar() *types.BlobTxSidecar
- func (tx *BlobTx) ChainID() uint32
- func (tx *BlobTx) EffectiveGasPrice(baseFee *big.Int) *big.Int
- func (tx *BlobTx) Gas() uint64
- func (tx *BlobTx) GasFeeCap() *big.Int
- func (tx *BlobTx) GasPrice() *big.Int
- func (tx *BlobTx) GasTipCap() *big.Int
- func (tx *BlobTx) Nonce() uint64
- func (tx *BlobTx) ProtoForRawHash() *iotextypes.ActionCore
- func (tx *BlobTx) SanityCheck() error
- func (tx *BlobTx) TxType() uint32
- func (tx *BlobTx) ValidateSidecar() error
- type BlobTxData
- type Builder
- type CandidateActivate
- func (cr *CandidateActivate) BucketID() uint64
- func (cr *CandidateActivate) EthData() ([]byte, error)
- func (CandidateActivate) EthTo() (*common.Address, error)
- func (cr *CandidateActivate) FillAction(act *iotextypes.ActionCore)
- func (cr *CandidateActivate) IntrinsicGas() (uint64, error)
- func (cr *CandidateActivate) LoadProto(pbAct *iotextypes.CandidateActivate) error
- func (cr *CandidateActivate) Proto() *iotextypes.CandidateActivate
- func (cr *CandidateActivate) SanityCheck() error
- func (CandidateActivate) Value() *big.Int
- type CandidateEndorsement
- func (act *CandidateEndorsement) BucketIndex() uint64
- func (act *CandidateEndorsement) EthData() ([]byte, error)
- func (CandidateEndorsement) EthTo() (*common.Address, error)
- func (act *CandidateEndorsement) FillAction(core *iotextypes.ActionCore)
- func (act *CandidateEndorsement) IntrinsicGas() (uint64, error)
- func (act *CandidateEndorsement) IsLegacy() bool
- func (act *CandidateEndorsement) LoadProto(pbAct *iotextypes.CandidateEndorsement) error
- func (act *CandidateEndorsement) Op() CandidateEndorsementOp
- func (act *CandidateEndorsement) Proto() *iotextypes.CandidateEndorsement
- func (act *CandidateEndorsement) SanityCheck() error
- func (CandidateEndorsement) Value() *big.Int
- type CandidateEndorsementOp
- type CandidateRegister
- func (cr *CandidateRegister) Amount() *big.Int
- func (cr *CandidateRegister) AutoStake() bool
- func (cr *CandidateRegister) Duration() uint32
- func (cr *CandidateRegister) EthData() ([]byte, error)
- func (CandidateRegister) EthTo() (*common.Address, error)
- func (act *CandidateRegister) FillAction(core *iotextypes.ActionCore)
- func (cr *CandidateRegister) IntrinsicGas() (uint64, error)
- func (cr *CandidateRegister) LoadProto(pbAct *iotextypes.CandidateRegister) error
- func (cr *CandidateRegister) Name() string
- func (cr *CandidateRegister) OperatorAddress() address.Address
- func (cr *CandidateRegister) OwnerAddress() address.Address
- func (cr *CandidateRegister) Payload() []byte
- func (cr *CandidateRegister) Proto() *iotextypes.CandidateRegister
- func (cr *CandidateRegister) RewardAddress() address.Address
- func (cr *CandidateRegister) SanityCheck() error
- func (cr *CandidateRegister) Serialize() []byte
- func (CandidateRegister) Value() *big.Int
- type CandidateTransferOwnership
- func (act *CandidateTransferOwnership) EthData() ([]byte, error)
- func (CandidateTransferOwnership) EthTo() (*common.Address, error)
- func (act *CandidateTransferOwnership) FillAction(core *iotextypes.ActionCore)
- func (act *CandidateTransferOwnership) IntrinsicGas() (uint64, error)
- func (act *CandidateTransferOwnership) LoadProto(pbAct *iotextypes.CandidateTransferOwnership) error
- func (act *CandidateTransferOwnership) NewOwner() address.Address
- func (act *CandidateTransferOwnership) Payload() []byte
- func (act *CandidateTransferOwnership) Proto() *iotextypes.CandidateTransferOwnership
- func (act *CandidateTransferOwnership) SanityCheck() error
- func (act *CandidateTransferOwnership) Serialize() []byte
- func (CandidateTransferOwnership) Value() *big.Int
- type CandidateUpdate
- func (cu *CandidateUpdate) EthData() ([]byte, error)
- func (CandidateUpdate) EthTo() (*common.Address, error)
- func (act *CandidateUpdate) FillAction(core *iotextypes.ActionCore)
- func (cu *CandidateUpdate) IntrinsicGas() (uint64, error)
- func (cu *CandidateUpdate) LoadProto(pbAct *iotextypes.CandidateBasicInfo) error
- func (cu *CandidateUpdate) Name() string
- func (cu *CandidateUpdate) OperatorAddress() address.Address
- func (cu *CandidateUpdate) Proto() *iotextypes.CandidateBasicInfo
- func (cu *CandidateUpdate) RewardAddress() address.Address
- func (cu *CandidateUpdate) SanityCheck() error
- func (cu *CandidateUpdate) Serialize() []byte
- func (CandidateUpdate) Value() *big.Int
- type ChangeCandidate
- func (cc *ChangeCandidate) BucketIndex() uint64
- func (cc *ChangeCandidate) Candidate() string
- func (cc *ChangeCandidate) EthData() ([]byte, error)
- func (ChangeCandidate) EthTo() (*common.Address, error)
- func (act *ChangeCandidate) FillAction(core *iotextypes.ActionCore)
- func (cc *ChangeCandidate) IntrinsicGas() (uint64, error)
- func (cc *ChangeCandidate) LoadProto(pbAct *iotextypes.StakeChangeCandidate) error
- func (cc *ChangeCandidate) Payload() []byte
- func (cc *ChangeCandidate) Proto() *iotextypes.StakeChangeCandidate
- func (cc *ChangeCandidate) SanityCheck() error
- func (cc *ChangeCandidate) Serialize() []byte
- func (ChangeCandidate) Value() *big.Int
- type ClaimFromRewardingFund
- func (c *ClaimFromRewardingFund) Address() address.Address
- func (c *ClaimFromRewardingFund) ClaimAmount() *big.Int
- func (c *ClaimFromRewardingFund) Data() []byte
- func (c *ClaimFromRewardingFund) EthData() ([]byte, error)
- func (ClaimFromRewardingFund) EthTo() (*common.Address, error)
- func (act *ClaimFromRewardingFund) FillAction(core *iotextypes.ActionCore)
- func (c *ClaimFromRewardingFund) IntrinsicGas() (uint64, error)
- func (c *ClaimFromRewardingFund) LoadProto(claim *iotextypes.ClaimFromRewardingFund) error
- func (c *ClaimFromRewardingFund) Proto() *iotextypes.ClaimFromRewardingFund
- func (c *ClaimFromRewardingFund) SanityCheck() error
- func (c *ClaimFromRewardingFund) Serialize() []byte
- func (ClaimFromRewardingFund) Value() *big.Int
- type ConsignJSON
- type ConsignMsgEther
- type Consignment
- type CreateStake
- func (cs *CreateStake) Amount() *big.Int
- func (cs *CreateStake) AutoStake() bool
- func (cs *CreateStake) Candidate() string
- func (cs *CreateStake) Duration() uint32
- func (cs *CreateStake) EthData() ([]byte, error)
- func (CreateStake) EthTo() (*common.Address, error)
- func (act *CreateStake) FillAction(core *iotextypes.ActionCore)
- func (cs *CreateStake) IntrinsicGas() (uint64, error)
- func (cs *CreateStake) LoadProto(pbAct *iotextypes.StakeCreate) error
- func (cs *CreateStake) Payload() []byte
- func (cs *CreateStake) Proto() *iotextypes.StakeCreate
- func (cs *CreateStake) SanityCheck() error
- func (cs *CreateStake) Serialize() []byte
- func (CreateStake) Value() *big.Int
- type DepositToRewardingFund
- func (d *DepositToRewardingFund) Amount() *big.Int
- func (d *DepositToRewardingFund) Data() []byte
- func (d *DepositToRewardingFund) EthData() ([]byte, error)
- func (DepositToRewardingFund) EthTo() (*common.Address, error)
- func (act *DepositToRewardingFund) FillAction(core *iotextypes.ActionCore)
- func (d *DepositToRewardingFund) IntrinsicGas() (uint64, error)
- func (d *DepositToRewardingFund) LoadProto(deposit *iotextypes.DepositToRewardingFund) error
- func (d *DepositToRewardingFund) Proto() *iotextypes.DepositToRewardingFund
- func (d *DepositToRewardingFund) SanityCheck() error
- func (d *DepositToRewardingFund) Serialize() []byte
- func (DepositToRewardingFund) Value() *big.Int
- type DepositToStake
- func (ds *DepositToStake) Amount() *big.Int
- func (ds *DepositToStake) BucketIndex() uint64
- func (ds *DepositToStake) EthData() ([]byte, error)
- func (DepositToStake) EthTo() (*common.Address, error)
- func (act *DepositToStake) FillAction(core *iotextypes.ActionCore)
- func (ds *DepositToStake) IntrinsicGas() (uint64, error)
- func (ds *DepositToStake) LoadProto(pbAct *iotextypes.StakeAddDeposit) error
- func (ds *DepositToStake) Payload() []byte
- func (ds *DepositToStake) Proto() *iotextypes.StakeAddDeposit
- func (ds *DepositToStake) SanityCheck() error
- func (ds *DepositToStake) Serialize() []byte
- func (DepositToStake) Value() *big.Int
- type Deserializer
- type DynamicFeeTx
- func (tx *DynamicFeeTx) AccessList() types.AccessList
- func (tx *DynamicFeeTx) BlobGas() uint64
- func (tx *DynamicFeeTx) BlobGasFeeCap() *big.Int
- func (tx *DynamicFeeTx) BlobHashes() []common.Hash
- func (tx *DynamicFeeTx) BlobTxSidecar() *types.BlobTxSidecar
- func (tx *DynamicFeeTx) ChainID() uint32
- func (tx *DynamicFeeTx) EffectiveGasPrice(baseFee *big.Int) *big.Int
- func (tx *DynamicFeeTx) Gas() uint64
- func (tx *DynamicFeeTx) GasFeeCap() *big.Int
- func (tx *DynamicFeeTx) GasPrice() *big.Int
- func (tx *DynamicFeeTx) GasTipCap() *big.Int
- func (tx *DynamicFeeTx) Nonce() uint64
- func (tx *DynamicFeeTx) SanityCheck() error
- func (tx *DynamicFeeTx) TxType() uint32
- type Envelope
- type EnvelopeBuilder
- func (b *EnvelopeBuilder) Build() Envelope
- func (b *EnvelopeBuilder) BuildExecution(tx *types.Transaction) (Envelope, error)
- func (b *EnvelopeBuilder) BuildRewardingAction(tx *types.Transaction) (Envelope, error)
- func (b *EnvelopeBuilder) BuildStakingAction(tx *types.Transaction) (Envelope, error)
- func (b *EnvelopeBuilder) BuildTransfer(tx *types.Transaction) (Envelope, error)
- func (b *EnvelopeBuilder) SetAccessList(acl types.AccessList) *EnvelopeBuilder
- func (b *EnvelopeBuilder) SetAction(action actionPayload) *EnvelopeBuilder
- func (b *EnvelopeBuilder) SetBlobTxData(feeCap *uint256.Int, hashes []common.Hash, sc *types.BlobTxSidecar) *EnvelopeBuilder
- func (b *EnvelopeBuilder) SetChainID(chainID uint32) *EnvelopeBuilder
- func (b *EnvelopeBuilder) SetDynamicGas(feeCap, tipCap *big.Int) *EnvelopeBuilder
- func (b *EnvelopeBuilder) SetGasLimit(l uint64) *EnvelopeBuilder
- func (b *EnvelopeBuilder) SetGasPrice(p *big.Int) *EnvelopeBuilder
- func (b *EnvelopeBuilder) SetGasPriceByBytes(buf []byte) *EnvelopeBuilder
- func (b *EnvelopeBuilder) SetNonce(n uint64) *EnvelopeBuilder
- func (b *EnvelopeBuilder) SetTxType(v uint32) *EnvelopeBuilder
- func (b *EnvelopeBuilder) SetVersion(v uint32) *EnvelopeBuilder
- type EthCompatibleAction
- type Execution
- func (ex *Execution) Amount() *big.Int
- func (ex *Execution) Contract() string
- func (ex *Execution) Data() []byte
- func (ex *Execution) Destination() string
- func (ex *Execution) EthData() ([]byte, error)
- func (ex *Execution) EthTo() (*common.Address, error)
- func (act *Execution) FillAction(core *iotextypes.ActionCore)
- func (ex *Execution) GasLimitForCost()
- func (ex *Execution) IntrinsicGas() (uint64, error)
- func (ex *Execution) LoadProto(pbAct *iotextypes.Execution) error
- func (ex *Execution) Payload() []byte
- func (ex *Execution) Proto() *iotextypes.Execution
- func (ex *Execution) Recipient() string
- func (ex *Execution) SanityCheck() error
- func (ex *Execution) Serialize() []byte
- func (ex *Execution) Size() uint32
- func (ex *Execution) To() *common.Address
- func (ex *Execution) Value() *big.Int
- type GrantReward
- func (g *GrantReward) EthData() ([]byte, error)
- func (GrantReward) EthTo() (*common.Address, error)
- func (act *GrantReward) FillAction(core *iotextypes.ActionCore)
- func (g *GrantReward) Height() uint64
- func (*GrantReward) IntrinsicGas() (uint64, error)
- func (g *GrantReward) LoadProto(gProto *iotextypes.GrantReward) error
- func (g *GrantReward) Proto() *iotextypes.GrantReward
- func (g *GrantReward) RewardType() int
- func (*GrantReward) SanityCheck() error
- func (g *GrantReward) Serialize() []byte
- func (GrantReward) Value() *big.Int
- type LegacyTx
- func (tx *LegacyTx) AccessList() types.AccessList
- func (tx *LegacyTx) BlobGas() uint64
- func (tx *LegacyTx) BlobGasFeeCap() *big.Int
- func (tx *LegacyTx) BlobHashes() []common.Hash
- func (tx *LegacyTx) BlobTxSidecar() *types.BlobTxSidecar
- func (tx *LegacyTx) ChainID() uint32
- func (tx *LegacyTx) EffectiveGasPrice(_ *big.Int) *big.Int
- func (tx *LegacyTx) Gas() uint64
- func (tx *LegacyTx) GasFeeCap() *big.Int
- func (tx *LegacyTx) GasPrice() *big.Int
- func (tx *LegacyTx) GasTipCap() *big.Int
- func (tx *LegacyTx) Nonce() uint64
- func (tx *LegacyTx) SanityCheck() error
- func (tx *LegacyTx) TxType() uint32
- type Log
- type MigrateStake
- func (ms *MigrateStake) BucketIndex() uint64
- func (ms *MigrateStake) EthData() ([]byte, error)
- func (MigrateStake) EthTo() (*common.Address, error)
- func (act *MigrateStake) FillAction(core *iotextypes.ActionCore)
- func (ms *MigrateStake) GasLimitForCost()
- func (ms *MigrateStake) IntrinsicGas() (uint64, error)
- func (ms *MigrateStake) LoadProto(pbAct *iotextypes.StakeMigrate) error
- func (ms *MigrateStake) Proto() *iotextypes.StakeMigrate
- func (*MigrateStake) SanityCheck() error
- func (ms *MigrateStake) Serialize() []byte
- func (MigrateStake) Value() *big.Int
- type PutPollResult
- func (r *PutPollResult) Candidates() state.CandidateList
- func (act *PutPollResult) FillAction(core *iotextypes.ActionCore)
- func (r *PutPollResult) Height() uint64
- func (r *PutPollResult) IntrinsicGas() (uint64, error)
- func (r *PutPollResult) LoadProto(putPollResultPb *iotextypes.PutPollResult) error
- func (r *PutPollResult) Proto() *iotextypes.PutPollResult
- func (r *PutPollResult) SanityCheck() error
- func (r *PutPollResult) Serialize() []byte
- type Receipt
- func (receipt *Receipt) AddLogs(logs ...*Log) *Receipt
- func (receipt *Receipt) AddTransactionLogs(logs ...*TransactionLog) *Receipt
- func (receipt *Receipt) ConvertFromReceiptPb(pbReceipt *iotextypes.Receipt)
- func (receipt *Receipt) ConvertToReceiptPb() *iotextypes.Receipt
- func (receipt *Receipt) Deserialize(buf []byte) error
- func (receipt *Receipt) ExecutionRevertMsg() string
- func (receipt *Receipt) Hash() hash.Hash256
- func (receipt *Receipt) Logs() []*Log
- func (receipt *Receipt) PriorityFee() *big.Int
- func (receipt *Receipt) Serialize() ([]byte, error)
- func (receipt *Receipt) SetExecutionRevertMsg(revertReason string) *Receipt
- func (receipt *Receipt) TransactionLogs() []*TransactionLog
- func (receipt *Receipt) UpdateIndex(txIndex, logIndex uint32) uint32
- type Restake
- func (rs *Restake) AutoStake() bool
- func (rs *Restake) BucketIndex() uint64
- func (rs *Restake) Duration() uint32
- func (rs *Restake) EthData() ([]byte, error)
- func (Restake) EthTo() (*common.Address, error)
- func (act *Restake) FillAction(core *iotextypes.ActionCore)
- func (rs *Restake) IntrinsicGas() (uint64, error)
- func (rs *Restake) LoadProto(pbAct *iotextypes.StakeRestake) error
- func (rs *Restake) Payload() []byte
- func (rs *Restake) Proto() *iotextypes.StakeRestake
- func (rs *Restake) SanityCheck() error
- func (rs *Restake) Serialize() []byte
- func (Restake) Value() *big.Int
- type SealedEnvelope
- func AssembleSealedEnvelope(act Envelope, pk crypto.PublicKey, sig []byte) *SealedEnvelope
- func FakeSeal(act Envelope, pubk crypto.PublicKey) *SealedEnvelope
- func Sign(act Envelope, sk crypto.PrivateKey) (*SealedEnvelope, error)
- func SignedCandidateActivate(nonce uint64, bucketIndex uint64, gasLimit uint64, gasPrice *big.Int, ...) (*SealedEnvelope, error)
- func SignedCandidateEndorsement(nonce uint64, bucketIndex uint64, op CandidateEndorsementOp, gasLimit uint64, ...) (*SealedEnvelope, error)
- func SignedCandidateEndorsementLegacy(nonce uint64, bucketIndex uint64, endorse bool, gasLimit uint64, ...) (*SealedEnvelope, error)
- func SignedCandidateRegister(nonce uint64, ...) (*SealedEnvelope, error)
- func SignedCandidateTransferOwnership(nonce uint64, ownerAddrStr string, payload []byte, gasLimit uint64, ...) (*SealedEnvelope, error)
- func SignedCandidateUpdate(nonce uint64, name, operatorAddrStr, rewardAddrStr string, gasLimit uint64, ...) (*SealedEnvelope, error)
- func SignedChangeCandidate(nonce uint64, candName string, bucketIndex uint64, payload []byte, ...) (*SealedEnvelope, error)
- func SignedClaimReward(nonce uint64, gasLimit uint64, gasPrice *big.Int, ...) (*SealedEnvelope, error)
- func SignedClaimRewardLegacy(nonce uint64, gasLimit uint64, gasPrice *big.Int, ...) (*SealedEnvelope, error)
- func SignedCreateStake(nonce uint64, candidateName, amount string, duration uint32, autoStake bool, ...) (*SealedEnvelope, error)
- func SignedDepositToStake(nonce uint64, index uint64, amount string, payload []byte, gasLimit uint64, ...) (*SealedEnvelope, error)
- func SignedExecution(contractAddr string, executorPriKey crypto.PrivateKey, nonce uint64, ...) (*SealedEnvelope, error)
- func SignedMigrateStake(nonce uint64, bucketIndex uint64, gasLimit uint64, gasPrice *big.Int, ...) (*SealedEnvelope, error)
- func SignedReclaimStake(withdraw bool, nonce uint64, bucketIndex uint64, payload []byte, ...) (*SealedEnvelope, error)
- func SignedRestake(nonce uint64, index uint64, duration uint32, autoStake bool, payload []byte, ...) (*SealedEnvelope, error)
- func SignedTransfer(recipientAddr string, senderPriKey crypto.PrivateKey, nonce uint64, ...) (*SealedEnvelope, error)
- func SignedTransferStake(nonce uint64, voterAddress string, bucketIndex uint64, payload []byte, ...) (*SealedEnvelope, error)
- func (sealed *SealedEnvelope) Encoding() uint32
- func (sealed *SealedEnvelope) Hash() (hash.Hash256, error)
- func (sealed *SealedEnvelope) Proto() *iotextypes.Action
- func (sealed *SealedEnvelope) SenderAddress() address.Address
- func (sealed *SealedEnvelope) Signature() []byte
- func (sealed *SealedEnvelope) SrcPubkey() crypto.PublicKey
- func (sealed *SealedEnvelope) ToEthTx() (*types.Transaction, error)
- func (sealed *SealedEnvelope) VerifySignature() error
- type SealedEnvelopeValidator
- type SignedActionOption
- type Topics
- type TransactionLog
- type Transfer
- func (tsf *Transfer) Amount() *big.Int
- func (tsf *Transfer) Destination() string
- func (tsf *Transfer) EthData() ([]byte, error)
- func (tsf *Transfer) EthTo() (*common.Address, error)
- func (tsf *Transfer) FillAction(act *iotextypes.ActionCore)
- func (tsf *Transfer) IntrinsicGas() (uint64, error)
- func (tsf *Transfer) LoadProto(pbAct *iotextypes.Transfer) error
- func (tsf *Transfer) Payload() []byte
- func (tsf *Transfer) Proto() *iotextypes.Transfer
- func (tsf *Transfer) Recipient() string
- func (tsf *Transfer) SanityCheck() error
- func (tsf *Transfer) Serialize() []byte
- func (tsf *Transfer) Size() uint32
- func (tsf *Transfer) Value() *big.Int
- type TransferStake
- func (ts *TransferStake) BucketIndex() uint64
- func (ts *TransferStake) EthData() ([]byte, error)
- func (TransferStake) EthTo() (*common.Address, error)
- func (act *TransferStake) FillAction(core *iotextypes.ActionCore)
- func (ts *TransferStake) IntrinsicGas() (uint64, error)
- func (ts *TransferStake) LoadProto(pbAct *iotextypes.StakeTransferOwnership) error
- func (ts *TransferStake) Payload() []byte
- func (ts *TransferStake) Proto() *iotextypes.StakeTransferOwnership
- func (ts *TransferStake) SanityCheck() error
- func (ts *TransferStake) Serialize() []byte
- func (TransferStake) Value() *big.Int
- func (ts *TransferStake) VoterAddress() address.Address
- type TxBlob
- type TxCommon
- type TxCommonInternal
- type TxContainer
- type TxData
- type TxDataForSimulation
- type TxDynamicGas
- type Unstake
- func (sr *Unstake) BucketIndex() uint64
- func (su *Unstake) EthData() ([]byte, error)
- func (act *Unstake) FillAction(core *iotextypes.ActionCore)
- func (su *Unstake) IntrinsicGas() (uint64, error)
- func (sr *Unstake) LoadProto(pbAct *iotextypes.StakeReclaim) error
- func (sr *Unstake) Payload() []byte
- func (sr *Unstake) Proto() *iotextypes.StakeReclaim
- func (sr *Unstake) SanityCheck() error
- func (sr *Unstake) Serialize() []byte
- type WithdrawStake
- func (sr *WithdrawStake) BucketIndex() uint64
- func (sw *WithdrawStake) EthData() ([]byte, error)
- func (act *WithdrawStake) FillAction(core *iotextypes.ActionCore)
- func (sw *WithdrawStake) IntrinsicGas() (uint64, error)
- func (sr *WithdrawStake) LoadProto(pbAct *iotextypes.StakeReclaim) error
- func (sr *WithdrawStake) Payload() []byte
- func (sr *WithdrawStake) Proto() *iotextypes.StakeReclaim
- func (sr *WithdrawStake) SanityCheck() error
- func (sr *WithdrawStake) Serialize() []byte
Constants ¶
const ( LegacyTxType = 0 AccessListTxType = 1 DynamicFeeTxType = 2 BlobTxType = 3 )
const ( // CandidateRegisterPayloadGas represents the CandidateRegister payload gas per uint CandidateRegisterPayloadGas = uint64(100) // CandidateRegisterBaseIntrinsicGas represents the base intrinsic gas for CandidateRegister CandidateRegisterBaseIntrinsicGas = uint64(10000) )
const ( // CandidateTransferOwnershipPayloadGas represents the CandidateTransferOwnership payload gas per uint CandidateTransferOwnershipPayloadGas = uint64(100) // CandidateTransferOwnershipBaseIntrinsicGas represents the base intrinsic gas for CandidateTransferOwnership CandidateTransferOwnershipBaseIntrinsicGas = uint64(10000) )
const ( DefaultBaseFeeChangeDenominator = 8 // Bounds the amount the base fee can change between blocks. DefaultElasticityMultiplier = 2 // Bounds the maximum gas limit an EIP-1559 block may have. InitialBaseFee = 1000000000000 // Initial base fee for EIP-1559 blocks. )
constants for EIP-1559 dynamic fee
const ( EmptyAddress = "" ExecutionDataGas uint64 = 100 // per-byte execution data gas ExecutionBaseIntrinsicGas uint64 = 10000 // base intrinsic gas for execution TxAccessListAddressGas uint64 = 2400 // Per address specified in EIP 2930 access list TxAccessListStorageKeyGas uint64 = 1900 // Per storage key specified in EIP 2930 access list )
const
const ( // BlockReward indicates that the action is to grant block reward BlockReward = iota // EpochReward indicates that the action is to grant epoch reward EpochReward )
const ( // DepositToStakePayloadGas represents the DepositToStake payload gas per uint DepositToStakePayloadGas = uint64(100) // DepositToStakeBaseIntrinsicGas represents the base intrinsic gas for DepositToStake DepositToStakeBaseIntrinsicGas = uint64(10000) )
const ( // MoveStakePayloadGas represents the stake move payload gas per uint MoveStakePayloadGas = uint64(100) // MoveStakeBaseIntrinsicGas represents the base intrinsic gas for stake move MoveStakeBaseIntrinsicGas = uint64(10000) )
const ( // CreateStakePayloadGas represents the CreateStake payload gas per uint CreateStakePayloadGas = uint64(100) // CreateStakeBaseIntrinsicGas represents the base intrinsic gas for CreateStake CreateStakeBaseIntrinsicGas = uint64(10000) )
const ( // MigrateStakePayloadGas represents the MigrateStake payload gas per uint MigrateStakePayloadGas = uint64(100) // MigrateStakeBaseIntrinsicGas represents the base intrinsic gas for MigrateStake MigrateStakeBaseIntrinsicGas = uint64(10000) )
const ( // ReclaimStakePayloadGas represents the stake reclaim payload gas per uint ReclaimStakePayloadGas = uint64(100) // ReclaimStakeBaseIntrinsicGas represents the base intrinsic gas for stake reclaim ReclaimStakeBaseIntrinsicGas = uint64(10000) )
const ( // RestakePayloadGas represents the Restake payload gas per uint RestakePayloadGas = uint64(100) // RestakeBaseIntrinsicGas represents the base intrinsic gas for stake again RestakeBaseIntrinsicGas = uint64(10000) )
const ( // TransferPayloadGas represents the transfer payload gas per uint TransferPayloadGas = uint64(100) // TransferBaseIntrinsicGas represents the base intrinsic gas for transfer TransferBaseIntrinsicGas = uint64(10000) )
const ( // CandidateActivateBaseIntrinsicGas represents the base intrinsic gas for CandidateActivate CandidateActivateBaseIntrinsicGas = uint64(10000) )
const ( // CandidateEndorsementBaseIntrinsicGas represents the base intrinsic gas for CandidateEndorsement CandidateEndorsementBaseIntrinsicGas = uint64(10000) )
const ( // CandidateUpdateBaseIntrinsicGas represents the base intrinsic gas for CandidateUpdate CandidateUpdateBaseIntrinsicGas = uint64(10000) )
Variables ¶
var ( // ErrInvalidAmount represents that amount is 0 or negative ErrInvalidAmount = errors.New("invalid amount") //ErrInvalidCanName represents that candidate name is invalid ErrInvalidCanName = errors.New("invalid candidate name") // ErrInvalidOwner represents that owner address is invalid ErrInvalidOwner = errors.New("invalid owner address") )
var ( // ClaimFromRewardingFundBaseGas represents the base intrinsic gas for claimFromRewardingFund ClaimFromRewardingFundBaseGas = uint64(10000) // ClaimFromRewardingFundGasPerByte represents the claimFromRewardingFund payload gas per uint ClaimFromRewardingFundGasPerByte = uint64(100) )
var ( ErrAddress = errors.New("invalid address") ErrVotee = errors.New("votee is not a candidate") ErrNotFound = errors.New("action not found") ErrChainID = errors.New("invalid chainID") ErrExistedInPool = errors.New("known transaction") ErrReplaceUnderpriced = errors.New("replacement transaction underpriced") ErrSystemActionNonce = errors.New("invalid system action nonce") ErrNonceTooLow = errors.New("nonce too low") ErrUnderpriced = errors.New("transaction underpriced") ErrNegativeValue = errors.New("negative value") ErrGasFeeCapTooLow = errors.New("fee cap less than base fee") ErrIntrinsicGas = errors.New("intrinsic gas too low") ErrInsufficientFunds = errors.New("insufficient funds for gas * price + value") ErrNonceTooHigh = errors.New("nonce too high") ErrInvalidSender = errors.New("invalid sender") ErrTxPoolOverflow = errors.New("txpool is full") ErrGasLimit = errors.New("exceeds block gas limit") ErrOversizedData = errors.New("oversized data") ErrNilProto = errors.New("empty action proto to load") ErrInvalidProto = errors.New("invalid action proto to load") ErrNilAction = errors.New("nil action to load proto") ErrInvalidAct = errors.New("invalid action type") ErrInvalidABI = errors.New("invalid abi binary data") ErrGasTipOverFeeCap = errors.New("tip cap is greater than fee cap") ErrMissRequiredField = errors.New("missing required field") ErrValueVeryHigh = errors.New("value is very high") ErrSpecialAddress = errors.New("special address not allowed") )
vars
var ( // DepositToRewardingFundBaseGas represents the base intrinsic gas for depositToRewardingFund DepositToRewardingFundBaseGas = uint64(10000) // DepositToRewardingFundGasPerByte represents the depositToRewardingFund payload gas per uint DepositToRewardingFundGasPerByte = uint64(100) )
var (
ErrNotSupported = errors.New("signature type not supported")
)
Errors
var (
ValidSig, _ = hex.DecodeString("15e73ad521ec9e06600c59e49b127c9dee114ad64fb2fcbe5e0d9f4c8d2b766e73d708cca1dc050dd27b20f2ee607f30428bf035f45d4da8ec2fb04a90c2c30901")
)
vars
Functions ¶
func CalculateIntrinsicGas ¶
func CalculateIntrinsicGas(baseIntrinsicGas uint64, payloadGas uint64, payloadSize uint64) (uint64, error)
CalculateIntrinsicGas returns the intrinsic gas of an action
func CheckSpecialAddress ¶ added in v2.0.6
func CheckTransferAddress ¶ added in v2.0.6
func DecodeEtherTx ¶
func DecodeEtherTx(rawData string) (*types.Transaction, error)
DecodeEtherTx decodes raw data string into eth tx
func EffectiveGasTip ¶
EffectiveGas returns the effective gas
func EthRawToContainer ¶
func EthRawToContainer(chainID uint32, rawString string) (*iotextypes.ActionCore, error)
func ExtractTypeSigPubkey ¶
func ExtractTypeSigPubkey(tx *types.Transaction) (iotextypes.Encoding, []byte, crypto.PublicKey, error)
ExtractTypeSigPubkey extracts tx type, signature, and pubkey
func FromProtoBlobTxSideCar ¶
func FromProtoBlobTxSideCar(pb *iotextypes.BlobTxSidecar) (*types.BlobTxSidecar, error)
func IsSystemAction ¶
func IsSystemAction(act *SealedEnvelope) bool
IsSystemAction determine whether input action belongs to system action
func IsValidCandidateName ¶
IsValidCandidateName check if a candidate name string is valid.
func LoadErrorDescription ¶
LoadErrorDescription loads corresponding description related to the error
func NewConsignJSON ¶
NewConsignJSON creates a consignment JSON from inputs
func NewConsignMsg ¶
NewConsignMsg creates a consignment message from inputs
func NewEthSigner ¶
NewEthSigner returns the proper signer for Eth-compatible tx
func RawTxToSignedTx ¶
func RawTxToSignedTx(rawTx *types.Transaction, signer types.Signer, sig []byte) (*types.Transaction, error)
RawTxToSignedTx converts the raw tx to corresponding signed tx
func RecoverPubkeyFromEccSig ¶
RecoverPubkeyFromEccSig recovers public key from ECC signature
func ToProtoSideCar ¶
func ToProtoSideCar(sidecar *types.BlobTxSidecar) *iotextypes.BlobTxSidecar
Types ¶
type AbstractAction ¶
type AbstractAction struct {
// contains filtered or unexported fields
}
AbstractAction is an abstract implementation of Action interface
func (*AbstractAction) BasicActionSize ¶
func (act *AbstractAction) BasicActionSize() uint32
BasicActionSize returns the basic size of action
func (*AbstractAction) ChainID ¶
func (act *AbstractAction) ChainID() uint32
ChainID returns the chainID
func (*AbstractAction) GasFeeCap ¶
func (act *AbstractAction) GasFeeCap() *big.Int
GasFeeCap returns the gas fee cap
func (*AbstractAction) GasPrice ¶
func (act *AbstractAction) GasPrice() *big.Int
GasPrice returns the gas price
func (*AbstractAction) GasTipCap ¶
func (act *AbstractAction) GasTipCap() *big.Int
GasTipCap returns the gas tip cap
func (*AbstractAction) SanityCheck ¶
func (act *AbstractAction) SanityCheck() error
SanityCheck validates the variables in the action
func (*AbstractAction) SetGasLimit ¶
func (act *AbstractAction) SetGasLimit(val uint64)
SetGasLimit sets gaslimit
func (*AbstractAction) SetGasPrice ¶
func (act *AbstractAction) SetGasPrice(val *big.Int)
SetGasPrice sets gaslimit
func (*AbstractAction) SetNonce ¶
func (act *AbstractAction) SetNonce(val uint64)
SetNonce sets gaslimit
type AccessListTx ¶
type AccessListTx struct {
// contains filtered or unexported fields
}
AccessListTx represents EIP-2930 access list transaction
func NewAccessListTx ¶
func NewAccessListTx(chainID uint32, nonce uint64, gasLimit uint64, gasPrice *big.Int, accessList types.AccessList) *AccessListTx
NewAccessListTx creates a new access list transaction
func (*AccessListTx) AccessList ¶
func (tx *AccessListTx) AccessList() types.AccessList
func (*AccessListTx) BlobGas ¶
func (tx *AccessListTx) BlobGas() uint64
func (*AccessListTx) BlobGasFeeCap ¶
func (tx *AccessListTx) BlobGasFeeCap() *big.Int
func (*AccessListTx) BlobHashes ¶
func (tx *AccessListTx) BlobHashes() []common.Hash
func (*AccessListTx) BlobTxSidecar ¶
func (tx *AccessListTx) BlobTxSidecar() *types.BlobTxSidecar
func (*AccessListTx) ChainID ¶
func (tx *AccessListTx) ChainID() uint32
func (*AccessListTx) EffectiveGasPrice ¶
func (tx *AccessListTx) EffectiveGasPrice(_ *big.Int) *big.Int
func (*AccessListTx) Gas ¶
func (tx *AccessListTx) Gas() uint64
func (*AccessListTx) GasFeeCap ¶
func (tx *AccessListTx) GasFeeCap() *big.Int
func (*AccessListTx) GasPrice ¶
func (tx *AccessListTx) GasPrice() *big.Int
func (*AccessListTx) GasTipCap ¶
func (tx *AccessListTx) GasTipCap() *big.Int
func (*AccessListTx) Nonce ¶
func (tx *AccessListTx) Nonce() uint64
func (*AccessListTx) SanityCheck ¶
func (tx *AccessListTx) SanityCheck() error
func (*AccessListTx) TxType ¶
func (tx *AccessListTx) TxType() uint32
type Action ¶
type Action interface {
SanityCheck() error
}
Action is the action can be Executed in protocols. The method is added to avoid mistakenly used empty interface as action.
type BlobTx ¶
type BlobTx struct {
// contains filtered or unexported fields
}
BlobTx represents EIP-4844 blob transaction
func NewBlobTx ¶
func NewBlobTx( chainID uint32, nonce uint64, gasLimit uint64, gasTipCap *big.Int, gasFeeCap *big.Int, accessList types.AccessList, blobData *BlobTxData, ) *BlobTx
NewBlobTx creates a new blob transaction
func (*BlobTx) AccessList ¶
func (tx *BlobTx) AccessList() types.AccessList
func (*BlobTx) BlobGasFeeCap ¶
func (*BlobTx) BlobHashes ¶
func (*BlobTx) BlobTxSidecar ¶
func (tx *BlobTx) BlobTxSidecar() *types.BlobTxSidecar
func (*BlobTx) ProtoForRawHash ¶
func (tx *BlobTx) ProtoForRawHash() *iotextypes.ActionCore
func (*BlobTx) SanityCheck ¶
func (*BlobTx) ValidateSidecar ¶
type BlobTxData ¶
type BlobTxData struct {
// contains filtered or unexported fields
}
BlobTxData represents an EIP-4844 transaction
func NewBlobTxData ¶
func NewBlobTxData(blobFeeCap *uint256.Int, blobHashes []common.Hash, sidecar *types.BlobTxSidecar) *BlobTxData
func (*BlobTxData) SanityCheck ¶
func (tx *BlobTxData) SanityCheck() error
func (*BlobTxData) ValidateSidecar ¶
func (tx *BlobTxData) ValidateSidecar() error
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is used to build an action.
func (*Builder) SetGasLimit ¶
SetGasLimit sets action's gas limit.
func (*Builder) SetGasPrice ¶
SetGasPrice sets action's gas price.
func (*Builder) SetGasPriceByBytes ¶
SetGasPriceByBytes sets action's gas price from a byte slice source.
func (*Builder) SetVersion ¶
SetVersion sets action's version.
type CandidateActivate ¶
type CandidateActivate struct {
// contains filtered or unexported fields
}
CandidateActivate is the action to update a candidate's bucket
func NewCandidateActivate ¶
func NewCandidateActivate(bucketID uint64) *CandidateActivate
NewCandidateActivate returns a CandidateActivate action
func NewCandidateActivateFromABIBinary ¶
func NewCandidateActivateFromABIBinary(data []byte) (*CandidateActivate, error)
NewCandidateActivateFromABIBinary parses the smart contract input and creates an action
func (*CandidateActivate) BucketID ¶
func (cr *CandidateActivate) BucketID() uint64
BucketID returns the bucket index want to be changed to
func (*CandidateActivate) EthData ¶
func (cr *CandidateActivate) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*CandidateActivate) FillAction ¶
func (cr *CandidateActivate) FillAction(act *iotextypes.ActionCore)
func (*CandidateActivate) IntrinsicGas ¶
func (cr *CandidateActivate) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a CandidateRegister
func (*CandidateActivate) LoadProto ¶
func (cr *CandidateActivate) LoadProto(pbAct *iotextypes.CandidateActivate) error
LoadProto converts a protobuf's Action to CandidateActivate
func (*CandidateActivate) Proto ¶
func (cr *CandidateActivate) Proto() *iotextypes.CandidateActivate
Proto converts CandidateActivate to protobuf's Action
func (*CandidateActivate) SanityCheck ¶
func (cr *CandidateActivate) SanityCheck() error
type CandidateEndorsement ¶
type CandidateEndorsement struct {
// contains filtered or unexported fields
}
CandidateEndorsement is the action to endorse or unendorse a candidate
func NewCandidateEndorsement ¶
func NewCandidateEndorsement(bucketIndex uint64, op CandidateEndorsementOp) (*CandidateEndorsement, error)
NewCandidateEndorsement returns a CandidateEndorsement action
func NewCandidateEndorsementFromABIBinary ¶
func NewCandidateEndorsementFromABIBinary(data []byte) (*CandidateEndorsement, error)
NewCandidateEndorsementFromABIBinary parses the smart contract input and creates an action
func NewCandidateEndorsementLegacy ¶
func NewCandidateEndorsementLegacy(bucketIndex uint64, endorse bool) *CandidateEndorsement
NewCandidateEndorsementLegacy returns a CandidateEndorsement action
func (*CandidateEndorsement) BucketIndex ¶
func (act *CandidateEndorsement) BucketIndex() uint64
BucketIndex returns the bucket index of the action
func (*CandidateEndorsement) EthData ¶
func (act *CandidateEndorsement) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*CandidateEndorsement) FillAction ¶
func (act *CandidateEndorsement) FillAction(core *iotextypes.ActionCore)
func (*CandidateEndorsement) IntrinsicGas ¶
func (act *CandidateEndorsement) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a CandidateEndorsement
func (*CandidateEndorsement) IsLegacy ¶
func (act *CandidateEndorsement) IsLegacy() bool
IsLegacy returns true if the action is in legacy version
func (*CandidateEndorsement) LoadProto ¶
func (act *CandidateEndorsement) LoadProto(pbAct *iotextypes.CandidateEndorsement) error
LoadProto converts a protobuf's Action to CandidateEndorsement
func (*CandidateEndorsement) Op ¶
func (act *CandidateEndorsement) Op() CandidateEndorsementOp
Op returns the operation of the endorsement
func (*CandidateEndorsement) Proto ¶
func (act *CandidateEndorsement) Proto() *iotextypes.CandidateEndorsement
Proto converts CandidateEndorsement to protobuf's Action
func (*CandidateEndorsement) SanityCheck ¶
func (act *CandidateEndorsement) SanityCheck() error
type CandidateEndorsementOp ¶
type CandidateEndorsementOp uint8
CandidateEndorsementOp defines the operation of CandidateEndorsement
const ( // CandidateEndorsementOpLegacy is the operation to endorse or unendorse a candidate in legacy version CandidateEndorsementOpLegacy CandidateEndorsementOp = iota // CandidateEndorsementOpEndorse is the operation to endorse a candidate CandidateEndorsementOpEndorse // CandidateEndorsementOpIntentToRevoke is the operation to intent to revoke an endorsement CandidateEndorsementOpIntentToRevoke // CandidateEndorsementOpRevoke is the operation to revoke an endorsement CandidateEndorsementOpRevoke )
CandidateEndorsementOp defines the operation of CandidateEndorsement
type CandidateRegister ¶
type CandidateRegister struct {
// contains filtered or unexported fields
}
CandidateRegister is the action to register a candidate
func NewCandidateRegister ¶
func NewCandidateRegister( name, operatorAddrStr, rewardAddrStr, ownerAddrStr, amountStr string, duration uint32, autoStake bool, payload []byte, ) (*CandidateRegister, error)
NewCandidateRegister creates a CandidateRegister instance
func NewCandidateRegisterFromABIBinary ¶
func NewCandidateRegisterFromABIBinary(data []byte) (*CandidateRegister, error)
NewCandidateRegisterFromABIBinary decodes data into CandidateRegister action
func (*CandidateRegister) Amount ¶
func (cr *CandidateRegister) Amount() *big.Int
Amount returns the amount
func (*CandidateRegister) AutoStake ¶
func (cr *CandidateRegister) AutoStake() bool
AutoStake returns the if staking is auth stake
func (*CandidateRegister) Duration ¶
func (cr *CandidateRegister) Duration() uint32
Duration returns the self-stake duration
func (*CandidateRegister) EthData ¶
func (cr *CandidateRegister) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*CandidateRegister) FillAction ¶
func (act *CandidateRegister) FillAction(core *iotextypes.ActionCore)
func (*CandidateRegister) IntrinsicGas ¶
func (cr *CandidateRegister) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a CandidateRegister
func (*CandidateRegister) LoadProto ¶
func (cr *CandidateRegister) LoadProto(pbAct *iotextypes.CandidateRegister) error
LoadProto converts a protobuf's Action to CandidateRegister
func (*CandidateRegister) Name ¶
func (cr *CandidateRegister) Name() string
Name returns candidate name to register
func (*CandidateRegister) OperatorAddress ¶
func (cr *CandidateRegister) OperatorAddress() address.Address
OperatorAddress returns candidate operatorAddress to register
func (*CandidateRegister) OwnerAddress ¶
func (cr *CandidateRegister) OwnerAddress() address.Address
OwnerAddress returns candidate ownerAddress to register
func (*CandidateRegister) Payload ¶
func (cr *CandidateRegister) Payload() []byte
Payload returns the payload bytes
func (*CandidateRegister) Proto ¶
func (cr *CandidateRegister) Proto() *iotextypes.CandidateRegister
Proto converts to protobuf CandidateRegister Action
func (*CandidateRegister) RewardAddress ¶
func (cr *CandidateRegister) RewardAddress() address.Address
RewardAddress returns candidate rewardAddress to register
func (*CandidateRegister) SanityCheck ¶
func (cr *CandidateRegister) SanityCheck() error
SanityCheck validates the variables in the action
func (*CandidateRegister) Serialize ¶
func (cr *CandidateRegister) Serialize() []byte
Serialize returns a raw byte stream of the CandidateRegister struct
type CandidateTransferOwnership ¶
type CandidateTransferOwnership struct {
// contains filtered or unexported fields
}
CandidateTransferOwnership is the action to transfer ownership of a candidate
func NewCandidateTransferOwnership ¶
func NewCandidateTransferOwnership(newOwnerStr string, payload []byte) (*CandidateTransferOwnership, error)
NewCandidateTransferOwnership returns a CandidateTransferOwnership action
func NewCandidateTransferOwnershipFromABIBinary ¶
func NewCandidateTransferOwnershipFromABIBinary(data []byte) (*CandidateTransferOwnership, error)
NewCandidateTransferOwnershipFromABIBinary decode data to CandidateTransferOwnership
func (*CandidateTransferOwnership) EthData ¶
func (act *CandidateTransferOwnership) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*CandidateTransferOwnership) FillAction ¶
func (act *CandidateTransferOwnership) FillAction(core *iotextypes.ActionCore)
func (*CandidateTransferOwnership) IntrinsicGas ¶
func (act *CandidateTransferOwnership) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a CandidateTransferOwnership
func (*CandidateTransferOwnership) LoadProto ¶
func (act *CandidateTransferOwnership) LoadProto(pbAct *iotextypes.CandidateTransferOwnership) error
LoadProto loads the CandidateTransferOwnership Action from protobuf
func (*CandidateTransferOwnership) NewOwner ¶
func (act *CandidateTransferOwnership) NewOwner() address.Address
NewOwner returns the new owner address
func (*CandidateTransferOwnership) Payload ¶
func (act *CandidateTransferOwnership) Payload() []byte
Payload returns the payload bytes
func (*CandidateTransferOwnership) Proto ¶
func (act *CandidateTransferOwnership) Proto() *iotextypes.CandidateTransferOwnership
Proto converts to protobuf CandidateTransferOwnership Action
func (*CandidateTransferOwnership) SanityCheck ¶
func (act *CandidateTransferOwnership) SanityCheck() error
SanityCheck validates the variables in the action
func (*CandidateTransferOwnership) Serialize ¶
func (act *CandidateTransferOwnership) Serialize() []byte
Serialize returns a raw byte stream of the CandidateTransferOwnership struct
type CandidateUpdate ¶
type CandidateUpdate struct {
// contains filtered or unexported fields
}
CandidateUpdate is the action to update a candidate
func NewCandidateUpdate ¶
func NewCandidateUpdate(name, operatorAddrStr, rewardAddrStr string) (*CandidateUpdate, error)
NewCandidateUpdate creates a CandidateUpdate instance
func NewCandidateUpdateFromABIBinary ¶
func NewCandidateUpdateFromABIBinary(data []byte) (*CandidateUpdate, error)
NewCandidateUpdateFromABIBinary decodes data into CandidateUpdate action
func (*CandidateUpdate) EthData ¶
func (cu *CandidateUpdate) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*CandidateUpdate) FillAction ¶
func (act *CandidateUpdate) FillAction(core *iotextypes.ActionCore)
func (*CandidateUpdate) IntrinsicGas ¶
func (cu *CandidateUpdate) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a CandidateUpdate
func (*CandidateUpdate) LoadProto ¶
func (cu *CandidateUpdate) LoadProto(pbAct *iotextypes.CandidateBasicInfo) error
LoadProto converts a protobuf's Action to CandidateUpdate
func (*CandidateUpdate) Name ¶
func (cu *CandidateUpdate) Name() string
Name returns candidate name to update
func (*CandidateUpdate) OperatorAddress ¶
func (cu *CandidateUpdate) OperatorAddress() address.Address
OperatorAddress returns candidate operatorAddress to update
func (*CandidateUpdate) Proto ¶
func (cu *CandidateUpdate) Proto() *iotextypes.CandidateBasicInfo
Proto converts to protobuf CandidateUpdate Action
func (*CandidateUpdate) RewardAddress ¶
func (cu *CandidateUpdate) RewardAddress() address.Address
RewardAddress returns candidate rewardAddress to update
func (*CandidateUpdate) SanityCheck ¶
func (cu *CandidateUpdate) SanityCheck() error
SanityCheck validates the variables in the action
func (*CandidateUpdate) Serialize ¶
func (cu *CandidateUpdate) Serialize() []byte
Serialize returns a raw byte stream of the CandidateUpdate struct
type ChangeCandidate ¶
type ChangeCandidate struct {
// contains filtered or unexported fields
}
ChangeCandidate defines the action of changing stake candidate ts the other
func NewChangeCandidate ¶
func NewChangeCandidate( candName string, bucketIndex uint64, payload []byte, ) *ChangeCandidate
NewChangeCandidate returns a ChangeCandidate instance
func NewChangeCandidateFromABIBinary ¶
func NewChangeCandidateFromABIBinary(data []byte) (*ChangeCandidate, error)
NewChangeCandidateFromABIBinary decodes data into ChangeCandidate action
func (*ChangeCandidate) BucketIndex ¶
func (cc *ChangeCandidate) BucketIndex() uint64
BucketIndex returns bucket index
func (*ChangeCandidate) Candidate ¶
func (cc *ChangeCandidate) Candidate() string
Candidate returns the address of recipient
func (*ChangeCandidate) EthData ¶
func (cc *ChangeCandidate) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*ChangeCandidate) FillAction ¶
func (act *ChangeCandidate) FillAction(core *iotextypes.ActionCore)
func (*ChangeCandidate) IntrinsicGas ¶
func (cc *ChangeCandidate) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a ChangeCandidate
func (*ChangeCandidate) LoadProto ¶
func (cc *ChangeCandidate) LoadProto(pbAct *iotextypes.StakeChangeCandidate) error
LoadProto loads change candidate from protobuf
func (*ChangeCandidate) Payload ¶
func (cc *ChangeCandidate) Payload() []byte
Payload returns the payload bytes
func (*ChangeCandidate) Proto ¶
func (cc *ChangeCandidate) Proto() *iotextypes.StakeChangeCandidate
Proto converts change candidate to protobuf
func (*ChangeCandidate) SanityCheck ¶
func (cc *ChangeCandidate) SanityCheck() error
SanityCheck validates the variables in the action
func (*ChangeCandidate) Serialize ¶
func (cc *ChangeCandidate) Serialize() []byte
Serialize returns a raw byte stream of the stake move action struct
type ClaimFromRewardingFund ¶
type ClaimFromRewardingFund struct {
// contains filtered or unexported fields
}
ClaimFromRewardingFund is the action to claim reward from the rewarding fund
func NewClaimFromRewardingFundFromABIBinary ¶
func NewClaimFromRewardingFundFromABIBinary(data []byte) (*ClaimFromRewardingFund, error)
NewClaimFromRewardingFundFromABIBinary decodes data into action
func (*ClaimFromRewardingFund) Address ¶
func (c *ClaimFromRewardingFund) Address() address.Address
Address returns the the account to claim if it's nil, the default is the action sender
func (*ClaimFromRewardingFund) ClaimAmount ¶
func (c *ClaimFromRewardingFund) ClaimAmount() *big.Int
ClaimAmount returns the amount to claim note that this amount won't be charged/deducted from sender
func (*ClaimFromRewardingFund) Data ¶
func (c *ClaimFromRewardingFund) Data() []byte
Data returns the additional data
func (*ClaimFromRewardingFund) EthData ¶
func (c *ClaimFromRewardingFund) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*ClaimFromRewardingFund) FillAction ¶
func (act *ClaimFromRewardingFund) FillAction(core *iotextypes.ActionCore)
func (*ClaimFromRewardingFund) IntrinsicGas ¶
func (c *ClaimFromRewardingFund) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a claim action
func (*ClaimFromRewardingFund) LoadProto ¶
func (c *ClaimFromRewardingFund) LoadProto(claim *iotextypes.ClaimFromRewardingFund) error
LoadProto converts a claim action protobuf to a claim action struct
func (*ClaimFromRewardingFund) Proto ¶
func (c *ClaimFromRewardingFund) Proto() *iotextypes.ClaimFromRewardingFund
Proto converts a claim action struct to a claim action protobuf
func (*ClaimFromRewardingFund) SanityCheck ¶
func (c *ClaimFromRewardingFund) SanityCheck() error
SanityCheck validates the variables in the action
func (*ClaimFromRewardingFund) Serialize ¶
func (c *ClaimFromRewardingFund) Serialize() []byte
Serialize returns a raw byte stream of a claim action
type ConsignJSON ¶
type ConsignJSON struct { Type string `json:"type"` Msg string `json:"msg"` Sig string `json:"sig"` }
ConsignJSON is the JSON format of a consignment, it contains the type, message, and signature
type ConsignMsgEther ¶
type ConsignMsgEther struct { BucketIdx uint64 `json:"bucket"` Nonce uint64 `json:"nonce"` Recipient string `json:"recipient"` Reclaim string `json:"reclaim"` }
ConsignMsgEther is the consignment message format of Ethereum
type Consignment ¶
type Consignment interface { Transferor() address.Address Transferee() address.Address AssetID() uint64 TransfereeNonce() uint64 }
Consignment represents a consignment
func NewConsignment ¶
func NewConsignment(data []byte) (Consignment, error)
NewConsignment creates a consignment from data
type CreateStake ¶
type CreateStake struct {
// contains filtered or unexported fields
}
CreateStake defines the action of CreateStake creation
func NewCreateStake ¶
func NewCreateStake( candidateName, amount string, duration uint32, autoStake bool, payload []byte, ) (*CreateStake, error)
NewCreateStake returns a CreateStake instance
func NewCreateStakeFromABIBinary ¶
func NewCreateStakeFromABIBinary(data []byte) (*CreateStake, error)
NewCreateStakeFromABIBinary decodes data into createStake action
func (*CreateStake) AutoStake ¶
func (cs *CreateStake) AutoStake() bool
AutoStake returns the flag of AutoStake s
func (*CreateStake) Candidate ¶
func (cs *CreateStake) Candidate() string
Candidate returns the candidate name
func (*CreateStake) Duration ¶
func (cs *CreateStake) Duration() uint32
Duration returns the CreateStaked duration
func (*CreateStake) EthData ¶
func (cs *CreateStake) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*CreateStake) FillAction ¶
func (act *CreateStake) FillAction(core *iotextypes.ActionCore)
func (*CreateStake) IntrinsicGas ¶
func (cs *CreateStake) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a CreateStake
func (*CreateStake) LoadProto ¶
func (cs *CreateStake) LoadProto(pbAct *iotextypes.StakeCreate) error
LoadProto converts a protobuf's Action to CreateStake
func (*CreateStake) Payload ¶
func (cs *CreateStake) Payload() []byte
Payload returns the payload bytes
func (*CreateStake) Proto ¶
func (cs *CreateStake) Proto() *iotextypes.StakeCreate
Proto converts to protobuf CreateStake Action
func (*CreateStake) SanityCheck ¶
func (cs *CreateStake) SanityCheck() error
SanityCheck validates the variables in the action
func (*CreateStake) Serialize ¶
func (cs *CreateStake) Serialize() []byte
Serialize returns a raw byte stream of the CreateStake struct
type DepositToRewardingFund ¶
type DepositToRewardingFund struct {
// contains filtered or unexported fields
}
DepositToRewardingFund is the action to deposit to the rewarding fund
func NewDepositToRewardingFund ¶
func NewDepositToRewardingFund(amount *big.Int, data []byte) *DepositToRewardingFund
func NewDepositToRewardingFundFromABIBinary ¶
func NewDepositToRewardingFundFromABIBinary(data []byte) (*DepositToRewardingFund, error)
NewDepositToRewardingFundFromABIBinary decodes data into action
func (*DepositToRewardingFund) Amount ¶
func (d *DepositToRewardingFund) Amount() *big.Int
Amount returns the amount to deposit
func (*DepositToRewardingFund) Data ¶
func (d *DepositToRewardingFund) Data() []byte
Data returns the additional data
func (*DepositToRewardingFund) EthData ¶
func (d *DepositToRewardingFund) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*DepositToRewardingFund) FillAction ¶
func (act *DepositToRewardingFund) FillAction(core *iotextypes.ActionCore)
func (*DepositToRewardingFund) IntrinsicGas ¶
func (d *DepositToRewardingFund) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a deposit action
func (*DepositToRewardingFund) LoadProto ¶
func (d *DepositToRewardingFund) LoadProto(deposit *iotextypes.DepositToRewardingFund) error
LoadProto converts a deposit action protobuf to a deposit action struct
func (*DepositToRewardingFund) Proto ¶
func (d *DepositToRewardingFund) Proto() *iotextypes.DepositToRewardingFund
Proto converts a deposit action struct to a deposit action protobuf
func (*DepositToRewardingFund) SanityCheck ¶
func (d *DepositToRewardingFund) SanityCheck() error
SanityCheck validates the variables in the action
func (*DepositToRewardingFund) Serialize ¶
func (d *DepositToRewardingFund) Serialize() []byte
Serialize returns a raw byte stream of a deposit action
type DepositToStake ¶
type DepositToStake struct {
// contains filtered or unexported fields
}
DepositToStake defines the action of stake add deposit
func NewDepositToStake ¶
func NewDepositToStake( index uint64, amount string, payload []byte, ) (*DepositToStake, error)
NewDepositToStake returns a DepositToStake instance
func NewDepositToStakeFromABIBinary ¶
func NewDepositToStakeFromABIBinary(data []byte) (*DepositToStake, error)
NewDepositToStakeFromABIBinary decodes data into depositToStake action
func (*DepositToStake) Amount ¶
func (ds *DepositToStake) Amount() *big.Int
Amount returns the amount
func (*DepositToStake) BucketIndex ¶
func (ds *DepositToStake) BucketIndex() uint64
BucketIndex returns bucket indexs
func (*DepositToStake) EthData ¶
func (ds *DepositToStake) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*DepositToStake) FillAction ¶
func (act *DepositToStake) FillAction(core *iotextypes.ActionCore)
func (*DepositToStake) IntrinsicGas ¶
func (ds *DepositToStake) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a DepositToStake
func (*DepositToStake) LoadProto ¶
func (ds *DepositToStake) LoadProto(pbAct *iotextypes.StakeAddDeposit) error
LoadProto converts a protobuf's Action to DepositToStake
func (*DepositToStake) Payload ¶
func (ds *DepositToStake) Payload() []byte
Payload returns the payload bytes
func (*DepositToStake) Proto ¶
func (ds *DepositToStake) Proto() *iotextypes.StakeAddDeposit
Proto converts to protobuf DepositToStake Action
func (*DepositToStake) SanityCheck ¶
func (ds *DepositToStake) SanityCheck() error
SanityCheck validates the variables in the action
func (*DepositToStake) Serialize ¶
func (ds *DepositToStake) Serialize() []byte
Serialize returns a raw byte stream of the DepositToStake struct
type Deserializer ¶
type Deserializer struct {
// contains filtered or unexported fields
}
Deserializer de-serializes an action
It's a wrapper to set certain parameters in order to correctly de-serialize an action Currently the parameter is EVM network ID for tx in web3 format, it is called like
act, err := (&Deserializer{}).SetEvmNetworkID(id).ActionToSealedEnvelope(pbAction)
func (*Deserializer) ActionToSealedEnvelope ¶
func (ad *Deserializer) ActionToSealedEnvelope(pbAct *iotextypes.Action) (*SealedEnvelope, error)
ActionToSealedEnvelope converts protobuf to SealedEnvelope
func (*Deserializer) SetEvmNetworkID ¶
func (ad *Deserializer) SetEvmNetworkID(id uint32) *Deserializer
SetEvmNetworkID sets the evm network ID for web3 actions
type DynamicFeeTx ¶
type DynamicFeeTx struct {
// contains filtered or unexported fields
}
DynamicFeeTx is a transaction type with dynamic fee cap and tip cap
func NewDynamicFeeTx ¶
func NewDynamicFeeTx(chainID uint32, nonce uint64, gasLimit uint64, gasFeeCap, gasTipCap *big.Int, accessList types.AccessList) *DynamicFeeTx
NewDynamicFeeTx creates a new dynamic fee transaction
func (*DynamicFeeTx) AccessList ¶
func (tx *DynamicFeeTx) AccessList() types.AccessList
func (*DynamicFeeTx) BlobGas ¶
func (tx *DynamicFeeTx) BlobGas() uint64
func (*DynamicFeeTx) BlobGasFeeCap ¶
func (tx *DynamicFeeTx) BlobGasFeeCap() *big.Int
func (*DynamicFeeTx) BlobHashes ¶
func (tx *DynamicFeeTx) BlobHashes() []common.Hash
func (*DynamicFeeTx) BlobTxSidecar ¶
func (tx *DynamicFeeTx) BlobTxSidecar() *types.BlobTxSidecar
func (*DynamicFeeTx) ChainID ¶
func (tx *DynamicFeeTx) ChainID() uint32
func (*DynamicFeeTx) EffectiveGasPrice ¶
func (tx *DynamicFeeTx) EffectiveGasPrice(baseFee *big.Int) *big.Int
func (*DynamicFeeTx) Gas ¶
func (tx *DynamicFeeTx) Gas() uint64
func (*DynamicFeeTx) GasFeeCap ¶
func (tx *DynamicFeeTx) GasFeeCap() *big.Int
func (*DynamicFeeTx) GasPrice ¶
func (tx *DynamicFeeTx) GasPrice() *big.Int
func (*DynamicFeeTx) GasTipCap ¶
func (tx *DynamicFeeTx) GasTipCap() *big.Int
func (*DynamicFeeTx) Nonce ¶
func (tx *DynamicFeeTx) Nonce() uint64
func (*DynamicFeeTx) SanityCheck ¶
func (tx *DynamicFeeTx) SanityCheck() error
func (*DynamicFeeTx) TxType ¶
func (tx *DynamicFeeTx) TxType() uint32
type Envelope ¶
type Envelope interface { TxData TxType() uint32 ChainID() uint32 Destination() (string, bool) Cost() (*big.Int, error) IntrinsicGas() (uint64, error) Size() uint32 Action() Action ToEthTx(uint32, iotextypes.Encoding) (*types.Transaction, error) Proto() *iotextypes.ActionCore ProtoForHash() *iotextypes.ActionCore LoadProto(*iotextypes.ActionCore) error SetNonce(uint64) SetGas(uint64) SetChainID(uint32) SanityCheck() error ValidateSidecar() error }
Envelope defines an envelope wrapped on action with some envelope metadata.
func NewEnvelope ¶
func NewEnvelope(common TxCommonInternal, payload actionPayload) Envelope
NewEnvelope creates a new envelope
func StakingRewardingTxToEnvelope ¶
func StakingRewardingTxToEnvelope(chainID uint32, tx *types.Transaction) (Envelope, error)
type EnvelopeBuilder ¶
type EnvelopeBuilder struct {
// contains filtered or unexported fields
}
EnvelopeBuilder is the builder to build Envelope. TODO: change envelope to *envelope
func (*EnvelopeBuilder) Build ¶
func (b *EnvelopeBuilder) Build() Envelope
Build builds a new action.
func (*EnvelopeBuilder) BuildExecution ¶
func (b *EnvelopeBuilder) BuildExecution(tx *types.Transaction) (Envelope, error)
BuildExecution loads executino action into envelope
func (*EnvelopeBuilder) BuildRewardingAction ¶
func (b *EnvelopeBuilder) BuildRewardingAction(tx *types.Transaction) (Envelope, error)
BuildRewardingAction loads rewarding action into envelope from abi-encoded data
func (*EnvelopeBuilder) BuildStakingAction ¶
func (b *EnvelopeBuilder) BuildStakingAction(tx *types.Transaction) (Envelope, error)
BuildStakingAction loads staking action into envelope from abi-encoded data
func (*EnvelopeBuilder) BuildTransfer ¶
func (b *EnvelopeBuilder) BuildTransfer(tx *types.Transaction) (Envelope, error)
BuildTransfer loads transfer action into envelope
func (*EnvelopeBuilder) SetAccessList ¶
func (b *EnvelopeBuilder) SetAccessList(acl types.AccessList) *EnvelopeBuilder
func (*EnvelopeBuilder) SetAction ¶
func (b *EnvelopeBuilder) SetAction(action actionPayload) *EnvelopeBuilder
SetAction sets the action payload for the Envelope Builder is building.
func (*EnvelopeBuilder) SetBlobTxData ¶
func (b *EnvelopeBuilder) SetBlobTxData( feeCap *uint256.Int, hashes []common.Hash, sc *types.BlobTxSidecar) *EnvelopeBuilder
func (*EnvelopeBuilder) SetChainID ¶
func (b *EnvelopeBuilder) SetChainID(chainID uint32) *EnvelopeBuilder
SetChainID sets action's chainID.
func (*EnvelopeBuilder) SetDynamicGas ¶
func (b *EnvelopeBuilder) SetDynamicGas(feeCap, tipCap *big.Int) *EnvelopeBuilder
func (*EnvelopeBuilder) SetGasLimit ¶
func (b *EnvelopeBuilder) SetGasLimit(l uint64) *EnvelopeBuilder
SetGasLimit sets action's gas limit.
func (*EnvelopeBuilder) SetGasPrice ¶
func (b *EnvelopeBuilder) SetGasPrice(p *big.Int) *EnvelopeBuilder
SetGasPrice sets action's gas price.
func (*EnvelopeBuilder) SetGasPriceByBytes ¶
func (b *EnvelopeBuilder) SetGasPriceByBytes(buf []byte) *EnvelopeBuilder
SetGasPriceByBytes sets action's gas price from a byte slice source.
func (*EnvelopeBuilder) SetNonce ¶
func (b *EnvelopeBuilder) SetNonce(n uint64) *EnvelopeBuilder
SetNonce sets action's nonce.
func (*EnvelopeBuilder) SetTxType ¶
func (b *EnvelopeBuilder) SetTxType(v uint32) *EnvelopeBuilder
func (*EnvelopeBuilder) SetVersion ¶
func (b *EnvelopeBuilder) SetVersion(v uint32) *EnvelopeBuilder
SetVersion sets action's version.
type EthCompatibleAction ¶
type EthCompatibleAction interface { EthTo() (*common.Address, error) Value() *big.Int EthData() ([]byte, error) }
EthCompatibleAction is the action which is compatible to be converted to eth tx
type Execution ¶
type Execution struct {
// contains filtered or unexported fields
}
Execution defines the struct of account-based contract execution
func NewExecution ¶
NewExecution returns an Execution instance (w/o access list)
func (*Execution) Destination ¶
Destination returns a contract address
func (*Execution) FillAction ¶
func (act *Execution) FillAction(core *iotextypes.ActionCore)
func (*Execution) GasLimitForCost ¶
func (ex *Execution) GasLimitForCost()
GasLimitForCost is an empty func to indicate that gas limit should be used to calculate action's cost
func (*Execution) IntrinsicGas ¶
IntrinsicGas returns the intrinsic gas of an execution
func (*Execution) LoadProto ¶
func (ex *Execution) LoadProto(pbAct *iotextypes.Execution) error
LoadProto converts a protobuf's Execution to Execution
func (*Execution) Proto ¶
func (ex *Execution) Proto() *iotextypes.Execution
Proto converts Execution to protobuf's Execution
func (*Execution) SanityCheck ¶
SanityCheck validates the variables in the action
type GrantReward ¶
type GrantReward struct {
// contains filtered or unexported fields
}
GrantReward is the action to grant either block or epoch reward
func NewGrantReward ¶
func NewGrantReward(rewardType int, height uint64) *GrantReward
func (*GrantReward) EthData ¶
func (g *GrantReward) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*GrantReward) FillAction ¶
func (act *GrantReward) FillAction(core *iotextypes.ActionCore)
func (*GrantReward) Height ¶
func (g *GrantReward) Height() uint64
Height returns the block height to grant reward
func (*GrantReward) IntrinsicGas ¶
func (*GrantReward) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a grant reward action, which is 0
func (*GrantReward) LoadProto ¶
func (g *GrantReward) LoadProto(gProto *iotextypes.GrantReward) error
LoadProto converts a grant reward action protobuf to a grant reward action struct
func (*GrantReward) Proto ¶
func (g *GrantReward) Proto() *iotextypes.GrantReward
Proto converts a grant reward action struct to a grant reward action protobuf
func (*GrantReward) RewardType ¶
func (g *GrantReward) RewardType() int
RewardType returns the grant reward type
func (*GrantReward) SanityCheck ¶
func (*GrantReward) SanityCheck() error
func (*GrantReward) Serialize ¶
func (g *GrantReward) Serialize() []byte
Serialize returns a raw byte stream of a grant reward action
type LegacyTx ¶
type LegacyTx struct {
// contains filtered or unexported fields
}
LegacyTx is the legacy transaction
func NewLegacyTx ¶
NewLegacyTx creates a new legacy transaction
func (*LegacyTx) AccessList ¶
func (tx *LegacyTx) AccessList() types.AccessList
func (*LegacyTx) BlobGasFeeCap ¶
func (*LegacyTx) BlobHashes ¶
func (*LegacyTx) BlobTxSidecar ¶
func (tx *LegacyTx) BlobTxSidecar() *types.BlobTxSidecar
func (*LegacyTx) SanityCheck ¶
type Log ¶
type Log struct { Address string Topics Topics Data []byte BlockHeight uint64 ActionHash hash.Hash256 Index, TxIndex uint32 NotFixTopicCopyBug bool }
Log stores an evm contract event
func (*Log) ConvertFromLogPb ¶
func (log *Log) ConvertFromLogPb(pbLog *iotextypes.Log)
ConvertFromLogPb converts a protobuf's LogPb to Log
func (*Log) ConvertToLogPb ¶
func (log *Log) ConvertToLogPb() *iotextypes.Log
ConvertToLogPb converts a Log to protobuf's Log
func (*Log) Deserialize ¶
Deserialize parse the byte stream into Log
type MigrateStake ¶
type MigrateStake struct {
// contains filtered or unexported fields
}
func NewMigrateStake ¶
func NewMigrateStake(index uint64) *MigrateStake
NewMigrateStake returns a MigrateStake instance
func NewMigrateStakeFromABIBinary ¶
func NewMigrateStakeFromABIBinary(data []byte) (*MigrateStake, error)
NewMigrateStakeFromABIBinary decodes data into MigrateStake
func (*MigrateStake) BucketIndex ¶
func (ms *MigrateStake) BucketIndex() uint64
BucketIndex returns bucket index
func (*MigrateStake) EthData ¶
func (ms *MigrateStake) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*MigrateStake) FillAction ¶
func (act *MigrateStake) FillAction(core *iotextypes.ActionCore)
func (*MigrateStake) GasLimitForCost ¶
func (ms *MigrateStake) GasLimitForCost()
GasLimitForCost is an empty func to indicate that gas limit should be used to calculate action's cost
func (*MigrateStake) IntrinsicGas ¶
func (ms *MigrateStake) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a Restake
func (*MigrateStake) LoadProto ¶
func (ms *MigrateStake) LoadProto(pbAct *iotextypes.StakeMigrate) error
LoadProto converts a protobuf's Action to Restake
func (*MigrateStake) Proto ¶
func (ms *MigrateStake) Proto() *iotextypes.StakeMigrate
Proto converts to protobuf Restake Action
func (*MigrateStake) SanityCheck ¶
func (*MigrateStake) SanityCheck() error
func (*MigrateStake) Serialize ¶
func (ms *MigrateStake) Serialize() []byte
Serialize returns a raw byte stream of the Stake again struct
type PutPollResult ¶
type PutPollResult struct {
// contains filtered or unexported fields
}
PutPollResult represents put the poll result from gravity chain.
func NewPutPollResult ¶
func NewPutPollResult( height uint64, candidates state.CandidateList, ) *PutPollResult
NewPutPollResult instantiates a putting poll result action struct.
func (*PutPollResult) Candidates ¶
func (r *PutPollResult) Candidates() state.CandidateList
Candidates returns the list of candidates.
func (*PutPollResult) FillAction ¶
func (act *PutPollResult) FillAction(core *iotextypes.ActionCore)
func (*PutPollResult) Height ¶
func (r *PutPollResult) Height() uint64
Height returns put poll result height.
func (*PutPollResult) IntrinsicGas ¶
func (r *PutPollResult) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a put poll result action
func (*PutPollResult) LoadProto ¶
func (r *PutPollResult) LoadProto(putPollResultPb *iotextypes.PutPollResult) error
LoadProto converts a proto message into put block action.
func (*PutPollResult) Proto ¶
func (r *PutPollResult) Proto() *iotextypes.PutPollResult
Proto converts put poll result action into a proto message.
func (*PutPollResult) SanityCheck ¶
func (r *PutPollResult) SanityCheck() error
func (*PutPollResult) Serialize ¶
func (r *PutPollResult) Serialize() []byte
Serialize returns the byte representation of put poll result action.
type Receipt ¶
type Receipt struct { Status uint64 BlockHeight uint64 ActionHash hash.Hash256 GasConsumed uint64 BlobGasUsed uint64 BlobGasPrice *big.Int ContractAddress string TxIndex uint32 EffectiveGasPrice *big.Int // contains filtered or unexported fields }
Receipt represents the result of a contract
func (*Receipt) AddTransactionLogs ¶
func (receipt *Receipt) AddTransactionLogs(logs ...*TransactionLog) *Receipt
AddTransactionLogs add transaction logs to receipt and filter out nil log.
func (*Receipt) ConvertFromReceiptPb ¶
func (receipt *Receipt) ConvertFromReceiptPb(pbReceipt *iotextypes.Receipt)
ConvertFromReceiptPb converts a protobuf's Receipt to Receipt
func (*Receipt) ConvertToReceiptPb ¶
func (receipt *Receipt) ConvertToReceiptPb() *iotextypes.Receipt
ConvertToReceiptPb converts a Receipt to protobuf's Receipt
func (*Receipt) Deserialize ¶
Deserialize parse the byte stream into Receipt
func (*Receipt) ExecutionRevertMsg ¶
ExecutionRevertMsg returns the list of execution revert error logs stored in receipt.
func (*Receipt) PriorityFee ¶
func (*Receipt) SetExecutionRevertMsg ¶
SetExecutionRevertMsg sets executionerrorlogs to receipt.
func (*Receipt) TransactionLogs ¶
func (receipt *Receipt) TransactionLogs() []*TransactionLog
TransactionLogs returns the list of transaction logs stored in receipt
func (*Receipt) UpdateIndex ¶
UpdateIndex updates the index of receipt and logs, and returns the next log index
type Restake ¶
type Restake struct {
// contains filtered or unexported fields
}
Restake defines the action of stake again
func NewRestake ¶
NewRestake returns a Restake instance
func NewRestakeFromABIBinary ¶
NewRestakeFromABIBinary decodes data into Restake action
func (*Restake) BucketIndex ¶
BucketIndex returns bucket index
func (*Restake) FillAction ¶
func (act *Restake) FillAction(core *iotextypes.ActionCore)
func (*Restake) IntrinsicGas ¶
IntrinsicGas returns the intrinsic gas of a Restake
func (*Restake) LoadProto ¶
func (rs *Restake) LoadProto(pbAct *iotextypes.StakeRestake) error
LoadProto converts a protobuf's Action to Restake
func (*Restake) Proto ¶
func (rs *Restake) Proto() *iotextypes.StakeRestake
Proto converts to protobuf Restake Action
func (*Restake) SanityCheck ¶
type SealedEnvelope ¶
type SealedEnvelope struct { Envelope // contains filtered or unexported fields }
SealedEnvelope is a signed action envelope.
func AssembleSealedEnvelope ¶
func AssembleSealedEnvelope(act Envelope, pk crypto.PublicKey, sig []byte) *SealedEnvelope
AssembleSealedEnvelope assembles a SealedEnvelope use Envelope, Sender Address and Signature. This method should be only used in tests.
func FakeSeal ¶
func FakeSeal(act Envelope, pubk crypto.PublicKey) *SealedEnvelope
FakeSeal creates a SealedActionEnvelope without signature. This method should be only used in tests.
func Sign ¶
func Sign(act Envelope, sk crypto.PrivateKey) (*SealedEnvelope, error)
Sign signs the action using sender's private key
func SignedCandidateActivate ¶
func SignedCandidateActivate( nonce uint64, bucketIndex uint64, gasLimit uint64, gasPrice *big.Int, registererPriKey crypto.PrivateKey, options ...SignedActionOption, ) (*SealedEnvelope, error)
SignedCandidateActivate returns a signed candidate selfstake
func SignedCandidateEndorsement ¶
func SignedCandidateEndorsement( nonce uint64, bucketIndex uint64, op CandidateEndorsementOp, gasLimit uint64, gasPrice *big.Int, registererPriKey crypto.PrivateKey, options ...SignedActionOption, ) (*SealedEnvelope, error)
SignedCandidateEndorsement returns a signed candidate endorsement
func SignedCandidateEndorsementLegacy ¶
func SignedCandidateEndorsementLegacy( nonce uint64, bucketIndex uint64, endorse bool, gasLimit uint64, gasPrice *big.Int, registererPriKey crypto.PrivateKey, options ...SignedActionOption, ) (*SealedEnvelope, error)
SignedCandidateEndorsementLegacy returns a signed candidate endorsement
func SignedCandidateRegister ¶
func SignedCandidateRegister( nonce uint64, name, operatorAddrStr, rewardAddrStr, ownerAddrStr, amountStr string, duration uint32, autoStake bool, payload []byte, gasLimit uint64, gasPrice *big.Int, registererPriKey crypto.PrivateKey, options ...SignedActionOption, ) (*SealedEnvelope, error)
SignedCandidateRegister returns a signed candidate register
func SignedCandidateTransferOwnership ¶
func SignedCandidateTransferOwnership( nonce uint64, ownerAddrStr string, payload []byte, gasLimit uint64, gasPrice *big.Int, senderPriKey crypto.PrivateKey, options ...SignedActionOption, ) (*SealedEnvelope, error)
SignedCandidateTransferOwnership returns a signed candidate transfer ownership
func SignedCandidateUpdate ¶
func SignedCandidateUpdate( nonce uint64, name, operatorAddrStr, rewardAddrStr string, gasLimit uint64, gasPrice *big.Int, registererPriKey crypto.PrivateKey, options ...SignedActionOption, ) (*SealedEnvelope, error)
SignedCandidateUpdate returns a signed candidate update
func SignedChangeCandidate ¶
func SignedChangeCandidate( nonce uint64, candName string, bucketIndex uint64, payload []byte, gasLimit uint64, gasPrice *big.Int, stakerPriKey crypto.PrivateKey, options ...SignedActionOption, ) (*SealedEnvelope, error)
SignedChangeCandidate returns a signed change candidate
func SignedClaimReward ¶
func SignedClaimReward( nonce uint64, gasLimit uint64, gasPrice *big.Int, senderPriKey crypto.PrivateKey, amount *big.Int, payload []byte, address address.Address, options ...SignedActionOption, ) (*SealedEnvelope, error)
func SignedClaimRewardLegacy ¶
func SignedClaimRewardLegacy( nonce uint64, gasLimit uint64, gasPrice *big.Int, senderPriKey crypto.PrivateKey, amount *big.Int, payload []byte, options ...SignedActionOption, ) (*SealedEnvelope, error)
func SignedCreateStake ¶
func SignedCreateStake(nonce uint64, candidateName, amount string, duration uint32, autoStake bool, payload []byte, gasLimit uint64, gasPrice *big.Int, stakerPriKey crypto.PrivateKey, options ...SignedActionOption, ) (*SealedEnvelope, error)
SignedCreateStake returns a signed create stake
func SignedDepositToStake ¶
func SignedDepositToStake( nonce uint64, index uint64, amount string, payload []byte, gasLimit uint64, gasPrice *big.Int, depositorPriKey crypto.PrivateKey, options ...SignedActionOption, ) (*SealedEnvelope, error)
SignedDepositToStake returns a signed deposit to stake
func SignedExecution ¶
func SignedExecution(contractAddr string, executorPriKey crypto.PrivateKey, nonce uint64, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte, options ...SignedActionOption) (*SealedEnvelope, error)
SignedExecution return a signed execution
func SignedMigrateStake ¶
func SignedMigrateStake( nonce uint64, bucketIndex uint64, gasLimit uint64, gasPrice *big.Int, senderPriKey crypto.PrivateKey, options ...SignedActionOption, ) (*SealedEnvelope, error)
func SignedReclaimStake ¶
func SignedReclaimStake( withdraw bool, nonce uint64, bucketIndex uint64, payload []byte, gasLimit uint64, gasPrice *big.Int, reclaimerPriKey crypto.PrivateKey, options ...SignedActionOption, ) (*SealedEnvelope, error)
SignedReclaimStake returns a signed unstake or withdraw stake
func SignedRestake ¶
func SignedRestake( nonce uint64, index uint64, duration uint32, autoStake bool, payload []byte, gasLimit uint64, gasPrice *big.Int, restakerPriKey crypto.PrivateKey, options ...SignedActionOption, ) (*SealedEnvelope, error)
SignedRestake returns a signed restake
func SignedTransfer ¶
func SignedTransfer(recipientAddr string, senderPriKey crypto.PrivateKey, nonce uint64, amount *big.Int, payload []byte, gasLimit uint64, gasPrice *big.Int, options ...SignedActionOption) (*SealedEnvelope, error)
SignedTransfer return a signed transfer
func SignedTransferStake ¶
func SignedTransferStake( nonce uint64, voterAddress string, bucketIndex uint64, payload []byte, gasLimit uint64, gasPrice *big.Int, stakerPriKey crypto.PrivateKey, options ...SignedActionOption, ) (*SealedEnvelope, error)
SignedTransferStake returns a signed transfer stake
func (*SealedEnvelope) Encoding ¶
func (sealed *SealedEnvelope) Encoding() uint32
Encoding returns the encoding
func (*SealedEnvelope) Hash ¶
func (sealed *SealedEnvelope) Hash() (hash.Hash256, error)
Hash returns the hash value of SealedEnvelope. an all-0 return value means the transaction is invalid
func (*SealedEnvelope) Proto ¶
func (sealed *SealedEnvelope) Proto() *iotextypes.Action
Proto converts it to it's proto scheme.
func (*SealedEnvelope) SenderAddress ¶
func (sealed *SealedEnvelope) SenderAddress() address.Address
SenderAddress returns address of the source public key
func (*SealedEnvelope) Signature ¶
func (sealed *SealedEnvelope) Signature() []byte
Signature returns signature bytes
func (*SealedEnvelope) SrcPubkey ¶
func (sealed *SealedEnvelope) SrcPubkey() crypto.PublicKey
SrcPubkey returns the source public key
func (*SealedEnvelope) ToEthTx ¶
func (sealed *SealedEnvelope) ToEthTx() (*types.Transaction, error)
ToEthTx converts to Ethereum tx
func (*SealedEnvelope) VerifySignature ¶
func (sealed *SealedEnvelope) VerifySignature() error
VerifySignature verifies the action using sender's public key
type SealedEnvelopeValidator ¶
type SealedEnvelopeValidator interface { // Validate returns an error if any validation failed Validate(context.Context, *SealedEnvelope) error }
SealedEnvelopeValidator is the interface of validating an SealedEnvelope action
type SignedActionOption ¶
type SignedActionOption func(*EnvelopeBuilder)
func WithChainID ¶
func WithChainID(chainID uint32) SignedActionOption
type TransactionLog ¶
type TransactionLog struct { Type iotextypes.TransactionLogType Amount *big.Int Sender string Recipient string }
TransactionLog stores a transaction event
type Transfer ¶
type Transfer struct {
// contains filtered or unexported fields
}
Transfer defines the struct of account-based transfer
func NewTransfer ¶
NewTransfer returns a Transfer instance
func (*Transfer) Destination ¶
Destination returns the recipient address as destination.
func (*Transfer) FillAction ¶
func (tsf *Transfer) FillAction(act *iotextypes.ActionCore)
func (*Transfer) IntrinsicGas ¶
IntrinsicGas returns the intrinsic gas of a transfer
func (*Transfer) LoadProto ¶
func (tsf *Transfer) LoadProto(pbAct *iotextypes.Transfer) error
LoadProto converts a protobuf's Action to Transfer
func (*Transfer) Proto ¶
func (tsf *Transfer) Proto() *iotextypes.Transfer
Proto converts Transfer to protobuf's Action
func (*Transfer) Recipient ¶
Recipient returns the recipient address. It's the wrapper of Action.DstAddr
func (*Transfer) SanityCheck ¶
SanityCheck validates the variables in the action
type TransferStake ¶
type TransferStake struct {
// contains filtered or unexported fields
}
TransferStake defines the action of transfering stake ownership ts the other
func NewTransferStake ¶
func NewTransferStake( voterAddress string, bucketIndex uint64, payload []byte, ) (*TransferStake, error)
NewTransferStake returns a TransferStake instance
func NewTransferStakeFromABIBinary ¶
func NewTransferStakeFromABIBinary(data []byte) (*TransferStake, error)
NewTransferStakeFromABIBinary decodes data into TransferStake action
func (*TransferStake) BucketIndex ¶
func (ts *TransferStake) BucketIndex() uint64
BucketIndex returns bucket index
func (*TransferStake) EthData ¶
func (ts *TransferStake) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*TransferStake) FillAction ¶
func (act *TransferStake) FillAction(core *iotextypes.ActionCore)
func (*TransferStake) IntrinsicGas ¶
func (ts *TransferStake) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a TransferStake
func (*TransferStake) LoadProto ¶
func (ts *TransferStake) LoadProto(pbAct *iotextypes.StakeTransferOwnership) error
LoadProto loads transfer stake protobuf
func (*TransferStake) Payload ¶
func (ts *TransferStake) Payload() []byte
Payload returns the payload bytes
func (*TransferStake) Proto ¶
func (ts *TransferStake) Proto() *iotextypes.StakeTransferOwnership
Proto converts transfer stake to protobuf
func (*TransferStake) SanityCheck ¶
func (ts *TransferStake) SanityCheck() error
func (*TransferStake) Serialize ¶
func (ts *TransferStake) Serialize() []byte
Serialize returns a raw byte stream of the transfer stake action struct
func (*TransferStake) VoterAddress ¶
func (ts *TransferStake) VoterAddress() address.Address
VoterAddress returns the address of recipient
type TxCommon ¶
type TxCommon interface { Nonce() uint64 Gas() uint64 GasPrice() *big.Int TxDynamicGas AccessList() types.AccessList TxBlob }
type TxCommonInternal ¶
type TxContainer ¶
type TxData ¶
TxData is the interface required to execute a transaction by EVM It follows the same-name interface in go-ethereum
type TxDataForSimulation ¶
type TxDataForSimulation interface { TxData SanityCheck() error Proto() *iotextypes.ActionCore }
TxDataForSimulation is the interface to run a simulation
type TxDynamicGas ¶
type Unstake ¶
type Unstake struct {
// contains filtered or unexported fields
}
Unstake defines the action of unstake
func NewUnstake ¶
NewUnstake returns a Unstake instance
func NewUnstakeFromABIBinary ¶
NewUnstakeFromABIBinary decodes data into WithdrawStake action
func (*Unstake) BucketIndex ¶
func (sr *Unstake) BucketIndex() uint64
BucketIndex returns bucket index
func (*Unstake) FillAction ¶
func (act *Unstake) FillAction(core *iotextypes.ActionCore)
func (*Unstake) IntrinsicGas ¶
IntrinsicGas returns the intrinsic gas of a Unstake
func (*Unstake) LoadProto ¶
func (sr *Unstake) LoadProto(pbAct *iotextypes.StakeReclaim) error
LoadProto converts a protobuf's Action to reclaimStake
func (*Unstake) Proto ¶
func (sr *Unstake) Proto() *iotextypes.StakeReclaim
Proto converts to protobuf stake reclaim action struct
func (*Unstake) SanityCheck ¶
func (sr *Unstake) SanityCheck() error
type WithdrawStake ¶
type WithdrawStake struct {
// contains filtered or unexported fields
}
WithdrawStake defines the action of stake withdraw
func NewWithdrawStake ¶
func NewWithdrawStake(bucketIndex uint64, payload []byte) *WithdrawStake
NewWithdrawStake returns a WithdrawStake instance
func NewWithdrawStakeFromABIBinary ¶
func NewWithdrawStakeFromABIBinary(data []byte) (*WithdrawStake, error)
NewWithdrawStakeFromABIBinary decodes data into WithdrawStake action
func (*WithdrawStake) BucketIndex ¶
func (sr *WithdrawStake) BucketIndex() uint64
BucketIndex returns bucket index
func (*WithdrawStake) EthData ¶
func (sw *WithdrawStake) EthData() ([]byte, error)
EthData returns the ABI-encoded data for converting to eth tx
func (*WithdrawStake) FillAction ¶
func (act *WithdrawStake) FillAction(core *iotextypes.ActionCore)
func (*WithdrawStake) IntrinsicGas ¶
func (sw *WithdrawStake) IntrinsicGas() (uint64, error)
IntrinsicGas returns the intrinsic gas of a WithdrawStake
func (*WithdrawStake) LoadProto ¶
func (sr *WithdrawStake) LoadProto(pbAct *iotextypes.StakeReclaim) error
LoadProto converts a protobuf's Action to reclaimStake
func (*WithdrawStake) Payload ¶
func (sr *WithdrawStake) Payload() []byte
Payload returns the payload bytes
func (*WithdrawStake) Proto ¶
func (sr *WithdrawStake) Proto() *iotextypes.StakeReclaim
Proto converts to protobuf stake reclaim action struct
func (*WithdrawStake) SanityCheck ¶
func (sr *WithdrawStake) SanityCheck() error
Source Files ¶
- actctx.go
- action.go
- action_deserializer.go
- blob_data.go
- builder.go
- candidate_activate.go
- candidate_endorsement.go
- candidate_register.go
- candidate_transfer_ownership.go
- candidate_update.go
- claimreward.go
- consignment_transfer.go
- const.go
- depositreward.go
- envelope.go
- evm_transaction.go
- execution.go
- grantreward.go
- putpollresult.go
- receipt.go
- reward_common.go
- rlp_tx.go
- sealedenvelope.go
- sealedenvelopevalidator.go
- signedaction.go
- stake_adddeposit.go
- stake_changecandidate.go
- stake_common.go
- stake_create.go
- stake_migrate.go
- stake_reclaim.go
- stake_restake.go
- stake_transferownership.go
- transfer.go
- tx_access_list.go
- tx_blob.go
- tx_container.go
- tx_dynamic_fee.go
- tx_legacy.go