Documentation
¶
Index ¶
- Variables
- func AssembleProof(header BlockHeader, log *types.Log, receipts []*types.Receipt, method string, ...) ([]byte, error)
- func Generate(slot, endpoint string) ([][32]byte, string, string, error)
- func GenerateByApi(slot []string) [][32]byte
- type AttestationData
- type Attestations
- type AttestedHeader
- type Beacon
- type BeaconBlockHeader
- type BeaconHeadersData
- type BeaconHeadersResp
- type BlockData
- type BlockHeader
- type BlocksMessage
- type BlocksResp
- type Body
- type Client
- func (c *Client) BeaconHeaders(ctx context.Context, blockId constant.BlockIdOfEth2) (*BeaconHeadersResp, error)
- func (c *Client) CallContext(ctx context.Context, url string, result interface{}) error
- func (c *Client) FinallyUpdate(ctx context.Context) (*FinalityUpdateResp, error)
- func (c *Client) GetBlocks(ctx context.Context, blockId string) (*BlocksResp, error)
- func (c *Client) LightClientUpdate(ctx context.Context, startPeriod uint64) (*LightClientUpdatesResp, error)
- type CommonData
- type CommonDataArray
- type ContractExecution
- type ContractSyncAggregate
- type ContractSyncCommittee
- type Eth1Data
- type Execution
- type FinalityUpdateData
- type FinalityUpdateResp
- type FinalizedHeader
- type Header
- type LightClientUpdate
- type LightClientUpdatesData
- type LightClientUpdatesResp
- type Message
- type NewAttestedHeader
- type NewFinalizedHeader
- type NextSyncCommittee
- type Receipt
- type ReceiptProof
- type Receipts
- type Source
- type SyncAggregate
- type Target
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoResult = errors.New("no result in JSON-RPC response")
Functions ¶
func AssembleProof ¶
func GenerateByApi ¶
Types ¶
type AttestationData ¶
type Attestations ¶
type Attestations struct {
AggregationBits string `json:"aggregation_bits"`
Data AttestationData `json:"data"`
Signature string `json:"signature"`
}
type AttestedHeader ¶
type BeaconBlockHeader ¶
type BeaconHeadersData ¶
type BeaconHeadersResp ¶
type BeaconHeadersResp struct {
Data BeaconHeadersData `json:"data"`
ExecutionOptimistic bool `json:"execution_optimistic"`
}
type BlockData ¶
type BlockData struct {
Message BlocksMessage `json:"message"`
Signature string `json:"signature"`
}
type BlockHeader ¶
type BlockHeader struct {
ParentHash [32]byte `json:"parent_hash"`
Sha3Uncles [32]byte `json:"sha_3_uncles"`
Miner common.Address `json:"miner"`
StateRoot [32]byte `json:"stateRoot"`
TransactionsRoot [32]byte `json:"transactionsRoot"`
ReceiptsRoot [32]byte `json:"receiptsRoot"`
LogsBloom []byte `json:"logsBloom"`
Difficulty *big.Int `json:"difficulty"`
Number *big.Int `json:"number"`
GasLimit *big.Int `json:"gasLimit"`
GasUsed *big.Int `json:"gasUsed"`
Timestamp *big.Int `json:"timestamp"`
ExtraData []byte `json:"extraData"`
MixHash [32]byte `json:"mixHash"`
Nonce []byte `json:"nonce"`
BaseFeePerGas *big.Int `json:"baseFeePerGas"`
WithdrawalsRoot [32]byte `json:"withdrawalsRoot"`
}
func ConvertHeader ¶
func ConvertHeader(header *ethclient.Header) *BlockHeader
type BlocksMessage ¶
type BlocksResp ¶
type Body ¶
type Body struct {
RandaoReveal string `json:"randao_reveal"`
Eth1Data Eth1Data `json:"eth1_data"`
Graffiti string `json:"graffiti"`
ProposerSlashings []interface{} `json:"proposer_slashings"`
AttesterSlashings []interface{} `json:"attester_slashings"`
Attestations []Attestations `json:"attestations"`
Deposits []interface{} `json:"deposits"`
VoluntaryExits []interface{} `json:"voluntary_exits"`
SyncAggregate SyncAggregate `json:"sync_aggregate"`
ExecutionPayload Execution `json:"execution_payload"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BeaconHeaders ¶
func (c *Client) BeaconHeaders(ctx context.Context, blockId constant.BlockIdOfEth2) (*BeaconHeadersResp, error)
func (*Client) CallContext ¶
func (*Client) FinallyUpdate ¶
func (c *Client) FinallyUpdate(ctx context.Context) (*FinalityUpdateResp, error)
func (*Client) LightClientUpdate ¶
type CommonData ¶
type CommonDataArray ¶
type CommonDataArray struct {
// contains filtered or unexported fields
}
type ContractExecution ¶
type ContractExecution struct {
ParentHash [32]byte `json:"parent_hash"`
FeeRecipient common.Address `json:"fee_recipient"`
StateRoot [32]byte `json:"state_root"`
ReceiptsRoot [32]byte `json:"receipts_root"`
LogsBloom []byte `json:"logs_bloom"`
PrevRandao [32]byte `json:"prev_randao"`
BlockNumber *big.Int `json:"block_number"`
GasLimit *big.Int `json:"gas_limit"`
GasUsed *big.Int `json:"gas_used"`
Timestamp *big.Int `json:"timestamp"`
ExtraData []byte `json:"extra_data"`
BaseFeePerGas *big.Int `json:"base_fee_per_gas"`
BlockHash [32]byte `json:"block_hash"`
TransactionsRoot [32]byte `json:"transactions_root"`
WithdrawalsRoot [32]byte `json:"withdrawals_root"`
}
func ConvertExecution ¶
func ConvertExecution(execution *Execution) (*ContractExecution, error)
type ContractSyncAggregate ¶
type ContractSyncCommittee ¶
type Execution ¶
type Execution struct {
ParentHash string `json:"parent_hash"`
FeeRecipient string `json:"fee_recipient"`
StateRoot string `json:"state_root"`
ReceiptsRoot string `json:"receipts_root"`
LogsBloom string `json:"logs_bloom"`
PrevRandao string `json:"prev_randao"`
BlockNumber string `json:"block_number"`
GasLimit string `json:"gas_limit"`
GasUsed string `json:"gas_used"`
Timestamp string `json:"timestamp"`
ExtraData string `json:"extra_data"`
BaseFeePerGas string `json:"base_fee_per_gas"`
BlockHash string `json:"block_hash"`
TransactionsRoot string `json:"transactions_root"`
WithdrawalsRoot string `json:"withdrawals_root"`
}
type FinalityUpdateData ¶
type FinalityUpdateData struct {
AttestedHeader NewAttestedHeader `json:"attested_header"`
FinalizedHeader NewFinalizedHeader `json:"finalized_header"`
FinalityBranch []string `json:"finality_branch"`
SyncAggregate SyncAggregate `json:"sync_aggregate"`
SignatureSlot string `json:"signature_slot"`
}
type FinalityUpdateResp ¶
type FinalityUpdateResp struct {
Data FinalityUpdateData `json:"data"`
Version string `json:"version"`
}
type FinalizedHeader ¶
type LightClientUpdate ¶
type LightClientUpdate struct {
AttestedHeader BeaconBlockHeader `json:"attested_header"`
SignatureSlot uint64 `json:"signature_slot"`
SyncAggregate ContractSyncAggregate `json:"sync_aggregate"`
NextSyncCommittee ContractSyncCommittee `json:"nextSyncCommittee"`
NextSyncCommitteeBranch [][32]byte `json:"nextSyncCommitteeBranch"`
FinalizedHeader BeaconBlockHeader
FinalityBranch [][32]byte
ExecutionBranch [][32]byte
FinalizedExecution *ContractExecution
}
type LightClientUpdatesData ¶
type LightClientUpdatesData struct {
AttestedHeader NewAttestedHeader `json:"attested_header"`
NextSyncCommittee NextSyncCommittee `json:"next_sync_committee"`
NextSyncCommitteeBranch []string `json:"next_sync_committee_branch"`
FinalizedHeader NewFinalizedHeader `json:"finalized_header"`
FinalityBranch []string `json:"finality_branch"`
SyncAggregate SyncAggregate `json:"sync_aggregate"`
SignatureSlot string `json:"signature_slot"`
}
type LightClientUpdatesResp ¶
type LightClientUpdatesResp struct {
Data LightClientUpdatesData `json:"data"`
Version string `json:"version"`
}
type NewAttestedHeader ¶
type NewFinalizedHeader ¶
type NextSyncCommittee ¶
type ReceiptProof ¶
type ReceiptProof struct {
Header BlockHeader
TxReceipt mapprotocol.TxReceipt
KeyIndex []byte
Proof [][]byte
}
type Receipts ¶ added in v1.2.0
type Receipts []*Receipt
func (Receipts) EncodeIndex ¶ added in v1.2.0
type SyncAggregate ¶
Click to show internal directories.
Click to hide internal directories.