btc

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: ISC Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AddressGapLimit is the number of consecutive unused addresses that
	// will be tracked before the wallet stops searching for new transactions.
	AddressGapLimit uint32 = 20
	// ImportedAccountNumber is the account number used for imported addresses.
	ImportedAccountNumber = waddrmgr.ImportedAddrAccount
	// DefaultAccountNum is the account number used for the default account.
	DefaultAccountNum = waddrmgr.DefaultAccountNum
)
View Source
const (
	// MainnetAPIFeeRateURL defines the URL to fetch the mainnet fee rate from.
	MainnetAPIFeeRateURL = "https://blockstream.info/api/fee-estimates"
	// TestnetAPIFeeRateURL defines the URL to fetch the testnet fee rate from.
	TestnetAPIFeeRateURL = "https://blockstream.info/testnet/api/fee-estimates"

	// FallBackFeeRatePerkvB defines the default fee rate to be used if API source of the
	// current fee rates fails. Fee rate in Sat/kvB => 50,000 Sat/kvB = 50 Sat/vB.
	// This feerate guarrantees relatively low fee cost and extremely fast tx
	// confirmation.
	FallBackFeeRatePerkvB btcutil.Amount = 50 * 1000

	// MinFeeRatePerkvB defines the minimum fee rate a user can set on a tx.
	MinFeeRatePerkvB btcutil.Amount = 1000 // Equals to 1 sat/vB.
)
View Source
const (
	// InvalidSyncStage is the default sync stage.
	InvalidSyncStage = utils.InvalidSyncStage
	// CFiltersFetchSyncStage is the sync stage for fetching cfilters.
	CFiltersFetchSyncStage = utils.CFiltersFetchSyncStage
	// HeadersFetchSyncStage is the sync stage for fetching headers.
	HeadersFetchSyncStage = utils.HeadersFetchSyncStage
	// AddressDiscoverySyncStage is the sync stage for address discovery.
	AddressDiscoverySyncStage = utils.AddressDiscoverySyncStage
	// HeadersRescanSyncStage is the sync stage for headers rescan.
	HeadersRescanSyncStage = utils.HeadersRescanSyncStage
)
View Source
const (

	// TestnetHDPath is the BIP 84 HD path used for deriving addresses on the
	// test network.
	TestnetHDPath = "m / 84' / 1' / "
	// MainnetHDPath is the BIP 84 HD path used for deriving addresses on the
	// main network.
	MainnetHDPath = "m / 84' / 0' / "
)

Variables

This section is empty.

Functions

func AmountBTC

func AmountBTC(amount int64) float64

AmountBTC converts a satoshi amount to a BTC amount.

func AmountSatoshi

func AmountSatoshi(f float64) int64

AmountSatoshi converts a BTC amount to a satoshi amount.

func CreateNewWallet

func CreateNewWallet(pass *sharedW.AuthInfo, params *sharedW.InitParams) (sharedW.Asset, error)

CreateNewWallet creates a new wallet for the BTC asset.

func CreateWatchOnlyWallet

func CreateWatchOnlyWallet(walletName, extendedPublicKey string, params *sharedW.InitParams) (sharedW.Asset, error)

CreateWatchOnlyWallet accepts the wallet name, extended public key and the init parameters to create a watch only wallet for the BTC asset. It validates the network type passed by fetching the chain parameters associated with it for the BTC asset. It then generates the BTC loader interface that is passed to be used upstream while creating the watch only wallet in the shared wallet implementation. Immediately a watch only wallet is created, the function to safely cancel network sync is set. There after returning the watch only wallet's interface.

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func GetScope

func GetScope() waddrmgr.KeyScope

GetScope returns the key scope that will be used within the waddrmgr to create an HD chain for deriving all of our required keys. A different scope is used for each specific coin type.

func LoadExisting

func LoadExisting(w *sharedW.Wallet, params *sharedW.InitParams) (sharedW.Asset, error)

LoadExisting accepts the stored shared wallet information and the init parameters. It validates the network type passed by fetching the chain parameters associated with it for the BTC asset. It then generates the BTC loader interface that is passed to be used upstream while loading the existing the wallet in the shared wallet implemenation. Immediately loading the existing wallet is complete, the function to safely cancel network sync is set. There after returning the loaded wallet's interface.

func RestoreWallet

func RestoreWallet(seedMnemonic string, pass *sharedW.AuthInfo, params *sharedW.InitParams) (sharedW.Asset, error)

RestoreWallet accepts the seed, wallet pass information and the init parameters. It validates the network type passed by fetching the chain parameters associated with it for the BTC asset. It then generates the BTC loader interface that is passed to be used upstream while restoring the wallet in the shared wallet implementation. Immediately wallet restore is complete, the function to safely cancel network sync is set. There after returning the restored wallet's interface.

func UseLogger

func UseLogger(sLogger btclog.Logger)

UseLogger sets the subsystem logs to use the provided loggers.

Types

type AddressInfo

type AddressInfo struct {
	Address       string
	IsMine        bool
	AccountNumber uint32
	AccountName   string
}

AddressInfo holds information about an address. If the address belongs to the querying wallet, IsMine will be true and the AccountNumber and AccountName values will be populated

type Amount

type Amount btcutil.Amount

Amount implements the Asset amount interface for the BTC asset

func (Amount) MulF64

func (a Amount) MulF64(f float64) sharedW.AssetAmount

MulF64 multiplys the Amount with the provided float64 value.

func (Amount) String

func (a Amount) String() string

String returns the string version of the BTC formatted asset amount.

func (Amount) ToCoin

func (a Amount) ToCoin() float64

ToCoin returns the float64 version of the BTC formatted asset amount.

func (Amount) ToInt

func (a Amount) ToInt() int64

ToInt return the original unformatted amount BTCs

type Asset

type Asset struct {
	*sharedW.Wallet

	TxAuthoredInfo *TxAuthor
	// contains filtered or unexported fields
}

Asset is a wrapper around the btcwallet.Wallet struct. It implements the sharedW.Asset interface. It also implements the sharedW.AssetsManagerDB interface. This is done to allow the Asset to be used as a db interface for the AssetsManager.

func (*Asset) AccountName

func (asset *Asset) AccountName(accountNumber int32) (string, error)

AccountName returns the account name for the provided account number.

func (*Asset) AccountNameRaw

func (asset *Asset) AccountNameRaw(accountNumber uint32) (string, error)

AccountNameRaw returns the account name for the provided account number from the internal wallet.

func (*Asset) AccountNumber

func (asset *Asset) AccountNumber(accountName string) (int32, error)

AccountNumber returns the account number for the provided account name.

func (*Asset) AccountOfAddress

func (asset *Asset) AccountOfAddress(address string) (string, error)

AccountOfAddress returns the account name of the provided address.

func (*Asset) AccountXPubMatches

func (asset *Asset) AccountXPubMatches(account uint32, xPub string) (bool, error)

AccountXPubMatches checks if the xpub of the provided account matches the provided xpub.

func (*Asset) AddSendDestination

func (asset *Asset) AddSendDestination(id int, address string, satoshiAmount int64, sendMax bool) error

AddSendDestination adds a destination address to the transaction. The amount to be sent to the address is specified in satoshi. If sendMax is true, the amount is ignored and the maximum amount is sent.

func (*Asset) AddSyncProgressListener

func (asset *Asset) AddSyncProgressListener(syncProgressListener *sharedW.SyncProgressListener, uniqueIdentifier string) error

AddSyncProgressListener registers a sync progress listener to the asset.

func (*Asset) AddTxAndBlockNotificationListener

func (asset *Asset) AddTxAndBlockNotificationListener(txAndBlockNotificationListener *sharedW.TxAndBlockNotificationListener,
	uniqueIdentifier string,
) error

AddTxAndBlockNotificationListener registers a set of functions to be invoked when a transaction or block update is processed by the asset. If async is true, the provided callback methods will be called from separate goroutines, allowing notification senders to continue their operation without waiting for the listener to complete processing the notification. This asyncrhonous handling is especially important for cases where the wallet process that sends the notification temporarily prevents access to other wallet features until all notification handlers finish processing the notification. If a notification handler were to try to access such features, it would result in a deadlock.

func (*Asset) AddressInfo

func (asset *Asset) AddressInfo(address string) (*AddressInfo, error)

AddressInfo returns information about an address.

func (*Asset) AddressPubKey

func (asset *Asset) AddressPubKey(address string) (string, error)

AddressPubKey returns the public key of the provided address.

func (*Asset) Broadcast

func (asset *Asset) Broadcast(privatePassphrase, transactionLabel string) ([]byte, error)

Broadcast broadcasts the transaction to the network.

func (*Asset) CancelRescan

func (asset *Asset) CancelRescan()

CancelRescan cancels the current rescan.

func (*Asset) CancelSync

func (asset *Asset) CancelSync()

CancelSync stops the sync process.

func (*Asset) ComputeTxSizeEstimation

func (asset *Asset) ComputeTxSizeEstimation(dstAddress string, utxos []*sharedW.UnspentOutput) (int, error)

ComputeTxSizeEstimation computes the estimated size of the final raw transaction.

func (*Asset) ConnectedPeers

func (asset *Asset) ConnectedPeers() int32

ConnectedPeers returns the number of connected peers.

func (*Asset) CountTransactions

func (asset *Asset) CountTransactions(txFilter int32) (int, error)

CountTransactions returns the total number of transactions for the wallet.

func (*Asset) CreateNewAccount

func (asset *Asset) CreateNewAccount(accountName, privPass string) (int32, error)

CreateNewAccount creates a new account with the provided account name.

func (*Asset) CurrentAddress

func (asset *Asset) CurrentAddress(account int32) (string, error)

CurrentAddress gets the most recently requested payment address from the asset. If that address has already been used to receive funds, the next chained address is returned.

func (*Asset) DeriveAccountXpub

func (asset *Asset) DeriveAccountXpub(seedMnemonic string, account uint32, params *chaincfg.Params) (xpub string, err error)

DeriveAccountXpub derives the xpub for the given account.

func (*Asset) EstimateFeeAndSize

func (asset *Asset) EstimateFeeAndSize() (*sharedW.TxFeeAndSize, error)

EstimateFeeAndSize estimates the fee and size of the transaction.

func (*Asset) EstimateMaxSendAmount

func (asset *Asset) EstimateMaxSendAmount() (*sharedW.Amount, error)

EstimateMaxSendAmount estimates the maximum amount that can be sent in the transaction.

func (*Asset) GetAPIFeeEstimateRate

func (asset *Asset) GetAPIFeeEstimateRate() (feerates []sharedW.FeeEstimate, err error)

GetAPIFeeEstimateRate returns the fee estimates from the API.

func (*Asset) GetAccount

func (asset *Asset) GetAccount(accountNumber int32) (*sharedW.Account, error)

GetAccount returns the account for the provided account number. If the account does not exist, an error is returned.

func (*Asset) GetAccountBalance

func (asset *Asset) GetAccountBalance(accountNumber int32) (*sharedW.Balance, error)

GetAccountBalance returns the balance for the provided account number.

func (*Asset) GetAccounts

func (asset *Asset) GetAccounts() (string, error)

GetAccounts returns a list of all accounts for the wallet.

func (*Asset) GetAccountsRaw

func (asset *Asset) GetAccountsRaw() (*sharedW.Accounts, error)

GetAccountsRaw returns a list of all accounts for the wallet without marshalling the response.

func (*Asset) GetBestBlock

func (asset *Asset) GetBestBlock() *sharedW.BlockInfo

GetBestBlock returns the best block.

func (*Asset) GetBestBlockHeight

func (asset *Asset) GetBestBlockHeight() int32

GetBestBlockHeight returns the best block height.

func (*Asset) GetBestBlockTimeStamp

func (asset *Asset) GetBestBlockTimeStamp() int64

GetBestBlockTimeStamp returns the best block timestamp.

func (*Asset) GetBlockHash

func (asset *Asset) GetBlockHash(height int64) (*chainhash.Hash, error)

GetBlockHash returns the block hash for the given block height.

func (*Asset) GetBlockHeight

func (asset *Asset) GetBlockHeight(hash chainhash.Hash) (int32, error)

GetBlockHeight returns the block height for the given block hash.

func (*Asset) GetExtendedPubKey

func (asset *Asset) GetExtendedPubKey(account int32) (string, error)

GetExtendedPubKey returns the extended public key of the given account, to do that it calls btcwallet's AccountProperties method, using KeyScopeBIP0084 and the account number. On failure it returns error.

func (*Asset) GetTransactionRaw

func (asset *Asset) GetTransactionRaw(txHash string) (*sharedW.Transaction, error)

GetTransactionRaw returns the transaction details for the given transaction hash.

func (*Asset) GetTransactions

func (asset *Asset) GetTransactions(offset, limit, txFilter int32, newestFirst bool) (string, error)

GetTransactions returns the transactions for the wallet.

func (*Asset) GetTransactionsRaw

func (asset *Asset) GetTransactionsRaw(offset, limit, txFilter int32, newestFirst bool, txHashSearch string) ([]*sharedW.Transaction, error)

GetTransactionsRaw returns the transactions for the wallet. The offset is the height of start block and limit is number of blocks will take from offset to get transactions. it is not the start block and the end block, so we need to get all transactions then return transactions that match the input limit and offset. If offset and limit are 0, it will return all transactions If newestFirst is true, it will return transactions from newest to oldest

func (*Asset) GetUnsignedTx

func (asset *Asset) GetUnsignedTx() *TxAuthor

GetUnsignedTx returns the unsigned transaction.

func (*Asset) GetUserFeeRate

func (asset *Asset) GetUserFeeRate() sharedW.AssetAmount

GetUserFeeRate returns the fee rate in kvB units. If not set it defaults to FallBackFeeRatePerkvB.

func (*Asset) GetWalletBalance added in v1.1.0

func (asset *Asset) GetWalletBalance() (*sharedW.Balance, error)

GetWalletBalance returns the total balance across all accounts.

func (*Asset) HDPathForAccount

func (asset *Asset) HDPathForAccount(accountNumber int32) (string, error)

HDPathForAccount returns the HD path for the provided account number.

func (*Asset) HasAccount

func (asset *Asset) HasAccount(accountName string) bool

HasAccount returns true if there is an account with the provided account name.

func (*Asset) HaveAddress

func (asset *Asset) HaveAddress(address string) bool

HaveAddress checks if the provided address belongs to the wallet.

func (*Asset) IsAddressValid

func (asset *Asset) IsAddressValid(address string) bool

IsAddressValid checks if the provided address is valid.

func (*Asset) IsConnectedToBitcoinNetwork

func (asset *Asset) IsConnectedToBitcoinNetwork() bool

IsConnectedToBitcoinNetwork returns true if the wallet is connected to the bitcoin network.

func (*Asset) IsConnectedToNetwork

func (asset *Asset) IsConnectedToNetwork() bool

IsConnectedToNetwork returns true if the wallet is connected to the network.

func (*Asset) IsRescanning

func (asset *Asset) IsRescanning() bool

IsRescanning returns true if the wallet is currently rescanning the blockchain.

func (*Asset) IsSyncShuttingDown

func (asset *Asset) IsSyncShuttingDown() bool

IsSyncShuttingDown returns true if the wallet is shutting down.

func (*Asset) IsSynced

func (asset *Asset) IsSynced() bool

IsSynced returns true if the wallet is synced.

func (*Asset) IsSyncing

func (asset *Asset) IsSyncing() bool

IsSyncing returns true if the wallet is syncing.

func (*Asset) IsUnsignedTxExist

func (asset *Asset) IsUnsignedTxExist() bool

IsUnsignedTxExist returns true if an unsigned transaction exists.

func (*Asset) IsWaiting

func (asset *Asset) IsWaiting() bool

IsWaiting returns true if the wallet is waiting for headers.

func (*Asset) NeutrinoClient added in v1.1.0

func (asset *Asset) NeutrinoClient() *chain.NeutrinoClient

func (*Asset) NewUnsignedTx

func (asset *Asset) NewUnsignedTx(sourceAccountNumber int32, utxos []*sharedW.UnspentOutput) error

NewUnsignedTx creates a new unsigned transaction.

func (*Asset) NextAccount

func (asset *Asset) NextAccount(accountName string) (int32, error)

NextAccount returns the next account number for the provided account name.

func (*Asset) NextAddress

func (asset *Asset) NextAddress(account int32) (string, error)

NextAddress returns the address immediately following the last requested payment address. If that address has already been used to receive funds, the next chained address is returned.

func (*Asset) PublishUnminedTransactions

func (asset *Asset) PublishUnminedTransactions() error

PublishUnminedTransactions publishes all unmined transactions to the network.

func (*Asset) RemoveChangeDestination

func (asset *Asset) RemoveChangeDestination()

RemoveChangeDestination removes the change address from the transaction.

func (*Asset) RemovePeers

func (asset *Asset) RemovePeers()

RemovePeers removes all peers from the wallet.

func (*Asset) RemoveSendDestination

func (asset *Asset) RemoveSendDestination(id int)

RemoveSendDestination removes a destination address from the transaction.

func (*Asset) RemoveSyncProgressListener

func (asset *Asset) RemoveSyncProgressListener(uniqueIdentifier string)

RemoveSyncProgressListener unregisters a sync progress listener from the asset.

func (*Asset) RemoveTxAndBlockNotificationListener

func (asset *Asset) RemoveTxAndBlockNotificationListener(uniqueIdentifier string)

RemoveTxAndBlockNotificationListener removes a previously registered transaction and block notification listener.

func (*Asset) RenameAccount

func (asset *Asset) RenameAccount(accountNumber int32, newName string) error

RenameAccount renames the account with the provided account number.

func (*Asset) RescanBlocks

func (asset *Asset) RescanBlocks() error

RescanBlocks rescans the blockchain for all addresses in the wallet.

func (*Asset) RescanBlocksFromHeight

func (asset *Asset) RescanBlocksFromHeight(startHeight int32) error

RescanBlocksFromHeight rescans the blockchain for all addresses in the wallet starting from the provided block height.

func (*Asset) SafelyCancelSync

func (asset *Asset) SafelyCancelSync()

SafelyCancelSync shuts down all the upstream processes. If not explicitly deleting a wallet use asset.CancelSync() instead.

func (*Asset) SendDestination

func (asset *Asset) SendDestination(id int) *sharedW.TransactionDestination

SendDestination returns a list of all destination addresses added to the transaction.

func (*Asset) SetBlocksRescanProgressListener

func (asset *Asset) SetBlocksRescanProgressListener(blocksRescanProgressListener *sharedW.BlocksRescanProgressListener)

SetBlocksRescanProgressListener sets the blocks rescan progress listener.

func (*Asset) SetChangeDestination

func (asset *Asset) SetChangeDestination(address string)

SetChangeDestination sets the change address for the transaction.

func (*Asset) SetSpecificPeer

func (asset *Asset) SetSpecificPeer(addresses string)

SetSpecificPeer sets a specific peer or list of peer to connect to.

func (*Asset) SetUserFeeRate

func (asset *Asset) SetUserFeeRate(feeRatePerkvB sharedW.AssetAmount) error

SetUserFeeRate sets the fee rate in kvB units. Setting fee rate less than MinFeeRatePerkvB is not allowed.

func (*Asset) SignMessage

func (asset *Asset) SignMessage(passphrase, address, message string) ([]byte, error)

SignMessage signs a message with the private key associated with an address.

func (*Asset) SpendableForAccount

func (asset *Asset) SpendableForAccount(account int32) (int64, error)

SpendableForAccount returns the spendable balance for the provided account

func (*Asset) SpvSync

func (asset *Asset) SpvSync() (err error)

SpvSync initiates the full chain sync starting protocols. It attempts to restart the chain service if it hasn't been initialized.

func (*Asset) ToAmount

func (asset *Asset) ToAmount(v int64) sharedW.AssetAmount

ToAmount returns a BTC amount that implements the asset amount interface.

func (*Asset) TotalSendAmount

func (asset *Asset) TotalSendAmount() *sharedW.Amount

TotalSendAmount returns the total amount to be sent in the transaction.

func (*Asset) TxMatchesFilter

func (asset *Asset) TxMatchesFilter(_ *sharedW.Transaction, txFilter int32) bool

TxMatchesFilter checks if the transaction matches the given filter.

func (*Asset) UnspentOutputs

func (asset *Asset) UnspentOutputs(account int32) ([]*sharedW.UnspentOutput, error)

UnspentOutputs returns all the unspent outputs available for the provided account index.

func (*Asset) UpdateSendDestination added in v1.1.0

func (asset *Asset) UpdateSendDestination(id int, address string, atomAmount int64, sendMax bool) error

func (*Asset) VerifyMessage

func (asset *Asset) VerifyMessage(address, message, signatureBase64 string) (bool, error)

VerifyMessage verifies a signed message.

type DEXWallet added in v1.1.0

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

DEXWallet wraps *wallet.Wallet and implements dexbtc.BTCWallet.

func NewDEXWallet added in v1.1.0

func NewDEXWallet(w *wallet.Wallet, acctNum int32, nc *chain.NeutrinoClient) *DEXWallet

NewDEXWallet returns a new *DEXWallet.

func (*DEXWallet) AccountInfo added in v1.1.0

func (dw *DEXWallet) AccountInfo() dexbtc.XCWalletAccount

AccountInfo returns the account information of the wallet for use by the exchange wallet.

func (*DEXWallet) AccountProperties added in v1.1.0

func (dw *DEXWallet) AccountProperties(scope waddrmgr.KeyScope, acct uint32) (*waddrmgr.AccountProperties, error)

func (*DEXWallet) AddPeer added in v1.1.0

func (dw *DEXWallet) AddPeer(_ string) error

func (*DEXWallet) Birthday added in v1.1.0

func (dw *DEXWallet) Birthday() time.Time

func (*DEXWallet) BlockNotifications added in v1.1.0

func (dw *DEXWallet) BlockNotifications(ctx context.Context) <-chan *dexbtc.BlockNotification

func (*DEXWallet) CalculateAccountBalances added in v1.1.0

func (dw *DEXWallet) CalculateAccountBalances(account uint32, confirms int32) (wallet.Balances, error)

func (*DEXWallet) ChainSynced added in v1.1.0

func (dw *DEXWallet) ChainSynced() bool

currently unused

func (*DEXWallet) FetchInputInfo added in v1.1.0

func (dw *DEXWallet) FetchInputInfo(prevOut *wire.OutPoint) (*wire.MsgTx, *wire.TxOut, *psbt.Bip32Derivation, int64, error)

func (*DEXWallet) ForceRescan added in v1.1.0

func (dw *DEXWallet) ForceRescan()

func (*DEXWallet) HaveAddress added in v1.1.0

func (dw *DEXWallet) HaveAddress(a btcutil.Address) (bool, error)

func (*DEXWallet) ListSinceBlock added in v1.1.0

func (dw *DEXWallet) ListSinceBlock(start, end, syncHeight int32) ([]btcjson.ListTransactionsResult, error)

func (*DEXWallet) ListUnspent added in v1.1.0

func (dw *DEXWallet) ListUnspent(minconf, maxconf int32, acctName string) ([]*btcjson.ListUnspentResult, error)

func (*DEXWallet) Lock added in v1.1.0

func (dw *DEXWallet) Lock()

func (*DEXWallet) LockOutpoint added in v1.1.0

func (dw *DEXWallet) LockOutpoint(op wire.OutPoint)

func (*DEXWallet) Locked added in v1.1.0

func (dw *DEXWallet) Locked() bool

func (*DEXWallet) LockedOutpoints added in v1.1.0

func (dw *DEXWallet) LockedOutpoints() []btcjson.TransactionInput

func (*DEXWallet) NewAddress added in v1.1.0

func (dw *DEXWallet) NewAddress(account uint32, scope waddrmgr.KeyScope) (btcutil.Address, error)

func (*DEXWallet) NewChangeAddress added in v1.1.0

func (dw *DEXWallet) NewChangeAddress(account uint32, scope waddrmgr.KeyScope) (btcutil.Address, error)

func (*DEXWallet) Peers added in v1.1.0

func (dw *DEXWallet) Peers() ([]*asset.WalletPeer, error)

func (*DEXWallet) PrivKeyForAddress added in v1.1.0

func (dw *DEXWallet) PrivKeyForAddress(a btcutil.Address) (*btcec.PrivateKey, error)

func (*DEXWallet) PublishTransaction added in v1.1.0

func (dw *DEXWallet) PublishTransaction(tx *wire.MsgTx, label string) error

func (*DEXWallet) Reconfigure added in v1.1.0

func (dw *DEXWallet) Reconfigure(*asset.WalletConfig, string) (bool, error)

func (*DEXWallet) RemovePeer added in v1.1.0

func (dw *DEXWallet) RemovePeer(_ string) error

func (*DEXWallet) RescanAsync added in v1.1.0

func (dw *DEXWallet) RescanAsync() error

func (*DEXWallet) ResetLockedOutpoints added in v1.1.0

func (dw *DEXWallet) ResetLockedOutpoints()

func (*DEXWallet) SendOutputs added in v1.1.0

func (dw *DEXWallet) SendOutputs(outputs []*wire.TxOut, keyScope *waddrmgr.KeyScope, account uint32, minconf int32,
	satPerKb btcutil.Amount, coinSelectionStrategy wallet.CoinSelectionStrategy, label string) (*wire.MsgTx, error)

func (*DEXWallet) SignTx added in v1.1.0

func (dw *DEXWallet) SignTx(tx *wire.MsgTx) error

func (*DEXWallet) Start added in v1.1.0

func (dw *DEXWallet) Start() (dexbtc.SPVService, error)

func (*DEXWallet) Stop added in v1.1.0

func (dw *DEXWallet) Stop()

func (*DEXWallet) SyncedTo added in v1.1.0

func (dw *DEXWallet) SyncedTo() waddrmgr.BlockStamp

func (*DEXWallet) Unlock added in v1.1.0

func (dw *DEXWallet) Unlock(passphrase []byte, lock <-chan time.Time) error

func (*DEXWallet) UnlockOutpoint added in v1.1.0

func (dw *DEXWallet) UnlockOutpoint(op wire.OutPoint)

func (*DEXWallet) WaitForShutdown added in v1.1.0

func (dw *DEXWallet) WaitForShutdown()

func (*DEXWallet) WalletTransaction added in v1.1.0

func (dw *DEXWallet) WalletTransaction(txHash *chainhash.Hash) (*wtxmgr.TxDetails, error)

type SyncData

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

SyncData holds the data required to sync the wallet.

type TxAuthor

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

TxAuthor holds the information required to construct a transaction that spends froma wallet's account.

Jump to

Keyboard shortcuts

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