router

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_ROUTE_PATH_LEN uint = 5

Variables

This section is empty.

Functions

This section is empty.

Types

type Pair

type Pair struct {
	Contract   string   `json:"contract"`
	AssetInfos []string `json:"asset_infos"`
}

type Router

type Router interface {
	RouterAddress() string
	Routes(from, to string) [][]string
	TokensFrom(from string, hopCount int) []string
	Update() error
}

func New

func New(repo SrcRepo, c configs.RouterConfig, logger logging.Logger) (Router, error)

func NewRouterMock

func NewRouterMock() Router

type SrcRepo

type SrcRepo interface {
	Pairs() ([]Pair, error)
	UpdateRoutes(indexToAsset map[int]string, routesMap map[int]map[int][][]int) error
}

func NewSrcRepo

func NewSrcRepo(chainId string, dbConfig configs.RdbConfig) SrcRepo

Jump to

Keyboard shortcuts

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