Documentation ¶
Overview ¶
Package sushiswap provdies a Golang client wrapper for SushiswapV2
Package sushiswap contains the required bindings as well as corresponding wrappers for those bindings for interacting with the sushiswap smart contracts.
Index ¶
- Variables
- func GeneratePairAddress(token0, token1 common.Address) common.Address
- func Quote(amount, reserve0, reserve1 *big.Int) *big.Int
- type Client
- func (c *Client) Factory() (*uniswapv2factory.Uniswapv2factory, error)
- func (c *Client) GetExchangeAmount(amount *big.Int, token0, token1 common.Address) (*big.Int, error)
- func (c *Client) GetExchangeAmountForPath(amount *big.Int, tokens ...common.Address) (*big.Int, error)
- func (c *Client) GetReserves(token0, token1 common.Address) (*Reserve, error)
- type Pair
- type Reserve
Constants ¶
This section is empty.
Variables ¶
var FactoryAddress = common.HexToAddress("0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac")
FactoryAddress points to the sushiswap factory.
var Router02Address = common.HexToAddress("0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F")
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 NewClient ¶
func NewClient(bc utils.Blockchain) *Client
NewClient returns a new instance of uniswap client.
func (*Client) Factory ¶
func (c *Client) Factory() (*uniswapv2factory.Uniswapv2factory, error)
Factory returns a uniswap cactory factory binding
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.