backend

package
v4.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version of the backend as displayed to the user.
	Version = semver.NewSemVer(4, 0, 0)
)

Functions

This section is empty.

Types

type Backend

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

Backend ties everything together and is the main starting point to use the godbb library.

func NewBackend

func NewBackend(arguments *arguments.Arguments) *Backend

NewBackend creates a new backend with the given arguments.

func (*Backend) Accounts

func (backend *Backend) Accounts() []*btc.Account

Accounts returns the supported accounts.

func (*Backend) CheckElectrumServer

func (backend *Backend) CheckElectrumServer(server string, pemCert string) error

CheckElectrumServer checks if a tls connection can be established with the electrum server, and whether the server is an electrum server.

func (*Backend) Coin

func (backend *Backend) Coin(code string) *btc.Coin

Coin returns a Coin instance for a coin type.

func (*Backend) Config

func (backend *Backend) Config() *config.Config

Config returns the app config.

func (*Backend) DefaultConfig

func (backend *Backend) DefaultConfig() config.AppConfig

DefaultConfig returns the default app config.y

func (*Backend) Deregister

func (backend *Backend) Deregister(deviceID string)

Deregister deregisters the device with the given ID from this backend.

func (*Backend) DeregisterKeystore

func (backend *Backend) DeregisterKeystore()

DeregisterKeystore removes the registered keystore.

func (*Backend) DevicesRegistered

func (backend *Backend) DevicesRegistered() []string

DevicesRegistered returns a slice of device IDs of registered devices.

func (*Backend) DownloadCert

func (backend *Backend) DownloadCert(server string) (string, error)

DownloadCert downloads the first element of the remote certificate chain.

func (*Backend) Events

func (backend *Backend) Events() <-chan interface{}

Events returns the push notifications channel.

func (*Backend) Keystores

func (backend *Backend) Keystores() keystore.Keystores

Keystores returns the keystores registered at this backend.

func (*Backend) OnDeviceInit

func (backend *Backend) OnDeviceInit(f func(device.Interface))

OnDeviceInit installs a callback to be called when a device is initialized.

func (*Backend) OnDeviceUninit

func (backend *Backend) OnDeviceUninit(f func(string))

OnDeviceUninit installs a callback to be called when a device is uninitialized.

func (*Backend) OnWalletInit

func (backend *Backend) OnWalletInit(f func(*btc.Account))

OnWalletInit installs a callback to be called when a wallet is initialized.

func (*Backend) OnWalletUninit

func (backend *Backend) OnWalletUninit(f func(*btc.Account))

OnWalletUninit installs a callback to be called when a wallet is stopped.

func (*Backend) Rates

func (backend *Backend) Rates() map[string]map[string]float64

Rates return the latest rates.

func (*Backend) Register

func (backend *Backend) Register(theDevice device.Interface) error

Register registers the given device at this backend.

func (*Backend) RegisterKeystore

func (backend *Backend) RegisterKeystore(keystore keystore.Keystore)

RegisterKeystore registers the given keystore at this backend.

func (*Backend) Start

func (backend *Backend) Start() <-chan interface{}

Start starts the background services. It returns a channel of events to handle by the library client.

func (*Backend) Testing

func (backend *Backend) Testing() bool

Testing returns whether this backend is for testing only.

func (*Backend) UserLanguage

func (backend *Backend) UserLanguage() language.Tag

UserLanguage returns the language the UI should be presented in to the user.

func (*Backend) WalletStatus

func (backend *Backend) WalletStatus() string

WalletStatus returns whether the wallets have been initialized.

type WalletEvent

type WalletEvent struct {
	Type string `json:"type"`
	Code string `json:"code"`
	Data string `json:"data"`
}

WalletEvent models an event triggered by a wallet.

Directories

Path Synopsis
coins
btc
btc/blockchain/mocks
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.
btc/electrum/client
Package client implements an Electrum JSON RPC client.
Package client implements an Electrum JSON RPC client.
btc/headers/mocks
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.
btc/maketx
Package maketx provides transaction creation code for wallets.
Package maketx provides transaction creation code for wallets.
ltc
db
devices
bitbox
Package bitbox contains the API to the physical device.
Package bitbox contains the API to the physical device.
bitbox/mocks
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.
usb
mocks
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

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