router

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RouterBridges    = make(map[string]tokens.IBridge)    // key is chainID
	MultichainTokens = make(map[string]map[string]string) // key is tokenID,chainID
	AllChainIDs      []*big.Int                           // all chainIDs is retrieved only once
	AllTokenIDs      []string                             // all tokenIDs can be reload
)

router bridges

Functions

func CallOnchainContract

func CallOnchainContract(data hexutil.Bytes, blockNumber string) (result []byte, err error)

CallOnchainContract call onchain contract

func GetAllChainIDs

func GetAllChainIDs() (chainIDs []*big.Int, err error)

GetAllChainIDs abi

func GetAllTokenIDs

func GetAllTokenIDs() (tokenIDs []string, err error)

GetAllTokenIDs abi

func GetBridgeByChainID

func GetBridgeByChainID(chainID string) tokens.IBridge

GetBridgeByChainID get bridge by chain id

func GetCachedMultichainToken

func GetCachedMultichainToken(tokenID, chainID string) (tokenAddr string)

GetCachedMultichainToken get multichain token address by tokenid and chainid

func GetCachedMultichainTokens

func GetCachedMultichainTokens(tokenID string) map[string]string

GetCachedMultichainTokens get multichain tokens of `tokenid`

func GetChainConfig

func GetChainConfig(chainID *big.Int) (*tokens.ChainConfig, error)

GetChainConfig abi

func GetCustomConfig

func GetCustomConfig(chainID *big.Int, key string) (string, error)

GetCustomConfig abi

func GetMPCPubkey

func GetMPCPubkey(mpcAddress string) (pubkey string, err error)

GetMPCPubkey abi

func GetMultichainToken

func GetMultichainToken(tokenID string, chainID *big.Int) (tokenAddr string, err error)

GetMultichainToken abi

func GetSwapConfig added in v3.2.0

func GetSwapConfig(tokenID string, toChainID *big.Int) (*tokens.SwapConfig, error)

GetSwapConfig abi

func GetTokenConfig

func GetTokenConfig(chainID *big.Int, token string) (tokenCfg *tokens.TokenConfig, err error)

GetTokenConfig abi

func GetUserTokenConfig

func GetUserTokenConfig(chainID *big.Int, token string) (tokenCfg *tokens.TokenConfig, err error)

GetUserTokenConfig abi

func InitRouterConfigClients

func InitRouterConfigClients()

InitRouterConfigClients init router config clients

func InitRouterConfigClientsWithArgs

func InitRouterConfigClientsWithArgs(configContract string, gateways []string)

InitRouterConfigClientsWithArgs init standalone

func InitWebSocketClients

func InitWebSocketClients(wsServers []string) []*ethclient.Client

InitWebSocketClients init

func IsChainIDExist

func IsChainIDExist(chainID *big.Int) (exist bool, err error)

IsChainIDExist abi

func IsTokenIDExist

func IsTokenIDExist(tokenID string) (exist bool, err error)

IsTokenIDExist abi

func PrintMultichainTokens

func PrintMultichainTokens()

PrintMultichainTokens print

func SubscribeRouterConfig

func SubscribeRouterConfig(topics []ethcommon.Hash)

SubscribeRouterConfig subscribe router config

func SubscribeUpdateConfig

func SubscribeUpdateConfig(callback func() bool)

SubscribeUpdateConfig subscribe update ID and reload configs

Types

type MultichainToken

type MultichainToken struct {
	ChainID      *big.Int
	TokenAddress string
}

MultichainToken struct

func GetAllMultichainTokens

func GetAllMultichainTokens(tokenID string) ([]MultichainToken, error)

GetAllMultichainTokens abi

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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