crosschain

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtherscanPriceFeed

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

EtherscanPriceFeed implements PriceFeed for Ethereum mainnet

func NewEtherscanPriceFeed

func NewEtherscanPriceFeed(apiKey string) *EtherscanPriceFeed

NewEtherscanPriceFeed creates a new Etherscan price feed

func (*EtherscanPriceFeed) GetGasPrice

func (pf *EtherscanPriceFeed) GetGasPrice(ctx context.Context) (*big.Int, error)

GetGasPrice gets the current gas price from Etherscan

func (*EtherscanPriceFeed) GetNetworkCongestion

func (pf *EtherscanPriceFeed) GetNetworkCongestion(ctx context.Context) (float64, error)

GetNetworkCongestion gets the current network congestion level

type GasAbstraction

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

GasAbstraction handles cross-chain gas payments using FLUMX tokens

func NewGasAbstraction

func NewGasAbstraction() *GasAbstraction

NewGasAbstraction creates a new gas abstraction handler

func (*GasAbstraction) PayGasWithFLUMX

func (ga *GasAbstraction) PayGasWithFLUMX(ctx context.Context, tx types.Tx, chainID string) error

PayGasWithFLUMX handles gas payment using FLUMX tokens

type GasConfig

type GasConfig struct {
	BaseGasPrice   *big.Int
	GasMultiplier  float64
	MinGasRequired *big.Int
	MaxGasAllowed  *big.Int
	UpdateInterval time.Duration
	LastUpdate     time.Time
}

GasConfig holds configuration for gas costs on different chains

type PriceFeed

type PriceFeed interface {
	GetGasPrice(ctx context.Context) (*big.Int, error)
	GetNetworkCongestion(ctx context.Context) (float64, error)
}

PriceFeed interface for getting gas prices and network conditions

Jump to

Keyboard shortcuts

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