networks

package
v0.16.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// The docs states the addresses for each network: https://docs.starknet.io/learn/cheatsheets/chain-info#important-addresses
	Mainnet = Network{
		Name:                "mainnet",
		FeederURL:           "https://feeder.alpha-mainnet.starknet.io/feeder_gateway/",
		GatewayURL:          "https://alpha-mainnet.starknet.io/gateway/",
		L2ChainID:           "SN_MAIN",
		L1ChainID:           big.NewInt(1),
		CoreContractAddress: common.HexToAddress("0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4"),
		BlockHashMetaInfo: &BlockHashMetaInfo{
			First07Block:             833,
			FallBackSequencerAddress: fallBackSequencerAddressMainnet,
		},
	}
	Goerli = Network{
		Name:       "goerli",
		FeederURL:  "https://alpha4.starknet.io/feeder_gateway/",
		GatewayURL: "https://alpha4.starknet.io/gateway/",
		L2ChainID:  "SN_GOERLI",

		L1ChainID:           big.NewInt(5),
		CoreContractAddress: common.HexToAddress("0xde29d060D45901Fb19ED6C6e959EB22d8626708e"),
		BlockHashMetaInfo: &BlockHashMetaInfo{
			First07Block:             47028,
			UnverifiableRange:        []uint64{119802, 148428},
			FallBackSequencerAddress: fallBackSequencerAddress,
		},
	}
	Goerli2 = Network{
		Name:       "goerli2",
		FeederURL:  "https://alpha4-2.starknet.io/feeder_gateway/",
		GatewayURL: "https://alpha4-2.starknet.io/gateway/",
		L2ChainID:  "SN_GOERLI2",

		L1ChainID:           big.NewInt(5),
		CoreContractAddress: common.HexToAddress("0xa4eD3aD27c294565cB0DCc993BDdCC75432D498c"),
		BlockHashMetaInfo: &BlockHashMetaInfo{
			First07Block:             0,
			FallBackSequencerAddress: fallBackSequencerAddress,
		},
	}
	Integration = Network{
		Name:       "integration",
		FeederURL:  "https://external.integration.starknet.io/feeder_gateway/",
		GatewayURL: "https://external.integration.starknet.io/gateway/",
		L2ChainID:  "SN_GOERLI",

		L1ChainID:           big.NewInt(5),
		CoreContractAddress: common.HexToAddress("0xd5c325D183C592C94998000C5e0EED9e6655c020"),
		BlockHashMetaInfo: &BlockHashMetaInfo{
			First07Block:             110511,
			UnverifiableRange:        []uint64{0, 110511},
			FallBackSequencerAddress: fallBackSequencerAddress,
		},
	}
	Sepolia = Network{
		Name:       "sepolia",
		FeederURL:  "https://feeder.alpha-sepolia.starknet.io/feeder_gateway/",
		GatewayURL: "https://alpha-sepolia.starknet.io/gateway/",
		L2ChainID:  "SN_SEPOLIA",

		L1ChainID:           big.NewInt(11155111),
		CoreContractAddress: common.HexToAddress("0xE2Bb56ee936fd6433DC0F6e7e3b8365C906AA057"),
		BlockHashMetaInfo: &BlockHashMetaInfo{
			First07Block:             0,
			FallBackSequencerAddress: fallBackSequencerAddress,
		},
	}
	SepoliaIntegration = Network{
		Name:       "sepolia-integration",
		FeederURL:  "https://feeder.integration-sepolia.starknet.io/feeder_gateway/",
		GatewayURL: "https://integration-sepolia.starknet.io/gateway/",
		L2ChainID:  "SN_INTEGRATION_SEPOLIA",

		L1ChainID:           big.NewInt(11155111),
		CoreContractAddress: common.HexToAddress("0x4737c0c1B4D5b1A687B42610DdabEE781152359c"),
		BlockHashMetaInfo: &BlockHashMetaInfo{
			First07Block:             0,
			FallBackSequencerAddress: fallBackSequencerAddress,
		},
	}
	Sequencer = Network{
		Name:              "sequencer",
		L2ChainID:         "SN_JUNO_SEQUENCER",
		BlockHashMetaInfo: &BlockHashMetaInfo{},
	}
)
View Source
var DefaultEthFeeTokenAddress = felt.Felt([4]uint64{
	4380532846569209554,
	17839402928228694863,
	17240401758547432026,
	418961398025637529,
})

0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7

View Source
var DefaultFeeTokenAddresses = starknet.FeeTokenAddresses{
	EthL2TokenAddress:  DefaultEthFeeTokenAddress,
	StrkL2TokenAddress: DefaultStrkFeeTokenAddress,
}
View Source
var DefaultStrkFeeTokenAddress = felt.Felt([4]uint64{
	16432072983745651214,
	1325769094487018516,
	5134018303144032807,
	468300854463065062,
})

0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d

View Source
var KnownNetworkNames = []string{
	Mainnet.String(),
	Sepolia.String(),
	SepoliaIntegration.String(),
	Sequencer.String(),
}

Functions

This section is empty.

Types

type BlockHashMetaInfo

type BlockHashMetaInfo struct {
	// The sequencer address to use for blocks that do not have one
	FallBackSequencerAddress *felt.Felt `json:"fallback_sequencer_address" validate:"required"`
	// First block that uses the post-0.7.0 block hash algorithm
	First07Block uint64 `json:"first_07_block" validate:"required"`
	// Range of blocks that are not verifiable
	UnverifiableRange []uint64 `json:"unverifiable_range" validate:"required"`
}

type Network

type Network struct {
	Name                string             `json:"name" validate:"required"`
	FeederURL           string             `json:"feeder_url" validate:"required"`
	GatewayURL          string             `json:"gateway_url" validate:"required"`
	L1ChainID           *big.Int           `json:"l1_chain_id" validate:"required"`
	L2ChainID           string             `json:"l2_chain_id" validate:"required"`
	CoreContractAddress common.Address     `json:"core_contract_address" validate:"required"`
	BlockHashMetaInfo   *BlockHashMetaInfo `json:"block_hash_meta_info"`
}

func (*Network) L2ChainIDFelt

func (n *Network) L2ChainIDFelt() *felt.Felt

func (*Network) MarshalText

func (n *Network) MarshalText() ([]byte, error)

func (*Network) MarshalYAML

func (n *Network) MarshalYAML() (any, error)

func (*Network) Set

func (n *Network) Set(s string) error

func (*Network) String

func (n *Network) String() string

func (*Network) Type

func (n *Network) Type() string

func (*Network) UnmarshalText

func (n *Network) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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