model

package
v1.42.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveRFQMessage added in v1.29.0

type ActiveRFQMessage struct {
	Op      string          `json:"op"`
	Content json.RawMessage `json:"content,omitempty"`
	Success bool            `json:"success,omitempty"`
}

ActiveRFQMessage represents the general structure of WebSocket messages for Active RFQ.

type GetContractsResponse added in v0.29.14

type GetContractsResponse struct {
	// Contracts is a map of chain id to contract address
	Contracts map[uint32]string `json:"contracts"`
}

GetContractsResponse contains the schema for a GET /contract response.

type GetOpenQuoteRequestsResponse added in v1.29.0

type GetOpenQuoteRequestsResponse struct {
	UserAddress       string    `json:"user_address"`
	OriginChainID     uint64    `json:"origin_chain_id"`
	OriginTokenAddr   string    `json:"origin_token"`
	DestChainID       uint64    `json:"dest_chain_id"`
	DestTokenAddr     string    `json:"dest_token"`
	OriginAmountExact string    `json:"origin_amount_exact"`
	ExpirationWindow  int       `json:"expiration_window"`
	CreatedAt         time.Time `json:"created_at"`
}

GetOpenQuoteRequestsResponse represents a response to a GET /open_quote_requests request.

type GetQuoteResponse

type GetQuoteResponse struct {
	// OriginChainID is the chain which the relayer is willing to relay from
	OriginChainID int `json:"origin_chain_id"`
	// OriginTokenAddr is the token address for which the relayer willing to relay from
	OriginTokenAddr string `json:"origin_token_addr"`
	// DestChainID is the chain which the relayer is willing to relay to
	DestChainID int `json:"dest_chain_id"`
	// DestToken is the token address for which the relayer willing to relay to
	DestTokenAddr string `json:"dest_token_addr"`
	// DestAmount is the max amount of liquidity which exists for a given destination token, provided in the destination token decimals
	DestAmount string `json:"dest_amount"`
	// MaxOriginAmount is the maximum amount of origin tokens bridgeable
	MaxOriginAmount string `json:"max_origin_amount"`
	// FixedFee is the fixed fee for the quote, provided in the destination token terms
	FixedFee string `json:"fixed_fee"`
	// Address of the relayer providing the quote
	RelayerAddr string `json:"relayer_addr"`
	// OriginFastBridgeAddress is the address of the fast bridge contract on the origin chain
	OriginFastBridgeAddress string `json:"origin_fast_bridge_address"`
	// DestFastBridgeAddress is the address of the fast bridge contract on the destination chain
	DestFastBridgeAddress string `json:"dest_fast_bridge_address"`
	// UpdatedAt is the time that the quote was last upserted
	UpdatedAt string `json:"updated_at"`
}

GetQuoteResponse contains the schema for a GET /quote response.

type GetQuoteSpecificRequest

type GetQuoteSpecificRequest struct {
	OriginChainID   int    `json:"originChainId"`
	OriginTokenAddr string `json:"originTokenAddr"`
	DestChainID     int    `json:"destChainId"`
	DestTokenAddr   string `json:"destTokenAddr"`
}

GetQuoteSpecificRequest contains the schema for a GET /quote request with specific params.

type PutAckRequest added in v0.22.0

type PutAckRequest struct {
	TxID        string `json:"tx_id"`
	DestChainID int    `json:"dest_chain_id"`
}

PutAckRequest contains the schema for a PUT /ack request.

type PutBulkQuotesRequest added in v0.29.13

type PutBulkQuotesRequest struct {
	Quotes []PutRelayerQuoteRequest `json:"quotes"`
}

PutBulkQuotesRequest contains the schema for a PUT /quote request.

type PutRFQRequest added in v1.29.0

type PutRFQRequest struct {
	UserAddress  string    `json:"user_address"`
	IntegratorID string    `json:"integrator_id"`
	QuoteTypes   []string  `json:"quote_types"`
	Data         QuoteData `json:"data"`
}

PutRFQRequest represents a user request for quote.

type PutRFQResponse added in v1.29.0

type PutRFQResponse struct {
	Success        bool    `json:"success"`
	Reason         string  `json:"reason,omitempty"`
	QuoteType      string  `json:"quote_type,omitempty"`
	QuoteID        *string `json:"quote_id,omitempty"`
	DestAmount     string  `json:"dest_amount,omitempty"`
	RelayerAddress string  `json:"relayer_address,omitempty"`
}

PutRFQResponse represents a response to a user quote request.

type PutRelayAckResponse added in v0.22.0

type PutRelayAckResponse struct {
	// TxID is the transaction ID
	TransactionID string `json:"tx_id"`
	// ShouldRelay is a boolean indicating whether the transaction should be relayed
	ShouldRelay bool `json:"should_relay"`
	// RelayerAddress is the address of the relayer that is currently acked
	RelayerAddress string `json:"relayer_address"`
}

PutRelayAckResponse contains the schema for a PUT /relay/ack response.

type PutRelayerQuoteRequest added in v1.29.0

type PutRelayerQuoteRequest struct {
	OriginChainID           int    `json:"origin_chain_id"`
	OriginTokenAddr         string `json:"origin_token_addr"`
	DestChainID             int    `json:"dest_chain_id"`
	DestTokenAddr           string `json:"dest_token_addr"`
	DestAmount              string `json:"dest_amount"`
	MaxOriginAmount         string `json:"max_origin_amount"`
	FixedFee                string `json:"fixed_fee"`
	OriginFastBridgeAddress string `json:"origin_fast_bridge_address"`
	DestFastBridgeAddress   string `json:"dest_fast_bridge_address"`
}

PutRelayerQuoteRequest contains the schema for a PUT /quote request.

type QuoteData added in v1.29.0

type QuoteData struct {
	OriginChainID     int     `json:"origin_chain_id"`
	DestChainID       int     `json:"dest_chain_id"`
	OriginTokenAddr   string  `json:"origin_token_addr"`
	DestTokenAddr     string  `json:"dest_token_addr"`
	OriginAmountExact string  `json:"origin_amount_exact"`
	ExpirationWindow  int64   `json:"expiration_window"`
	DestAmount        *string `json:"dest_amount"`
	RelayerAddress    *string `json:"relayer_address"`
	QuoteID           *string `json:"quote_id"`
}

QuoteData represents the data within a quote request.

type QuoteRequest added in v1.29.0

type QuoteRequest struct {
	RequestID string    `json:"request_id"`
	Data      QuoteData `json:"data"`
	CreatedAt time.Time `json:"created_at"`
}

QuoteRequest represents a request for a quote.

type SubscribeActiveRFQRequest added in v1.29.0

type SubscribeActiveRFQRequest struct {
	ChainIDs []int `json:"chain_ids"`
}

SubscribeActiveRFQRequest represents a request to subscribe to active quotes. Note that this request is not actually bound to the request body, but rather the chain IDs are encoded under the ChainsHeader.

type SubscriptionParams added in v1.29.0

type SubscriptionParams struct {
	Chains []int `json:"chains"`
}

SubscriptionParams are the parameters for a subscription.

type WsRFQRequest added in v1.29.0

type WsRFQRequest struct {
	RequestID string    `json:"request_id"`
	Data      QuoteData `json:"data"`
	CreatedAt time.Time `json:"created_at"`
}

WsRFQRequest represents a request for a quote to a relayer.

func NewWsRFQRequest added in v1.29.0

func NewWsRFQRequest(data QuoteData, requestID string) *WsRFQRequest

NewWsRFQRequest creates a new WsRFQRequest.

type WsRFQResponse added in v1.29.0

type WsRFQResponse struct {
	RequestID  string    `json:"request_id"`
	QuoteID    string    `json:"quote_id,omitempty"`
	DestAmount string    `json:"dest_amount"`
	UpdatedAt  time.Time `json:"updated_at"`
}

WsRFQResponse represents a response to a quote request.

Jump to

Keyboard shortcuts

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