handlers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONError

func JSONError(w http.ResponseWriter, err interface{}, code int)

Types

type BigInt

type BigInt struct {
	*big.Int
}

func (*BigInt) MarshalJSON

func (b *BigInt) MarshalJSON() ([]byte, error)

func (*BigInt) UnmarshalJSON

func (b *BigInt) UnmarshalJSON(data []byte) error

type ConfirmationsHandler

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

func NewConfirmationsHandler

func NewConfirmationsHandler(confirmationsByChain map[uint64]map[uint64]uint64) *ConfirmationsHandler

func (*ConfirmationsHandler) HandleRequest

func (h *ConfirmationsHandler) HandleRequest(w http.ResponseWriter, r *http.Request)

HandleRequest returns confirmations by value buckets for the requested chain

type ProtocolType

type ProtocolType string
const (
	AcrossProtocol ProtocolType = "across"
)

type SignatureCacher

type SignatureCacher interface {
	Subscribe(ctx context.Context, id string, sigChannel chan []byte)
}

type SigningBody

type SigningBody struct {
	ChainId       uint64
	DepositId     *BigInt      `json:"depositId"`
	Nonce         *BigInt      `json:"nonce"`
	Protocol      ProtocolType `json:"protocol"`
	LiquidityPool string       `json:"liquidityPool"`
	Caller        string       `json:"caller"`
}

type SigningHandler

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

func NewSigningHandler

func NewSigningHandler(msgChan chan []*message.Message, chains map[uint64]struct{}) *SigningHandler

func (*SigningHandler) HandleSigning

func (h *SigningHandler) HandleSigning(w http.ResponseWriter, r *http.Request)

HandleSigning sends a message to the across message handler and returns status code 202 if the deposit has been accepted for the signing process

type StatusHandler

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

func NewStatusHandler

func NewStatusHandler(cache SignatureCacher, chains map[uint64]struct{}) *StatusHandler

func (*StatusHandler) HandleRequest

func (h *StatusHandler) HandleRequest(w http.ResponseWriter, r *http.Request)

HandleRequest is an sse handler that waits until the signing signature is ready and returns it

Directories

Path Synopsis
Package mock_handlers is a generated GoMock package.
Package mock_handlers is a generated GoMock package.

Jump to

Keyboard shortcuts

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