toml

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: LGPL-3.0, MIT Imports: 26 Imported by: 19

Documentation

Index

Constants

View Source
const (
	DAOracleOPStack        = DAOracleType("opstack")
	DAOracleArbitrum       = DAOracleType("arbitrum")
	DAOracleZKSync         = DAOracleType("zksync")
	DAOracleCustomCalldata = DAOracleType("custom_calldata")
)
View Source
const ENV_CUSTOM_DEFAULTS = "CL_CHAIN_DEFAULTS"

Variables

View Source
var (

	// DefaultIDs is the set of chain ids which have defaults.
	DefaultIDs []*big.Big
)
View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

func ChainIDInt64

func ChainIDInt64(cid string) (int64, error)

func ChainTypeForID

func ChainTypeForID(chainID *big.Big) (chaintype.ChainType, bool)

func GenerateDocs

func GenerateDocs() (string, error)

Types

type AutoPurgeConfig

type AutoPurgeConfig struct {
	Enabled         *bool
	Threshold       *uint32
	MinAttempts     *uint32
	DetectionApiUrl *commonconfig.URL
}

type Automation

type Automation struct {
	GasLimit *uint32
}

type BalanceMonitor

type BalanceMonitor struct {
	Enabled *bool
}

type BlockHistoryEstimator

type BlockHistoryEstimator struct {
	BatchSize                 *uint32
	BlockHistorySize          *uint16
	CheckInclusionBlocks      *uint16
	CheckInclusionPercentile  *uint16
	EIP1559FeeCapBufferBlocks *uint16
	TransactionPercentile     *uint16
}

type Chain

type Chain struct {
	AutoCreateKey                *bool
	BlockBackfillDepth           *uint32
	BlockBackfillSkip            *bool
	ChainType                    *chaintype.Config
	FinalityDepth                *uint32
	SafeDepth                    *uint32
	FinalityTagEnabled           *bool
	FlagsContractAddress         *types.EIP55Address
	LinkContractAddress          *types.EIP55Address
	LogBackfillBatchSize         *uint32
	LogPollInterval              *commonconfig.Duration
	LogKeepBlocksDepth           *uint32
	LogPrunePageSize             *uint32
	BackupLogPollerBlockDelay    *uint64
	MinIncomingConfirmations     *uint32
	MinContractPayment           *commonassets.Link
	NonceAutoSync                *bool
	NoNewHeadsThreshold          *commonconfig.Duration
	OperatorFactoryAddress       *types.EIP55Address
	LogBroadcasterEnabled        *bool
	RPCDefaultBatchSize          *uint32
	RPCBlockQueryDelay           *uint16
	FinalizedBlockOffset         *uint32
	NoNewFinalizedHeadsThreshold *commonconfig.Duration

	Transactions   Transactions      `toml:",omitempty"`
	BalanceMonitor BalanceMonitor    `toml:",omitempty"`
	GasEstimator   GasEstimator      `toml:",omitempty"`
	HeadTracker    HeadTracker       `toml:",omitempty"`
	KeySpecific    KeySpecificConfig `toml:",omitempty"`
	NodePool       NodePool          `toml:",omitempty"`
	OCR            OCR               `toml:",omitempty"`
	OCR2           OCR2              `toml:",omitempty"`
	Workflow       Workflow          `toml:",omitempty"`
}

func Defaults

func Defaults(chainID *big.Big, with ...*Chain) Chain

Defaults returns a Chain based on the defaults for chainID and fields from with, applied in order so later Chains override earlier ones.

func DefaultsNamed

func DefaultsNamed(chainID *big.Big) (c Chain, name string)

DefaultsNamed returns the default Chain values, optionally for the given chainID, as well as a name if the chainID is known.

func (*Chain) SetFrom

func (c *Chain) SetFrom(f *Chain)

SetFrom updates c with any non-nil values from f.

func (*Chain) ValidateConfig

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

type ClientErrors

type ClientErrors struct {
	NonceTooLow                       *string `toml:",omitempty"`
	NonceTooHigh                      *string `toml:",omitempty"`
	ReplacementTransactionUnderpriced *string `toml:",omitempty"`
	LimitReached                      *string `toml:",omitempty"`
	TransactionAlreadyInMempool       *string `toml:",omitempty"`
	TerminallyUnderpriced             *string `toml:",omitempty"`
	InsufficientEth                   *string `toml:",omitempty"`
	TxFeeExceedsCap                   *string `toml:",omitempty"`
	L2FeeTooLow                       *string `toml:",omitempty"`
	L2FeeTooHigh                      *string `toml:",omitempty"`
	L2Full                            *string `toml:",omitempty"`
	TransactionAlreadyMined           *string `toml:",omitempty"`
	Fatal                             *string `toml:",omitempty"`
	ServiceUnavailable                *string `toml:",omitempty"`
	TooManyResults                    *string `toml:",omitempty"`
	MissingBlocks                     *string `toml:",omitempty"`
}

type DAOracle

type DAOracle struct {
	OracleType             *DAOracleType
	OracleAddress          *types.EIP55Address
	CustomGasPriceCalldata *string
}

func (*DAOracle) ValidateConfig

func (o *DAOracle) ValidateConfig() (err error)

type DAOracleType

type DAOracleType string

func (DAOracleType) IsValid

func (o DAOracleType) IsValid() bool

type EVMConfig

type EVMConfig struct {
	ChainID *big.Big
	Enabled *bool
	Chain
	Nodes EVMNodes
}

func (*EVMConfig) ConfirmationTimeout

func (c *EVMConfig) ConfirmationTimeout() time.Duration

func (*EVMConfig) IsEnabled

func (c *EVMConfig) IsEnabled() bool

func (*EVMConfig) SetFrom

func (c *EVMConfig) SetFrom(f *EVMConfig)

func (*EVMConfig) TOMLString

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

func (*EVMConfig) ValidateConfig

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

type EVMConfigs

type EVMConfigs []*EVMConfig

func (EVMConfigs) Chains

func (cs EVMConfigs) Chains(ids ...string) (r []commontypes.ChainStatus, total int, err error)

func (EVMConfigs) Enabled

func (cs EVMConfigs) Enabled() bool

func (EVMConfigs) Node

func (cs EVMConfigs) Node(name string) (types.Node, error)

func (EVMConfigs) NodeStatus

func (cs EVMConfigs) NodeStatus(name string) (commontypes.NodeStatus, error)

func (EVMConfigs) NodeStatuses

func (cs EVMConfigs) NodeStatuses(chainIDs ...string) (ns []commontypes.NodeStatus, err error)

func (EVMConfigs) Nodes

func (cs EVMConfigs) Nodes(chainID string) (ns []types.Node, err error)

func (EVMConfigs) RPCEnabled

func (cs EVMConfigs) RPCEnabled() bool

func (*EVMConfigs) SetFrom

func (cs *EVMConfigs) SetFrom(fs *EVMConfigs) (err error)

func (EVMConfigs) ValidateConfig

func (cs EVMConfigs) ValidateConfig() (err error)

type EVMNodes

type EVMNodes []*Node

func (*EVMNodes) SetFrom

func (ns *EVMNodes) SetFrom(fs *EVMNodes)

type FeeHistoryEstimator

type FeeHistoryEstimator struct {
	CacheTimeout *commonconfig.Duration
}

type GasEstimator

type GasEstimator struct {
	Mode *string

	PriceDefault *assets.Wei
	PriceMax     *assets.Wei
	PriceMin     *assets.Wei

	LimitDefault    *uint64
	LimitMax        *uint64
	LimitMultiplier *decimal.Decimal
	LimitTransfer   *uint64
	LimitJobType    GasLimitJobType `toml:",omitempty"`
	EstimateLimit   *bool
	SenderAddress   *types.EIP55Address `toml:",omitempty"`

	BumpMin       *assets.Wei
	BumpPercent   *uint16
	BumpThreshold *uint32
	BumpTxDepth   *uint32

	EIP1559DynamicFees *bool

	FeeCapDefault *assets.Wei
	TipCapDefault *assets.Wei
	TipCapMin     *assets.Wei

	BlockHistory BlockHistoryEstimator `toml:",omitempty"`
	FeeHistory   FeeHistoryEstimator   `toml:",omitempty"`
	DAOracle     DAOracle              `toml:",omitempty"`
}

func (*GasEstimator) ValidateConfig

func (e *GasEstimator) ValidateConfig() (err error)

type GasLimitJobType

type GasLimitJobType struct {
	OCR    *uint32 `toml:",inline"`
	OCR2   *uint32 `toml:",inline"`
	DR     *uint32 `toml:",inline"`
	VRF    *uint32 `toml:",inline"`
	FM     *uint32 `toml:",inline"`
	Keeper *uint32 `toml:",inline"`
}

type HasEVMConfigs

type HasEVMConfigs interface {
	EVMConfigs() EVMConfigs
}

type HeadTracker

type HeadTracker struct {
	HistoryDepth            *uint32
	MaxBufferSize           *uint32
	SamplingInterval        *commonconfig.Duration
	MaxAllowedFinalityDepth *uint32
	FinalityTagBypass       *bool
	PersistenceEnabled      *bool
	PersistenceBatchSize    *int64
}

func (*HeadTracker) ValidateConfig

func (t *HeadTracker) ValidateConfig() (err error)

type KeySpecific

type KeySpecific struct {
	Key          *types.EIP55Address
	GasEstimator KeySpecificGasEstimator `toml:",omitempty"`
}

type KeySpecificConfig

type KeySpecificConfig []KeySpecific

func (KeySpecificConfig) ValidateConfig

func (ks KeySpecificConfig) ValidateConfig() (err error)

type KeySpecificGasEstimator

type KeySpecificGasEstimator struct {
	PriceMax *assets.Wei
}

type Node

type Node struct {
	Name    *string
	WSURL   *commonconfig.URL
	HTTPURL *commonconfig.URL
	// The HTTPURLExtraWrite is an undocumented config option used only for chains that require
	// an additional URL in conjunction to the standard JSON-RPC URL
	// Supports TRON (different write path)
	HTTPURLExtraWrite *commonconfig.URL
	SendOnly          *bool
	Order             *int32
}

func (*Node) SetFrom

func (n *Node) SetFrom(f *Node)

func (*Node) ValidateConfig

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

type NodePool

type NodePool struct {
	PollFailureThreshold       *uint32
	PollInterval               *commonconfig.Duration
	SelectionMode              *string
	SyncThreshold              *uint32
	LeaseDuration              *commonconfig.Duration
	NodeIsSyncingEnabled       *bool
	FinalizedBlockPollInterval *commonconfig.Duration
	Errors                     ClientErrors `toml:",omitempty"`
	EnforceRepeatableRead      *bool
	DeathDeclarationDelay      *commonconfig.Duration
	NewHeadsPollInterval       *commonconfig.Duration
	VerifyChainID              *bool
}

func (*NodePool) ValidateConfig

func (p *NodePool) ValidateConfig(finalityTagEnabled *bool) (err error)

type OCR

type OCR struct {
	ContractConfirmations              *uint16
	ContractTransmitterTransmitTimeout *commonconfig.Duration
	DatabaseTimeout                    *commonconfig.Duration
	DeltaCOverride                     *commonconfig.Duration
	DeltaCJitterOverride               *commonconfig.Duration
	ObservationGracePeriod             *commonconfig.Duration
}

type OCR2

type OCR2 struct {
	Automation Automation `toml:",omitempty"`
}

type TransactionManagerV2Config

type TransactionManagerV2Config struct {
	Enabled       *bool                  `toml:",omitempty"`
	BlockTime     *commonconfig.Duration `toml:",omitempty"`
	CustomURL     *commonconfig.URL      `toml:",omitempty"`
	DualBroadcast *bool                  `toml:",omitempty"`
}

func (*TransactionManagerV2Config) ValidateConfig

func (t *TransactionManagerV2Config) ValidateConfig() (err error)

type Transactions

type Transactions struct {
	Enabled              *bool
	ForwardersEnabled    *bool
	MaxInFlight          *uint32
	MaxQueued            *uint32
	ReaperInterval       *commonconfig.Duration
	ReaperThreshold      *commonconfig.Duration
	ResendAfterThreshold *commonconfig.Duration
	ConfirmationTimeout  *commonconfig.Duration

	AutoPurge            AutoPurgeConfig            `toml:",omitempty"`
	TransactionManagerV2 TransactionManagerV2Config `toml:",omitempty"`
}

func (*Transactions) ValidateConfig

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

type Workflow

type Workflow struct {
	FromAddress       *types.EIP55Address `toml:",omitempty"`
	ForwarderAddress  *types.EIP55Address `toml:",omitempty"`
	GasLimitDefault   *uint64
	TxAcceptanceState *commontypes.TransactionStatus
	PollPeriod        *commonconfig.Duration
	AcceptanceTimeout *commonconfig.Duration
}

Jump to

Keyboard shortcuts

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