evm

package
v0.0.0-...-40caaf7 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAPIKeyIsRequired = errors.New("api key is required")
	ErrInvalidRPC       = errors.New("invalid rpc")
)
View Source
var ChainsDir embed.FS
View Source
var ChainsDirName = "chains"
View Source
var ErrUnsupportedImage = errors.New("unsupported image")
View Source
var IconsDir embed.FS
View Source
var IconsDirName = "icons"
View Source
var IconsDownloadDir embed.FS
View Source
var IconsDownloadDirName = "iconsDownload"

Functions

func LoadChains

func LoadChains() <-chan LoadChainsResponse

Types

type Bridge

type Bridge struct {
	URL string `json:"url"`
}

type Chain

type Chain struct {
	Name           string         `json:"name"`
	Chain          string         `json:"chain"`
	Icon           string         `json:"icon,omitempty"`
	IconsData      []IconData     `json:",omitempty"`
	RPC            []RPC          `json:"rpc"`
	Features       []Features     `json:"features,omitempty"`
	Faucets        []string       `json:"faucets"`
	NativeCurrency NativeCurrency `json:"nativeCurrency"`
	InfoURL        string         `json:"infoURL"`
	ShortName      string         `json:"shortName"`
	ChainID        big.Int        `json:"chainId"`
	NetworkID      big.Int        `json:"networkId"`
	Slip44         big.Int        `json:"slip44,omitempty"`
	Ens            Ens            `json:"ens,omitempty"`
	Explorers      []Explorer     `json:"explorers,omitempty"`
	Title          string         `json:"title,omitempty"`
	RedFlags       []string       `json:"redFlags,omitempty"`
	Parent         Parent         `json:"parent,omitempty"`
	Status         string         `json:"status,omitempty"`
}

type Ens

type Ens struct {
	Registry string `json:"registry"`
}

type Explorer

type Explorer struct {
	Name     string `json:"name"`
	URL      string `json:"url"`
	Standard string `json:"standard"`
	Icon     string `json:"icon,omitempty"`
}

type Features

type Features struct {
	Name string `json:"name"`
}

type IconData

type IconData struct {
	URL    string `json:"url"`
	Width  int    `json:"width"`
	Height int    `json:"height"`
	Format string `json:"format"`
}

func (IconData) Encoded

func (i IconData) Encoded() ([]byte, error)

func (IconData) OrigEncodedImage

func (i IconData) OrigEncodedImage() ([]byte, error)

func (IconData) OrigImage

func (i IconData) OrigImage() (image.Image, error)

func (IconData) SmallEncodedImage

func (i IconData) SmallEncodedImage() ([]byte, error)

func (IconData) SmallImage

func (i IconData) SmallImage() (image.Image, error)

type LoadChainsResponse

type LoadChainsResponse struct {
	Done   bool
	Chains []Chain
}

type NativeCurrency

type NativeCurrency struct {
	Name     string `json:"name"`
	Symbol   string `json:"symbol"`
	Decimals int    `json:"decimals"`
}

type Parent

type Parent struct {
	Type    string   `json:"type"`
	Chain   string   `json:"chain"`
	Bridges []Bridge `json:"bridges"`
}

type RPC

type RPC string

func (RPC) GetURL

func (r RPC) GetURL(key string) (string, error)

func (RPC) KeyRequired

func (r RPC) KeyRequired() bool

Jump to

Keyboard shortcuts

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