Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeGob[T any](data []byte) (*T, error)
- func DecodeResponseToStruct[T any](data []felt.Felt, s T) error
- func DecodeSlice[T any](data [][]byte) ([]*T, error)
- func DecodeToString(feltArr []felt.Felt) string
- func DeserializeResponse[T any](data []byte, into *T) (*T, error)
- func EncodeGob[T any](data *T) ([]byte, error)
- func EnsureStarkFelt(felt string) string
- func FeltArrToBytesArr(feltArr []felt.Felt) []byte
- func FeltFromString(s string) *felt.Felt
- func FeltFromUint64(i uint64) *felt.Felt
- func HexStringToUint64(s string) uint64
- func StarknetKeccak(b []byte) (*felt.Felt, error)
- type BlockId
- type Event
- type ExecutionResources
- type FeederGatewayClient
- type GetBlockResponse
- type JsonRpcStarknetClient
- type L2ToL1Message
- type SlotUri
- type StarknetNetwork
- type StarknetRpcClient
- type Transaction
- type TransactionReceipt
Constants ¶
View Source
const ( BlockLatest BlockId = "latest" BlockPending BlockId = "pending" Mainnet StarknetNetwork = "mainnet" Goerli StarknetNetwork = "goerli" Sepolia StarknetNetwork = "sepolia" )
Variables ¶
View Source
var ( Zero = FeltFromString("0x0") One = FeltFromString("0x1") Two = FeltFromString("0x2") )
Functions ¶
func DecodeSlice ¶
func DecodeToString ¶
func DeserializeResponse ¶
func EnsureStarkFelt ¶
EnsureStarkFelt adds 0 padding to left side of felt
func FeltArrToBytesArr ¶
func FeltFromString ¶
func FeltFromUint64 ¶
func HexStringToUint64 ¶
Types ¶
type ExecutionResources ¶
type ExecutionResources struct { ActualFee string `json:"actual_fee"` BuiltinInstanceCounter struct { RangeCheckBuiltin uint `json:"range_check_builtin"` PedersenBuiltin uint `json:"pedersen_builtin"` BitwiseBuiltin uint `json:"bitwise_builtin"` OutputBuiltin uint `json:"output_builtin"` EcdsaBuiltin uint `json:"ecdsa_builtin"` EcOpBuiltin uint `json:"ec_op_builtin"` } `json:"builtin_instance_counter"` NSteps uint `json:"n_steps"` NMemoryHoles uint `json:"n_memory_holes"` }
type FeederGatewayClient ¶
type FeederGatewayClient struct {
// contains filtered or unexported fields
}
func NewFeederGatewayClient ¶
func NewFeederGatewayClient(baseUrl string) *FeederGatewayClient
func NewFeederGatewayClientFromEnv ¶
func NewFeederGatewayClientFromEnv(env string) *FeederGatewayClient
func NewMainnetFeederGatewayClient ¶
func NewMainnetFeederGatewayClient() *FeederGatewayClient
func NewSepoliaFeederGatewayClient ¶
func NewSepoliaFeederGatewayClient() *FeederGatewayClient
func (*FeederGatewayClient) GetBlock ¶
func (c *FeederGatewayClient) GetBlock(blockNumber uint64) (*GetBlockResponse, error)
type GetBlockResponse ¶
type GetBlockResponse struct { BlockHash string `json:"block_hash"` ParentBlockHash string `json:"parent_block_hash"` StateRoot string `json:"state_root"` Status string `json:"status"` GasPrice string `json:"gas_price"` SequencerAddress string `json:"sequencer_address"` StarknetVersion string `json:"starknet_version"` Transactions []Transaction `json:"transactions"` TransactionReceipts []TransactionReceipt `json:"transaction_receipts"` BlockNumber uint64 `json:"block_number"` Timestamp uint64 `json:"timestamp"` }
type JsonRpcStarknetClient ¶
func GoerliJsonRpcStarknetClient ¶
func GoerliJsonRpcStarknetClient() *JsonRpcStarknetClient
Create goerli json rpc client
func MainnetJsonRpcStarknetClient ¶
func MainnetJsonRpcStarknetClient() *JsonRpcStarknetClient
Create mainnet json rpc client
func NewJsonRpcStarknetClient ¶
func NewJsonRpcStarknetClient(endpoint string) *JsonRpcStarknetClient
func SepoliaJsonRpcStarknetClient ¶
func SepoliaJsonRpcStarknetClient() *JsonRpcStarknetClient
Create sepolia json rpc client
type L2ToL1Message ¶
type SlotUri ¶
type SlotUri struct { Name string `json:"name"` Description string `json:"description"` Image string `json:"image"` ExternalUrl string `json:"external_url"` YoutubeUrl string `json:"youtube_url"` Attributes []struct { Value interface{} `json:"value,string"` DisplayType string `json:"display_type"` TraitType string `json:"trait_type"` } `json:"attributes"` }
type StarknetNetwork ¶
type StarknetNetwork string
type StarknetRpcClient ¶
type Transaction ¶
type Transaction struct { TransactionHash string `json:"transaction_hash"` Version string `json:"version"` MaxFeePerGas string `json:"max_fee_per_gas"` Nonce string `json:"nonce"` SenderAddress string `json:"sender_address"` Type string `json:"type"` Signatures []string `json:"signatures"` Calldata []string `json:"calldata"` }
type TransactionReceipt ¶
type TransactionReceipt struct { ExecutionStatus string `json:"execution_status"` TransactionHash string `json:"transaction_hash"` ActualFee string `json:"actual_fee"` Version string `json:"version"` L2ToL1Messages []L2ToL1Message `json:"l2_to_l1_messages"` Events []Event `json:"events"` ExecutionResources ExecutionResources `json:"execution_resources"` TransactionIndex uint `json:"transaction_index"` }
Click to show internal directories.
Click to hide internal directories.