starknet

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	BlockHash           *Felt                 `json:"block_hash"`
	ParentBlockHash     *Felt                 `json:"parent_block_hash"`
	BlockNumber         uint64                `json:"block_number"`
	StateRoot           string                `json:"state_root"`
	Status              string                `json:"status"`
	GasPrice            string                `json:"gas_price"`
	Transactions        []*Transaction        `json:"Transactions"`
	Timestamp           int64                 `json:"timestamp"`
	SequencerAddress    string                `json:"sequencer_address"`
	TransactionReceipts []*TransactionReceipt `json:"transaction_receipts"`
}

type BuiltinInstanceCounter

type BuiltinInstanceCounter struct {
	PedersenBuiltin   int `json:"pedersen_builtin"`
	RangeCheckBuiltin int `json:"range_check_builtin"`
	OutputBuiltin     int `json:"output_builtin"`
	EcdsaBuiltin      int `json:"ecdsa_builtin"`
	BitwiseBuiltin    int `json:"bitwise_builtin"`
	EcOpBuiltin       int `json:"ec_op_builtin"`
}

type Error added in v0.8.0

type Error struct {
	Err error
}

func (Error) Error added in v0.8.0

func (e Error) Error() string

func (Error) Unwrap added in v0.8.0

func (e Error) Unwrap() error

type Event

type Event struct {
	FromAddress *Felt   `json:"from_address"`
	Keys        []*Felt `json:"keys"`
	Data        []*Felt `json:"data"`
}

type ExecutionResource

type ExecutionResource struct {
	NSteps                 int                     `json:"n_steps"`
	BuiltinInstanceCounter *BuiltinInstanceCounter `json:"builtin_instance_counter"`
	NMemoryHoles           int                     `json:"n_memory_holes"`
}

type Felt

type Felt struct {
	*big.Int
}

func HexToFelt

func HexToFelt(s string) *Felt

func (Felt) MarshalJSON

func (f Felt) MarshalJSON() ([]byte, error)

func (Felt) MarshalText added in v0.7.1

func (f Felt) MarshalText() ([]byte, error)

func (*Felt) UnmarshalJSON

func (f *Felt) UnmarshalJSON(p []byte) error

func (*Felt) UnmarshalText added in v0.7.1

func (f *Felt) UnmarshalText(p []byte) error

type HTTPError added in v0.8.0

type HTTPError struct {
	StatusCode int
}

func (HTTPError) Error added in v0.8.0

func (e HTTPError) Error() string

type L1ToL2Message

type L1ToL2Message struct {
	FromAddress *Felt   `json:"from_address"`
	ToAddress   *Felt   `json:"to_address"`
	Selector    *Felt   `json:"selector"`
	Payload     []*Felt `json:"payload"`
	Nonce       *Felt   `json:"nonce"`
}

type Sequencer

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

func NewSequencer

func NewSequencer(endpoint string, httpClient http.Client) *Sequencer

func (*Sequencer) GetBlockByNumber

func (s *Sequencer) GetBlockByNumber(ctx context.Context, blockNumber uint64) (*Block, error)

func (*Sequencer) GetLatestBlock

func (s *Sequencer) GetLatestBlock(ctx context.Context) (*Block, error)

func (*Sequencer) GetPendingBlock

func (s *Sequencer) GetPendingBlock(ctx context.Context) (*Block, error)

type Transaction

type Transaction struct {
	ContractAddress     *Felt   `json:"contract_address"`
	ContractAddressSalt *Felt   `json:"contract_address_salt,omitempty"`
	ClassHash           *Felt   `json:"class_hash,omitempty"`
	ConstructorCalldata []*Felt `json:"constructor_calldata,omitempty"`
	TransactionHash     *Felt   `json:"transaction_hash"`
	Type                string  `json:"type"`
	EntryPointSelector  *Felt   `json:"entry_point_selector,omitempty"`
	EntryPointType      string  `json:"entry_point_type,omitempty"`
	Calldata            []*Felt `json:"calldata,omitempty"`
	MaxFee              *Felt   `json:"max_fee,omitempty"`
}

type TransactionReceipt

type TransactionReceipt struct {
	TransactionIndex      int                `json:"transaction_index"`
	TransactionHash       *Felt              `json:"transaction_hash"`
	L2ToL1Messages        []*L1ToL2Message   `json:"l2_to_l1_messages"`
	Events                []*Event           `json:"events"`
	ExecutionResources    *ExecutionResource `json:"execution_resources"`
	ActualFee             string             `json:"actual_fee"`
	L1ToL2ConsumedMessage *L1ToL2Message     `json:"l1_to_l2_consumed_message,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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