config

package
v0.1.0-alpha-2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: Apache-2.0 Imports: 9 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 LoadHederaFeePercentages

func LoadHederaFeePercentages(tokens map[string]parser.Token) map[string]int64

Types

type Assets

type Assets struct {
	// contains filtered or unexported fields
}

func LoadAssets

func LoadAssets(networks map[int64]*parser.Network) Assets

func (Assets) NativeToWrapped

func (a Assets) NativeToWrapped(nativeAsset string, nativeChainId, targetChainId int64) string

func (Assets) NetworkAssets

func (a Assets) NetworkAssets(id int64) []string

func (Assets) WrappedToNative

func (a Assets) WrappedToNative(wrappedAsset string, wrappedChainId int64) *NativeAsset

type Bridge added in v1.4.0

type Bridge struct {
	TopicId string
	Hedera  *BridgeHedera
	EVMs    map[int64]BridgeEvm
	Assets  Assets
}

func NewBridge added in v1.4.0

func NewBridge(bridge parser.Bridge) 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
}

type Clients added in v1.4.0

type Clients struct {
	Evm        map[int64]Evm
	Hedera     Hedera
	MirrorNode MirrorNode
}

type Config

type Config struct {
	Node   Node
	Bridge Bridge
}

func LoadConfig

func LoadConfig() Config

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
}

type Hedera

type Hedera struct {
	Operator       Operator
	Network        string
	StartTimestamp int64
}

type HederaToken added in v1.4.0

type HederaToken struct {
	FeePercentage int64
	Networks      map[int64]string
}

type MirrorNode

type MirrorNode struct {
	ClientAddress   string
	ApiAddress      string
	PollingInterval time.Duration
}

type NativeAsset

type NativeAsset struct {
	ChainId int64
	Asset   string
}

type Node added in v1.4.0

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

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 Token added in v1.4.0

type Token struct {
	Networks map[int64]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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