api

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package api contains server-side logic for the relayer's REST API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageResult added in v0.0.13

type MessageResult struct {
	OriginHash      string `json:"origin_hash"`
	DestinationHash string `json:"destination_hash"`
	Origin          uint32 `json:"origin"`
	Destination     uint32 `json:"destination"`
	RequestID       string `json:"request_id"`
	State           string `json:"state"`
}

MessageResult is the result of a successful /tx request.

type RelayRequest added in v0.0.13

type RelayRequest struct {
	Origin uint32
	TxHash common.Hash
}

RelayRequest is a request to relay a transaction.

type RelayerAPIServer added in v0.0.13

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

RelayerAPIServer exposes API endpoints that interact with CCTPRelayer.

func NewRelayerAPIServer added in v0.0.13

func NewRelayerAPIServer(port uint16, host string, db db2.CCTPRelayerDB, relayRequestChan chan *RelayRequest) *RelayerAPIServer

NewRelayerAPIServer creates a new RelayerAPIServer.

func (RelayerAPIServer) GetTx added in v0.0.13

func (r RelayerAPIServer) GetTx(ctx *gin.Context)

GetTx handles the /tx endpoint. If the transaction is found in the db, return information about the transaction. Otherwise, queue the corresponding Message for relay.

func (RelayerAPIServer) Start added in v0.0.13

func (r RelayerAPIServer) Start(ctx context.Context) error

Start starts the RelayerAPIServer.

type RelayerResponse added in v0.0.13

type RelayerResponse struct {
	Success bool        `json:"success"`
	Result  interface{} `json:"result"`
}

RelayerResponse is a wrapper struct for a relayer API response.

Jump to

Keyboard shortcuts

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