params

package
v0.0.0-...-9dbe7f8 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxSwapin          = "swapin"
	TxSwapout         = "swapout"
	TxSwapout2        = "swapout2" // swapout to string address (eg. BTC)
	TxSwapin_2        = "swapin_2"
	TxSwapout_2       = "swapout_2"
	TxSwapout2_2      = "swapout2_2" // swapout to string address (eg. BTC)
	TxRouterERC20Swap = "routerswap"
	TxRouterNFTSwap   = "nftswap"
)

swap tx types

View Source
const (
	VersionMajor = 0  // Major version component of the current release
	VersionMinor = 3  // Minor version component of the current release
	VersionPatch = 1  // Patch version component of the current release
	VersionMeta  = "" // Version metadata to append to the version string
)

version parts

Variables

View Source
var Version = func() string {
	v := fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch)
	if VersionMeta != "" {
		v += "-" + VersionMeta
	}
	return v
}()

Version holds the textual version string.

Functions

func ReloadConfig

func ReloadConfig()

ReloadConfig reload config

func WatchAndReloadScanConfig

func WatchAndReloadScanConfig()

WatchAndReloadScanConfig reload scan config if modified

Types

type ChainConfig

type ChainConfig struct {
	BlockChain string
	ChainID    string
}

func GetChainConfig

func GetChainConfig() *ChainConfig

GetChainConfig get chain config

type Config

type Config struct {
	MongoDB *MongoDBConfig
	Chain   *ChainConfig
	Tokens  []*TokenConfig
}

type MongoDBConfig

type MongoDBConfig struct {
	DBURL    string
	DBName   string
	UserName string `json:"-"`
	Password string `json:"-"`
	Enable   bool
}

MongoDBConfig mongodb config

func GetMongodbConfig

func GetMongodbConfig() *MongoDBConfig

GetMongodbConfig get mongodb config

type ScanConfig

type ScanConfig struct {
	Tokens []*TokenConfig
}

ScanConfig scan config

func GetScanConfig

func GetScanConfig() *ScanConfig

GetScanConfig get scan config

func LoadConfig

func LoadConfig(filePath string) *ScanConfig

LoadConfig load config

func (*ScanConfig) CheckConfig

func (c *ScanConfig) CheckConfig() (err error)

CheckConfig check scan config

type TokenConfig

type TokenConfig struct {
	// common
	TxType string
	//SwapServer     string
	CallByContract string   `toml:",omitempty" json:",omitempty"`
	Whitelist      []string `toml:",omitempty" json:",omitempty"`

	// bridge
	PairID         string `toml:",omitempty" json:",omitempty"`
	TokenAddress   string `toml:",omitempty" json:",omitempty"`
	Decimal        uint64
	DepositAddress string `toml:",omitempty" json:",omitempty"`

	// router
	ChainID        string `toml:",omitempty" json:",omitempty"`
	RouterContract string `toml:",omitempty" json:",omitempty"`
}

TokenConfig token config

func (*TokenConfig) CheckConfig

func (c *TokenConfig) CheckConfig() error

CheckConfig check token config

func (*TokenConfig) IsBridgeSwap

func (c *TokenConfig) IsBridgeSwap() bool

IsBridgeSwap is bridge swap

func (*TokenConfig) IsBridgeSwap_2

func (c *TokenConfig) IsBridgeSwap_2() bool

IsBridgeSwap_2 is bridge swap

func (*TokenConfig) IsBridgeSwapin

func (c *TokenConfig) IsBridgeSwapin() bool

IsBridgeSwapIn is bridge swap

func (*TokenConfig) IsNativeToken

func (c *TokenConfig) IsNativeToken() bool

IsNativeToken is native token

func (*TokenConfig) IsRouterERC20Swap

func (c *TokenConfig) IsRouterERC20Swap() bool

IsRouterERC20Swap is router erc20 swap

func (*TokenConfig) IsRouterNFTSwap

func (c *TokenConfig) IsRouterNFTSwap() bool

IsRouterNFTSwap is router nft swap

func (*TokenConfig) IsRouterSwap

func (c *TokenConfig) IsRouterSwap() bool

IsRouterSwap is router swap

func (*TokenConfig) IsValidSwapType

func (c *TokenConfig) IsValidSwapType() bool

IsValidSwapType is valid swap type

Jump to

Keyboard shortcuts

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