observer

package
v1.0.1-0...-8b5ffd9 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API is object which exposes observer API.

func NewAPI

func NewAPI(url string, timeout time.Duration) *API

NewAPI returns a new API instance.

func (*API) GetApprovedHermesAdresses

func (a *API) GetApprovedHermesAdresses() (map[int64][]common.Address, error)

GetApprovedHermesAdresses returns a map by chain of all approved hermes addresses.

func (*API) GetHermesAdresses

func (a *API) GetHermesAdresses(f *HermesFilter) (map[int64][]common.Address, error)

GetHermesAdresses returns a map by chain of hermes addresses filtered by the given query.

func (*API) GetHermesData

func (a *API) GetHermesData(chainId int64, hermesAddress common.Address) (*HermesResponse, error)

func (*API) GetHermeses

func (a *API) GetHermeses(f *HermesFilter) (HermesesResponse, error)

GetHermeses returns a map by chain of all known hermeses. An optional value `HermesFilter` is accepted which can be used to filter data on observer. `f` can be equal to `nil`, it will then be ignored.

type HermesFilter

type HermesFilter struct {
	Active   *bool
	Approved *bool
}

HermesFilter can be used to filter values which would be returned from the observer.

type HermesResponse

type HermesResponse struct {
	HermesAddress common.Address `json:"hermes_address"`
	Operator      common.Address `json:"operator"`
	ChannelImpl   common.Address `json:"channel_impl"`

	Version int    `json:"version"`
	Fee     uint   `json:"fee"`
	URL     string `json:"url"`

	Active   bool `json:"active"`
	Approved bool `json:"approved"`
}

HermesResponse describes a hermes.

type HermesesResponse

type HermesesResponse map[int64][]HermesResponse

HermesesResponse is returned from the observer hermeses endpoints and maps a slice of hermeses to its chain id.

Jump to

Keyboard shortcuts

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