config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPriceAPIRequestFailed = errors.New("failed to fetch price api")
	ErrEmptyPrice            = errors.New("dollar price in ETH is empty")
)

Functions

This section is empty.

Types

type AirdropConfig added in v0.1.1

type AirdropConfig struct {
	Amount       *big.Int       `fig:"amount,required"`
	TokenAddress common.Address `fig:"token_address,required"`
}

type AirdropConfiger added in v0.1.1

type AirdropConfiger interface {
	AirdropConfig() AirdropConfig
}

func NewAirdropConfiger added in v0.1.1

func NewAirdropConfiger(getter kv.Getter) AirdropConfiger

type Broadcaster

type Broadcaster struct {
	RPC                 *ethclient.Client
	ChainID             *big.Int
	PrivateKey          *ecdsa.PrivateKey
	Address             common.Address
	QueryLimit          uint64
	ERC20PermitTransfer common.Address
	// contains filtered or unexported fields
}

func (*Broadcaster) IncrementNonce added in v0.1.1

func (n *Broadcaster) IncrementNonce()

func (*Broadcaster) LockNonce added in v0.1.1

func (n *Broadcaster) LockNonce()

func (*Broadcaster) MultiplyGasPrice added in v0.2.0

func (n *Broadcaster) MultiplyGasPrice(gasPrice *big.Int) *big.Int

func (*Broadcaster) Nonce added in v0.1.1

func (n *Broadcaster) Nonce() uint64

func (*Broadcaster) ResetNonce added in v0.1.1

func (n *Broadcaster) ResetNonce(client *ethclient.Client) error

ResetNonce sets nonce to the value received from a node

func (*Broadcaster) UnlockNonce added in v0.1.1

func (n *Broadcaster) UnlockNonce()

type Broadcasterer

type Broadcasterer interface {
	Broadcaster() Broadcaster
}

func NewBroadcaster

func NewBroadcaster(getter kv.Getter) Broadcasterer

type Config

type Config struct {
	comfig.Logger
	pgdb.Databaser
	comfig.Listenerer
	identity.VerifierProvider
	Broadcasterer
	AirdropConfiger
	PriceAPIConfiger
	// contains filtered or unexported fields
}

func New

func New(getter kv.Getter) *Config

func (*Config) NewRouting added in v0.1.1

func (c *Config) NewRouting() Routing

func (*Config) Verifier

func (c *Config) Verifier() *Verifierer

type Currency added in v0.2.0

type Currency struct {
	ID     int              `json:"id"`
	Name   string           `json:"name"`
	Symbol string           `json:"symbol"`
	Quote  map[string]Quote `json:"quote"`
}

type GlobalParams

type GlobalParams struct {
	EventID       string
	QuerySelector string
	AirdropStart  int64
}

type PriceAPIConfig added in v0.2.0

type PriceAPIConfig struct {
	URL        *url.URL `fig:"url,required"`
	Key        string   `fig:"key,required"`
	CurrencyID string   `fig:"currency_id,required"`
	QuoteTag   string   `fig:"quote_tag,required"`
}

func (PriceAPIConfig) ConvertPrice added in v0.2.0

func (cfg PriceAPIConfig) ConvertPrice() (*big.Float, error)

ConvertPrice converts tokens price

type PriceAPIConfiger added in v0.2.0

type PriceAPIConfiger interface {
	PriceAPIConfig() PriceAPIConfig
}

func NewPriceAPIConfiger added in v0.2.0

func NewPriceAPIConfiger(getter kv.Getter) PriceAPIConfiger

type Quote added in v0.2.0

type Quote struct {
	Price       float64   `json:"price"`
	LastUpdated time.Time `json:"last_updated"`
}

type QuoteResponse added in v0.2.0

type QuoteResponse struct {
	Data map[string]Currency `json:"data"`
}

type Routing added in v0.1.1

type Routing struct {
	Prefix string `fig:"prefix,required"`
}

type Verifierer

type Verifierer struct {
	Params     GlobalParams
	ZkVerifier *zk.Verifier
}

Jump to

Keyboard shortcuts

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