config

package
v0.0.0-...-57b5d92 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

View Source
const (
	EthereumRegistryAddressMainnet = "0x5c69ccf91eab4ef80d9929b3c1b4d5bc03eb0981"
	EthereumRegistryAddressRinkeby = "0x5cEF053c7b383f430FC4F4e1ea2F7D31d8e2D16C"
	EthereumRegistryAddressRopsten = "0x403d907982474cdd51687b09a8968346159378f3"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CoinConfig

type CoinConfig struct {
	// The type of coin to configure
	CoinType util.ExtCoinType

	// The default fee-per-byte for each level
	SuperLowFee uint64
	LowFee      uint64
	MediumFee   uint64
	HighFee     uint64

	// The highest allowable fee-per-byte
	MaxFee uint64

	// External API to query to look up fees. If this field is nil then the default fees will be used.
	// If the API is unreachable then the default fees will likewise be used. If the API returns a fee
	// greater than MaxFee then the MaxFee will be used in place. The API response must be formatted as
	// { "fastestFee": 40, "halfHourFee": 20, "hourFee": 10 }
	FeeAPI string

	// The trusted APIs to use for querying for balances and listening to blockchain events.
	ClientAPIs []string

	// An implementation of the Datastore interface for each desired coin
	DB wallet.Datastore

	// Custom options for wallet to use
	Options map[string]interface{}
}

type Config

type Config struct {
	// Network parameters. Set mainnet, testnet, or regtest using this.
	Params *chaincfg.Params

	// Bip39 mnemonic string. If empty a new mnemonic will be created.
	Mnemonic string

	// The date the wallet was created.
	// If before the earliest checkpoint the chain will be synced using the earliest checkpoint.
	CreationDate time.Time

	// A Tor proxy can be set here causing the wallet will use Tor
	Proxy proxy.Dialer

	// A logger. You can write the logs to file or stdout or however else you want.
	Logger logging.Backend

	// Cache is a persistable storage provided by the consumer where the wallet can
	// keep state between runtime executions
	Cache cache.Cacher

	// A list of coin configs. One config should be included for each coin to be used.
	Coins []CoinConfig

	// Disable the exchange rate functionality in each wallet
	DisableExchangeRates bool
}

func NewDefaultConfig

func NewDefaultConfig(coinTypes map[wallet.CoinType]bool, params *chaincfg.Params) *Config

Jump to

Keyboard shortcuts

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