zec

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: BlueOak-1.0.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BipID = 133
)

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 zec backend as a btc clone using an asset/btc helper function.

Types

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 Zcash.

func (*Driver) Setup

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

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

func (*Driver) UnitInfo

func (d *Driver) UnitInfo() dex.UnitInfo

UnitInfo returns the dex.UnitInfo for the asset.

func (*Driver) Version

func (d *Driver) Version() uint32

Version returns the Backend implementation's version number.

type ZECBackend

type ZECBackend struct {
	*btc.Backend
	// contains filtered or unexported fields
}

ZECBackend embeds *btc.Backend and re-implements the Contract method to deal with Zcash address translation.

func (*ZECBackend) Contract

func (be *ZECBackend) 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 Zcash encoding. TODO: Drop this in favor of an AddressEncoder field in the BackendCloneConfig.

func (*ZECBackend) FeeRate added in v0.6.1

func (be *ZECBackend) FeeRate(context.Context) (uint64, error)

For Zcash, return a constant fee rate of 10 zats / byte. We just need to guarantee the tx gets over the legacy 0.00001 standard tx fee.

Jump to

Keyboard shortcuts

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