config

package
v4.14.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 8 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	CoinCode      string                 `json:"coinCode"`
	Name          string                 `json:"name"`
	Code          string                 `json:"code"`
	Configuration *signing.Configuration `json:"configuration"`
}

Account holds information related to an account.

type AccountsConfig

type AccountsConfig struct {
	Accounts []Account `json:"accounts"`
}

AccountsConfig persists the list of accounts added to the app.

type AppConfig

type AppConfig struct {
	Backend  Backend     `json:"backend"`
	Frontend interface{} `json:"frontend"`
}

AppConfig holds the whole app configuration.

func NewDefaultAppConfig

func NewDefaultAppConfig() AppConfig

NewDefaultAppConfig returns the default app config.

type Backend

type Backend struct {
	Proxy proxyConfig `json:"proxy"`

	BitcoinP2PKHActive       bool `json:"bitcoinP2PKHActive"`
	BitcoinP2WPKHP2SHActive  bool `json:"bitcoinP2WPKHP2SHActive"`
	BitcoinP2WPKHActive      bool `json:"bitcoinP2WPKHActive"`
	LitecoinP2WPKHP2SHActive bool `json:"litecoinP2WPKHP2SHActive"`
	LitecoinP2WPKHActive     bool `json:"litecoinP2WPKHActive"`
	EthereumActive           bool `json:"ethereumActive"`

	BTC  btcCoinConfig `json:"btc"`
	TBTC btcCoinConfig `json:"tbtc"`
	RBTC btcCoinConfig `json:"rbtc"`
	LTC  btcCoinConfig `json:"ltc"`
	TLTC btcCoinConfig `json:"tltc"`
	ETH  ethCoinConfig `json:"eth"`
	TETH ethCoinConfig `json:"teth"`
	RETH ethCoinConfig `json:"reth"`
}

Backend holds the backend specific configuration.

func (Backend) AccountActive

func (backend Backend) AccountActive(code string) bool

AccountActive returns the Active setting for a coin by code.

type Config

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

Config manages the app configuration.

func NewConfig

func NewConfig(appConfigFilename string, accountsConfigFilename string) (*Config, error)

NewConfig creates a new Config, stored in the given location. The filename must be writable, but does not have to exist.

func (*Config) AccountsConfig

func (config *Config) AccountsConfig() AccountsConfig

AccountsConfig returns the accounts config.

func (*Config) AppConfig

func (config *Config) AppConfig() AppConfig

AppConfig returns the app config.

func (*Config) SetAccountsConfig

func (config *Config) SetAccountsConfig(accountsConfig AccountsConfig) error

SetAccountsConfig sets and persists the accounts config.

func (*Config) SetAppConfig

func (config *Config) SetAppConfig(appConfig AppConfig) error

SetAppConfig sets and persists the app config.

func (*Config) SetBTCElectrumServers

func (config *Config) SetBTCElectrumServers(electrumAddress, electrumCert string)

SetBTCElectrumServers sets the BTC configuration to the provided electrumIP and electrumCert

func (*Config) SetBtcOnly

func (config *Config) SetBtcOnly()

SetBtcOnly sets non-bitcoin accounts in the config to false

func (*Config) SetTBTCElectrumServers

func (config *Config) SetTBTCElectrumServers(electrumAddress, electrumCert string)

SetTBTCElectrumServers sets the TBTC configuration to the provided electrumIP and electrumCert

type ETHTransactionsSource

type ETHTransactionsSource string

ETHTransactionsSource where to get Ethereum transactions from. See the list of consts below.

const (
	// ETHTransactionsSourceNone means no source of tranasctions. Only the locally cached
	// transactions will be shown.
	ETHTransactionsSourceNone ETHTransactionsSource = "none"
	// ETHTransactionsSourceEtherScan configures to get transactions from EtherScan.
	ETHTransactionsSourceEtherScan ETHTransactionsSource = "etherScan"
)

Jump to

Keyboard shortcuts

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