handlers

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const SIGNATURE_TIMEOUT = time.Second * 15

Variables

This section is empty.

Functions

func JSONError

func JSONError(w http.ResponseWriter, err error, 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"
	MayanProtocol      ProtocolType = "mayan"
	RhinestoneProtocol ProtocolType = "rhinestone"
	LifiEscrowProtocol ProtocolType = "lifi-escrow"
	LighterProtocol    ProtocolType = "lighter"
)

type SignatureCacher

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

type SigningBody

type SigningBody struct {
	ChainId          uint64
	DepositId        string       `json:"depositId"`
	Nonce            *BigInt      `json:"nonce"`
	Protocol         ProtocolType `json:"protocol"`
	LiquidityPool    string       `json:"liquidityPool"`
	Caller           string       `json:"caller"`
	Calldata         string       `json:"calldata"`
	DepositTxHash    string       `json:"depositTxHash"`
	BorrowAmount     *BigInt      `json:"borrowAmount"`
	RepaymentChainId uint64       `json:"repaymentChainId"`
	Deadline         uint64       `json:"deadline"`
}

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

type UnlockBody added in v0.5.0

type UnlockBody struct {
	ChainId  uint64
	Protocol ProtocolType `json:"protocol"`
	OrderID  string       `json:"orderId"`
	Settler  string       `json:"settler"`
}

type UnlockHandler added in v0.5.0

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

func NewUnlockHandler added in v0.5.0

func NewUnlockHandler(msgChn chan []*message.Message, chains map[uint64]struct{}) *UnlockHandler

func (*UnlockHandler) HandleUnlock added in v0.5.0

func (h *UnlockHandler) HandleUnlock(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 UnlockResponse added in v0.5.0

type UnlockResponse struct {
	Signature string `json:"signature"`
	ID        string `json:"id"`
}

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