Documentation
¶
Index ¶
- Constants
- type APIService
- type Client
- func (c *Client) GetAllDepositsByAddress(l1Address common.Address) ([]models.DepositItem, error)
- func (c *Client) GetAllWithdrawalsByAddress(l2Address common.Address) ([]models.WithdrawalItem, error)
- func (c *Client) GetDepositsByAddress(l1Address common.Address, cursor string) (*models.DepositResponse, error)
- func (c *Client) GetSupplyAssessment() (*models.BridgeSupplyView, error)
- func (c *Client) GetWithdrawalsByAddress(l2Address common.Address, cursor string) (*models.WithdrawalResponse, error)
- func (c *Client) HealthCheck() error
- type ClientConfig
- type Config
- type DB
- type DBConfigConnector
- type DBConnector
- type Option
- type TestDBConnector
Constants ¶
const ( MetricsNamespace = "op_indexer_api" // Endpoint paths DocsPath = "/docs" HealthPath = "/healthz" DepositsPath = "/api/v0/deposits/" WithdrawalsPath = "/api/v0/withdrawals/" SupplyPath = "/api/v0/supply" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIService ¶ added in v1.4.2
type APIService struct {
// contains filtered or unexported fields
}
Api ... Indexer API struct TODO : Structured error responses
func (*APIService) Addr ¶ added in v1.4.2
func (a *APIService) Addr() string
Addr ... returns the address that the HTTP server is listening on (excl. http:// prefix, just the host and port)
func (*APIService) Stopped ¶ added in v1.4.2
func (a *APIService) Stopped() bool
type Client ¶ added in v1.7.6
type Client struct {
// contains filtered or unexported fields
}
Client ... Indexer client struct
func NewClient ¶ added in v1.7.6
func NewClient(cfg *ClientConfig, opts ...Option) (*Client, error)
NewClient ... Construct a new indexer client
func (*Client) GetAllDepositsByAddress ¶ added in v1.7.6
GetAllDepositsByAddress ... Gets all deposits provided a L1 address
func (*Client) GetAllWithdrawalsByAddress ¶ added in v1.7.6
func (c *Client) GetAllWithdrawalsByAddress(l2Address common.Address) ([]models.WithdrawalItem, error)
GetAllWithdrawalsByAddress ... Gets all withdrawals provided a L2 address
func (*Client) GetDepositsByAddress ¶ added in v1.7.6
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 ¶ added in v1.7.6
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 ¶ added in v1.7.6
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 ¶ added in v1.7.6
HealthCheck ... Checks the health of the indexer API
type ClientConfig ¶ added in v1.7.6
Config ... Indexer client config struct
type Config ¶ added in v1.4.2
type Config struct {
DB DBConnector
HTTPServer config.ServerConfig
MetricsServer config.ServerConfig
}
Config for the API service
type DB ¶ added in v1.4.2
type DB struct {
BridgeTransfers database.BridgeTransfersView
Closer func() error
}
DB represents the abstract DB access the API has.
type DBConfigConnector ¶ added in v1.4.2
DBConfigConnector implements a fully config based DBConnector
type DBConnector ¶ added in v1.4.2
DBConnector is an interface: the config may provide different ways to access the DB. This is implemented in tests to provide custom DB views, or share the DB with other services.
type Option ¶ added in v1.7.6
Option ... Provides configuration through callback injection
func WithMetrics ¶ added in v1.7.6
func WithMetrics(m metrics.RPCClientMetricer) Option
WithMetrics ... Triggers metric optionality
func WithTimeout ¶ added in v1.7.6
WithTimeout ... Embeds a timeout limit to request
type TestDBConnector ¶ added in v1.4.2
type TestDBConnector struct {
BridgeTransfers database.BridgeTransfersView
}