config

package
v1.2.1-rc-1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(config interface{}, path string) error

func GetLoggerFor

func GetLoggerFor(ctx string) *log.Entry

GetLoggerFor returns a logger defined with a context

func InitLogger

func InitLogger(level string)

InitLogger sets the initial configuration of the used logger

func LoadHederaFees added in v1.4.0

func LoadHederaFees(tokens parser.Tokens) (res struct {
	FungiblePercentages map[string]int64
	ConstantNftFees     map[string]int64
	DynamicNftFees      map[string]decimal.Decimal
})

Types

type Bridge added in v1.4.0

type Bridge struct {
	TopicId           string
	Hedera            *BridgeHedera
	EVMs              map[uint64]BridgeEvm
	CoinMarketCapIds  map[uint64]map[string]string
	CoinGeckoIds      map[uint64]map[string]string
	MinAmounts        map[uint64]map[string]*big.Int
	MonitoredAccounts map[string]string
}

func NewBridge added in v1.4.0

func NewBridge(bridge parser.Bridge) *Bridge

func (Bridge) LoadStaticMinAmountsForWrappedFungibleTokens added in v1.4.0

func (b Bridge) LoadStaticMinAmountsForWrappedFungibleTokens(parsedBridge parser.Bridge, assetsService service.Assets)

func (*Bridge) Update added in v1.4.0

func (b *Bridge) Update(from *Bridge)

type BridgeEvm added in v1.4.0

type BridgeEvm struct {
	RouterContractAddress string
	Tokens                map[string]Token
}

type BridgeHedera added in v1.4.0

type BridgeHedera struct {
	BridgeAccount   string
	PayerAccount    string
	Members         []string
	Tokens          map[string]HederaToken
	FeePercentages  map[string]int64
	NftConstantFees map[string]int64
	NftDynamicFees  map[string]decimal.Decimal
}

type Clients added in v1.4.0

type Clients struct {
	Evm           map[uint64]Evm
	Hedera        Hedera
	MirrorNode    MirrorNode
	CoinGecko     CoinGecko
	CoinMarketCap CoinMarketCap
}

type CoinGecko added in v1.4.0

type CoinGecko struct {
	ApiAddress string
}

type CoinMarketCap added in v1.4.0

type CoinMarketCap struct {
	ApiKey     string
	ApiAddress string
}

type Config

type Config struct {
	Node   Node
	Bridge *Bridge
}

func LoadConfig

func LoadConfig() (*Config, *parser.Bridge, error)

type Database added in v1.4.0

type Database struct {
	Host     string
	Name     string
	Password string
	Port     string
	Username string
}

type Evm added in v1.4.0

type Evm struct {
	BlockConfirmations uint64
	NodeUrl            string
	PrivateKey         string
	StartBlock         int64
	PollingInterval    time.Duration
	MaxLogsBlocks      int64
}

type Hedera

type Hedera struct {
	Operator       Operator
	Network        string
	Rpc            map[string]hedera.AccountID
	StartTimestamp int64
	MaxRetry       int
}

func (*Hedera) DefaultOrConfig added in v1.4.0

func (h *Hedera) DefaultOrConfig(cfg *parser.Hedera) *Hedera

type HederaToken added in v1.4.0

type HederaToken struct {
	Fee               int64
	FeePercentage     int64
	MinFeeAmountInUsd string
	MinAmount         *big.Int
	Networks          map[uint64]string
	ReleaseTimestamp  uint64
}

func NewHederaTokenFromToken added in v1.4.0

func NewHederaTokenFromToken(token parser.Token) HederaToken

type MirrorNode

type MirrorNode struct {
	ClientAddress     string
	ApiAddress        string
	PollingInterval   time.Duration
	QueryMaxLimit     int64
	QueryDefaultLimit int64
	RetryPolicy       RetryPolicy
	RequestTimeout    int
}

func (*MirrorNode) DefaultOrConfig added in v1.4.0

func (m *MirrorNode) DefaultOrConfig(cfg *parser.MirrorNode) *MirrorNode

type Monitoring added in v1.4.0

type Monitoring struct {
	Enable           bool
	DashboardPolling time.Duration
}

type Node added in v1.4.0

type Node struct {
	Database   Database
	Clients    Clients
	LogLevel   string
	Port       string
	Validator  bool
	Monitoring Monitoring
}

func New added in v1.4.0

func New(node parser.Node) Node

type Operator

type Operator struct {
	AccountId  string
	PrivateKey string
}

type Recovery

type Recovery struct {
	StartTimestamp int64
	StartBlock     int64
}

type RetryPolicy added in v1.4.0

type RetryPolicy struct {
	MaxRetry  int
	MinWait   int
	MaxWait   int
	MaxJitter int
}

func (*RetryPolicy) DefaultOrConfig added in v1.4.0

func (r *RetryPolicy) DefaultOrConfig(cfg *parser.RetryPolicy) *RetryPolicy

type Token added in v1.4.0

type Token struct {
	MinFeeAmountInUsd *big.Int
	Networks          map[uint64]string
	ReleaseTimestamp  uint64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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