client

package
v0.0.0-...-86af830 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client ... Indexer client struct

func NewClient

func NewClient(cfg *Config, opts ...Option) (*Client, error)

NewClient ... Construct a new indexer client

func (*Client) GetAllDepositsByAddress

func (c *Client) GetAllDepositsByAddress(l1Address common.Address) ([]models.DepositItem, error)

GetAllDepositsByAddress ... Gets all deposits provided a L1 address

func (*Client) GetAllWithdrawalsByAddress

func (c *Client) GetAllWithdrawalsByAddress(l2Address common.Address) ([]models.WithdrawalItem, error)

GetAllWithdrawalsByAddress ... Gets all withdrawals provided a L2 address

func (*Client) GetDepositsByAddress

func (c *Client) GetDepositsByAddress(l1Address common.Address, cursor string) (*models.DepositResponse, error)

GetDepositsByAddress ... Gets a deposit response object provided an L1 address and cursor

func (*Client) GetSupplyAssessment

func (c *Client) GetSupplyAssessment() (*models.BridgeSupplyView, error)

GetSupplyAssessment ... Returns an assessment of the current supply on both L1 and L2. This includes the individual sums of (L1/L2) deposits and withdrawals

func (*Client) GetWithdrawalsByAddress

func (c *Client) GetWithdrawalsByAddress(l2Address common.Address, cursor string) (*models.WithdrawalResponse, error)

GetWithdrawalsByAddress ... Gets a withdrawal response object provided an L2 address and cursor

func (*Client) HealthCheck

func (c *Client) HealthCheck() error

HealthCheck ... Checks the health of the indexer API

type Config

type Config struct {
	PaginationLimit int
	BaseURL         string
}

Config ... Indexer client config struct

type Option

type Option func(*Client) error

Option ... Provides configuration through callback injection

func WithMetrics

func WithMetrics(m node.Metricer) Option

WithMetrics ... Triggers metric optionality

func WithTimeout

func WithTimeout(t time.Duration) Option

WithTimeout ... Embeds a timeout limit to request

Jump to

Keyboard shortcuts

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