gateway

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptBlock

func AdaptBlock(response *clients.Block) (*core.Block, error)

func AdaptStateUpdate

func AdaptStateUpdate(response *clients.StateUpdate) (*core.StateUpdate, error)

Types

type Gateway

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

func NewGateway

func NewGateway(n utils.Network) *Gateway

func NewGatewayWithClient

func NewGatewayWithClient(client *clients.GatewayClient) *Gateway

func (*Gateway) BlockByNumber

func (g *Gateway) BlockByNumber(ctx context.Context, blockNumber uint64) (*core.Block, error)

BlockByNumber gets the block for a given block number from the feeder gateway, then adapts it to the core.Block type.

func (*Gateway) Class

func (g *Gateway) Class(ctx context.Context, classHash *felt.Felt) (*core.Class, error)

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

func (*Gateway) StateUpdate

func (g *Gateway) StateUpdate(ctx context.Context, blockNumber uint64) (*core.StateUpdate, error)

StateUpdate gets the state update for a given block number from the feeder gateway, then adapts it to the core.StateUpdate type.

func (*Gateway) Transaction

func (g *Gateway) Transaction(ctx context.Context, transactionHash *felt.Felt) (core.Transaction, error)

Transaction gets the transaction for a given transaction hash from the feeder gateway, then adapts it to the appropriate core.Transaction types.

Jump to

Keyboard shortcuts

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