Versions in this module Expand all Collapse all v0 v0.0.2 Aug 11, 2023 Changes in this version + const AccessListTxType + const BloomByteLength + const DynamicFeeTxType + const LegacyTxType + var ErrMissingPrefix = fmt.Errorf("hex string without 0x prefix") + var ErrOddLength = fmt.Errorf("hex string of odd length") + var ErrSyntax = fmt.Errorf("invalid hex string") + func GenerateTransactionAndSigner(nonce uint64, to *Address, value *big.Int, data []byte) (*Transaction, *Signer, error) + func InitEIP155Signer(chainId *big.Int) + func MarshalObjects(objs []*T) ([]byte, error) + func MarshalReceipts(objs []*Receipt) ([]byte, error) + func MarshalTransactions(objs []*Transaction) ([]byte, error) + func PrefixedRlpHash(prefix byte, x interface{}) *common.Hash + func RecoverPlain(hash []byte, R, S, Vb *big.Int, homestead bool) ([]byte, error) + func RlpHash(x interface{}) *common.Hash + func UnmarshalObjects(data []byte) ([]*T, error) + type AccessListTx struct + AccessList types.AccessList + ChainID *big.Int + Data []byte + Gas uint64 + GasPrice *big.Int + Nonce uint64 + R *big.Int + S *big.Int + To *common.Address + V *big.Int + Value *big.Int + func (tx *AccessListTx) GetAccessList() types.AccessList + func (tx *AccessListTx) GetChainID() *big.Int + func (tx *AccessListTx) GetData() []byte + func (tx *AccessListTx) GetGas() uint64 + func (tx *AccessListTx) GetGasFeeCap() *big.Int + func (tx *AccessListTx) GetGasPrice() *big.Int + func (tx *AccessListTx) GetGasTipCap() *big.Int + func (tx *AccessListTx) GetNonce() uint64 + func (tx *AccessListTx) GetTo() *common.Address + func (tx *AccessListTx) GetValue() *big.Int + func (tx *AccessListTx) RawSignatureValues() (v, r, s *big.Int) + func (tx *AccessListTx) TxType() byte + type Address struct + func NewAddress(b []byte) *Address + func NewAddressByStr(s string) *Address + func (a *Address) Bytes() []byte + func (a *Address) MarshalJSON() ([]byte, error) + func (a *Address) SetBytes(b []byte) + func (a *Address) String() string + func (a *Address) UnmarshalJSON(data []byte) error + func (h *Address) ETHAddress() common.Address + type Block struct + BlockHash *Hash + BlockHeader *BlockHeader + Extra []byte + Signature []byte + Transactions []*Transaction + func (b *Block) Hash() *Hash + func (b *Block) Height() uint64 + func (b *Block) Marshal() ([]byte, error) + func (b *Block) Size() int + func (b *Block) Unmarshal(data []byte) error + type BlockHeader struct + Bloom *Bloom + GasPrice int64 + Number uint64 + ParentHash *Hash + ReceiptRoot *Hash + StateRoot *Hash + Timestamp int64 + TxRoot *Hash + Version []byte + func (h *BlockHeader) Hash() *Hash + func (h *BlockHeader) Marshal() ([]byte, error) + func (h *BlockHeader) Unmarshal(data []byte) error + type Bloom [BloomByteLength]byte + func (b *Bloom) Add(d []byte) + func (b *Bloom) Bytes() []byte + func (b *Bloom) ETHBloom() types.Bloom + func (b *Bloom) OrBloom(bl *Bloom) + func (b *Bloom) SetBytes(d []byte) + func (b *Bloom) Test(topic []byte) bool + type CallArgs struct + AccessList *types.AccessList + ChainID *hexutil.Big + Data *hexutil.Bytes + From *common.Address + Gas *hexutil.Uint64 + GasPrice *hexutil.Big + Input *hexutil.Bytes + MaxFeePerGas *hexutil.Big + MaxPriorityFeePerGas *hexutil.Big + Nonce *hexutil.Uint64 + To *common.Address + Value *hexutil.Big + func (args *CallArgs) GetData() []byte + func (args *CallArgs) GetFrom() common.Address + func (args *CallArgs) ToTransaction() *types.Transaction + type ChainMeta struct + BlockHash *Hash + Height uint64 + func (m *ChainMeta) Marshal() ([]byte, error) + func (m *ChainMeta) Unmarshal(data []byte) error + type CodecObject interface + Marshal func() ([]byte, error) + Unmarshal func(buf []byte) error + type CodecObjectConstraint interface + type CommitEvent struct + Block *Block + LocalList []bool + type DynamicFeeTx struct + AccessList types.AccessList + ChainID *big.Int + Data []byte + Gas uint64 + GasFeeCap *big.Int + GasTipCap *big.Int + Nonce uint64 + R *big.Int + S *big.Int + To *common.Address + V *big.Int + Value *big.Int + func (tx *DynamicFeeTx) GetAccessList() types.AccessList + func (tx *DynamicFeeTx) GetChainID() *big.Int + func (tx *DynamicFeeTx) GetData() []byte + func (tx *DynamicFeeTx) GetGas() uint64 + func (tx *DynamicFeeTx) GetGasFeeCap() *big.Int + func (tx *DynamicFeeTx) GetGasPrice() *big.Int + func (tx *DynamicFeeTx) GetGasTipCap() *big.Int + func (tx *DynamicFeeTx) GetNonce() uint64 + func (tx *DynamicFeeTx) GetTo() *common.Address + func (tx *DynamicFeeTx) GetValue() *big.Int + func (tx *DynamicFeeTx) RawSignatureValues() (v, r, s *big.Int) + func (tx *DynamicFeeTx) TxType() byte + type EIP155Signer struct + type Event struct + Data []byte + EventType EventType + TxHash *Hash + func (e *Event) Marshal() ([]byte, error) + func (e *Event) Unmarshal(data []byte) error + type EventType int32 + const EventOTHER + func (x EventType) String() string + type EvmLog struct + Address *Address + BlockHash *Hash + BlockNumber uint64 + Data []byte + LogIndex uint64 + Removed bool + Topics []*Hash + TransactionHash *Hash + TransactionIndex uint64 + func (l *EvmLog) Marshal() ([]byte, error) + func (l *EvmLog) MarshalJSON() ([]byte, error) + func (l *EvmLog) Unmarshal(data []byte) error + type Hash struct + func NewHash(b []byte) *Hash + func NewHashByStr(s string) *Hash + func (h *Hash) Bytes() []byte + func (h *Hash) CalculateHash() ([]byte, error) + func (h *Hash) ETHHash() common.Hash + func (h *Hash) Equals(other mt.Content) (bool, error) + func (h *Hash) MarshalJSON() ([]byte, error) + func (h *Hash) SetBytes(b []byte) + func (h *Hash) Size() int + func (h *Hash) String() string + func (h *Hash) UnmarshalJSON(data []byte) error + type KeccakState interface + Read func([]byte) (int, error) + type LegacyTx struct + Data []byte + Gas uint64 + GasPrice *big.Int + Nonce uint64 + R *big.Int + S *big.Int + To *common.Address + V *big.Int + Value *big.Int + func (tx *LegacyTx) GetAccessList() types.AccessList + func (tx *LegacyTx) GetChainID() *big.Int + func (tx *LegacyTx) GetData() []byte + func (tx *LegacyTx) GetGas() uint64 + func (tx *LegacyTx) GetGasFeeCap() *big.Int + func (tx *LegacyTx) GetGasPrice() *big.Int + func (tx *LegacyTx) GetGasTipCap() *big.Int + func (tx *LegacyTx) GetNonce() uint64 + func (tx *LegacyTx) GetTo() *common.Address + func (tx *LegacyTx) GetValue() *big.Int + func (tx *LegacyTx) RawSignatureValues() (v, r, s *big.Int) + func (tx *LegacyTx) TxType() byte + type Receipt struct + Bloom *Bloom + ContractAddress *Address + Events []*Event + EvmLogs []*EvmLog + GasUsed uint64 + Ret []byte + Status ReceiptStatus + TxHash *Hash + Version []byte + func UnmarshalReceipts(data []byte) ([]*Receipt, error) + func (r *Receipt) Hash() *Hash + func (r *Receipt) IsSuccess() bool + func (r *Receipt) Marshal() ([]byte, error) + func (r *Receipt) Unmarshal(data []byte) error + type ReceiptStatus int32 + const ReceiptFAILED + const ReceiptSUCCESS + func (x ReceiptStatus) String() string + type Signer struct + Addr *Address + Sk *ecdsa.PrivateKey + func GenerateSigner() (*Signer, error) + type Transaction struct + Inner TxData + Time time.Time + func GenerateEmptyTransactionAndSigner() (*Transaction, error) + func GenerateTransactionWithSigner(nonce uint64, to *Address, value *big.Int, data []byte, s *Signer) (*Transaction, error) + func UnmarshalTransactions(data []byte) ([]*Transaction, error) + func (e *Transaction) FromCallArgs(callArgs CallArgs) + func (e *Transaction) GetChainID() *big.Int + func (e *Transaction) GetExtra() []byte + func (e *Transaction) GetFrom() *Address + func (e *Transaction) GetGas() uint64 + func (e *Transaction) GetGasFeeCap() *big.Int + func (e *Transaction) GetGasPrice() *big.Int + func (e *Transaction) GetGasTipCap() *big.Int + func (e *Transaction) GetHash() *Hash + func (e *Transaction) GetInner() TxData + func (e *Transaction) GetNonce() uint64 + func (e *Transaction) GetPayload() []byte + func (e *Transaction) GetRawSignature() (v, r, s *big.Int) + func (e *Transaction) GetSignHash() *Hash + func (e *Transaction) GetSignature() []byte + func (e *Transaction) GetTimeStamp() int64 + func (e *Transaction) GetTo() *Address + func (e *Transaction) GetType() byte + func (e *Transaction) GetValue() *big.Int + func (e *Transaction) GetVersion() []byte + func (e *Transaction) Protected() bool + func (e *Transaction) Size() int + func (e *Transaction) VerifySignature() error + func (tx *Transaction) DecodeRLP(s *rlp.Stream) error + func (tx *Transaction) EncodeRLP(w io.Writer) error + func (tx *Transaction) Marshal() ([]byte, error) + func (tx *Transaction) MarshalBinary() ([]byte, error) + func (tx *Transaction) MarshalJSON() ([]byte, error) + func (tx *Transaction) RbftGetData() []byte + func (tx *Transaction) RbftGetFrom() string + func (tx *Transaction) RbftGetNonce() uint64 + func (tx *Transaction) RbftGetSize() int + func (tx *Transaction) RbftGetTimeStamp() int64 + func (tx *Transaction) RbftGetTxHash() string + func (tx *Transaction) RbftIsConfigTx() bool + func (tx *Transaction) RbftMarshal() ([]byte, error) + func (tx *Transaction) RbftUnmarshal(raw []byte) error + func (tx *Transaction) Sign(prv *ecdsa.PrivateKey) error + func (tx *Transaction) Unmarshal(buf []byte) error + func (tx *Transaction) UnmarshalBinary(b []byte) error + type TransactionMeta struct + BlockHash *Hash + BlockHeight uint64 + Index uint64 + func (m *TransactionMeta) Marshal() ([]byte, error) + func (m *TransactionMeta) Unmarshal(data []byte) error + type TxData interface + GetAccessList func() types.AccessList + GetChainID func() *big.Int + GetData func() []byte + GetGas func() uint64 + GetGasFeeCap func() *big.Int + GetGasPrice func() *big.Int + GetGasTipCap func() *big.Int + GetNonce func() uint64 + GetTo func() *common.Address + GetValue func() *big.Int + RawSignatureValues func() (v, r, s *big.Int) + TxType func() byte + type VpInfo struct + Account string + Hosts []string + Id uint64 + Pid string + func (i *VpInfo) Marshal() ([]byte, error) + func (i *VpInfo) Unmarshal(data []byte) error