config

package
v0.0.0-...-29137c7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ChainFamilyName = "aptos"

Name of the chain family (e.g., "ethereum", "solana", "aptos")

Variables

View Source
var DefaultConfigSet = ConfigSet{
	TransactionManager: txm.DefaultConfigSet,
	BalanceMonitor: monitor.GenericBalanceConfig{
		BalancePollPeriod: *config.MustNewDuration(10 * time.Second),
	},
	WriteTargetCap: write_target.DefaultConfigSet,
}

Functions

func GetNetworkConfig

func GetNetworkConfig(chainID string) (aptos.NetworkConfig, error)

GetNetworkConfig returns a known network configuration for the given chain ID. A NetworkConfig contains the configuration details for connecting to a specific Aptos network, including the network's ChainId, URL, and other relevant settings. This function takes a chain ID as a string, validates it, and returns the corresponding NetworkConfig.

Types

type Chain

type Chain struct {
	TransactionManager *txm.Config
	BalanceMonitor     *monitor.GenericBalanceConfig
	WriteTargetCap     *write_target.Config
	Workflow           *WorkflowConfig
}

type ConfigSet

type ConfigSet struct {
	TransactionManager txm.Config
	BalanceMonitor     monitor.GenericBalanceConfig
	WriteTargetCap     write_target.Config
}

type Node

type Node struct {
	Name *string
	URL  *config.URL
}

func (*Node) ValidateConfig

func (n *Node) ValidateConfig() (err error)

type Nodes

type Nodes []*Node

func (*Nodes) SetFrom

func (ns *Nodes) SetFrom(fs *Nodes)

type TOMLConfig

type TOMLConfig struct {
	// Do not access directly. Use [IsEnabled]
	Enabled *bool

	// Chain configuration
	ChainID         string
	NetworkName     string
	NetworkNameFull string

	// Chain-specific components configuration
	Chain

	Nodes Nodes
}

func NewDecodedTOMLConfig

func NewDecodedTOMLConfig(rawConfig string) (*TOMLConfig, error)

decodeConfig decodes the rawConfig as (Aptos) TOML and sets default values

func (*TOMLConfig) IsEnabled

func (c *TOMLConfig) IsEnabled() bool

func (*TOMLConfig) SetDefaults

func (c *TOMLConfig) SetDefaults()

func (*TOMLConfig) SetFrom

func (c *TOMLConfig) SetFrom(f *TOMLConfig)

func (*TOMLConfig) TOMLString

func (c *TOMLConfig) TOMLString() (string, error)

func (*TOMLConfig) ValidateConfig

func (c *TOMLConfig) ValidateConfig() (err error)

type TOMLConfigs

type TOMLConfigs []*TOMLConfig

func (TOMLConfigs) ValidateConfig

func (cs TOMLConfigs) ValidateConfig() (err error)

type WorkflowConfig

type WorkflowConfig struct {
	ForwarderAddress string
	// FromAddress      string
	PublicKey string
}

Jump to

Keyboard shortcuts

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