config

package
v1.0.1-0...-a516edb Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const UnsupportedChain = "Unsupport chain"
View Source
const UnsupportedOperation = UnsupportedChain

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server   Server   `yaml:"server"`
	Fullnode Fullnode `yaml:"fullnode"`
	NetWork  string   `yaml:"network"`
	Chains   []string `yaml:"chains"`
	OkLink   OkLink   `yaml:"okLink"`
}

Config instance define

func New

func New(path string) (*Config, error)

Setup init config

type Fullnode

type Fullnode struct {
	Btc      Node       `yaml:"btc"`
	Eth      Node       `yaml:"eth"`
	Arbi     Node       `yaml:"arbi"`
	Op       Node       `yaml:"op"`
	Zksync   Node       `yaml:"zksync"`
	Bsc      Node       `yaml:"bsc"`
	Heco     Node       `yaml:"heco"`
	Avax     Node       `yaml:"avax"`
	Evmos    Node       `yaml:"evmos"`
	Polygon  Node       `yaml:"polygon"`
	Tron     Node       `yaml:"tron"`
	Near     Node       `yaml:"near"`
	Algo     Node       `yaml:"alog"`
	Xrp      Node       `yaml:"xrp"`
	Sol      SolanaNode `yaml:"solana"`
	Cosmos   Node       `yaml:"cosmos"`
	FileCoin Node       `yaml:"filecoin"`
	Dot      Node       `yaml:"dot"`
	Eos      Node       `yaml:"eos"`
	Oasis    Node       `yaml:"oasis"`
	Tezos    Node       `yaml:"tezos"`
	Aptos    Node       `yaml:"aptos"`
	Egld     Node       `yaml:"egld"`
	Mantle   Node       `yaml:"mantle"`
	Scroll   Node       `yaml:"scroll"`
	Base     Node       `yaml:"base"`
	Linea    Node       `yaml:"linea"`
	Ada      Node       `yaml:"ada"`
	Sui      Node       `yaml:"sui"`
	Flow     Node       `yaml:"flow"`
	Ton      Node       `yaml:"ton"`
	Ar       Node       `yaml:"ar"`
}

Fullnode define

type NetWorkType

type NetWorkType int
const (
	MainNet NetWorkType = iota
	TestNet
	RegTest
)

type Node

type Node struct {
	RPCs          []*RPC `yaml:"rpcs"`
	TpApiUrl      string `yaml:"tp_api_url"`
	TpApiKey      string `yaml:"tp_api_key"`
	Confirmations uint64 `yaml:"confirmations"`
	ApiToken      string `yaml:"apiToken"`
}
type OkLink struct {
	OkLinkBaseUrl string        `yaml:"okLinkBaseUrl"`
	OkLinkApiKey  string        `yaml:"okLinkApiKey"`
	OkLinkTimeout time.Duration `yaml:"okLinkTimeout"`
}

type RPC

type RPC struct {
	RPCURL  string `yaml:"rpc_url"`
	RPCUser string `yaml:"rpc_user"`
	RPCPass string `yaml:"rpc_pass"`
}

RPC connection info define

type Server

type Server struct {
	Port string `yaml:"port"`
}

Server prot

type SolanaNode

type SolanaNode struct {
	RPCs               []*RPC        `yaml:"rpcs"`
	NetWork            string        `yaml:"network"`
	NonceAccountAddr   string        `yaml:"NonceAccountAddr"`
	FeeAccountPriKey   string        `yaml:"FeeAccountPriKey"`
	SolScanApiKey      string        `yaml:"solScanApiKey"`
	SolScanBaseUrl     string        `yaml:"solScanBaseUrl"`
	SolScanBaseTimeout time.Duration `yaml:"solScanBaseTimeout"`
}

Jump to

Keyboard shortcuts

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