Documentation ¶
Index ¶
- Constants
- Variables
- func NewWallet(cfg *asset.WalletConfig, logger dex.Logger, network dex.Network) (asset.Wallet, error)
- func RegisterCustomSPVWallet(constructor btc.CustomSPVWalletConstructor, def *asset.WalletDefinition)
- type Driver
- func (d *Driver) Create(params *asset.CreateWalletParams) error
- func (d *Driver) DecodeCoinID(coinID []byte) (string, error)
- func (d *Driver) Exists(walletType, dataDir string, settings map[string]string, net dex.Network) (bool, error)
- func (d *Driver) Info() *asset.WalletInfo
- func (d *Driver) MinLotSize(maxFeeRate uint64) uint64
- func (d *Driver) Open(cfg *asset.WalletConfig, logger dex.Logger, network dex.Network) (asset.Wallet, error)
Constants ¶
const (
// BipID is the BIP-0044 asset ID.
BipID = 2
)
const (
DefaultM uint64 = 784931 // From ltcutil. Used for gcs filters.
)
Variables ¶
var ( NetPorts = dexbtc.NetPorts{ Mainnet: "9332", Testnet: "19332", Simnet: "19443", } // WalletInfo defines some general information about a Litecoin wallet. WalletInfo = &asset.WalletInfo{ Name: "Litecoin", SupportedVersions: []uint32{version}, UnitInfo: dexltc.UnitInfo, AvailableWallets: []*asset.WalletDefinition{ spvWalletDefinition, rpcWalletDefinition, electrumWalletDefinition, }, } )
Functions ¶
func NewWallet ¶
func NewWallet(cfg *asset.WalletConfig, logger dex.Logger, network dex.Network) (asset.Wallet, error)
NewWallet is the exported constructor by which the DEX will import the exchange wallet.
func RegisterCustomSPVWallet ¶ added in v1.0.0
func RegisterCustomSPVWallet(constructor btc.CustomSPVWalletConstructor, def *asset.WalletDefinition)
RegisterCustomSPVWallet registers a function that should be used in creating a btc.BTCWallet implementation that the ExchangeWalletSPV will use in place of the default spv wallet implementation. External consumers can use this function to provide alternative btc.BTCWallet implementations, and must do so before attempting to create an ExchangeWalletSPV instance of this type. It'll panic if callers try to register a wallet twice.
Types ¶
type Driver ¶
type Driver struct{}
Driver implements asset.Driver.
func (*Driver) Create ¶ added in v0.6.0
func (d *Driver) Create(params *asset.CreateWalletParams) error
Create creates a new SPV wallet.
func (*Driver) DecodeCoinID ¶
DecodeCoinID creates a human-readable representation of a coin ID for Litecoin.
func (*Driver) Exists ¶ added in v0.6.0
func (d *Driver) Exists(walletType, dataDir string, settings map[string]string, net dex.Network) (bool, error)
Exists checks the existence of the wallet. Part of the Creator interface, so only used for wallets with WalletDefinition.Seeded = true.
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
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.