Documentation
¶
Overview ¶
Package adaptfeeder adapts feeder gateway responses to core types.
Index ¶
- type Feeder
- func (f *Feeder) BlockHeaderLatest(ctx context.Context) (core.Header, error)
- func (f *Feeder) Class(ctx context.Context, classHash *felt.Felt) (core.ClassDefinition, error)
- func (f *Feeder) PreConfirmedBlockByNumber(ctx context.Context, blockNumber uint64, blockIdentifier string, ...) (starknet.PreConfirmedUpdate, error)
- func (f *Feeder) PreConfirmedBlockLatest(ctx context.Context, blockIdentifier string, knownTransactionCount uint64) (starknet.PreConfirmedUpdate, uint64, error)
- func (f *Feeder) StateUpdateWithBlock(ctx context.Context, blockNumber uint64) (*core.StateUpdate, *core.Block, error)
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 (*Feeder) BlockHeaderLatest ¶
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 ¶
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. |