ethtypes

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0, MIT Imports: 24 Imported by: 58

Documentation

Index

Constants

View Source
const (
	EthLegacyTxType = 0x00
	EIP1559TxType   = 0x02
)
View Source
const (
	EthEIP1559TxSignatureLen            = 65
	EthLegacyHomesteadTxSignatureLen    = 66
	EthLegacyHomesteadTxSignaturePrefix = 0x01
	EthLegacy155TxSignaturePrefix       = 0x02
	EthLegacyHomesteadTxChainID         = 0x00
)
View Source
const (
	EthAddressLength = 20
	EthHashLength    = 32
)
View Source
const EthBloomSize = 2048
View Source
const SafeEpochDelay = abi.ChainEpoch(30)

Research into Filecoin chain behaviour suggests that probabilistic finality generally approaches the intended stability guarantee at, or near, 30 epochs. Although a strictly "finalized" safe recommendation remains 900 epochs. See https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0089.md

Variables

View Source
var (
	EthLegacy155TxSignatureLen0 int
	EthLegacy155TxSignatureLen1 int
)
View Source
var (
	EmptyEthHash   = EthHash{}
	EmptyUncleHash = must.One(ParseEthHash("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")) // Keccak-256 of an RLP of an empty array
	EmptyRootHash  = must.One(ParseEthHash("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")) // Keccak-256 hash of the RLP of null
	EmptyEthInt    = EthUint64(0)
	EmptyEthNonce  = [8]byte{0, 0, 0, 0, 0, 0, 0, 0}
)
View Source
var ErrInvalidAddress = errors.New("invalid Filecoin Eth address")
View Source
var EthBigIntZero = EthBigInt{Int: big.Zero().Int}

Functions

func DecodeHexString

func DecodeHexString(s string) ([]byte, error)

func DecodeHexStringTrimSpace

func DecodeHexStringTrimSpace(s string) ([]byte, error)

func DecodeRLP

func DecodeRLP(data []byte) (interface{}, error)

func EncodeRLP

func EncodeRLP(val interface{}) ([]byte, error)

func EthAddressFromPubKey

func EthAddressFromPubKey(pubk []byte) ([]byte, error)

EthAddressFromPubKey returns the Ethereum address corresponding to an uncompressed secp256k1 public key.

func EthBloomSet

func EthBloomSet(f EthBytes, data []byte)

func IsEthAddress

func IsEthAddress(addr address.Address) bool

func NewEmptyEthBloom added in v1.29.0

func NewEmptyEthBloom() []byte

func NewFullEthBloom added in v1.29.0

func NewFullEthBloom() []byte

func ToSignedFilecoinMessage added in v1.27.1

func ToSignedFilecoinMessage(tx EthTransaction) (*types.SignedMessage, error)

Types

type Eth1559TxArgs added in v1.27.1

type Eth1559TxArgs struct {
	ChainID              int         `json:"chainId"`
	Nonce                int         `json:"nonce"`
	To                   *EthAddress `json:"to"`
	Value                big.Int     `json:"value"`
	MaxFeePerGas         big.Int     `json:"maxFeePerGas"`
	MaxPriorityFeePerGas big.Int     `json:"maxPriorityFeePerGas"`
	GasLimit             int         `json:"gasLimit"`
	Input                []byte      `json:"input"`
	V                    big.Int     `json:"v"`
	R                    big.Int     `json:"r"`
	S                    big.Int     `json:"s"`
}

func Eth1559TxArgsFromUnsignedFilecoinMessage added in v1.27.1

func Eth1559TxArgsFromUnsignedFilecoinMessage(msg *types.Message) (*Eth1559TxArgs, error)

func (*Eth1559TxArgs) InitialiseSignature added in v1.27.1

func (tx *Eth1559TxArgs) InitialiseSignature(sig typescrypto.Signature) error

func (*Eth1559TxArgs) Sender added in v1.27.1

func (tx *Eth1559TxArgs) Sender() (address.Address, error)

func (*Eth1559TxArgs) Signature added in v1.27.1

func (tx *Eth1559TxArgs) Signature() (*typescrypto.Signature, error)

func (*Eth1559TxArgs) ToEthTx added in v1.27.1

func (tx *Eth1559TxArgs) ToEthTx(smsg *types.SignedMessage) (EthTx, error)

func (*Eth1559TxArgs) ToRlpSignedMsg added in v1.27.1

func (tx *Eth1559TxArgs) ToRlpSignedMsg() ([]byte, error)

func (*Eth1559TxArgs) ToRlpUnsignedMsg added in v1.27.1

func (tx *Eth1559TxArgs) ToRlpUnsignedMsg() ([]byte, error)

func (*Eth1559TxArgs) ToUnsignedFilecoinMessage added in v1.27.1

func (tx *Eth1559TxArgs) ToUnsignedFilecoinMessage(from address.Address) (*types.Message, error)

func (*Eth1559TxArgs) ToVerifiableSignature added in v1.27.1

func (tx *Eth1559TxArgs) ToVerifiableSignature(sig []byte) ([]byte, error)

func (*Eth1559TxArgs) TxHash added in v1.27.1

func (tx *Eth1559TxArgs) TxHash() (EthHash, error)

func (*Eth1559TxArgs) Type added in v1.27.1

func (tx *Eth1559TxArgs) Type() int

type EthAddress

type EthAddress [EthAddressLength]byte

func CastEthAddress

func CastEthAddress(b []byte) (EthAddress, error)

CastEthAddress interprets bytes as an EthAddress, performing some basic checks.

func EthAddressFromActorID added in v1.26.0

func EthAddressFromActorID(id abi.ActorID) EthAddress

func EthAddressFromFilecoinAddress

func EthAddressFromFilecoinAddress(addr address.Address) (EthAddress, error)

func GetContractEthAddressFromCode

func GetContractEthAddressFromCode(sender EthAddress, salt [32]byte, initcode []byte) (EthAddress, error)

func ParseEthAddress

func ParseEthAddress(s string) (EthAddress, error)

ParseEthAddress parses an Ethereum address from a hex string.

func (EthAddress) IsMaskedID

func (ea EthAddress) IsMaskedID() bool

func (EthAddress) MarshalJSON

func (ea EthAddress) MarshalJSON() ([]byte, error)

func (EthAddress) String

func (ea EthAddress) String() string

func (EthAddress) ToFilecoinAddress

func (ea EthAddress) ToFilecoinAddress() (address.Address, error)

func (*EthAddress) UnmarshalJSON

func (ea *EthAddress) UnmarshalJSON(b []byte) error

type EthAddressList

type EthAddressList []EthAddress

EthAddressList represents a list of addresses. The JSON decoding must treat a string as equivalent to an array with one value, for example "0x8888f1f195afa192cfee86069858" must be decoded as [ "0x8888f1f195afa192cfee86069858" ]

func (*EthAddressList) UnmarshalJSON

func (e *EthAddressList) UnmarshalJSON(b []byte) error

type EthBigInt

type EthBigInt big.Int

EthBigInt represents a large integer whose zero value serializes to "0x0".

func (EthBigInt) MarshalJSON

func (e EthBigInt) MarshalJSON() ([]byte, error)

func (EthBigInt) String

func (e EthBigInt) String() string

func (*EthBigInt) UnmarshalJSON

func (e *EthBigInt) UnmarshalJSON(b []byte) error

type EthBlock

type EthBlock struct {
	Hash             EthHash    `json:"hash"`
	ParentHash       EthHash    `json:"parentHash"`
	Sha3Uncles       EthHash    `json:"sha3Uncles"`
	Miner            EthAddress `json:"miner"`
	StateRoot        EthHash    `json:"stateRoot"`
	TransactionsRoot EthHash    `json:"transactionsRoot"`
	ReceiptsRoot     EthHash    `json:"receiptsRoot"`
	LogsBloom        EthBytes   `json:"logsBloom"`
	Difficulty       EthUint64  `json:"difficulty"`
	TotalDifficulty  EthUint64  `json:"totalDifficulty"`
	Number           EthUint64  `json:"number"`
	GasLimit         EthUint64  `json:"gasLimit"`
	GasUsed          EthUint64  `json:"gasUsed"`
	Timestamp        EthUint64  `json:"timestamp"`
	Extradata        EthBytes   `json:"extraData"`
	MixHash          EthHash    `json:"mixHash"`
	Nonce            EthNonce   `json:"nonce"`
	BaseFeePerGas    EthBigInt  `json:"baseFeePerGas"`
	Size             EthUint64  `json:"size"`
	// can be []EthTx or []string depending on query params
	Transactions []interface{} `json:"transactions"`
	Uncles       []EthHash     `json:"uncles"`
}

func NewEthBlock

func NewEthBlock(hasTransactions bool, tipsetLen int) EthBlock

type EthBlockNumberOrHash added in v1.23.3

type EthBlockNumberOrHash struct {
	// PredefinedBlock can be one of "earliest", "pending" or "latest". We could merge this
	// field with BlockNumber if the latter could store negative numbers representing
	// each predefined value (e.g. -1 for "earliest", -2 for "pending" and -3 for "latest")
	PredefinedBlock *string `json:"-"`

	BlockNumber      *EthUint64 `json:"blockNumber,omitempty"`
	BlockHash        *EthHash   `json:"blockHash,omitempty"`
	RequireCanonical bool       `json:"requireCanonical,omitempty"`
}

func NewEthBlockNumberOrHashFromHexString added in v1.23.3

func NewEthBlockNumberOrHashFromHexString(str string) (EthBlockNumberOrHash, error)

func NewEthBlockNumberOrHashFromNumber added in v1.23.3

func NewEthBlockNumberOrHashFromNumber(number EthUint64) EthBlockNumberOrHash

func NewEthBlockNumberOrHashFromPredefined added in v1.23.3

func NewEthBlockNumberOrHashFromPredefined(predefined string) EthBlockNumberOrHash

func (EthBlockNumberOrHash) MarshalJSON added in v1.23.3

func (e EthBlockNumberOrHash) MarshalJSON() ([]byte, error)

func (*EthBlockNumberOrHash) UnmarshalJSON added in v1.23.3

func (e *EthBlockNumberOrHash) UnmarshalJSON(b []byte) error

type EthBytes

type EthBytes []byte

EthBytes represent arbitrary bytes. A nil or empty slice serializes to "0x".

func (EthBytes) MarshalJSON

func (e EthBytes) MarshalJSON() ([]byte, error)

func (EthBytes) String

func (e EthBytes) String() string

func (*EthBytes) UnmarshalJSON

func (e *EthBytes) UnmarshalJSON(b []byte) error

type EthCall

type EthCall struct {
	From     *EthAddress `json:"from"`
	To       *EthAddress `json:"to"`
	Gas      EthUint64   `json:"gas"`
	GasPrice EthBigInt   `json:"gasPrice"`
	Value    EthBigInt   `json:"value"`
	Data     EthBytes    `json:"data"`
}

func (*EthCall) UnmarshalJSON

func (c *EthCall) UnmarshalJSON(b []byte) error

type EthCallTraceAction added in v1.26.0

type EthCallTraceAction struct {
	CallType string     `json:"callType"`
	From     EthAddress `json:"from"`
	To       EthAddress `json:"to"`
	Gas      EthUint64  `json:"gas"`
	Value    EthBigInt  `json:"value"`
	Input    EthBytes   `json:"input"`
}

type EthCallTraceResult added in v1.26.0

type EthCallTraceResult struct {
	GasUsed EthUint64 `json:"gasUsed"`
	Output  EthBytes  `json:"output"`
}

type EthCreateTraceAction added in v1.26.0

type EthCreateTraceAction struct {
	From  EthAddress `json:"from"`
	Gas   EthUint64  `json:"gas"`
	Value EthBigInt  `json:"value"`
	Init  EthBytes   `json:"init"`
}

type EthCreateTraceResult added in v1.26.0

type EthCreateTraceResult struct {
	Address *EthAddress `json:"address,omitempty"`
	GasUsed EthUint64   `json:"gasUsed"`
	Code    EthBytes    `json:"code"`
}

type EthEstimateGasParams added in v1.25.2

type EthEstimateGasParams struct {
	Tx       EthCall
	BlkParam *EthBlockNumberOrHash
}

EthEstimateGasParams handles raw jsonrpc params for eth_estimateGas

func (EthEstimateGasParams) MarshalJSON added in v1.25.2

func (e EthEstimateGasParams) MarshalJSON() ([]byte, error)

func (*EthEstimateGasParams) UnmarshalJSON added in v1.25.2

func (e *EthEstimateGasParams) UnmarshalJSON(b []byte) error

type EthFeeHistory

type EthFeeHistory struct {
	OldestBlock   EthUint64      `json:"oldestBlock"`
	BaseFeePerGas []EthBigInt    `json:"baseFeePerGas"`
	GasUsedRatio  []float64      `json:"gasUsedRatio"`
	Reward        *[][]EthBigInt `json:"reward,omitempty"`
}

type EthFeeHistoryParams

type EthFeeHistoryParams struct {
	BlkCount          EthUint64
	NewestBlkNum      string
	RewardPercentiles *[]float64
}

EthFeeHistoryParams handles raw jsonrpc params for eth_feeHistory

func (EthFeeHistoryParams) MarshalJSON

func (e EthFeeHistoryParams) MarshalJSON() ([]byte, error)

func (*EthFeeHistoryParams) UnmarshalJSON

func (e *EthFeeHistoryParams) UnmarshalJSON(b []byte) error

type EthFilterID

type EthFilterID EthHash

func (EthFilterID) MarshalJSON

func (h EthFilterID) MarshalJSON() ([]byte, error)

func (EthFilterID) String

func (h EthFilterID) String() string

func (*EthFilterID) UnmarshalJSON

func (h *EthFilterID) UnmarshalJSON(b []byte) error

type EthFilterResult

type EthFilterResult struct {
	Results []interface{}
}

EthFilterResult represents the response from executing a filter: a list of block hashes, a list of transaction hashes or a list of logs This is a union type. Only one field will be populated. The JSON encoding must produce an array of the populated field.

func (EthFilterResult) MarshalJSON

func (h EthFilterResult) MarshalJSON() ([]byte, error)

func (*EthFilterResult) UnmarshalJSON

func (h *EthFilterResult) UnmarshalJSON(b []byte) error

type EthFilterSpec

type EthFilterSpec struct {
	// Interpreted as an epoch (in hex) or one of "latest" for last mined block, "earliest" for first,
	// "pending" for not yet committed messages.
	// Optional, default: "latest".
	FromBlock *string `json:"fromBlock,omitempty"`

	// Interpreted as an epoch (in hex) or one of "latest" for last mined block, "earliest" for first,
	// "pending" for not yet committed messages.
	// Optional, default: "latest".
	ToBlock *string `json:"toBlock,omitempty"`

	// Actor address or a list of addresses from which event logs should originate.
	// Optional, default nil.
	// The JSON decoding must treat a string as equivalent to an array with one value, for example
	// "0x8888f1f195afa192cfee86069858" must be decoded as [ "0x8888f1f195afa192cfee86069858" ]
	Address EthAddressList `json:"address"`

	// List of topics to be matched.
	// Optional, default: empty list
	Topics EthTopicSpec `json:"topics"`

	// Restricts event logs returned to those emitted from messages contained in this tipset.
	// If BlockHash is present in the filter criteria, then neither FromBlock nor ToBlock are allowed.
	// Added in EIP-234
	BlockHash *EthHash `json:"blockHash,omitempty"`
}

type EthHash

type EthHash [EthHashLength]byte

func EthHashFromCid

func EthHashFromCid(c cid.Cid) (EthHash, error)

func EthHashFromTxBytes

func EthHashFromTxBytes(b []byte) EthHash

func ParseEthHash

func ParseEthHash(s string) (EthHash, error)

func (EthHash) MarshalJSON

func (h EthHash) MarshalJSON() ([]byte, error)

func (EthHash) String

func (h EthHash) String() string

func (EthHash) ToCid

func (h EthHash) ToCid() cid.Cid

ToCid should ONLY be used for blocks and Filecoin messages. Eth transactions expect a different hashing scheme.

func (*EthHash) UnmarshalJSON

func (h *EthHash) UnmarshalJSON(b []byte) error

type EthHashList

type EthHashList []EthHash

EthHashList represents a list of EthHashes. The JSON decoding treats string values as equivalent to arrays with one value.

func (*EthHashList) UnmarshalJSON

func (e *EthHashList) UnmarshalJSON(b []byte) error

type EthLegacy155TxArgs added in v1.27.1

type EthLegacy155TxArgs struct {
	// contains filtered or unexported fields
}

EthLegacy155TxArgs is a legacy Ethereum transaction that uses the EIP-155 chain replay protection mechanism by incorporating the chainId in the signature. See how the `V` value in the signature is derived from the chainId at https://github.com/ethereum/go-ethereum/blob/86a1f0c39494c8f5caddf6bd9fbddd4bdfa944fd/core/types/transaction_signing.go#L424 For EthLegacy155TxArgs, the digest that is used to create a signed transaction includes the `ChainID` but the serialised RLP transaction does not include the `ChainID` as an explicit field. Instead, the `ChainID` is included in the V value of the signature as mentioned above.

func NewEthLegacy155TxArgs added in v1.27.1

func NewEthLegacy155TxArgs(tx *EthLegacyHomesteadTxArgs) *EthLegacy155TxArgs

func (*EthLegacy155TxArgs) GetLegacyTx added in v1.27.1

func (tx *EthLegacy155TxArgs) GetLegacyTx() *EthLegacyHomesteadTxArgs

func (*EthLegacy155TxArgs) InitialiseSignature added in v1.27.1

func (tx *EthLegacy155TxArgs) InitialiseSignature(sig typescrypto.Signature) error

func (*EthLegacy155TxArgs) Sender added in v1.27.1

func (tx *EthLegacy155TxArgs) Sender() (address.Address, error)

func (*EthLegacy155TxArgs) Signature added in v1.27.1

func (tx *EthLegacy155TxArgs) Signature() (*typescrypto.Signature, error)

func (*EthLegacy155TxArgs) ToEthTx added in v1.27.1

func (tx *EthLegacy155TxArgs) ToEthTx(smsg *types.SignedMessage) (EthTx, error)

func (*EthLegacy155TxArgs) ToRawTxBytesSigned added in v1.27.1

func (tx *EthLegacy155TxArgs) ToRawTxBytesSigned() ([]byte, error)

func (*EthLegacy155TxArgs) ToRlpSignedMsg added in v1.27.1

func (tx *EthLegacy155TxArgs) ToRlpSignedMsg() ([]byte, error)

func (*EthLegacy155TxArgs) ToRlpUnsignedMsg added in v1.27.1

func (tx *EthLegacy155TxArgs) ToRlpUnsignedMsg() ([]byte, error)

func (*EthLegacy155TxArgs) ToUnsignedFilecoinMessage added in v1.27.1

func (tx *EthLegacy155TxArgs) ToUnsignedFilecoinMessage(from address.Address) (*types.Message, error)

func (*EthLegacy155TxArgs) ToVerifiableSignature added in v1.27.1

func (tx *EthLegacy155TxArgs) ToVerifiableSignature(sig []byte) ([]byte, error)

func (*EthLegacy155TxArgs) TxHash added in v1.27.1

func (tx *EthLegacy155TxArgs) TxHash() (EthHash, error)

func (*EthLegacy155TxArgs) Type added in v1.27.1

func (tx *EthLegacy155TxArgs) Type() int

type EthLegacyHomesteadTxArgs added in v1.27.1

type EthLegacyHomesteadTxArgs struct {
	Nonce    int         `json:"nonce"`
	GasPrice big.Int     `json:"gasPrice"`
	GasLimit int         `json:"gasLimit"`
	To       *EthAddress `json:"to"`
	Value    big.Int     `json:"value"`
	Input    []byte      `json:"input"`
	V        big.Int     `json:"v"`
	R        big.Int     `json:"r"`
	S        big.Int     `json:"s"`
}

func (*EthLegacyHomesteadTxArgs) InitialiseSignature added in v1.27.1

func (tx *EthLegacyHomesteadTxArgs) InitialiseSignature(sig typescrypto.Signature) error

func (*EthLegacyHomesteadTxArgs) Sender added in v1.27.1

func (tx *EthLegacyHomesteadTxArgs) Sender() (address.Address, error)

func (*EthLegacyHomesteadTxArgs) Signature added in v1.27.1

func (*EthLegacyHomesteadTxArgs) ToEthTx added in v1.27.1

func (tx *EthLegacyHomesteadTxArgs) ToEthTx(smsg *types.SignedMessage) (EthTx, error)

func (*EthLegacyHomesteadTxArgs) ToRlpSignedMsg added in v1.27.1

func (tx *EthLegacyHomesteadTxArgs) ToRlpSignedMsg() ([]byte, error)

func (*EthLegacyHomesteadTxArgs) ToRlpUnsignedMsg added in v1.27.1

func (tx *EthLegacyHomesteadTxArgs) ToRlpUnsignedMsg() ([]byte, error)

func (*EthLegacyHomesteadTxArgs) ToUnsignedFilecoinMessage added in v1.27.1

func (tx *EthLegacyHomesteadTxArgs) ToUnsignedFilecoinMessage(from address.Address) (*types.Message, error)

func (*EthLegacyHomesteadTxArgs) ToVerifiableSignature added in v1.27.1

func (tx *EthLegacyHomesteadTxArgs) ToVerifiableSignature(sig []byte) ([]byte, error)

func (*EthLegacyHomesteadTxArgs) TxHash added in v1.27.1

func (tx *EthLegacyHomesteadTxArgs) TxHash() (EthHash, error)

func (*EthLegacyHomesteadTxArgs) Type added in v1.27.1

func (tx *EthLegacyHomesteadTxArgs) Type() int

type EthLog

type EthLog struct {
	// Address is the address of the actor that produced the event log.
	Address EthAddress `json:"address"`

	// Data is the value of the event log, excluding topics
	Data EthBytes `json:"data"`

	// List of topics associated with the event log.
	Topics []EthHash `json:"topics"`

	// Indicates whether the log was removed due to a chain reorganization.
	Removed bool `json:"removed"`

	// LogIndex is the index of the event log in the sequence of events produced by the message execution.
	// (this is the index in the events AMT on the message receipt)
	LogIndex EthUint64 `json:"logIndex"`

	// TransactionIndex is the index in the tipset of the transaction that produced the event log.
	// The index corresponds to the sequence of messages produced by ChainGetParentMessages
	TransactionIndex EthUint64 `json:"transactionIndex"`

	// TransactionHash is the hash of the RLP message that produced the event log.
	TransactionHash EthHash `json:"transactionHash"`

	// BlockHash is the hash of the tipset containing the message that produced the log.
	BlockHash EthHash `json:"blockHash"`

	// BlockNumber is the epoch of the tipset containing the message.
	BlockNumber EthUint64 `json:"blockNumber"`
}

EthLog represents the results of an event filter execution.

type EthNonce

type EthNonce [8]byte

func (EthNonce) MarshalJSON

func (n EthNonce) MarshalJSON() ([]byte, error)

func (EthNonce) String

func (n EthNonce) String() string

func (*EthNonce) UnmarshalJSON

func (n *EthNonce) UnmarshalJSON(b []byte) error

type EthSubscribeParams

type EthSubscribeParams struct {
	EventType string
	Params    *EthSubscriptionParams
}

EthSubscribeParams handles raw jsonrpc params for eth_subscribe

func (EthSubscribeParams) MarshalJSON

func (e EthSubscribeParams) MarshalJSON() ([]byte, error)

func (*EthSubscribeParams) UnmarshalJSON

func (e *EthSubscribeParams) UnmarshalJSON(b []byte) error

type EthSubscriptionID

type EthSubscriptionID EthHash

EthSubscriptionID is an opaque identifier generated by the Lotus node to refer to an active subscription.

func (EthSubscriptionID) MarshalJSON

func (h EthSubscriptionID) MarshalJSON() ([]byte, error)

func (EthSubscriptionID) String

func (h EthSubscriptionID) String() string

func (*EthSubscriptionID) UnmarshalJSON

func (h *EthSubscriptionID) UnmarshalJSON(b []byte) error

type EthSubscriptionParams

type EthSubscriptionParams struct {
	// List of topics to be matched.
	// Optional, default: empty list
	Topics EthTopicSpec `json:"topics,omitempty"`

	// Actor address or a list of addresses from which event logs should originate.
	// Optional, default nil.
	// The JSON decoding must treat a string as equivalent to an array with one value, for example
	// "0x8888f1f195afa192cfee86069858" must be decoded as [ "0x8888f1f195afa192cfee86069858" ]
	Address EthAddressList `json:"address"`
}

type EthSubscriptionResponse

type EthSubscriptionResponse struct {
	// The persistent identifier for the subscription which can be used to unsubscribe.
	SubscriptionID EthSubscriptionID `json:"subscription"`

	// The object matching the subscription. This may be a Block (tipset), a Transaction (message) or an EthLog
	Result interface{} `json:"result"`
}

type EthSyncingResult added in v1.23.3

type EthSyncingResult struct {
	DoneSync      bool
	StartingBlock EthUint64
	CurrentBlock  EthUint64
	HighestBlock  EthUint64
}

func (EthSyncingResult) MarshalJSON added in v1.23.3

func (sr EthSyncingResult) MarshalJSON() ([]byte, error)

type EthTopicSpec

type EthTopicSpec []EthHashList

EthTopicSpec represents a specification for matching by topic. An empty spec means all topics will be matched. Otherwise topics are matched conjunctively in the first dimension of the slice and disjunctively in the second dimension. Topics are matched in order. An event log with topics [A, B] will be matched by the following topic specs: [] "all" [[A]] "A in first position (and anything after)" [nil, [B] ] "anything in first position AND B in second position (and anything after)" [[A], [B]] "A in first position AND B in second position (and anything after)" [[A, B], [A, B]] "(A OR B) in first position AND (A OR B) in second position (and anything after)"

The JSON decoding must treat string values as equivalent to arrays with one value, for example { "A", [ "B", "C" ] } must be decoded as [ [ A ], [ B, C ] ]

type EthTrace added in v1.25.0

type EthTrace struct {
	Type         string `json:"type"`
	Error        string `json:"error,omitempty"`
	Subtraces    int    `json:"subtraces"`
	TraceAddress []int  `json:"traceAddress"`
	Action       any    `json:"action"`
	Result       any    `json:"result"`
}

type EthTraceBlock added in v1.25.0

type EthTraceBlock struct {
	*EthTrace
	BlockHash           EthHash `json:"blockHash"`
	BlockNumber         int64   `json:"blockNumber"`
	TransactionHash     EthHash `json:"transactionHash"`
	TransactionPosition int     `json:"transactionPosition"`
}

type EthTraceFilterCriteria added in v1.29.0

type EthTraceFilterCriteria struct {
	// Interpreted as an epoch (in hex) or one of "latest" for last mined block, "pending" for not yet committed messages.
	// Optional, default: "latest".
	// Note: "earliest" is not a permitted value.
	FromBlock *string `json:"fromBlock,omitempty"`

	// Interpreted as an epoch (in hex) or one of "latest" for last mined block, "pending" for not yet committed messages.
	// Optional, default: "latest".
	// Note: "earliest" is not a permitted value.
	ToBlock *string `json:"toBlock,omitempty"`

	// Actor address or a list of addresses from which transactions that generate traces should originate.
	// Optional, default: nil.
	// The JSON decoding must treat a string as equivalent to an array with one value, for example
	// "0x8888f1f195afa192cfee86069858" must be decoded as [ "0x8888f1f195afa192cfee86069858" ]
	FromAddress EthAddressList `json:"fromAddress,omitempty"`

	// Actor address or a list of addresses to which transactions that generate traces are sent.
	// Optional, default: nil.
	// The JSON decoding must treat a string as equivalent to an array with one value, for example
	// "0x8888f1f195afa192cfee86069858" must be decoded as [ "0x8888f1f195afa192cfee86069858" ]
	ToAddress EthAddressList `json:"toAddress,omitempty"`

	// After specifies the offset for pagination of trace results. The number of traces to skip before returning results.
	// Optional, default: nil.
	After *EthUint64 `json:"after,omitempty"`

	// Limits the number of traces returned.
	// Optional, default: all traces.
	Count *EthUint64 `json:"count,omitempty"`
}

EthTraceFilterCriteria defines the criteria for filtering traces.

type EthTraceFilterResult added in v1.29.0

type EthTraceFilterResult struct {
	*EthTrace
	BlockHash           EthHash `json:"blockHash"`
	BlockNumber         int64   `json:"blockNumber"`
	TransactionHash     EthHash `json:"transactionHash"`
	TransactionPosition int     `json:"transactionPosition"`
}

type EthTraceReplayBlockTransaction added in v1.25.0

type EthTraceReplayBlockTransaction struct {
	Output          EthBytes    `json:"output"`
	StateDiff       *string     `json:"stateDiff"`
	Trace           []*EthTrace `json:"trace"`
	TransactionHash EthHash     `json:"transactionHash"`
	VmTrace         *string     `json:"vmTrace"`
}

type EthTraceTransaction added in v1.27.1

type EthTraceTransaction struct {
	*EthTrace
	BlockHash           EthHash `json:"blockHash"`
	BlockNumber         int64   `json:"blockNumber"`
	TransactionHash     EthHash `json:"transactionHash"`
	TransactionPosition int     `json:"transactionPosition"`
}

type EthTransaction added in v1.27.1

type EthTransaction interface {
	Type() int
	Sender() (address.Address, error)
	Signature() (*typescrypto.Signature, error)
	InitialiseSignature(sig typescrypto.Signature) error
	ToUnsignedFilecoinMessage(from address.Address) (*types.Message, error)
	ToRlpUnsignedMsg() ([]byte, error)
	ToRlpSignedMsg() ([]byte, error)
	TxHash() (EthHash, error)
	ToVerifiableSignature(sig []byte) ([]byte, error)
	ToEthTx(*types.SignedMessage) (EthTx, error)
}

EthTransaction defines the interface for Ethereum-like transactions. It provides methods to convert transactions to various formats, retrieve transaction details, and manipulate transaction signatures.

func EthTransactionFromSignedFilecoinMessage added in v1.27.1

func EthTransactionFromSignedFilecoinMessage(smsg *types.SignedMessage) (EthTransaction, error)

func ParseEthTransaction added in v1.27.1

func ParseEthTransaction(data []byte) (EthTransaction, error)

type EthTx

type EthTx struct {
	ChainID              EthUint64   `json:"chainId"`
	Nonce                EthUint64   `json:"nonce"`
	Hash                 EthHash     `json:"hash"`
	BlockHash            *EthHash    `json:"blockHash"`
	BlockNumber          *EthUint64  `json:"blockNumber"`
	TransactionIndex     *EthUint64  `json:"transactionIndex"`
	From                 EthAddress  `json:"from"`
	To                   *EthAddress `json:"to"`
	Value                EthBigInt   `json:"value"`
	Type                 EthUint64   `json:"type"`
	Input                EthBytes    `json:"input"`
	Gas                  EthUint64   `json:"gas"`
	MaxFeePerGas         *EthBigInt  `json:"maxFeePerGas,omitempty"`
	MaxPriorityFeePerGas *EthBigInt  `json:"maxPriorityFeePerGas,omitempty"`
	GasPrice             *EthBigInt  `json:"gasPrice,omitempty"`
	AccessList           []EthHash   `json:"accessList"`
	V                    EthBigInt   `json:"v"`
	R                    EthBigInt   `json:"r"`
	S                    EthBigInt   `json:"s"`
}

EthTx represents an Ethereum transaction structure, encapsulating fields that align with the standard Ethereum transaction components. This structure can represent both EIP-1559 transactions and legacy Homestead transactions: - In EIP-1559 transactions, the `GasPrice` field is set to nil/empty. - In legacy Homestead transactions, the `GasPrice` field is populated to specify the fee per unit of gas, while the `MaxFeePerGas` and `MaxPriorityFeePerGas` fields are set to nil/empty. Additionally, both the `ChainID` and the `Type` fields are set to 0 in legacy Homestead transactions to differentiate them from EIP-1559 transactions.

func (*EthTx) GasFeeCap added in v1.27.1

func (tx *EthTx) GasFeeCap() (EthBigInt, error)

func (*EthTx) GasPremium added in v1.27.1

func (tx *EthTx) GasPremium() (EthBigInt, error)

type EthUint64

type EthUint64 uint64

func EthUint64FromBytes

func EthUint64FromBytes(b []byte) (EthUint64, error)

EthUint64FromBytes parses a uint64 from big-endian encoded bytes.

func EthUint64FromHex

func EthUint64FromHex(s string) (EthUint64, error)

func (EthUint64) Hex

func (e EthUint64) Hex() string

func (EthUint64) MarshalJSON

func (e EthUint64) MarshalJSON() ([]byte, error)

func (*EthUint64) UnmarshalJSON

func (e *EthUint64) UnmarshalJSON(b []byte) error

UnmarshalJSON should be able to parse these types of input: 1. a JSON string containing a hex-encoded uint64 starting with 0x 2. a JSON string containing an uint64 in decimal 3. a string containing an uint64 in decimal

type FilecoinAddressToEthAddressParams added in v1.29.0

type FilecoinAddressToEthAddressParams struct {
	FilecoinAddress address.Address
	BlkParam        *string
}

func (*FilecoinAddressToEthAddressParams) MarshalJSON added in v1.29.0

func (e *FilecoinAddressToEthAddressParams) MarshalJSON() ([]byte, error)

func (*FilecoinAddressToEthAddressParams) UnmarshalJSON added in v1.29.0

func (e *FilecoinAddressToEthAddressParams) UnmarshalJSON(b []byte) error

type RlpPackable added in v1.27.1

type RlpPackable interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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