client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EthClient

type EthClient interface {
	CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
	CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)

	HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
	BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)

	BalanceAt(ctx context.Context, account common.Address, number *big.Int) (*big.Int, error)
	FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
	SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery,
		ch chan<- types.Log) (ethereum.Subscription, error)
}

EthClient ... Provides interface wrapper for ethClient functions Useful for mocking go-ethereum json rpc client logic

func FromContext

func FromContext(ctx context.Context, layer core.Network) (EthClient, error)

FromContext ... Retrieves EthClient from context

func NewEthClient

func NewEthClient(ctx context.Context, rawURL string) (EthClient, error)

NewEthClient ... Initializer

type GethClient

type GethClient interface {
	GetProof(ctx context.Context, account common.Address, keys []string,
		blockNumber *big.Int) (*gethclient.AccountResult, error)
}

GethClient ... Provides interface wrapper for gethClient functions

func L2GethFromContext

func L2GethFromContext(ctx context.Context) (GethClient, error)

func NewGethClient

func NewGethClient(rawURL string) (GethClient, error)

NewGethClient ... Initializer

type SlackAPIResponse

type SlackAPIResponse struct {
	Ok  bool   `json:"ok"`
	Err string `json:"error"`
}

SlackAPIResponse ... represents the structure of a slack API response

type SlackClient

type SlackClient interface {
	PostData(context.Context, string) (*SlackAPIResponse, error)
}

SlackClient ... Interface for slack client

func NewSlackClient

func NewSlackClient(url string) SlackClient

NewSlackClient ... Initializer

type SlackPayload

type SlackPayload struct {
	Text interface{} `json:"text"`
}

slackPayload represents the structure of a slack alert

Jump to

Keyboard shortcuts

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