papps

package
v0.0.0-...-c0e0e34 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCallDataPancake

func BuildCallDataPancake(paths []common.Address, srcQty *big.Int, expectedOut *big.Int, isNative bool) (string, error)

func BuildCallDataUniswap

func BuildCallDataUniswap(paths []common.Address, recipient common.Address, fees []int64, srcQty *big.Int, expectedOut *big.Int, isNativeOut bool) (string, error)

func BuildCurveCallData

func BuildCurveCallData(
	srcQty *big.Int,
	expectOutputAmount *big.Int,
	i *big.Int,
	j *big.Int,
	curvePool common.Address) (string, error)

func BuildOpenSeaCalldata

func BuildOpenSeaCalldata(nftDetal *popensea.NFTDetail, recipient string) (string, error)

func CurveQuote

func CurveQuote(
	evmClient *ethclient.Client,
	srcQty *big.Int,
	i *big.Int,
	j *big.Int,
	curvePool common.Address,
) (*big.Int, error)

func DecodeOpenSeaCalldata

func DecodeOpenSeaCalldata()

func PancakeQuote

func PancakeQuote(tokenIn, tokenOut, amount, chainId, tokenInSymbol, tokenOutSymbol string, tokenInDecimal, tokenOutDecimal int, exactIn bool, endpoint string, tokenList string) ([]byte, error)

func UniswapQuote

func UniswapQuote(tokenIn, tokenOut, amount, chainId string, exactIn bool, endpoint string) ([]byte, error)

Types

type CurveDecodeData

type CurveDecodeData struct {
	Amount    *big.Int       `json:"amount"`
	MinAmount *big.Int       `json:"minAmount"`
	I         *big.Int       `json:"i"`
	J         *big.Int       `json:"j"`
	CurvePool common.Address `json:"curvePool"`
}

func DecodeCurveCalldata

func DecodeCurveCalldata(inputHex string) (*CurveDecodeData, error)

type PancakeDecodeData

type PancakeDecodeData struct {
	AmountOutMin *big.Int         `json:"amountOutMin"`
	Deadline     *big.Int         `json:"deadline"`
	Path         []common.Address `json:"path"`
	SrcQty       *big.Int         `json:"srcQty"`
}

func DecodePancakeCalldata

func DecodePancakeCalldata(inputHex string) (*PancakeDecodeData, error)

type UniswapDecodeData

type UniswapDecodeData struct {
	TokenIn           common.Address `json:"tokenIn"`
	TokenOut          common.Address `json:"tokenOut"`
	Fee               *big.Int       `json:"fee"`
	Recipient         common.Address `json:"recipient"`
	AmountIn          *big.Int       `json:"amountIn"`
	AmountOutMinimum  *big.Int       `json:"amountOutMinimum"`
	SqrtPriceLimitX96 *big.Int       `json:"sqrtPriceLimitX96"`
	Path              []byte         `json:"path"`
}

func DecodeUniswapCalldata

func DecodeUniswapCalldata(inputHex string) (*UniswapDecodeData, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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