config

package
v0.0.0-...-b634e5d Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auditor

type Auditor interface {
	payer.Auditor
	Close()
}

type Auditors

type Auditors map[payer.Type]Auditor

func (*Auditors) Add

func (as *Auditors) Add(t payer.Type, a Auditor)

func (Auditors) Close

func (as Auditors) Close()

type CoinMarketCap

type CoinMarketCap struct {
	APIURL      string   `toml:"api_url"`
	APIKeyPath  Path     `toml:"api_key_path"`
	CacheExpiry Duration `toml:"cache_expiry"`
}

func (CoinMarketCap) NewQuoter

func (c CoinMarketCap) NewQuoter() (coinmarketcap.Quoter, error)

type Config

type Config struct {
	Pipeline      Pipeline      `toml:"pipeline"`
	CoinMarketCap CoinMarketCap `toml:"coinmarketcap"`
	Eth           *Eth          `toml:"eth"`
	ZkSyncEra     *ZkSyncEra    `toml:"zksync-era"`
}

func Load

func Load(path string) (Config, error)

func Parse

func Parse(data []byte) (Config, error)

func (*Config) NewAuditors

func (c *Config) NewAuditors(ctx context.Context) (_ Auditors, err error)

func (*Config) NewPayers

func (c *Config) NewPayers(ctx context.Context) (_ Payers, err error)

type Duration

type Duration time.Duration

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(b []byte) error

type Eth

type Eth struct {
	NodeAddress          string          `toml:"node_address"`
	SpenderKeyPath       Path            `toml:"spender_key_path"`
	ERC20ContractAddress common.Address  `toml:"erc20_contract_address"`
	ChainID              int             `toml:"chain_id"`
	Owner                *common.Address `toml:"owner"`
	MaxGas               *big.Int        `toml:"max_gas"`
	GasTipCap            *big.Int        `toml:"gas_tip_cap"`
}

func (Eth) NewAuditor

func (c Eth) NewAuditor(ctx context.Context) (_ Auditor, err error)

func (Eth) NewPayer

func (c Eth) NewPayer(ctx context.Context) (_ Payer, err error)

type HexString

type HexString []byte

func (*HexString) UnmarshalText

func (d *HexString) UnmarshalText(b []byte) error

type Path

type Path string

func ToPath

func ToPath(path string) Path

func (*Path) UnmarshalText

func (p *Path) UnmarshalText(b []byte) error

type Payer

type Payer interface {
	payer.Payer
	Close()
}

type Payers

type Payers map[payer.Type]Payer

func (*Payers) Add

func (ps *Payers) Add(t payer.Type, p Payer)

func (Payers) Close

func (ps Payers) Close()

type Pipeline

type Pipeline struct {
	DepthLimit int      `toml:"depth_limit"`
	TxDelay    Duration `toml:"tx_delay"`
}

type ZkSyncEra

type ZkSyncEra struct {
	NodeAddress          string          `toml:"node_address"`
	SpenderKeyPath       Path            `toml:"spender_key_path"`
	ERC20ContractAddress common.Address  `toml:"erc20_contract_address"`
	ChainID              int             `toml:"chain_id"`
	MaxFee               *big.Int        `toml:"max_fee"`
	PaymasterAddress     *common.Address `toml:"paymaster_address"`
	PaymasterPayload     HexString       `toml:"paymaster_payload"`
}

func (ZkSyncEra) NewAuditor

func (c ZkSyncEra) NewAuditor(ctx context.Context) (_ Auditor, err error)

func (ZkSyncEra) NewPayer

func (c ZkSyncEra) NewPayer(ctx context.Context) (_ Payer, err error)

Jump to

Keyboard shortcuts

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