Documentation ¶
Overview ¶
+k8s:deepcopy-gen=package Package eth contains data structures for (de)serializing data from Ethereum JSONRPC requests and responses.
Index ¶
- Variables
- func OptionalString(s string) *string
- func ToChecksumAddress(address string) string
- type AccessList
- type AccessListEntry
- type Address
- type Block
- type BlockNumberOrTag
- func (in *BlockNumberOrTag) DeepCopy() *BlockNumberOrTag
- func (in *BlockNumberOrTag) DeepCopyInto(out *BlockNumberOrTag)
- func (b BlockNumberOrTag) MarshalJSON() ([]byte, error)
- func (b *BlockNumberOrTag) Quantity() (Quantity, bool)
- func (b *BlockNumberOrTag) Tag() (Tag, bool)
- func (b *BlockNumberOrTag) UnmarshalJSON(data []byte) error
- type BlockSpecifier
- func (in *BlockSpecifier) DeepCopy() *BlockSpecifier
- func (in *BlockSpecifier) DeepCopyInto(out *BlockSpecifier)
- func (b *BlockSpecifier) GetHash() (*Hash, bool)
- func (b *BlockSpecifier) GetQuantity() (*Quantity, bool)
- func (b *BlockSpecifier) GetTag() (*Tag, bool)
- func (b BlockSpecifier) MarshalJSON() ([]byte, error)
- func (b *BlockSpecifier) UnmarshalJSON(data []byte) error
- type Bloom
- func (b *Bloom) AddAddress(addr Address)
- func (b *Bloom) AddBytes(_bytes []byte)
- func (b *Bloom) AddData32(data Data32)
- func (b *Bloom) AddLog(log Log)
- func (b *Bloom) MatchesAddress(addr Address) bool
- func (b *Bloom) MatchesBytes(_bytes []byte) bool
- func (b *Bloom) MatchesData32(data Data32) bool
- func (b *Bloom) MatchesLog(log Log) bool
- func (b *Bloom) Value() Data256
- type Condition
- type Data
- type Data20
- type Data256
- type Data32
- type Data8
- type Hash
- type Log
- type LogFilter
- type NewHeadsNotificationParams
- type NewHeadsResult
- type NewPendingTxBodyNotificationParams
- type NewPendingTxNotificationParams
- type Quantity
- func MustQuantity(value string) *Quantity
- func NewQuantity(value string) (*Quantity, error)
- func NewQuantityFromRLP(v rlp.Value) (*Quantity, error)
- func OptionalQuantityFromInt(value int) *Quantity
- func QuantityFromBigInt(value *big.Int) Quantity
- func QuantityFromInt64(value int64) Quantity
- func QuantityFromUInt64(value uint64) Quantity
- func (q Quantity) Big() *big.Int
- func (in *Quantity) DeepCopy() *Quantity
- func (q *Quantity) DeepCopyInto(out *Quantity)
- func (q Quantity) Int64() int64
- func (q Quantity) MarshalJSON() ([]byte, error)
- func (q Quantity) RLP() rlp.Value
- func (q Quantity) String() string
- func (q Quantity) UInt64() uint64
- func (q *Quantity) UnmarshalJSON(data []byte) error
- type Signature
- func (s *Signature) ChainId() (*Quantity, error)
- func (in *Signature) DeepCopy() *Signature
- func (in *Signature) DeepCopyInto(out *Signature)
- func (s *Signature) EIP155Values() (R Quantity, S Quantity, V Quantity)
- func (s *Signature) EIP2718Values() (R Quantity, S Quantity, V Quantity)
- func (s *Signature) Recover(hash *Hash) (*Address, error)
- type Tag
- type Topic
- type Transaction
- func (in *Transaction) DeepCopy() *Transaction
- func (in *Transaction) DeepCopyInto(out *Transaction)
- func (t *Transaction) FromRaw(input string) error
- func (t *Transaction) IsProtected() bool
- func (t Transaction) MarshalJSON() ([]byte, error)
- func (t *Transaction) RawRepresentation() (*Data, error)
- func (t *Transaction) RequiredFields() error
- func (t *Transaction) Sign(privateKey string, chainId Quantity) (*Data, error)
- func (t *Transaction) Signature() (*Signature, error)
- func (t *Transaction) SigningHash(chainId Quantity) (*Hash, error)
- func (t *Transaction) SigningPreimage(chainId Quantity) (*Data, error)
- func (t *Transaction) TransactionType() int64
- func (t *Transaction) UnmarshalJSON(data []byte) error
- type TransactionReceipt
- type TxOrHash
- type Uncle
Constants ¶
This section is empty.
Variables ¶
var ( TransactionTypeLegacy = int64(0x0) // TransactionTypeLegacy refers to pre-EIP-2718 transactions. TransactionTypeAccessList = int64(0x1) // TransactionTypeAccessList refers to EIP-2930 transactions. TransactionTypeDynamicFee = int64(0x2) // TransactionTypeDynamicFee refers to EIP-1559 transactions. )
Functions ¶
func OptionalString ¶
OptionalString can be used to generate a string pointer from a static string easily
func ToChecksumAddress ¶
ToChecksumAddress converts a string to the proper EIP55 casing.
Transliteration of this code from the EIP55 wiki page:
function toChecksumAddress (address) { address = address.toLowerCase().replace('0x', '') var hash = createKeccakHash('keccak256').update(address).digest('hex') var ret = '0x' for (var i = 0; i < address.length; i++) { if (parseInt(hash[i], 16) >= 8) { ret += address[i].toUpperCase() } else { ret += address[i] } } return ret }
Types ¶
type AccessList ¶
type AccessList []AccessListEntry
func NewAccessListFromRLP ¶
func NewAccessListFromRLP(v rlp.Value) (AccessList, error)
NewAccessListFromRLP decodes an RLP list into an AccessList, or returns an error. The RLP format of AccessLists is defined in EIP-2930, each entry is a tuple of an address and a list of storage slots.
func (AccessList) DeepCopy ¶
func (in AccessList) DeepCopy() AccessList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessList.
func (AccessList) DeepCopyInto ¶
func (in AccessList) DeepCopyInto(out *AccessList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*AccessList) RLP ¶
func (a *AccessList) RLP() rlp.Value
RLP returns the AccessList as an RLP-encoded list
type AccessListEntry ¶
type AccessListEntry struct { Address Address `json:"address"` StorageKeys []Data32 `json:"storageKeys"` }
func (*AccessListEntry) DeepCopy ¶
func (in *AccessListEntry) DeepCopy() *AccessListEntry
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessListEntry.
func (*AccessListEntry) DeepCopyInto ¶
func (in *AccessListEntry) DeepCopyInto(out *AccessListEntry)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Address ¶
type Address Data20
func ECRecover ¶
ECRecover returns the sending address, given a message digest and R, S, V values. Primarily used to recover the sender of eth.Transaction objects.
func MustAddress ¶
func NewAddress ¶
func (Address) MarshalJSON ¶
func (*Address) RLP ¶
RLP returns the Address as an RLP-encoded string, or an empty RLP string for the nil Address.
func (*Address) UnmarshalJSON ¶
type Block ¶
type Block struct { Number *Quantity `json:"number"` Hash *Hash `json:"hash"` ParentHash Hash `json:"parentHash"` SHA3Uncles Data32 `json:"sha3Uncles"` LogsBloom Data256 `json:"logsBloom"` TransactionsRoot Data32 `json:"transactionsRoot"` StateRoot Data32 `json:"stateRoot"` ReceiptsRoot Data32 `json:"receiptsRoot"` Miner Address `json:"miner"` Author Address `json:"author,omitempty"` // Parity-specific alias of miner Difficulty Quantity `json:"difficulty"` TotalDifficulty Quantity `json:"totalDifficulty"` ExtraData Data `json:"extraData"` Size Quantity `json:"size"` GasLimit Quantity `json:"gasLimit"` GasUsed Quantity `json:"gasUsed"` Timestamp Quantity `json:"timestamp"` Transactions []TxOrHash `json:"transactions"` Uncles []Hash `json:"uncles"` // EIP-1559 BaseFeePerGas BaseFeePerGas *Quantity `json:"baseFeePerGas,omitempty"` // Ethhash POW Fields Nonce *Data8 `json:"nonce"` MixHash *Data `json:"mixHash"` // POA Fields (Aura) Step *string `json:"step,omitempty"` Signature *string `json:"signature,omitempty"` // Parity Specific Fields SealFields *[]Data `json:"sealFields,omitempty"` // contains filtered or unexported fields }
func (*Block) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Block.
func (*Block) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Block) DepopulateTransactions ¶
func (b *Block) DepopulateTransactions()
func (Block) MarshalJSON ¶
func (*Block) UnmarshalJSON ¶
type BlockNumberOrTag ¶
type BlockNumberOrTag struct {
// contains filtered or unexported fields
}
func MustBlockNumberOrTag ¶
func MustBlockNumberOrTag(value string) *BlockNumberOrTag
func NewBlockNumberOrTag ¶
func NewBlockNumberOrTag(value string) (*BlockNumberOrTag, error)
func (*BlockNumberOrTag) DeepCopy ¶
func (in *BlockNumberOrTag) DeepCopy() *BlockNumberOrTag
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockNumberOrTag.
func (*BlockNumberOrTag) DeepCopyInto ¶
func (in *BlockNumberOrTag) DeepCopyInto(out *BlockNumberOrTag)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (BlockNumberOrTag) MarshalJSON ¶
func (b BlockNumberOrTag) MarshalJSON() ([]byte, error)
func (*BlockNumberOrTag) Quantity ¶
func (b *BlockNumberOrTag) Quantity() (Quantity, bool)
func (*BlockNumberOrTag) Tag ¶
func (b *BlockNumberOrTag) Tag() (Tag, bool)
func (*BlockNumberOrTag) UnmarshalJSON ¶
func (b *BlockNumberOrTag) UnmarshalJSON(data []byte) error
type BlockSpecifier ¶
func MustBlockSpecifier ¶
func MustBlockSpecifier(value interface{}) *BlockSpecifier
func NewBlockSpecifier ¶
func NewBlockSpecifier(value interface{}) (*BlockSpecifier, error)
func NewBlockSpecifierFromMap ¶
func NewBlockSpecifierFromMap(value map[string]interface{}) (*BlockSpecifier, error)
func NewBlockSpecifierFromString ¶
func NewBlockSpecifierFromString(value string) (*BlockSpecifier, error)
func (*BlockSpecifier) DeepCopy ¶
func (in *BlockSpecifier) DeepCopy() *BlockSpecifier
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockSpecifier.
func (*BlockSpecifier) DeepCopyInto ¶
func (in *BlockSpecifier) DeepCopyInto(out *BlockSpecifier)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*BlockSpecifier) GetHash ¶
func (b *BlockSpecifier) GetHash() (*Hash, bool)
func (*BlockSpecifier) GetQuantity ¶
func (b *BlockSpecifier) GetQuantity() (*Quantity, bool)
func (*BlockSpecifier) GetTag ¶
func (b *BlockSpecifier) GetTag() (*Tag, bool)
func (BlockSpecifier) MarshalJSON ¶
func (b BlockSpecifier) MarshalJSON() ([]byte, error)
func (*BlockSpecifier) UnmarshalJSON ¶
func (b *BlockSpecifier) UnmarshalJSON(data []byte) error
type Bloom ¶
type Bloom struct {
// contains filtered or unexported fields
}
+k8s:deepcopy-gen=false
func (*Bloom) AddAddress ¶
func (*Bloom) MatchesAddress ¶
func (*Bloom) MatchesBytes ¶
func (*Bloom) MatchesData32 ¶
func (*Bloom) MatchesLog ¶
type Condition ¶
type Condition json.RawMessage
func (Condition) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (Condition) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Data256 ¶
type Data256 Data
func MustData256 ¶
func NewData256 ¶
func (*Data256) UnmarshalJSON ¶
type Data32 ¶
type Data32 Data
func MustData32 ¶
func (*Data32) UnmarshalJSON ¶
type Log ¶
type Log struct { Removed bool `json:"removed"` LogIndex *Quantity `json:"logIndex"` TxIndex *Quantity `json:"transactionIndex"` TxHash *Hash `json:"transactionHash"` BlockHash *Hash `json:"blockHash"` BlockNumber *Quantity `json:"blockNumber"` Address Address `json:"address"` Data Data `json:"data"` Topics []Topic `json:"topics"` // Parity-specific fields TxLogIndex *Quantity `json:"transactionLogIndex,omitempty"` Type *string `json:"type,omitempty"` }
func (*Log) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Log.
func (*Log) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LogFilter ¶
type LogFilter struct { FromBlock *BlockNumberOrTag `json:"fromBlock,omitempty"` ToBlock *BlockNumberOrTag `json:"toBlock,omitempty"` BlockHash *Hash `json:"blockHash,omitempty"` Address []Address `json:"address,omitempty"` Topics [][]Topic `json:"topics,omitempty"` }
func (*LogFilter) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogFilter.
func (*LogFilter) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*LogFilter) Matches ¶
Matches returns true if this filter matches the passed in log. It follows the rules expressed at: https://eth.wiki/json-rpc/API#a-note-on-specifying-topic-filters
However, note that "tags" for FromBlock and ToBlock are implicitly ignored and treated the same as if the parameter was nil. Callers should replace tags with concrete quantities for block numbers before calling this function.
func (*LogFilter) UnmarshalJSON ¶
type NewHeadsNotificationParams ¶
type NewHeadsNotificationParams struct { Subscription string `json:"subscription"` Result NewHeadsResult `json:"result"` }
func (*NewHeadsNotificationParams) DeepCopy ¶
func (in *NewHeadsNotificationParams) DeepCopy() *NewHeadsNotificationParams
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NewHeadsNotificationParams.
func (*NewHeadsNotificationParams) DeepCopyInto ¶
func (in *NewHeadsNotificationParams) DeepCopyInto(out *NewHeadsNotificationParams)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NewHeadsResult ¶
type NewHeadsResult struct { Number Quantity `json:"number"` Hash Hash `json:"hash"` ParentHash Hash `json:"parentHash"` SHA3Uncles Data32 `json:"sha3Uncles"` LogsBloom Data256 `json:"logsBloom"` TransactionsRoot Data32 `json:"transactionsRoot"` StateRoot Data32 `json:"stateRoot"` ReceiptsRoot Data32 `json:"receiptsRoot"` Miner Address `json:"miner"` Author Address `json:"author,omitempty"` // Parity-specific alias of miner Difficulty Quantity `json:"difficulty"` // TotalDifficulty Quantity `json:"totalDifficulty"` ExtraData Data `json:"extraData"` Size *Quantity `json:"size,omitempty"` // parity includes this geth does not GasLimit Quantity `json:"gasLimit"` GasUsed Quantity `json:"gasUsed"` Timestamp Quantity `json:"timestamp"` // EIP-1559 BaseFeePerGas BaseFeePerGas *Quantity `json:"baseFeePerGas,omitempty"` // Ethhash POW Fields Nonce *Data8 `json:"nonce"` MixHash *Data `json:"mixHash"` // POA Fields (Aura) Step *string `json:"step,omitempty"` Signature *string `json:"signature,omitempty"` // Parity Specific Fields SealFields *[]Data `json:"sealFields,omitempty"` // contains filtered or unexported fields }
NewHeadsResult is the "result" payload in a newHeads notification. It looks a lot like a Block but is missing important fields, namely .TotalDifficulty and .Uncles
func (*NewHeadsResult) DeepCopy ¶
func (in *NewHeadsResult) DeepCopy() *NewHeadsResult
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NewHeadsResult.
func (*NewHeadsResult) DeepCopyInto ¶
func (in *NewHeadsResult) DeepCopyInto(out *NewHeadsResult)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*NewHeadsResult) FromBlock ¶
func (nh *NewHeadsResult) FromBlock(block *Block)
FromBlock can be used to populate a NewHeadsResult with the contents of a Block. It does a best effort to emulate a NewHeadsResult with the same flavor as the Block.
func (NewHeadsResult) MarshalJSON ¶
func (nh NewHeadsResult) MarshalJSON() ([]byte, error)
func (*NewHeadsResult) UnmarshalJSON ¶
func (nh *NewHeadsResult) UnmarshalJSON(data []byte) error
type NewPendingTxBodyNotificationParams ¶
type NewPendingTxBodyNotificationParams struct { Subscription string `json:"subscription"` Result Transaction `json:"result"` }
func (*NewPendingTxBodyNotificationParams) DeepCopy ¶
func (in *NewPendingTxBodyNotificationParams) DeepCopy() *NewPendingTxBodyNotificationParams
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NewPendingTxBodyNotificationParams.
func (*NewPendingTxBodyNotificationParams) DeepCopyInto ¶
func (in *NewPendingTxBodyNotificationParams) DeepCopyInto(out *NewPendingTxBodyNotificationParams)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NewPendingTxNotificationParams ¶
type NewPendingTxNotificationParams struct { Subscription string `json:"subscription"` Result Hash `json:"result"` }
func (*NewPendingTxNotificationParams) DeepCopy ¶
func (in *NewPendingTxNotificationParams) DeepCopy() *NewPendingTxNotificationParams
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NewPendingTxNotificationParams.
func (*NewPendingTxNotificationParams) DeepCopyInto ¶
func (in *NewPendingTxNotificationParams) DeepCopyInto(out *NewPendingTxNotificationParams)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Quantity ¶
type Quantity struct {
// contains filtered or unexported fields
}
func MustQuantity ¶
func NewQuantity ¶
func OptionalQuantityFromInt ¶
func QuantityFromBigInt ¶
func QuantityFromInt64 ¶
func QuantityFromUInt64 ¶
func (*Quantity) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Quantity.
func (*Quantity) DeepCopyInto ¶
DeepCopyInto copies Quantity values into out
func (Quantity) MarshalJSON ¶
func (*Quantity) UnmarshalJSON ¶
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
func ECSign ¶
ECSign returns the signature values for a given message hash for the given chainId using the bytes of given private key. Primarily used to sign transactions before submitting them with eth_sendRawTransaction.
TODO: Currently there's no clean way to do this in with the Go runtime Looks like there have been multiple attempts to get the Koblitz curve (secp256k1) supported in golang
https://github.com/golang/go/pull/26873 <-- rejected https://github.com/golang/go/issues/26776 <-- rejected
For the meantime, we will use btcd's eliptic curve implementation.
func NewEIP155Signature ¶
NewEIP155Signature creates a new Signature from EIP-155 packed R,S,V values
func NewEIP2718Signature ¶
NewEIP2718Signature creates a new Signature from discrete chainId, R, S, and V values.
func (*Signature) ChainId ¶
ChainId returns the chain id included in the signature, or an error if signature was created with unprotected pre-EIP-155 R, S, and V values.
func (*Signature) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Signature.
func (*Signature) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Signature) EIP155Values ¶
EIP155Values returns the expected R,S, and V values for an EIP-155 Signature. Namely, the V value includes the EIP-155 encoded chain id.
func (*Signature) EIP2718Values ¶
EIP2718Values returns the expected R, S, and V values for EIP-2718 signatures. Namely, the V value is simply the 0x0 or 0x1 parity bit.
type Transaction ¶
type Transaction struct { Type *Quantity `json:"type,omitempty"` BlockHash *Hash `json:"blockHash"` BlockNumber *Quantity `json:"blockNumber"` From Address `json:"from"` Gas Quantity `json:"gas"` Hash Hash `json:"hash"` Input Data `json:"input"` Nonce Quantity `json:"nonce"` To *Address `json:"to"` Index *Quantity `json:"transactionIndex"` Value Quantity `json:"value"` V Quantity `json:"v"` R Quantity `json:"r"` S Quantity `json:"s"` // Gas Price (optional since not included in EIP-1559) GasPrice *Quantity `json:"gasPrice,omitempty"` // EIP-1559 MaxFeePerGas/MaxPriorityFeePerGas (optional since only included in EIP-1559 transactions) MaxFeePerGas *Quantity `json:"maxFeePerGas,omitempty"` MaxPriorityFeePerGas *Quantity `json:"maxPriorityFeePerGas,omitempty"` // Parity Fields StandardV *Quantity `json:"standardV,omitempty"` Raw *Data `json:"raw,omitempty"` PublicKey *Data `json:"publicKey,omitempty"` ChainId *Quantity `json:"chainId,omitempty"` Creates *Address `json:"creates,omitempty"` // Parity wiki claims this is a Hash Condition *Condition `json:"condition,omitempty"` // EIP-2930 accessList AccessList *AccessList `json:"accessList,omitempty"` // contains filtered or unexported fields }
func (*Transaction) DeepCopy ¶
func (in *Transaction) DeepCopy() *Transaction
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Transaction.
func (*Transaction) DeepCopyInto ¶
func (in *Transaction) DeepCopyInto(out *Transaction)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Transaction) FromRaw ¶
func (t *Transaction) FromRaw(input string) error
FromRaw populates a Transaction's fields from the raw transaction data supplied as a hexadecimal encoded string. For pre-EIP-2718 legacy transactions the input string is an RLP-encoded list, for transaction types defined after EIP-2718 the payload format depends on the transaction type included as the first byte. Unsigned transactions where R, S, and V are zero are not currently supported.
func (*Transaction) IsProtected ¶
func (t *Transaction) IsProtected() bool
IsProtected returns true if a transaction is replay protected, either via EIP-155 or newer transaction formats. This method returns false for transactions with invalid signatures.
func (Transaction) MarshalJSON ¶
func (t Transaction) MarshalJSON() ([]byte, error)
func (*Transaction) RawRepresentation ¶
func (t *Transaction) RawRepresentation() (*Data, error)
RawRepresentation returns the transaction encoded as a raw hexadecimal data string, or an error
func (*Transaction) RequiredFields ¶
func (t *Transaction) RequiredFields() error
RequiredFields inspects the Transaction Type and returns an error if any required fields are missing
func (*Transaction) Sign ¶
func (t *Transaction) Sign(privateKey string, chainId Quantity) (*Data, error)
Sign uses the hex-encoded private key and chainId to update the R, S, and V values for a Transaction, and returns the raw signed transaction or an error.
func (*Transaction) Signature ¶
func (t *Transaction) Signature() (*Signature, error)
Signature returns the R, S, V values for a transaction, and the ChainId if available
func (*Transaction) SigningHash ¶
func (t *Transaction) SigningHash(chainId Quantity) (*Hash, error)
SigningHash returns the Keccak-256 hash of the transaction fields required for transaction signing or an error.
func (*Transaction) SigningPreimage ¶
func (t *Transaction) SigningPreimage(chainId Quantity) (*Data, error)
SigningPreimage returns the opaque data preimage that is required for signing a given transaction type
func (*Transaction) TransactionType ¶
func (t *Transaction) TransactionType() int64
TransactionType returns the transactions EIP-2718 type, or TransactionTypeLegacy for pre-EIP-2718 transactions.
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(data []byte) error
type TransactionReceipt ¶
type TransactionReceipt struct { Type *Quantity `json:"type,omitempty"` TransactionHash Hash `json:"transactionHash"` TransactionIndex Quantity `json:"transactionIndex"` BlockHash Hash `json:"blockHash"` BlockNumber Quantity `json:"blockNumber"` From Address `json:"from"` To *Address `json:"to"` CumulativeGasUsed Quantity `json:"cumulativeGasUsed"` GasUsed Quantity `json:"gasUsed"` ContractAddress *Address `json:"contractAddress"` Logs []Log `json:"logs"` LogsBloom Data256 `json:"logsBloom"` Root *Data32 `json:"root,omitempty"` Status *Quantity `json:"status,omitempty"` EffectiveGasPrice *Quantity `json:"effectiveGasPrice,omitempty"` }
func (*TransactionReceipt) DeepCopy ¶
func (in *TransactionReceipt) DeepCopy() *TransactionReceipt
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TransactionReceipt.
func (*TransactionReceipt) DeepCopyInto ¶
func (in *TransactionReceipt) DeepCopyInto(out *TransactionReceipt)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TransactionReceipt) TransactionType ¶
func (t *TransactionReceipt) TransactionType() int64
TransactionType returns the transactions EIP-2718 type, or TransactionTypeLegacy for pre-EIP-2718 transactions.
type TxOrHash ¶
type TxOrHash struct { Transaction Populated bool `json:"-"` }
func (*TxOrHash) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TxOrHash.
func (*TxOrHash) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (TxOrHash) MarshalJSON ¶
func (*TxOrHash) UnmarshalJSON ¶
type Uncle ¶
type Uncle struct { Number *Quantity `json:"number"` Hash *Hash `json:"hash"` ParentHash Hash `json:"parentHash"` SHA3Uncles Data32 `json:"sha3Uncles"` LogsBloom Data256 `json:"logsBloom"` TransactionsRoot Data32 `json:"transactionsRoot"` StateRoot Data32 `json:"stateRoot"` ReceiptsRoot Data32 `json:"receiptsRoot"` Miner Address `json:"miner"` Author Address `json:"author,omitempty"` // Parity-specific alias of miner Difficulty Quantity `json:"difficulty"` TotalDifficulty *Quantity `json:"totalDifficulty"` // null when using Geth getUncle APIs ExtraData Data `json:"extraData"` Size *Quantity `json:"size"` // null when using parity getUncle APIs GasLimit Quantity `json:"gasLimit"` GasUsed Quantity `json:"gasUsed"` Timestamp Quantity `json:"timestamp"` Transactions []TxOrHash `json:"transactions"` // missing from geth, always empty in parity Uncles []Hash `json:"uncles"` // Ethhash POW Fields Nonce *Data8 `json:"nonce"` MixHash *Data `json:"mixHash"` // POA Fields (Aura) Step *string `json:"step,omitempty"` Signature *string `json:"signature,omitempty"` // Parity Specific Fields SealFields *[]Data `json:"sealFields,omitempty"` // contains filtered or unexported fields }
func (*Uncle) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Uncle.
func (*Uncle) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (Uncle) MarshalJSON ¶
func (*Uncle) UnmarshalJSON ¶
Source Files ¶
- accesslist.go
- address.go
- block.go
- block_from_raw.go
- block_number_or_tag.go
- block_specifier.go
- bloom.go
- data.go
- doc.go
- helpers.go
- logfilter.go
- logs.go
- new_heads.go
- quantity.go
- signature.go
- transaction.go
- transaction_from_raw.go
- transaction_receipt.go
- transaction_signing.go
- uncle.go
- zz_deepcopy_generated.go