relapi

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

Package relapi provides RESTful API services for the RFQ relayer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetQuoteRequestStatusResponse

type GetQuoteRequestStatusResponse struct {
	Status       string `json:"status"`
	TxID         string `json:"tx_id"`
	OriginTxHash string `json:"origin_tx_hash"`
	DestTxHash   string `json:"dest_tx_hash"`
}

GetQuoteRequestStatusResponse contains the schema for a GET /quote response.

type GetTxRetryResponse

type GetTxRetryResponse struct {
	TxID      string `json:"tx_id"`
	ChainID   uint32 `json:"chain_id"`
	Nonce     uint64 `json:"nonce"`
	GasAmount string `json:"gas_amount"`
}

GetTxRetryResponse contains the schema for a PUT /tx/retry response.

type Handler

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

Handler is the REST API handler.

func NewHandler

func NewHandler(db reldb.Service, chains map[uint32]*chain.Chain) *Handler

NewHandler creates a new REST API handler.

func (*Handler) GetHealth

func (h *Handler) GetHealth(c *gin.Context)

GetHealth returns a successful response to signify the API is up and running.

func (*Handler) GetQuoteRequestStatusByTxHash

func (h *Handler) GetQuoteRequestStatusByTxHash(c *gin.Context)

GetQuoteRequestStatusByTxHash gets the status of a quote request, given an origin tx hash.

func (*Handler) GetQuoteRequestStatusByTxID

func (h *Handler) GetQuoteRequestStatusByTxID(c *gin.Context)

GetQuoteRequestStatusByTxID gets the status of a quote request, given a tx id.

func (*Handler) GetTxRetry

func (h *Handler) GetTxRetry(c *gin.Context)

GetTxRetry retries a transaction based on tx hash.

type RelayerAPIServer

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

RelayerAPIServer is a struct that holds the configuration, database connection, gin engine, RPC client, metrics handler, and fast bridge contracts. It is used to initialize and run the API server.

func NewRelayerAPI

func NewRelayerAPI(
	ctx context.Context,
	cfg relconfig.Config,
	handler metrics.Handler,
	omniRPCClient omniClient.RPCClient,
	store reldb.Service,
	submitter submitter.TransactionSubmitter,
) (*RelayerAPIServer, error)

NewRelayerAPI holds the configuration, database connection, gin engine, RPC client, metrics handler, and fast bridge contracts. It is used to initialize and run the API server.

func (*RelayerAPIServer) Run

func (r *RelayerAPIServer) Run(ctx context.Context) error

Run runs the rest api server.

Jump to

Keyboard shortcuts

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