Documentation ¶
Index ¶
- type CandidatePool
- type CandidateRoute
- type CandidateRoutes
- type RouteImpl
- func (r *RouteImpl) AddPool(pool domain.PoolI, tokenOutDenom string, takerFee osmomath.Dec)
- func (r *RouteImpl) CalculateTokenOutByTokenIn(tokenIn sdk.Coin) (tokenOut sdk.Coin, err error)
- func (r *RouteImpl) GetPools() []domain.RoutablePool
- func (r *RouteImpl) GetTokenOutDenom() string
- func (r *RouteImpl) PrepareResultPools() []domain.RoutablePool
- func (r *RouteImpl) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CandidatePool ¶
CandidatePool is a data structure representing a candidate pool to be used for routing.
type CandidateRoute ¶
type CandidateRoute struct {
Pools []CandidatePool
}
CandidateRoute is a data structure representing a candidate route to be used for routing.
type CandidateRoutes ¶
type CandidateRoutes struct { Routes []CandidateRoute UniquePoolIDs map[uint64]struct{} }
CandidateRoutes is a data structure representing a list of candidate routes to be used for routing. Additionally, it encapsulates a map of unique pool IDs contained in the routes.
type RouteImpl ¶
type RouteImpl struct {
Pools []domain.RoutablePool "json:\"pools\""
}
func (*RouteImpl) CalculateTokenOutByTokenIn ¶
CalculateTokenOutByTokenIn implements Route.
func (*RouteImpl) GetPools ¶
func (r *RouteImpl) GetPools() []domain.RoutablePool
GetPools implements Route.
func (*RouteImpl) GetTokenOutDenom ¶
GetTokenOutDenom implements domain.Route. Returns token out denom of the last pool in the route. If route is empty, returns empty string.
func (*RouteImpl) PrepareResultPools ¶
func (r *RouteImpl) PrepareResultPools() []domain.RoutablePool
PrepareResultPools implements domain.Route. Strips away unnecessary fields from each pool in the route, leaving only the data needed by client The following are the list of fields that are returned to the client in each pool: - ID - Type - Balances - Spread Factor - Token Out Denom - Taker Fee Note that it mutates the route. Returns the resulting pools.