Documentation ¶
Index ¶
- Constants
- func NewBackend(cfg *asset.BackendConfig) (asset.Backend, error)
- type Driver
- func (d *Driver) DecodeCoinID(coinID []byte) (string, error)
- func (d *Driver) MinBondSize(maxFeeRate uint64) uint64
- func (d *Driver) MinLotSize(maxFeeRate uint64) uint64
- func (d *Driver) Name() string
- func (d *Driver) Setup(cfg *asset.BackendConfig) (asset.Backend, error)
- func (d *Driver) UnitInfo() dex.UnitInfo
- func (d *Driver) Version() uint32
- type ZECBackend
- func (be *ZECBackend) Contract(coinID []byte, redeemScript []byte) (*asset.Contract, error)
- func (be *ZECBackend) FeeRate(context.Context) (uint64, error)
- func (be *ZECBackend) ValidateFeeRate(ci asset.Coin, _ uint64) bool
- func (*ZECBackend) ValidateOrderFunding(swapVal, valSum, inputCount, inputsSize, maxSwaps uint64, _ *dex.Asset) bool
Constants ¶
const (
BipID = 133
)
Variables ¶
This section is empty.
Functions ¶
func NewBackend ¶
func NewBackend(cfg *asset.BackendConfig) (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 ¶
DecodeCoinID creates a human-readable representation of a coin ID for Zcash.
func (*Driver) MinBondSize ¶ added in v1.0.0
MinBondSize calculates the minimum bond size for a given fee rate that avoids dust outputs on the bond and refund txs, assuming the maxFeeRate doesn't change.
func (*Driver) MinLotSize ¶ added in v1.0.0
MinLotSize calculates the minimum bond size for a given fee rate that avoids dust outputs on the swap and refund txs, assuming the maxFeeRate doesn't change.
type ZECBackend ¶
ZECBackend embeds *btc.Backend and re-implements the Contract method to deal with Zcash address translation.
func (*ZECBackend) Contract ¶
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 get over the legacy 0.00001 standard tx fee.
func (*ZECBackend) ValidateFeeRate ¶ added in v1.0.0
func (be *ZECBackend) ValidateFeeRate(ci asset.Coin, _ uint64) bool
func (*ZECBackend) ValidateOrderFunding ¶ added in v1.0.0
func (*ZECBackend) ValidateOrderFunding(swapVal, valSum, inputCount, inputsSize, maxSwaps uint64, _ *dex.Asset) bool