networks

package
v0.50.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CurrencyGroupName = map[uint8]string{
	0: "none",
	1: "usdc",
	2: "usdc_testnet",
	3: "weth",
}
View Source
var CurrencyGroupValue = map[string]uint8{
	"none":         0,
	"usdc":         1,
	"usdc_testnet": 2,
	"weth":         3,
}
View Source
var OrderSideName = map[uint8]string{
	0: "unknown",
	1: "mainnet",
	2: "testnet",
}
View Source
var OrderSideValue = map[string]uint8{
	"unknown": 0,
	"mainnet": 1,
	"testnet": 2,
}

Functions

This section is empty.

Types

type BlockExplorerConfig

type BlockExplorerConfig struct {
	Name       string `toml:"name"         json:"name,omitempty"`
	RootURL    string `toml:"root_url"     json:"rootUrl,omitempty"`
	AddressURL string `toml:"address_url"  json:"addressUrl,omitempty"`
	TxnHashURL string `toml:"txn_hash_url" json:"txnHashUrl,omitempty"`
}

type Currency

type Currency struct {
	ContractAddress *string       `toml:"contract_address" json:"contractAddress,omitempty"`
	Name            string        `toml:"name"             json:"name,omitempty"`
	Symbol          string        `toml:"symbol"           json:"symbol,omitempty"`
	Decimals        uint64        `toml:"decimals"         json:"decimals,omitempty"`
	ImageURL        string        `toml:"image_url"        json:"imageUrl,omitempty"`
	Native          bool          `toml:"native"           json:"native,omitempty"`
	Default         bool          `toml:"default"          json:"default,omitempty"`
	Group           CurrencyGroup `toml:"group"            json:"group,omitempty"`
}

type CurrencyGroup

type CurrencyGroup uint8

Grouping currencies for cross chain purchases

const (
	CurrencyGroupNone CurrencyGroup = iota
	CurrencyGroupUSDC
	CurrencyGroupUSDCTestnet
	CurrencyGroupWETH
)

func (CurrencyGroup) MarshalText

func (x CurrencyGroup) MarshalText() ([]byte, error)

func (CurrencyGroup) String

func (x CurrencyGroup) String() string

func (*CurrencyGroup) UnmarshalText

func (x *CurrencyGroup) UnmarshalText(b []byte) error

type Network

type Network struct {
	ChainID    uint64      `toml:"chain_id"    json:"chainId,omitempty"`
	Name       string      `toml:"name"        json:"name,omitempty"`
	Title      string      `toml:"title"       json:"title,omitempty"`
	Type       NetworkType `toml:"type"        json:"type,omitempty"`
	LogoURL    string      `toml:"logo_url"    json:"logoUrl,omitempty"`
	ENSAddress string      `toml:"ens_address" json:"ensAddress,omitempty"`
	AuthChain  bool        `toml:"auth_chain"  json:"authChain,omitempty"`
	Deprecated bool        `toml:"deprecated"  json:"deprecated,omitempty"`
	Disabled   bool        `toml:"disabled"    json:"disabled,omitempty"`
	WSEnabled  bool        `toml:"ws_enabled"  json:"wsEnabled,omitempty"`
	WSURL      string      `toml:"ws_url"      json:"wsUrl,omitempty"`

	BlockExplorer *BlockExplorerConfig `toml:"block_explorer" json:"blockExplorer,omitempty"`

	NodeURL            string `toml:"node_url"             json:"nodeUrl,omitempty"`
	IndexerURL         string `toml:"indexer_url"          json:"indexerUrl,omitempty"`
	RelayerURL         string `toml:"relayer_url"          json:"relayerUrl,omitempty"`
	InternalNodeURL    string `toml:"internal_node_url"    json:"-"`
	InternalIndexerURL string `toml:"internal_indexer_url" json:"-"`
	InternalRelayerURL string `toml:"internal_relayer_url" json:"-"`

	NativeToken *Currency   `toml:"native_token" json:"nativeToken,omitempty"`
	Currencies  []*Currency `toml:"currencies"   json:"currencies,omitempty"`
}

func (*Network) IsMainnet

func (n *Network) IsMainnet() bool

func (*Network) IsTesnet

func (n *Network) IsTesnet() bool

type NetworkType

type NetworkType uint8
const (
	NetworkTypeUnknown NetworkType = 0
	NetworkTypeMainnet NetworkType = 1
	NetworkTypeTestnet NetworkType = 2
)

func (NetworkType) MarshalText

func (x NetworkType) MarshalText() ([]byte, error)

func (NetworkType) String

func (x NetworkType) String() string

func (*NetworkType) UnmarshalText

func (x *NetworkType) UnmarshalText(b []byte) error

type Networks

type Networks map[string]*Network

func (Networks) Active

func (n Networks) Active() Networks

func (Networks) EthProvidersConfig

func (n Networks) EthProvidersConfig() ethproviders.Config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳