params

package
v3.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package params provides common version info and config items.

Index

Constants

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

version parts

View Source
const (
	RouterSwapPrefixID = "routerswap"
)

router swap constants

Variables

View Source
var (
	GetBalanceBlockNumberOpt = "latest" // latest or pending

	GatewayConfigFile string
)

exported variables

View Source
var CustomizeConfigFunc func(*RouterConfig)

CustomizeConfigFunc customize config items

View Source
var IsReload bool

IsReload is reloading config

View Source
var (

	// IsSwapServer is swap server
	IsSwapServer bool
)
View Source
var IsTestMode bool

IsTestMode used for testing

View Source
var Version = func() string {
	return fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch)
}()

Version holds the textual version string.

View Source
var VersionWithMeta = func() string {
	v := Version
	if VersionMeta != "" {
		v += "-" + VersionMeta
	}
	return v
}()

VersionWithMeta holds the textual version string including the metadata.

Functions

func AddOrRemoveAccountBlackList added in v3.5.2

func AddOrRemoveAccountBlackList(accounts []string, isAdd bool)

AddOrRemoveAccountBlackList add or remove account blacklist

func AddOrRemoveBigValueWhitelist added in v3.5.2

func AddOrRemoveBigValueWhitelist(tokenID string, callers []string, isAdd bool)

AddOrRemoveBigValueWhitelist add or remove big value whitelist

func AddOrRemoveCallByContractCodeHashWhitelist added in v3.5.2

func AddOrRemoveCallByContractCodeHashWhitelist(chainID string, codehashes []string, isAdd bool)

AddOrRemoveCallByContractCodeHashWhitelist add or remove call by contract code hash whitelist

func AddOrRemoveCallByContractWhitelist added in v3.5.2

func AddOrRemoveCallByContractWhitelist(chainID string, callers []string, isAdd bool)

AddOrRemoveCallByContractWhitelist add or remove call by contract whitelist

func AddOrRemoveChainIDBlackList added in v3.5.2

func AddOrRemoveChainIDBlackList(chainIDs []string, isAdd bool)

AddOrRemoveChainIDBlackList add or remove chainID blacklist

func AddOrRemoveTokenIDBlackList added in v3.5.2

func AddOrRemoveTokenIDBlackList(tokenIDs []string, isAdd bool)

AddOrRemoveTokenIDBlackList add or remove tokenID blacklist

func AllowCallByConstructor added in v3.5.1

func AllowCallByConstructor() bool

AllowCallByConstructor allow call by constructor

func AllowCallByContract added in v3.2.1

func AllowCallByContract() bool

AllowCallByContract allow call into router from contract

func CallContractWithGateway

func CallContractWithGateway(gateway, contract string, data hexutil.Bytes, blockNumber string) (result string, err error)

CallContractWithGateway call eth_call

func ChargeFeeOnDestChain added in v3.6.2

func ChargeFeeOnDestChain(tokenID, fromChainID, toChainID string) bool

ChargeFeeOnDestChain charge fee on dest chain

func CheckEIP1167Master added in v3.5.0

func CheckEIP1167Master() bool

CheckEIP1167Master whether check eip1167 master call by contract

func DontCheckInInitRouter added in v3.6.2

func DontCheckInInitRouter() bool

DontCheckInInitRouter do not check in init router

func DontCheckTokenBalance added in v3.6.1

func DontCheckTokenBalance(tokenID string) bool

DontCheckTokenBalance do not check token balance (a security enhance checking)

func DontCheckTokenReceived added in v3.5.1

func DontCheckTokenReceived(tokenID string) bool

DontCheckTokenReceived do not check token received (a security enhance checking)

func DontCheckTokenTotalSupply added in v3.6.1

func DontCheckTokenTotalSupply(tokenID string) bool

DontCheckTokenTotalSupply do not check token total supply (a security enhance checking)

func FeeReceiverOnDestChain added in v3.6.2

func FeeReceiverOnDestChain(toChainID string) string

FeeReceiverOnDestChain fee receiver on dest chain

func GetAttestationServer added in v3.6.2

func GetAttestationServer() string

GetAttestationServer get attestation server

func GetBaseFeePercent added in v3.4.0

func GetBaseFeePercent(chainID string) int64

GetBaseFeePercent get base fee percent

func GetCalcGasPriceMethod added in v3.5.0

func GetCalcGasPriceMethod(chainID string) string

GetCalcGasPriceMethod get calc gas price method eg. median (default), first, max, etc.

func GetCustom added in v3.4.0

func GetCustom(chainID, key string) string

GetCustom get custom

func GetDataDir added in v3.4.0

func GetDataDir() string

GetDataDir get data dir

func GetFixedGasPrice added in v3.4.0

func GetFixedGasPrice(chainID string) *big.Int

GetFixedGasPrice get fixed gas price of specified chain

func GetIdentifier

func GetIdentifier() string

GetIdentifier get identifier (to distiguish in mpc accept)

func GetMaxGasLimit added in v3.6.1

func GetMaxGasLimit(chainID string) uint64

GetMaxGasLimit get max gas limit of specified chain

func GetMaxGasPrice added in v3.4.0

func GetMaxGasPrice(chainID string) *big.Int

GetMaxGasPrice get max gas price of specified chain

func GetMaxTokenGasLimit added in v3.6.1

func GetMaxTokenGasLimit(tokenID, chainID string) uint64

GetMaxTokenGasLimit get max token gas limit of specified tokenID and chainID

func GetMinReserveBudget added in v3.5.1

func GetMinReserveBudget(chainID string) *big.Int

GetMinReserveBudget get min reserve budget

func GetMinReserveFee added in v3.3.0

func GetMinReserveFee(chainID string) *big.Int

GetMinReserveFee get min reserve fee

func GetNoncePassedConfirmInterval added in v3.4.0

func GetNoncePassedConfirmInterval(chainID string) int64

GetNoncePassedConfirmInterval get nonce passed confirm interval

func GetOnchainContract

func GetOnchainContract() string

GetOnchainContract get onchain config contract address

func GetRPCClientTimeout added in v3.5.1

func GetRPCClientTimeout(chainID string) int

GetRPCClientTimeout get rpc client timeout

func GetSpecialFlag added in v3.6.2

func GetSpecialFlag(key string) string

GetSpecialFlag get special flag

func GetSwapSubType added in v3.5.0

func GetSwapSubType() string

GetSwapSubType get router swap sub type

func GetSwapType added in v3.4.0

func GetSwapType() string

GetSwapType get router swap type

func HasCallByContractCodeHashWhitelist added in v3.5.0

func HasCallByContractCodeHashWhitelist(chainID string) bool

HasCallByContractCodeHashWhitelist has call by contract code hash whitelist

func HasMinReserveBudgetConfig added in v3.5.1

func HasMinReserveBudgetConfig() bool

HasMinReserveBudgetConfig has min reserve budget config

func HasRouterAdmin

func HasRouterAdmin() bool

HasRouterAdmin has admin

func IsAccountInBlackList added in v3.4.0

func IsAccountInBlackList(account string) bool

IsAccountInBlackList is account in black list

func IsAnycallFallbackIgnored added in v3.6.1

func IsAnycallFallbackIgnored(appid string) bool

IsAnycallFallbackIgnored is anycall fallback ignored

func IsAutoSwapNonceEnabled added in v3.4.0

func IsAutoSwapNonceEnabled(chainID string) bool

IsAutoSwapNonceEnabled is auto swap nonce enabled

func IsChainIDInBlackList

func IsChainIDInBlackList(chainID string) bool

IsChainIDInBlackList is chain id in black list

func IsCheckTokenBalanceEnabled added in v3.6.1

func IsCheckTokenBalanceEnabled(chainID string) bool

IsCheckTokenBalanceEnabled is check token balance enabled

func IsCheckTxBlockHashEnabled added in v3.4.0

func IsCheckTxBlockHashEnabled(chainID string) bool

IsCheckTxBlockHashEnabled check tx block hash

func IsCheckTxBlockIndexEnabled added in v3.4.0

func IsCheckTxBlockIndexEnabled(chainID string) bool

IsCheckTxBlockIndexEnabled check tx block and index

func IsDebugMode added in v3.3.0

func IsDebugMode() bool

IsDebugMode is debug mode, add more debugging log infos

func IsDynamicFeeTxEnabled added in v3.3.0

func IsDynamicFeeTxEnabled(chainID string) bool

IsDynamicFeeTxEnabled is dynamic fee tx enabled (EIP-1559)

func IsFixedGasPrice added in v3.4.0

func IsFixedGasPrice(chainID string) bool

IsFixedGasPrice is fixed gas price of specified chain

func IsForceAnySwapInAuto added in v3.4.0

func IsForceAnySwapInAuto() bool

IsForceAnySwapInAuto is forcely call anySwapinAuto

func IsInBigValueWhitelist added in v3.4.0

func IsInBigValueWhitelist(tokenID, caller string) bool

IsInBigValueWhitelist is in call by contract whitelist

func IsInCallByContractCodeHashWhitelist added in v3.5.0

func IsInCallByContractCodeHashWhitelist(chainID, codehash string) bool

IsInCallByContractCodeHashWhitelist is in call by contract code hash whitelist

func IsInCallByContractWhitelist added in v3.3.0

func IsInCallByContractWhitelist(chainID, caller string) bool

IsInCallByContractWhitelist is in call by contract whitelist

func IsNFTSwapWithData added in v3.4.0

func IsNFTSwapWithData() bool

IsNFTSwapWithData is nft swap with data, add data in swapout log and swapin argument

func IsParallelSwapEnabled added in v3.4.0

func IsParallelSwapEnabled() bool

IsParallelSwapEnabled is parallel swap enabled

func IsRouterAdmin

func IsRouterAdmin(account string) bool

IsRouterAdmin is admin

func IsRouterAssistant added in v3.4.0

func IsRouterAssistant(account string) bool

IsRouterAssistant is router assistants

func IsSwapWithPermitEnabled added in v3.4.0

func IsSwapWithPermitEnabled() bool

IsSwapWithPermitEnabled is swap with permit enabled

func IsSwapoutForbidden added in v3.6.1

func IsSwapoutForbidden(chainID, tokenID string) bool

IsSwapoutForbidden forbid swapout judge

func IsTokenIDInBlackList

func IsTokenIDInBlackList(tokenID string) bool

IsTokenIDInBlackList is token id in black list

func IsTokenIDInBlackListOnChain added in v3.6.1

func IsTokenIDInBlackListOnChain(chainID, tokenID string) bool

IsTokenIDInBlackListOnChain is token id in black list on chain

func IsUseFastMPC added in v3.6.0

func IsUseFastMPC(chainID string) bool

IsUseFastMPC is use fast mpc

func IsUseFromChainIDInReceiptDisabled added in v3.4.0

func IsUseFromChainIDInReceiptDisabled(chainID string) bool

IsUseFromChainIDInReceiptDisabled if use fromChainID from receipt log

func ReloadRouterConfig added in v3.5.2

func ReloadRouterConfig()

ReloadRouterConfig reload config

func SetAllowCallByContract added in v3.4.0

func SetAllowCallByContract(allow bool)

SetAllowCallByContract set allow call by contract flag (used in testing)

func SetDataDir added in v3.4.0

func SetDataDir(dir string, isServer bool)

SetDataDir set data dir

func SetDebugMode added in v3.5.0

func SetDebugMode(flag bool)

SetDebugMode set debug mode

func SetExtraConfig added in v3.4.0

func SetExtraConfig(extra *ExtraConfig) error

SetExtraConfig set extra config (used by testing)

func VersionWithCommit

func VersionWithCommit(gitCommit, gitDate string) string

VersionWithCommit add git commit and data to version.

Types

type APIServerConfig

type APIServerConfig struct {
	Port             int
	AllowedOrigins   []string
	MaxRequestsLimit int
}

APIServerConfig api service config

type Blacklists added in v3.6.2

type Blacklists struct {
	ChainIDBlackList        []string            `toml:",omitempty" json:",omitempty"`
	TokenIDBlackList        []string            `toml:",omitempty" json:",omitempty"`
	TokenIDBlackListOnChain map[string][]string `toml:",omitempty" json:",omitempty"`
	AccountBlackList        []string            `toml:",omitempty" json:",omitempty"`
}

Blacklists black lists

type DynamicFeeTxConfig added in v3.3.0

type DynamicFeeTxConfig struct {
	PlusGasTipCapPercent uint64
	PlusGasFeeCapPercent uint64
	BlockCountFeeHistory int
	MaxGasTipCap         string
	MaxGasFeeCap         string
	// contains filtered or unexported fields
}

DynamicFeeTxConfig dynamic fee tx config

func GetDynamicFeeTxConfig added in v3.3.0

func GetDynamicFeeTxConfig(chainID string) *DynamicFeeTxConfig

GetDynamicFeeTxConfig get dynamic fee tx config (EIP-1559)

func (*DynamicFeeTxConfig) GetMaxGasFeeCap added in v3.3.0

func (c *DynamicFeeTxConfig) GetMaxGasFeeCap() *big.Int

GetMaxGasFeeCap get max fee gas cap

func (*DynamicFeeTxConfig) GetMaxGasTipCap added in v3.3.0

func (c *DynamicFeeTxConfig) GetMaxGasTipCap() *big.Int

GetMaxGasTipCap get max gas tip cap

type ExtraConfig added in v3.3.0

type ExtraConfig struct {
	IsDebugMode           bool `toml:",omitempty" json:",omitempty"`
	EnableSwapWithPermit  bool `toml:",omitempty" json:",omitempty"`
	ForceAnySwapInAuto    bool `toml:",omitempty" json:",omitempty"`
	IsNFTSwapWithData     bool `toml:",omitempty" json:",omitempty"`
	EnableParallelSwap    bool `toml:",omitempty" json:",omitempty"`
	UsePendingBalance     bool `toml:",omitempty" json:",omitempty"`
	DontPanicInInitRouter bool `toml:",omitempty" json:",omitempty"`
	DontCheckInInitRouter bool `toml:",omitempty" json:",omitempty"`

	MinReserveFee    map[string]uint64 `toml:",omitempty" json:",omitempty"`
	BaseFeePercent   map[string]int64  `toml:",omitempty" json:",omitempty"` // key is chain ID
	MinReserveBudget map[string]uint64 `toml:",omitempty" json:",omitempty"`

	AllowCallByConstructor          bool                `toml:",omitempty" json:",omitempty"`
	AllowCallByContract             bool                `toml:",omitempty" json:",omitempty"`
	CheckEIP1167Master              bool                `toml:",omitempty" json:",omitempty"`
	CallByContractWhitelist         map[string][]string `toml:",omitempty" json:",omitempty"` // chainID -> whitelist
	CallByContractCodeHashWhitelist map[string][]string `toml:",omitempty" json:",omitempty"` // chainID -> whitelist
	BigValueWhitelist               map[string][]string `toml:",omitempty" json:",omitempty"` // tokenID -> whitelist

	DynamicFeeTxEnabledChains            []string `toml:",omitempty" json:",omitempty"`
	EnableCheckTxBlockHashChains         []string `toml:",omitempty" json:",omitempty"`
	EnableCheckTxBlockIndexChains        []string `toml:",omitempty" json:",omitempty"`
	DisableUseFromChainIDInReceiptChains []string `toml:",omitempty" json:",omitempty"`
	UseFastMPCChains                     []string `toml:",omitempty" json:",omitempty"`
	DontCheckReceivedTokenIDs            []string `toml:",omitempty" json:",omitempty"`
	DontCheckBalanceTokenIDs             []string `toml:",omitempty" json:",omitempty"`
	DontCheckTotalSupplyTokenIDs         []string `toml:",omitempty" json:",omitempty"`
	CheckTokenBalanceEnabledChains       []string `toml:",omitempty" json:",omitempty"`
	IgnoreAnycallFallbackAppIDs          []string `toml:",omitempty" json:",omitempty"`

	RPCClientTimeout map[string]int `toml:",omitempty" json:",omitempty"` // key is chainID
	// chainID,customKey => customValue
	Customs map[string]map[string]string `toml:",omitempty" json:",omitempty"`

	LocalChainConfig map[string]*LocalChainConfig `toml:",omitempty" json:",omitempty"` // key is chain ID

	SpecialFlags map[string]string `toml:",omitempty" json:",omitempty"`

	AttestationServer string `toml:",omitempty" json:",omitempty"`
}

ExtraConfig extra config

func GetExtraConfig added in v3.3.0

func GetExtraConfig() *ExtraConfig

GetExtraConfig get extra config

func (*ExtraConfig) CheckConfig added in v3.3.0

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

CheckConfig check extra config

type GatewayConfigs added in v3.6.2

type GatewayConfigs struct {
	Gateways         map[string][]string // key is chain ID
	GatewaysExt      map[string][]string `toml:",omitempty" json:",omitempty"` // key is chain ID
	EVMGatewaysExt   map[string][]string `toml:",omitempty" json:",omitempty"` // key is chain ID
	FinalizeGateways map[string][]string `toml:",omitempty" json:",omitempty"` // key is chain ID
	GRPCGateways     map[string][]string `toml:",omitempty" json:",omitempty"` // key is chain ID
}

GatewayConfigs gateway config

func LoadGatewayConfigs added in v3.6.2

func LoadGatewayConfigs() (*GatewayConfigs, error)

LoadGatewayConfigs load gateway configs

type LocalChainConfig added in v3.6.1

type LocalChainConfig struct {
	ForbidParallelLoading      bool     `toml:",omitempty" json:",omitempty"`
	EstimatedGasMustBePositive bool     `toml:",omitempty" json:",omitempty"`
	SmallestGasPriceUnit       uint64   `toml:",omitempty" json:",omitempty"`
	ForbidSwapoutTokenIDs      []string `toml:",omitempty" json:",omitempty"`
	BigValueDiscount           uint64   `toml:",omitempty" json:",omitempty"`

	// chainID -> tokenids
	ChargeFeeOnDestChain   map[string][]string `toml:",omitempty" json:",omitempty"`
	FeeReceiverOnDestChain string              `toml:",omitempty" json:",omitempty"`
	// contains filtered or unexported fields
}

LocalChainConfig local chain config

func GetLocalChainConfig added in v3.6.1

func GetLocalChainConfig(chainID string) *LocalChainConfig

GetLocalChainConfig get local chain config

func (*LocalChainConfig) CheckConfig added in v3.6.1

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

CheckConfig check local chain config

type MPCConfig

type MPCConfig struct {
	SignTypeEC256K1 string `toml:",omitempty" json:",omitempty"`

	APIPrefix                 string
	RPCTimeout                uint64 `toml:",omitempty" json:",omitempty"`
	SignTimeout               uint64 `toml:",omitempty" json:",omitempty"`
	MaxSignGroupFailures      int    `toml:",omitempty" json:",omitempty"`
	MinIntervalToAddSignGroup int64  `toml:",omitempty" json:",omitempty"`

	VerifySignatureInAccept bool `toml:",omitempty" json:",omitempty"`

	GetAcceptListLoopInterval  uint64 `toml:",omitempty" json:",omitempty"`
	GetAcceptListRetryInterval uint64 `toml:",omitempty" json:",omitempty"`
	MaxAcceptSignTimeInterval  int64  `toml:",omitempty" json:",omitempty"`
	PendingInvalidAccept       bool   `toml:",omitempty" json:",omitempty"`

	GroupID       *string
	NeededOracles *uint32
	TotalOracles  *uint32
	Mode          uint32 // 0:managed 1:private (default 0)
	Initiators    []string
	DefaultNode   *MPCNodeConfig
	OtherNodes    []*MPCNodeConfig `toml:",omitempty" json:",omitempty"`

	SignWithPrivateKey bool              // use private key instead (use for testing)
	SignerPrivateKeys  map[string]string `json:"-"` // key is chain ID (use for testing)
}

MPCConfig mpc related config

func GetMPCConfig added in v3.5.0

func GetMPCConfig(isFastMPC bool) *MPCConfig

GetMPCConfig get mpc config

func (*MPCConfig) CheckConfig

func (c *MPCConfig) CheckConfig(isServer bool) (err error)

CheckConfig check mpc config

func (*MPCConfig) GetSignerPrivateKey added in v3.6.0

func (c *MPCConfig) GetSignerPrivateKey(chainID string) string

GetSignerPrivateKey get signer private key (use for testing)

func (*MPCConfig) SetSignerPrivateKey added in v3.6.0

func (c *MPCConfig) SetSignerPrivateKey(chainID, prikey string)

SetSignerPrivateKey set signer private key (use for testing)

type MPCNodeConfig

type MPCNodeConfig struct {
	RPCAddress   *string
	SignGroups   []string `toml:",omitempty" json:",omitempty"`
	KeystoreFile *string  `json:"-"`
	PasswordFile *string  `json:"-"`
}

MPCNodeConfig mpc node config

func (*MPCNodeConfig) CheckConfig

func (c *MPCNodeConfig) CheckConfig(isServer bool) (err error)

CheckConfig check mpc node config

type MongoDBConfig

type MongoDBConfig struct {
	DBURL    string   `toml:",omitempty" json:",omitempty"`
	DBURLs   []string `toml:",omitempty" json:",omitempty"`
	DBName   string
	UserName string `json:"-"`
	Password string `json:"-"`
}

MongoDBConfig mongodb config

func (*MongoDBConfig) CheckConfig added in v3.4.0

func (c *MongoDBConfig) CheckConfig() error

CheckConfig check mongodb config

type OnchainConfig

type OnchainConfig struct {
	Contract    string
	APIAddress  []string
	WSServers   []string
	ReloadCycle uint64 // seconds
	IgnoreCheck bool
}

OnchainConfig struct

func (*OnchainConfig) CheckConfig

func (c *OnchainConfig) CheckConfig() error

CheckConfig check onchain config storing chain and token configs

type RouterConfig

type RouterConfig struct {
	Server *RouterServerConfig `toml:",omitempty" json:",omitempty"`
	Oracle *RouterOracleConfig `toml:",omitempty" json:",omitempty"`

	Identifier  string
	SwapType    string
	SwapSubType string

	Onchain *OnchainConfig
	*GatewayConfigs

	MPC     *MPCConfig
	FastMPC *MPCConfig   `toml:",omitempty" json:",omitempty"`
	Extra   *ExtraConfig `toml:",omitempty" json:",omitempty"`

	*Blacklists
}

RouterConfig config

func GetRouterConfig

func GetRouterConfig() *RouterConfig

GetRouterConfig get router config

func LoadRouterConfig

func LoadRouterConfig(configFile string, isServer, check bool) *RouterConfig

LoadRouterConfig load router swap config

func NewRouterConfig added in v3.6.2

func NewRouterConfig() *RouterConfig

func (*RouterConfig) CheckBlacklistConfig added in v3.6.0

func (config *RouterConfig) CheckBlacklistConfig() (err error)

CheckBlacklistConfig check black list config

func (*RouterConfig) CheckConfig

func (config *RouterConfig) CheckConfig(isServer bool) (err error)

CheckConfig check router config

type RouterOracleConfig added in v3.4.0

type RouterOracleConfig struct {
	ServerAPIAddress        string
	NoCheckServerConnection bool `toml:",omitempty" json:",omitempty"`
	CheckGasTokenBalance    bool `toml:",omitempty" json:",omitempty"`
}

RouterOracleConfig only for oracle

func GetRouterOracleConfig added in v3.4.0

func GetRouterOracleConfig() *RouterOracleConfig

GetRouterOracleConfig get router oracle config

func (*RouterOracleConfig) CheckConfig added in v3.4.0

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

CheckConfig of router oracle

type RouterServerConfig

type RouterServerConfig struct {
	Admins     []string
	Assistants []string
	MongoDB    *MongoDBConfig
	APIServer  *APIServerConfig

	AutoSwapNonceEnabledChains []string `toml:",omitempty" json:",omitempty"`

	// extras
	EnableReplaceSwap          bool
	EnablePassBigValueSwap     bool
	ReplacePlusGasPricePercent uint64            `toml:",omitempty" json:",omitempty"`
	WaitTimeToReplace          int64             `toml:",omitempty" json:",omitempty"` // seconds
	MaxReplaceCount            int               `toml:",omitempty" json:",omitempty"`
	PlusGasPricePercentage     uint64            `toml:",omitempty" json:",omitempty"`
	MaxPlusGasPricePercentage  uint64            `toml:",omitempty" json:",omitempty"`
	MaxGasPriceFluctPercent    uint64            `toml:",omitempty" json:",omitempty"`
	FixedGasPrice              map[string]string `toml:",omitempty" json:",omitempty"` // key is chain ID
	MaxGasPrice                map[string]string `toml:",omitempty" json:",omitempty"` // key is chain ID
	NoncePassedConfirmInterval map[string]int64  `toml:",omitempty" json:",omitempty"` // key is chain ID
	CalcGasPriceMethod         map[string]string `toml:",omitempty" json:",omitempty"` // key is chain ID
	RetrySendTxLoopCount       map[string]int    `toml:",omitempty" json:",omitempty"` // key is chain ID
	SendTxLoopCount            map[string]int    `toml:",omitempty" json:",omitempty"` // key is chain ID
	SendTxLoopInterval         map[string]int    `toml:",omitempty" json:",omitempty"` // key is chain ID

	DefaultFee       map[string]string            `toml:",omitempty" json:",omitempty"` // key is chain ID
	DefaultGasLimit  map[string]uint64            `toml:",omitempty" json:",omitempty"` // key is chain ID
	MaxGasLimit      map[string]uint64            `toml:",omitempty" json:",omitempty"` // key is chain ID
	MaxTokenGasLimit map[string]map[string]uint64 `toml:",omitempty" json:",omitempty"` // key is tokenID,chainID

	DynamicFeeTx map[string]*DynamicFeeTxConfig `toml:",omitempty" json:",omitempty"` // key is chain ID
}

RouterServerConfig only for server

func GetRouterServerConfig

func GetRouterServerConfig() *RouterServerConfig

GetRouterServerConfig get router server config

func (*RouterServerConfig) CheckConfig

func (s *RouterServerConfig) CheckConfig() error

CheckConfig of router server

func (*RouterServerConfig) CheckDynamicFeeTxConfig added in v3.3.0

func (s *RouterServerConfig) CheckDynamicFeeTxConfig() error

CheckDynamicFeeTxConfig check dynamic fee tx config

func (*RouterServerConfig) CheckExtra

func (s *RouterServerConfig) CheckExtra() error

CheckExtra check extra server config

Jump to

Keyboard shortcuts

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