functions

package
v2.2.1-mercury-20230627 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFunctionsHandler

func NewFunctionsHandler(handlerConfig json.RawMessage, donConfig *config.DONConfig, don handlers.DON, chains evm.ChainSet, lggr logger.Logger) (handlers.Handler, error)

Types

type FunctionsHandlerConfig

type FunctionsHandlerConfig struct {
	AllowlistCheckEnabled       bool   `json:"allowlistCheckEnabled"`
	AllowlistChainID            int64  `json:"allowlistChainID"`
	AllowlistContractAddress    string `json:"allowlistContractAddress"`
	AllowlistBlockConfirmations int64  `json:"allowlistBlockConfirmations"`
	AllowlistUpdateFrequencySec int    `json:"allowlistUpdateFrequencySec"`
	AllowlistUpdateTimeoutSec   int    `json:"allowlistUpdateTimeoutSec"`
}

func ParseConfig

func ParseConfig(handlerConfig json.RawMessage) (*FunctionsHandlerConfig, error)

type OnchainAllowlist

type OnchainAllowlist interface {
	Allow(common.Address) bool
	UpdateFromContract(ctx context.Context) error
	UpdatePeriodically(ctx context.Context, updateFrequency time.Duration, updateTimeout time.Duration)
}

OnchainAllowlist maintains an allowlist of addresses fetched from the blockchain (EVM-only). Use UpdateFromContract() for a one-time update or UpdatePeriodically() for periodic updates. All methods are thread-safe.

func NewOnchainAllowlist

func NewOnchainAllowlist(client evmclient.Client, contractAddress common.Address, blockConfirmations int64, lggr logger.Logger) (OnchainAllowlist, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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