network

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 7 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EthereumChainIDStrings

func EthereumChainIDStrings() []string

EthereumChainIDStrings returns a slice of all String values of the enum

func IsOptimismSuperchain

func IsOptimismSuperchain(chainID uint64) bool

func NetworkStrings

func NetworkStrings() []string

NetworkStrings returns a slice of all String values of the enum

func ParseNetworkAndChainIDFromString added in v0.4.2

func ParseNetworkAndChainIDFromString(networkString string) (Network, EthereumChainID)

ParseNetworkAndChainIDFromString returns the Network and its corresponding EthereumChainID based on a string network name.

Types

type EthereumChainID

type EthereumChainID uint64
const (
	EthereumChainIDArbitrum          EthereumChainID = 42161 // arbitrum
	EthereumChainIDAvalanche         EthereumChainID = 43114 // avax
	EthereumChainIDBase              EthereumChainID = 8453  // base
	EthereumChainIDBinanceSmartChain EthereumChainID = 56    // binance-smart-chain
	EthereumChainIDCrossbell         EthereumChainID = 3737  // crossbell
	EthereumChainIDGnosis            EthereumChainID = 100   // gnosis
	EthereumChainIDLinea             EthereumChainID = 59144 // linea
	EthereumChainIDMainnet           EthereumChainID = 1     // ethereum
	EthereumChainIDOptimism          EthereumChainID = 10    // optimism
	EthereumChainIDPolygon           EthereumChainID = 137   // polygon
	EthereumChainIDSatoshiVM         EthereumChainID = 3109  // savm
	EthereumChainIDVSL               EthereumChainID = 12553 // vsl
)

func EthereumChainIDString

func EthereumChainIDString(s string) (EthereumChainID, error)

EthereumChainIDString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func EthereumChainIDValues

func EthereumChainIDValues() []EthereumChainID

EthereumChainIDValues returns all values of the enum

func (EthereumChainID) IsAEthereumChainID

func (i EthereumChainID) IsAEthereumChainID() bool

IsAEthereumChainID returns "true" if the value is listed in the enum definition. "false" otherwise

func (EthereumChainID) MarshalJSON

func (i EthereumChainID) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for EthereumChainID

func (EthereumChainID) MarshalYAML

func (i EthereumChainID) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for EthereumChainID

func (*EthereumChainID) Scan

func (i *EthereumChainID) Scan(value interface{}) error

func (EthereumChainID) String

func (i EthereumChainID) String() string

func (*EthereumChainID) UnmarshalJSON

func (i *EthereumChainID) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for EthereumChainID

func (*EthereumChainID) UnmarshalYAML

func (i *EthereumChainID) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for EthereumChainID

func (EthereumChainID) Value

func (i EthereumChainID) Value() (driver.Value, error)

func (EthereumChainID) Values

func (EthereumChainID) Values() []string

type Network

type Network uint64
const (
	Unknown           Network = iota // unknown
	Arbitrum                         // arbitrum
	Arweave                          // arweave
	Avalanche                        // avax
	Base                             // base
	BinanceSmartChain                // binance-smart-chain
	Bitcoin                          // bitcoin
	Crossbell                        // crossbell
	Ethereum                         // ethereum
	Farcaster                        // farcaster
	Gnosis                           // gnosis
	Linea                            // linea
	Optimism                         // optimism
	Polygon                          // polygon
	RSS                              // rss
	SatoshiVM                        // savm
	VSL                              // vsl
)

func NetworkString

func NetworkString(s string) (Network, error)

NetworkString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func NetworkValues

func NetworkValues() []Network

NetworkValues returns all values of the enum

func (Network) IsANetwork

func (i Network) IsANetwork() bool

IsANetwork returns "true" if the value is listed in the enum definition. "false" otherwise

func (Network) MarshalJSON

func (i Network) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Network

func (Network) MarshalYAML

func (i Network) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for Network

func (*Network) Scan

func (i *Network) Scan(value interface{}) error

func (Network) Source

func (n Network) Source() Source

func (Network) String

func (i Network) String() string

func (*Network) UnmarshalJSON

func (i *Network) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Network

func (*Network) UnmarshalParam

func (n *Network) UnmarshalParam(param string) error

func (*Network) UnmarshalYAML

func (i *Network) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for Network

func (Network) Value

func (i Network) Value() (driver.Value, error)

func (Network) Values

func (Network) Values() []string

type Source

type Source string
const (
	ArweaveSource   Source = "arweave"
	EthereumSource  Source = "ethereum"
	FarcasterSource Source = "farcaster"
)

Jump to

Keyboard shortcuts

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