client

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: 7 Imported by: 1

Documentation

Overview

Package client contians a client implementation for the RFQ Quoter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIQuote

type APIQuote struct {
	Relayer string `json:"relayer" binding:"required"`

	OriginChainID uint   `json:"origin_chain_id" binding:"required"`
	OriginToken   string `json:"origin_token" binding:"required"`
	OriginAmount  string `json:"origin_amount" binding:"required"`
	// TODO: origin amount norm should be a string
	OriginAmountNorm float64 `json:"origin_amount_norm" binding:"required"`
	OriginDecimals   uint8   `json:"origin_decimals" binding:"required"`

	DestChainID    uint    `json:"dest_chain_id" binding:"required"`
	DestToken      string  `json:"dest_token" binding:"required"`
	DestAmount     string  `json:"dest_amount" binding:"required"`
	DestAmountNorm float64 `json:"dest_amount_norm" binding:"required"`
	DestDecimals   uint8   `json:"dest_decimals" binding:"required"`

	Price     float64        `json:"price"` // price = destAmount <quote> / originAmount <base>
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

APIQuote is the struct for the quote API.

type Client

type Client interface {
	CreateQuote(q *APIQuote) error
	UpdateQuote(quoteID string, q *APIQuote) error
}

func NewClient

func NewClient(rfqURL string, reqSigner signer.Signer) (Client, error)

NewClient creates a new client for the RFQ quoting API

Jump to

Keyboard shortcuts

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