config

package
v0.2.0-alpha-1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 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) (fungiblePercentages map[string]int64, nftFees map[string]int64)

Types

type Assets

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

func LoadAssets

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

func (Assets) FungibleNativeAsset

func (a Assets) FungibleNativeAsset(id uint64, asset string) *NativeAsset

func (Assets) FungibleNetworkAssets

func (a Assets) FungibleNetworkAssets(id uint64) []string

func (Assets) GetFungibleNetworkAssets

func (a Assets) GetFungibleNetworkAssets() map[uint64][]string

func (Assets) GetNativeToWrapped

func (a Assets) GetNativeToWrapped() map[uint64]map[string]map[uint64]string

func (Assets) GetOppositeAsset

func (a Assets) GetOppositeAsset(sourceChainId uint64, targetChainId uint64, asset string) string

func (Assets) IsNative

func (a Assets) IsNative(networkId uint64, asset string) bool

func (Assets) NativeToWrapped

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

func (Assets) WrappedFromNative

func (a Assets) WrappedFromNative(nativeChainId uint64, nativeAsset string) map[uint64]string

func (Assets) WrappedToNative

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

type Bridge added in v1.4.0

type Bridge struct {
	TopicId string
	Hedera  *BridgeHedera
	EVMs    map[uint64]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
	NftFees        map[string]int64
}

type Clients added in v1.4.0

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

type Config

type Config struct {
	Node   Node
	Bridge Bridge
}

func LoadConfig

func LoadConfig() (Config, parser.Bridge)

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
}

type HederaToken added in v1.4.0

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

type MirrorNode

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

type Monitoring added in v1.4.0

type Monitoring struct {
	Enable           bool
	DashboardPolling time.Duration
}

type NativeAsset

type NativeAsset struct {
	MinAmount *big.Int
	ChainId   uint64
	Asset     string
}

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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