Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterExchange ¶
func RegisterExchange(name string, constructor RouterConstructor)
func Registered ¶
func Registered() []string
Types ¶
type Router ¶
type Router interface { Name() string GetRouterAddress() common.Address GetFactoryAddress() common.Address GetRouterContract() RouterContract GetAllPairs(ctx context.Context) ([]common.Address, error) GetAllPairsAsync(ctx context.Context) (int64, chan *common.Address, chan error) GetPairInfo(address common.Address) (*models.LiquidityPool, error) GetPairPrice(address common.Address, token0Amount int64, token1Amount int64) (*TradeInfo, error) GetReserves(address common.Address) (float64, float64, error) }
type RouterConstructor ¶
type RouterContract ¶
type RouterContract interface { // GetAmountIn(opts *bind.CallOpts, amountOut *big.Int, reserveIn *big.Int, reserveOut *big.Int) (*big.Int, error) // GetAmountOut(opts *bind.CallOpts, amountIn *big.Int, reserveIn *big.Int, reserveOut *big.Int) (*big.Int, error) GetAmountsIn(opts *bind.CallOpts, amountOut *big.Int, path []common.Address) ([]*big.Int, error) GetAmountsOut(opts *bind.CallOpts, amountIn *big.Int, path []common.Address) ([]*big.Int, error) }
Click to show internal directories.
Click to hide internal directories.