config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package config contains data structures related to Client configuration

Index

Constants

View Source
const (
	CoinBTC = "btc"
	CoinBCH = "bch"
)

List of supported coins

View Source
const (
	CoinTypeBTC  uint32 = 0
	CoinTypeTEST uint32 = 1
	CoinTypeBCH  uint32 = 145
)

BIP-44 Coin types

View Source
const (
	NetworkLive = "livenet"
	NetworkTest = "testnet"
)

List of supported networks

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug    bool
	BaseURL  string
	Coin     string
	Network  string
	Timeout  int
	Deadline int
}

Config contains Client configuration

func NewCashLocal

func NewCashLocal() *Config

NewCashLocal creates new instance of Config for localhost API, BCH and livenet

func NewCashPublic

func NewCashPublic() *Config

NewCashPublic creates new instance of Config for public API, BCH and livenet

func NewCashPublicTestnet

func NewCashPublicTestnet() *Config

NewCashPublicTestnet creates new instance of Config for public API, BCH and livenet

func NewCustom

func NewCustom(baseURL, coin, network string) (*Config, error)

NewCustom creates new instance of Config with custom parameters

func NewLocal

func NewLocal() *Config

NewLocal creates new instance of Config for localhost API, BTC and livenet

func NewLocalTestnet

func NewLocalTestnet() *Config

NewLocalTestnet creates new instance of Config for localhost API, BTC and testnet

func NewPublic

func NewPublic() *Config

NewPublic creates new instance of Config for public API, BTC and livenet

func NewPublicTestnet

func NewPublicTestnet() *Config

NewPublicTestnet creates new instance of Config for public API, BTC and testnet

func (*Config) CoinType

func (cfg *Config) CoinType() uint32

CoinType returns BIP-44 coin type

func (*Config) NetParams

func (cfg *Config) NetParams() *chaincfg.Params

NetParams return network params for btcd

func (*Config) NetShort

func (cfg *Config) NetShort() string

NetShort returns network ID in one symbol

Jump to

Keyboard shortcuts

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