adaptfeeder

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package adaptfeeder adapts feeder gateway responses to core types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feeder

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

func New

func New(client feeder.Reader) *Feeder

func (*Feeder) BlockHeaderLatest

func (f *Feeder) BlockHeaderLatest(ctx context.Context) (core.Header, error)

BlockHeaderLatest gets only the block hash and number for the latest block from the feeder, using the headerOnly=true parameter to minimise bandwidth.

func (*Feeder) Class

func (f *Feeder) Class(ctx context.Context, classHash *felt.Felt) (core.ClassDefinition, error)

Class gets the class for a given class hash from the feeder, then adapts it to the core.Class type.

func (*Feeder) PreConfirmedBlockByNumber

func (f *Feeder) PreConfirmedBlockByNumber(
	ctx context.Context,
	blockNumber uint64,
	blockIdentifier string,
	knownTransactionCount uint64,
) (starknet.PreConfirmedUpdate, error)

PreConfirmedBlockByNumber fetches the pre_confirmed block at the given height and returns a delta-aware update. blockIdentifier and knownTransactionCount tell the server what the caller already has so the server can return a no-change marker, only the transactions appended since knownTransactionCount, or the full block when the round identifier no longer matches. Set both to zero values to get a full block.

func (*Feeder) PreConfirmedBlockLatest

func (f *Feeder) PreConfirmedBlockLatest(
	ctx context.Context,
	blockIdentifier string,
	knownTransactionCount uint64,
) (starknet.PreConfirmedUpdate, uint64, error)

PreConfirmedBlockLatest fetches whichever pre_confirmed block the sequencer is currently exposing as latest. The returned block number is the height the response describes.

func (*Feeder) StateUpdateWithBlock

func (f *Feeder) StateUpdateWithBlock(
	ctx context.Context,
	blockNumber uint64,
) (*core.StateUpdate, *core.Block, error)

StateUpdateWithBlock gets both state update and block for a given block number from the feeder, then adapts them to the core.StateUpdate and core.Block types respectively

Directories

Path Synopsis
Package adaptfeedertest loads feeder gateway fixtures as core types for tests.
Package adaptfeedertest loads feeder gateway fixtures as core types for tests.

Jump to

Keyboard shortcuts

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