zec

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: BlueOak-1.0.0 Imports: 33 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FullPrivacy                  privacyPolicy = "FullPrivacy"
	AllowRevealedRecipients      privacyPolicy = "AllowRevealedRecipients"
	AllowRevealedAmounts         privacyPolicy = "AllowRevealedAmounts"
	AllowRevealedSenders         privacyPolicy = "AllowRevealedSenders"
	AllowLinkingAccountAddresses privacyPolicy = "AllowLinkingAccountAddresses"
	NoPrivacy                    privacyPolicy = "NoPrivacy"
)
View Source
const (
	BipID = 133
)
View Source
const ErrEmptyOpResults = dex.ErrorKind("no z_getoperationstatus results")

ErrEmptyOpResults is returned when z_getoperationresult returns an empty array for the specified operation ID. This appears to be normal in some or all cases when the result is not yet ready.

Variables

View Source
var (

	// WalletInfo defines some general information about a Zcash wallet.
	WalletInfo = &asset.WalletInfo{
		Name:              "Zcash",
		SupportedVersions: []uint32{version},
		UnitInfo:          dexzec.UnitInfo,
		AvailableWallets: []*asset.WalletDefinition{{
			Type:              walletTypeRPC,
			Tab:               "External",
			Description:       "Connect to zcashd",
			DefaultConfigPath: dexbtc.SystemConfigPath("zcash"),
			ConfigOpts:        configOpts,
			NoAuth:            true,
		}},
	}
)

Functions

func NewWallet

func NewWallet(cfg *asset.WalletConfig, logger dex.Logger, net dex.Network) (asset.Wallet, error)

NewWallet is the exported constructor by which the DEX will import the exchange wallet. The wallet will shut down when the provided context is canceled. The configPath can be an empty string, in which case the standard system location of the zcashd config file is assumed.

func UnwrapErr added in v1.0.0

func UnwrapErr(err error) error

UnwrapErr returns the result of calling the Unwrap method on err, until it returns a non-wrapped error.

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) Info

func (d *Driver) Info() *asset.WalletInfo

Info returns basic information about the wallet and asset.

func (*Driver) MinLotSize added in v1.0.0

func (d *Driver) MinLotSize(maxFeeRate uint64) uint64

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.

func (*Driver) Open

func (d *Driver) Open(cfg *asset.WalletConfig, logger dex.Logger, network dex.Network) (asset.Wallet, error)

Open creates the ZEC exchange wallet. Start the wallet with its Run method.

type Error added in v1.0.0

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

Error is an error code and a wrapped error.

func (*Error) Code added in v1.0.0

func (e *Error) Code() *int

Code returns the error code.

func (*Error) Error added in v1.0.0

func (e *Error) Error() string

Error returns the error string. Satisfies the error interface.

func (*Error) Unwrap added in v1.0.0

func (e *Error) Unwrap() error

Unwrap returns the underlying wrapped error.

type GetTransactionResult added in v1.0.0

type GetTransactionResult struct {
	Confirmations int64  `json:"confirmations"`
	BlockHash     string `json:"blockhash"`
	// BlockIndex    int64  `json:"blockindex"` // unused, consider commenting
	BlockTime    uint64    `json:"blocktime"`
	TxID         string    `json:"txid"`
	Time         uint64    `json:"time"`
	TimeReceived uint64    `json:"timereceived"`
	Bytes        dex.Bytes `json:"hex"`
}

type WalletConfig added in v1.0.0

type WalletConfig struct {
	UseSplitTx       bool   `ini:"txsplit"`
	RedeemConfTarget uint64 `ini:"redeemconftarget"`
	ActivelyUsed     bool   `ini:"special_activelyUsed"` // injected by core
}

WalletConfig are wallet-level configuration settings.

Jump to

Keyboard shortcuts

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