evm

package
v0.0.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// APIKey is the API key used to make requests to the EVM API.
	APIKey string `mapstructure:"api_key" toml:"api_key"`
	// TokenNameToMetadata is a map of token names to their metadata.
	TokenNameToMetadata map[string]TokenMetadata `mapstructure:"token_name_to_metadata" toml:"token_name_to_metadata"`
	// RPCEndpoint is the endpoint of the ethereum rpc node to use for querying
	RPCEndpoint string `mapstructure:"rpc_endpoint" toml:"rpc_endpoint"`
}

Config is the config struct for EVM providers.

func ReadEVMConfigFromFile

func ReadEVMConfigFromFile(path string) (Config, error)

ReadEVMConfigFromFile reads a config from a file and returns the config.

type TokenMetadata

type TokenMetadata struct {
	// Symbol is the provider-specific token identifier. This can be a name, ticker, contract address, etc.
	Symbol string `mapstructure:"symbol" toml:"symbol"`
	// Decimals is the number of decimal places the token has on chain.
	Decimals uint64 `mapstructure:"decimals" toml:"decimals"`
	// IsTWAP indicates whether this token's price is a time weighted average.
	IsTWAP bool `mapstructure:"is_twap" toml:"is_twap"`
}

TokenMetadata is the metadata for a token.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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