bch

package
v0.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: BlueOak-1.0.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBackend

func NewBackend(configPath string, logger dex.Logger, network dex.Network) (asset.Backend, error)

NewBackend generates the network parameters and creates a bch backend as a btc clone using an asset/btc helper function.

Types

type BCHBackend

type BCHBackend struct {
	*btc.Backend
}

BCHBackend embeds *btc.Backend and re-implements the Contract method to deal with Cash Address translation.

func (*BCHBackend) Contract

func (bch *BCHBackend) Contract(coinID []byte, redeemScript []byte) (*asset.Contract, error)

Contract returns the output from embedded Backend's Contract method, but with the SwapAddress field converted to Cash Address encoding.

type Driver

type Driver struct{}

Driver implements asset.Driver.

func (*Driver) DecodeCoinID

func (d *Driver) DecodeCoinID(coinID []byte) (string, error)

DecodeCoinID creates a human-readable representation of a coin ID for Bitcoin Cash.

func (*Driver) Setup

func (d *Driver) Setup(configPath string, logger dex.Logger, network dex.Network) (asset.Backend, error)

Setup creates the BCH backend. Start the backend with its Run method.

func (*Driver) Version

func (d *Driver) Version() uint32

Version returns the Backend implementation's version number.

Jump to

Keyboard shortcuts

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