client

package
v0.0.0-...-236728d Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHttpTransportConfig

func GetHttpTransportConfig() *http.Client

func GetHttpsTransportConfig

func GetHttpsTransportConfig() *http.Client

Types

type APIClient

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

func NewAPIClient

func NewAPIClient(endpoint string, withCerts bool) *APIClient

func (*APIClient) GetSimpleQuote

func (c *APIClient) GetSimpleQuote(ctx context.Context, req QuoteRequest) (QuoteResponse, error)

func (*APIClient) GetTokenPrice

func (c *APIClient) GetTokenPrice(ctx context.Context, req PriceRequest) (PriceResponse, error)

type PoolInfo

type PoolInfo struct {
	Kind    string
	Address common.Address

	Fee         uint64
	TickSpacing int
	Hook        common.Address
	V4ID        common.Hash
}

type PriceData

type PriceData struct {
	TokenInBasePrice    *big.Float
	TokenInStablePrice  *big.Float
	TokenOutBasePrice   *big.Float
	TokenOutStablePrice *big.Float

	AmountInValueBase    *big.Float
	AmountInValueStable  *big.Float
	AmountOutValueBase   *big.Float
	AmountOutValueStable *big.Float

	PriceImpact float64
}

type PriceRequest

type PriceRequest struct {
	Token common.Address
}

type PriceResponse

type PriceResponse struct {
	PriceInBase   *big.Float
	PriceInStable *big.Float
	Liquidity     float64

	Error string
}

type QuoteRequest

type QuoteRequest struct {
	AmountIn *big.Int
	TokenIn  common.Address
	TokenOut common.Address
	MaxHops  int
	MaxPaths int
}

type QuoteResponse

type QuoteResponse struct {
	AmountIn          *big.Int
	AmountOut         *big.Int
	TokenIn           common.Address
	TokenOut          common.Address
	Liquidity         float64
	PriceData         PriceData
	QuoteResponseInfo []RouteResponseData

	Error string
}

type RouteResponseData

type RouteResponseData struct {
	AmountIn  *big.Int
	AmountOut *big.Int
	Path      []common.Address
	PoolsInfo []PoolInfo
}

Jump to

Keyboard shortcuts

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