Documentation ¶
Overview ¶
Package uniswap provdies a Golang client wrapper for UniswapV2
Package uniswap contains the required bindings as well as corresponding wrappers for those bindings for interacting with the uniswap smart contracts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FactoryAddress = common.HexToAddress("0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f")
FactoryAddress points to the uniswap factory.
View Source
var Router02Address = common.HexToAddress("0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D")
Router02Address points to the uniswap v2 02 router.
Functions ¶
func GeneratePairAddress ¶
GeneratePairAddress generates a pair address for the given tokens
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client allows to do operations on uniswap smart contracts.
func (*Client) GetExchangeAmount ¶
func (c *Client) GetExchangeAmount(amount *big.Int, token0, token1 common.Address) (*big.Int, error)
GetExchangeAmount returns the amount of tokens you'd receive when exchanging the given amount of token0 to token1.
type Pair ¶
Pair represents a token pair.
func GetPathPairs ¶
GetPathPairs takes in the given token path and returns the corresponding pairs.
Click to show internal directories.
Click to hide internal directories.