core

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GasPriceFetcher

type GasPriceFetcher struct {
	// contains filtered or unexported fields
}

GasPriceFetcher handles periodic gas price fetching for all chains

func NewGasPriceFetcher

func NewGasPriceFetcher(
	chainRegistry *chains.ChainRegistry,
	cfg *config.Config,
	logger zerolog.Logger,
) *GasPriceFetcher

NewGasPriceFetcher creates a new gas price fetcher

func (*GasPriceFetcher) GetActiveFetchers

func (f *GasPriceFetcher) GetActiveFetchers() []string

GetActiveFetchers returns the list of active chain IDs being fetched

func (*GasPriceFetcher) SetGasVoteHandler

func (f *GasPriceFetcher) SetGasVoteHandler(chainID string, handler *GasVoteHandler)

SetGasVoteHandler sets the gas vote handler for a specific chain

func (*GasPriceFetcher) Start

func (f *GasPriceFetcher) Start(ctx context.Context) error

Start begins the gas price fetching process for all chains

func (*GasPriceFetcher) Stop

func (f *GasPriceFetcher) Stop()

Stop halts all gas price fetchers

func (*GasPriceFetcher) UpdateChainInterval

func (f *GasPriceFetcher) UpdateChainInterval(chainID string, intervalSeconds int) error

UpdateChainInterval updates the fetching interval for a specific chain

type GasVoteHandler

type GasVoteHandler struct {
	// contains filtered or unexported fields
}

GasVoteHandler handles voting on gas prices for external chains

func NewGasVoteHandler

func NewGasVoteHandler(
	txSigner TxSignerInterface,
	db *db.DB,
	log zerolog.Logger,
	keys keys.UniversalValidatorKeys,
	granter string,
) *GasVoteHandler

NewGasVoteHandler creates a new gas vote handler

func (*GasVoteHandler) VoteGasPrice

func (gh *GasVoteHandler) VoteGasPrice(
	ctx context.Context,
	chainID string,
	price uint64,
) error

VoteGasPrice votes on an observed gas price and stores the vote transaction

type SignerHandler

type SignerHandler struct {
	// contains filtered or unexported fields
}

SignerHandler manages transaction signing for all chains It provides a unified interface for voting on any chain

func NewSignerHandler

func NewSignerHandler(
	ctx context.Context,
	log zerolog.Logger,
	validationResult *StartupValidationResult,
	grpcURL string,
	chainID string,
) (*SignerHandler, error)

NewSignerHandler creates a new unified signer handler

func (*SignerHandler) GetGranter

func (sh *SignerHandler) GetGranter() string

GetGranter returns the granter address

func (*SignerHandler) GetKeys

GetKeys returns the universal validator keys

func (*SignerHandler) GetTxSigner

func (sh *SignerHandler) GetTxSigner() TxSignerInterface

GetTxSigner returns the underlying transaction signer

func (*SignerHandler) SignAndBroadcast

func (sh *SignerHandler) SignAndBroadcast(
	ctx context.Context,
	msgs []sdk.Msg,
	memo string,
	gasLimit uint64,
	feeAmount sdk.Coins,
) (*sdk.TxResponse, error)

SignAndBroadcast signs and broadcasts a transaction with the given messages

type StartupValidationResult

type StartupValidationResult struct {
	Keyring  keyring.Keyring
	KeyName  string
	KeyAddr  string
	Granter  string
	Messages []string // List of authorized message types
}

StartupValidationResult contains the validated hotkey information

type StartupValidator

type StartupValidator struct {
	// contains filtered or unexported fields
}

StartupValidator validates startup requirements

func NewStartupValidator

func NewStartupValidator(
	ctx context.Context,
	log zerolog.Logger,
	config *config.Config,
	grpcURL string,
) *StartupValidator

NewStartupValidator creates a new startup validator

func (*StartupValidator) ValidateStartupRequirements

func (sv *StartupValidator) ValidateStartupRequirements() (*StartupValidationResult, error)

ValidateStartupRequirements validates hotkey and AuthZ permissions

type TxSignerInterface

type TxSignerInterface interface {
	SignAndBroadcastAuthZTx(ctx context.Context, msgs []sdk.Msg, memo string, gasLimit uint64, feeAmount sdk.Coins) (*sdk.TxResponse, error)
}

TxSignerInterface defines the interface for transaction signing

type UniversalClient

type UniversalClient struct {
	// contains filtered or unexported fields
}

func NewUniversalClient

func NewUniversalClient(ctx context.Context, log zerolog.Logger, dbManager *db.ChainDBManager, cfg *config.Config) (*UniversalClient, error)

func (*UniversalClient) GetAllChainData

func (uc *UniversalClient) GetAllChainData() []*cache.ChainData

GetAllChainConfigs returns all cached chain configurations

func (*UniversalClient) OnChainAdded

func (uc *UniversalClient) OnChainAdded(chainID string)

OnChainAdded implements ChainRegistryObserver interface

func (*UniversalClient) Start

func (uc *UniversalClient) Start() error

type VoteHandler

type VoteHandler struct {
	// contains filtered or unexported fields
}

VoteHandler handles voting on confirmed inbound transactions

func NewVoteHandler

func NewVoteHandler(
	txSigner TxSignerInterface,
	db *db.DB,
	log zerolog.Logger,
	keys keys.UniversalValidatorKeys,
	granter string,
) *VoteHandler

NewVoteHandler creates a new vote handler

func (*VoteHandler) GetPendingTransactions

func (vh *VoteHandler) GetPendingTransactions(minConfirmations uint64) ([]store.ChainTransaction, error)

GetPendingTransactions returns all transactions that have enough confirmations but haven't been voted on

func (*VoteHandler) VoteAndConfirm

func (vh *VoteHandler) VoteAndConfirm(ctx context.Context, tx *store.ChainTransaction) error

VoteAndConfirm votes on a transaction and updates its status to confirmed

Jump to

Keyboard shortcuts

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