quote

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package quote contains the quote service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DLL

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

DLL represents a doubly linked list.

func (*DLL) AddNode

func (dll *DLL) AddNode(node *DLLNode)

AddNode adds a node to the front of the list.

func (*DLL) ClearStale

func (dll *DLL) ClearStale()

ClearStale clears any stale items from the list.

func (*DLL) Head

func (dll *DLL) Head() *DLLNode

Head returns the head of the doubly linked list.

func (*DLL) NewTimestamp

func (dll *DLL) NewTimestamp(newTime int64, node *DLLNode)

NewTimestamp is just for testing purposes.

func (*DLL) RemoveNode

func (dll *DLL) RemoveNode(node *DLLNode)

RemoveNode removes a given node from the list.

func (*DLL) Tail

func (dll *DLL) Tail() *DLLNode

Tail returns the tail of the doubly linked list.

type DLLNode

type DLLNode struct {
	Value *big.Int // exported for tests
	// contains filtered or unexported fields
}

DLLNode represents a node in the doubly linked list.

func NewNode

func NewNode(transactionID string, value *big.Int) *DLLNode

NewNode creates a new Node.

type IBridgeReqHandler

type IBridgeReqHandler interface {
	GetAndDelete(transactionID string) (*big.Int, bool) // Pop
	Put(transactionID string, value *big.Int)
	Capacity() int
	Sum() *big.Int
	GetHashmapLen() int
	GetHead() *DLLNode
}

IBridgeReqHandler is the interface for the handling bridge requests.

func NewBridgeReqs

func NewBridgeReqs(capacity int) IBridgeReqHandler

NewBridgeReqs creates a new IBridgeReqHandler.

type IQuoter

type IQuoter interface {
	GetValidQuote(quoteID string, destTokenID string, destVolume *big.Int) (*Quote, error)
	PublishQuotes() error
	UpdateQuotes(quoteID string) error
	GetQuotes(quoteID string) []*Quote
	QuoteToAPIQuote(quote *Quote) (*client.APIQuote, error)
	HandleUnconfirmedBridgeRequest(req *bindings.FastBridgeBridgeRequested) error
	HandleCompletedBridge(transactionID string, event *bindings.IFastBridgeBridgeTransaction) error
	HandleUncompletedBridge(transactionID string, event *bindings.IFastBridgeBridgeTransaction) error
}

IQuoter is the interface for a Quoter.

func NewQuoter

func NewQuoter(ctx context.Context, clients map[uint32]EVMClient.EVM, assets []config.AssetConfig, relayer common.Address, rfqURL string, signer signer.Signer) (IQuoter, error)

NewQuoter creates a new quoter.

type Quote

type Quote struct {
	QuoteID       string   // Hash of relayer, sell/buy asset, sell/buy chainID
	Gas           *big.Int // Customizable by the relayer config
	OriginToken   common.Address
	DestToken     common.Address
	OriginChainID uint32
	DestChainID   uint32
	MaxVolume     *big.Int // Max volume the quote applies for
	APIID         int
}

Quote holds all the data for a quote.

Jump to

Keyboard shortcuts

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