paraswap

package
v0.179.21 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientV5

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

func NewClientV5

func NewClientV5(chainID uint64) *ClientV5

func (*ClientV5) BuildTransaction

func (c *ClientV5) BuildTransaction(ctx context.Context, srcTokenAddress common.Address, srcTokenDecimals uint, srcAmountWei *big.Int,
	destTokenAddress common.Address, destTokenDecimals uint, destAmountWei *big.Int,
	addressFrom common.Address, addressTo common.Address, priceRoute json.RawMessage) (Transaction, error)

func (*ClientV5) FetchPriceRoute

func (c *ClientV5) FetchPriceRoute(ctx context.Context, srcTokenAddress common.Address, srcTokenDecimals uint,
	destTokenAddress common.Address, destTokenDecimals uint, amountWei *big.Int, addressFrom common.Address,
	addressTo common.Address) (Route, error)

func (*ClientV5) FetchTokensList

func (c *ClientV5) FetchTokensList(ctx context.Context) ([]Token, error)

func (*ClientV5) SetChainID

func (c *ClientV5) SetChainID(chainID uint64)

type HTTPClient

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

func NewHTTPClient

func NewHTTPClient() *HTTPClient

type PriceRouteResponse

type PriceRouteResponse struct {
	PriceRoute json.RawMessage `json:"priceRoute"`
	Error      string          `json:"error"`
}

type Route

type Route struct {
	GasCost           *bigint.BigInt  `json:"gasCost"`
	SrcAmount         *bigint.BigInt  `json:"srcAmount"`
	SrcTokenAddress   common.Address  `json:"srcToken"`
	SrcTokenDecimals  uint            `json:"srcDecimals"`
	DestAmount        *bigint.BigInt  `json:"destAmount"`
	DestTokenAddress  common.Address  `json:"destToken"`
	DestTokenDecimals uint            `json:"destDecimals"`
	RawPriceRoute     json.RawMessage `json:"rawPriceRoute"`
}

type Token

type Token struct {
	Symbol   string `json:"symbol"`
	Address  string `json:"address"`
	Decimals uint   `json:"decimals"`
	Img      string `json:"img"`
	Network  int    `json:"network"`
}

type TokensResponse

type TokensResponse struct {
	Tokens []Token `json:"tokens"`
	Error  string  `json:"error"`
}

type Transaction

type Transaction struct {
	From     string `json:"from"`
	To       string `json:"to"`
	Value    string `json:"value"`
	Data     string `json:"data"`
	GasPrice string `json:"gasPrice"`
	Gas      string `json:"gas"`
	ChainID  uint64 `json:"chainId"`
	Error    string `json:"error"`
}

Jump to

Keyboard shortcuts

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