Documentation ¶
Index ¶
- Constants
- func AmountBTC(amount int64) float64
- func AmountSatoshi(f float64) int64
- func CreateNewWallet(pass *sharedW.AuthInfo, params *sharedW.InitParams) (sharedW.Asset, error)
- func CreateWatchOnlyWallet(walletName, extendedPublicKey string, params *sharedW.InitParams) (sharedW.Asset, error)
- func DisableLog()
- func GetScope() waddrmgr.KeyScope
- func LoadExisting(w *sharedW.Wallet, params *sharedW.InitParams) (sharedW.Asset, error)
- func RestoreWallet(seedMnemonic string, pass *sharedW.AuthInfo, params *sharedW.InitParams) (sharedW.Asset, error)
- func UseLogger(sLogger btclog.Logger)
- type AddressInfo
- type Amount
- type Asset
- func (asset *Asset) AccountName(accountNumber int32) (string, error)
- func (asset *Asset) AccountNameRaw(accountNumber uint32) (string, error)
- func (asset *Asset) AccountNumber(accountName string) (int32, error)
- func (asset *Asset) AccountOfAddress(address string) (string, error)
- func (asset *Asset) AccountXPubMatches(account uint32, xPub string) (bool, error)
- func (asset *Asset) AddSendDestination(id int, address string, satoshiAmount int64, sendMax bool) error
- func (asset *Asset) AddSyncProgressListener(syncProgressListener *sharedW.SyncProgressListener, uniqueIdentifier string) error
- func (asset *Asset) AddTxAndBlockNotificationListener(txAndBlockNotificationListener *sharedW.TxAndBlockNotificationListener, ...) error
- func (asset *Asset) AddressInfo(address string) (*AddressInfo, error)
- func (asset *Asset) AddressPubKey(address string) (string, error)
- func (asset *Asset) Broadcast(privatePassphrase, transactionLabel string) ([]byte, error)
- func (asset *Asset) CancelRescan()
- func (asset *Asset) CancelSync()
- func (asset *Asset) ComputeTxSizeEstimation(dstAddress string, utxos []*sharedW.UnspentOutput) (int, error)
- func (asset *Asset) ConnectedPeers() int32
- func (asset *Asset) CountTransactions(txFilter int32) (int, error)
- func (asset *Asset) CreateNewAccount(accountName, privPass string) (int32, error)
- func (asset *Asset) CurrentAddress(account int32) (string, error)
- func (asset *Asset) DeriveAccountXpub(seedMnemonic string, account uint32, params *chaincfg.Params) (xpub string, err error)
- func (asset *Asset) EstimateFeeAndSize() (*sharedW.TxFeeAndSize, error)
- func (asset *Asset) EstimateMaxSendAmount() (*sharedW.Amount, error)
- func (asset *Asset) GetAPIFeeEstimateRate() (feerates []sharedW.FeeEstimate, err error)
- func (asset *Asset) GetAccount(accountNumber int32) (*sharedW.Account, error)
- func (asset *Asset) GetAccountBalance(accountNumber int32) (*sharedW.Balance, error)
- func (asset *Asset) GetAccounts() (string, error)
- func (asset *Asset) GetAccountsRaw() (*sharedW.Accounts, error)
- func (asset *Asset) GetBestBlock() *sharedW.BlockInfo
- func (asset *Asset) GetBestBlockHeight() int32
- func (asset *Asset) GetBestBlockTimeStamp() int64
- func (asset *Asset) GetBlockHash(height int64) (*chainhash.Hash, error)
- func (asset *Asset) GetBlockHeight(hash chainhash.Hash) (int32, error)
- func (asset *Asset) GetExtendedPubKey(account int32) (string, error)
- func (asset *Asset) GetTransactionRaw(txHash string) (*sharedW.Transaction, error)
- func (asset *Asset) GetTransactions(offset, limit, txFilter int32, newestFirst bool) (string, error)
- func (asset *Asset) GetTransactionsRaw(offset, limit, txFilter int32, newestFirst bool, txHashSearch string) ([]*sharedW.Transaction, error)
- func (asset *Asset) GetUnsignedTx() *TxAuthor
- func (asset *Asset) GetUserFeeRate() sharedW.AssetAmount
- func (asset *Asset) GetWalletBalance() (*sharedW.Balance, error)
- func (asset *Asset) HDPathForAccount(accountNumber int32) (string, error)
- func (asset *Asset) HasAccount(accountName string) bool
- func (asset *Asset) HaveAddress(address string) bool
- func (asset *Asset) IsAddressValid(address string) bool
- func (asset *Asset) IsConnectedToBitcoinNetwork() bool
- func (asset *Asset) IsConnectedToNetwork() bool
- func (asset *Asset) IsRescanning() bool
- func (asset *Asset) IsSyncShuttingDown() bool
- func (asset *Asset) IsSynced() bool
- func (asset *Asset) IsSyncing() bool
- func (asset *Asset) IsUnsignedTxExist() bool
- func (asset *Asset) IsWaiting() bool
- func (asset *Asset) NeutrinoClient() *chain.NeutrinoClient
- func (asset *Asset) NewUnsignedTx(sourceAccountNumber int32, utxos []*sharedW.UnspentOutput) error
- func (asset *Asset) NextAccount(accountName string) (int32, error)
- func (asset *Asset) NextAddress(account int32) (string, error)
- func (asset *Asset) PublishUnminedTransactions() error
- func (asset *Asset) RemoveChangeDestination()
- func (asset *Asset) RemovePeers()
- func (asset *Asset) RemoveSendDestination(id int)
- func (asset *Asset) RemoveSyncProgressListener(uniqueIdentifier string)
- func (asset *Asset) RemoveTxAndBlockNotificationListener(uniqueIdentifier string)
- func (asset *Asset) RenameAccount(accountNumber int32, newName string) error
- func (asset *Asset) RescanBlocks() error
- func (asset *Asset) RescanBlocksFromHeight(startHeight int32) error
- func (asset *Asset) SafelyCancelSync()
- func (asset *Asset) SendDestination(id int) *sharedW.TransactionDestination
- func (asset *Asset) SetBlocksRescanProgressListener(blocksRescanProgressListener *sharedW.BlocksRescanProgressListener)
- func (asset *Asset) SetChangeDestination(address string)
- func (asset *Asset) SetSpecificPeer(addresses string)
- func (asset *Asset) SetUserFeeRate(feeRatePerkvB sharedW.AssetAmount) error
- func (asset *Asset) SignMessage(passphrase, address, message string) ([]byte, error)
- func (asset *Asset) SpendableForAccount(account int32) (int64, error)
- func (asset *Asset) SpvSync() (err error)
- func (asset *Asset) ToAmount(v int64) sharedW.AssetAmount
- func (asset *Asset) TotalSendAmount() *sharedW.Amount
- func (asset *Asset) TxMatchesFilter(_ *sharedW.Transaction, txFilter int32) bool
- func (asset *Asset) UnspentOutputs(account int32) ([]*sharedW.UnspentOutput, error)
- func (asset *Asset) UpdateSendDestination(id int, address string, atomAmount int64, sendMax bool) error
- func (asset *Asset) VerifyMessage(address, message, signatureBase64 string) (bool, error)
- type DEXWallet
- func (dw *DEXWallet) AccountInfo() dexbtc.XCWalletAccount
- func (dw *DEXWallet) AccountProperties(scope waddrmgr.KeyScope, acct uint32) (*waddrmgr.AccountProperties, error)
- func (dw *DEXWallet) AddPeer(_ string) error
- func (dw *DEXWallet) Birthday() time.Time
- func (dw *DEXWallet) BlockNotifications(ctx context.Context) <-chan *dexbtc.BlockNotification
- func (dw *DEXWallet) CalculateAccountBalances(account uint32, confirms int32) (wallet.Balances, error)
- func (dw *DEXWallet) ChainSynced() bool
- func (dw *DEXWallet) FetchInputInfo(prevOut *wire.OutPoint) (*wire.MsgTx, *wire.TxOut, *psbt.Bip32Derivation, int64, error)
- func (dw *DEXWallet) ForceRescan()
- func (dw *DEXWallet) HaveAddress(a btcutil.Address) (bool, error)
- func (dw *DEXWallet) ListSinceBlock(start, end, syncHeight int32) ([]btcjson.ListTransactionsResult, error)
- func (dw *DEXWallet) ListUnspent(minconf, maxconf int32, acctName string) ([]*btcjson.ListUnspentResult, error)
- func (dw *DEXWallet) Lock()
- func (dw *DEXWallet) LockOutpoint(op wire.OutPoint)
- func (dw *DEXWallet) Locked() bool
- func (dw *DEXWallet) LockedOutpoints() []btcjson.TransactionInput
- func (dw *DEXWallet) NewAddress(account uint32, scope waddrmgr.KeyScope) (btcutil.Address, error)
- func (dw *DEXWallet) NewChangeAddress(account uint32, scope waddrmgr.KeyScope) (btcutil.Address, error)
- func (dw *DEXWallet) Peers() ([]*asset.WalletPeer, error)
- func (dw *DEXWallet) PrivKeyForAddress(a btcutil.Address) (*btcec.PrivateKey, error)
- func (dw *DEXWallet) PublishTransaction(tx *wire.MsgTx, label string) error
- func (dw *DEXWallet) Reconfigure(*asset.WalletConfig, string) (bool, error)
- func (dw *DEXWallet) RemovePeer(_ string) error
- func (dw *DEXWallet) RescanAsync() error
- func (dw *DEXWallet) ResetLockedOutpoints()
- func (dw *DEXWallet) SendOutputs(outputs []*wire.TxOut, keyScope *waddrmgr.KeyScope, account uint32, ...) (*wire.MsgTx, error)
- func (dw *DEXWallet) SignTx(tx *wire.MsgTx) error
- func (dw *DEXWallet) Start() (dexbtc.SPVService, error)
- func (dw *DEXWallet) Stop()
- func (dw *DEXWallet) SyncedTo() waddrmgr.BlockStamp
- func (dw *DEXWallet) Unlock(passphrase []byte, lock <-chan time.Time) error
- func (dw *DEXWallet) UnlockOutpoint(op wire.OutPoint)
- func (dw *DEXWallet) WaitForShutdown()
- func (dw *DEXWallet) WalletTransaction(txHash *chainhash.Hash) (*wtxmgr.TxDetails, error)
- type SyncData
- type TxAuthor
Constants ¶
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 )
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. )
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 )
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 AmountSatoshi ¶
AmountSatoshi converts a BTC amount to a satoshi amount.
func CreateNewWallet ¶
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 ¶
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 ¶
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 implementation. 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.
Types ¶
type AddressInfo ¶
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 ¶
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.
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 ¶
AccountName returns the account name for the provided account number.
func (*Asset) AccountNameRaw ¶
AccountNameRaw returns the account name for the provided account number from the internal wallet.
func (*Asset) AccountNumber ¶
AccountNumber returns the account number for the provided account name.
func (*Asset) AccountOfAddress ¶
AccountOfAddress returns the account name of the provided address.
func (*Asset) AccountXPubMatches ¶
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 ¶
AddressPubKey returns the public key of the provided address.
func (*Asset) CancelRescan ¶
func (asset *Asset) CancelRescan()
CancelRescan cancels the current rescan.
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 ¶
ConnectedPeers returns the number of connected peers.
func (*Asset) CountTransactions ¶
CountTransactions returns the total number of transactions for the wallet.
func (*Asset) CreateNewAccount ¶
CreateNewAccount creates a new account with the provided account name.
func (*Asset) CurrentAddress ¶
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 ¶
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 ¶
GetAccount returns the account for the provided account number. If the account does not exist, an error is returned.
func (*Asset) GetAccountBalance ¶
GetAccountBalance returns the balance for the provided account number.
func (*Asset) GetAccounts ¶
GetAccounts returns a list of all accounts for the wallet.
func (*Asset) GetAccountsRaw ¶
GetAccountsRaw returns a list of all accounts for the wallet without marshalling the response.
func (*Asset) GetBestBlock ¶
GetBestBlock returns the best block.
func (*Asset) GetBestBlockHeight ¶
GetBestBlockHeight returns the best block height.
func (*Asset) GetBestBlockTimeStamp ¶
GetBestBlockTimeStamp returns the best block timestamp.
func (*Asset) GetBlockHash ¶
GetBlockHash returns the block hash for the given block height.
func (*Asset) GetBlockHeight ¶
GetBlockHeight returns the block height for the given block hash.
func (*Asset) GetExtendedPubKey ¶
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 ¶
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
GetWalletBalance returns the total balance across all accounts.
func (*Asset) HDPathForAccount ¶
HDPathForAccount returns the HD path for the provided account number.
func (*Asset) HasAccount ¶
HasAccount returns true if there is an account with the provided account name.
func (*Asset) HaveAddress ¶
HaveAddress checks if the provided address belongs to the wallet.
func (*Asset) IsAddressValid ¶
IsAddressValid checks if the provided address is valid.
func (*Asset) IsConnectedToBitcoinNetwork ¶
IsConnectedToBitcoinNetwork returns true if the wallet is connected to the bitcoin network.
func (*Asset) IsConnectedToNetwork ¶
IsConnectedToNetwork returns true if the wallet is connected to the network.
func (*Asset) IsRescanning ¶
IsRescanning returns true if the wallet is currently rescanning the blockchain.
func (*Asset) IsSyncShuttingDown ¶
IsSyncShuttingDown returns true if the wallet is shutting down.
func (*Asset) IsUnsignedTxExist ¶
IsUnsignedTxExist returns true if an unsigned transaction exists.
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 ¶
NextAccount returns the next account number for the provided account name.
func (*Asset) NextAddress ¶
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 ¶
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 ¶
RemoveSendDestination removes a destination address from the transaction.
func (*Asset) RemoveSyncProgressListener ¶
RemoveSyncProgressListener unregisters a sync progress listener from the asset.
func (*Asset) RemoveTxAndBlockNotificationListener ¶
RemoveTxAndBlockNotificationListener removes a previously registered transaction and block notification listener.
func (*Asset) RenameAccount ¶
RenameAccount renames the account with the provided account number.
func (*Asset) RescanBlocks ¶
RescanBlocks rescans the blockchain for all addresses in the wallet.
func (*Asset) RescanBlocksFromHeight ¶
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 ¶
SetChangeDestination sets the change address for the transaction.
func (*Asset) SetSpecificPeer ¶
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 ¶
SignMessage signs a message with the private key associated with an address.
func (*Asset) SpendableForAccount ¶
SpendableForAccount returns the spendable balance for the provided account
func (*Asset) SpvSync ¶
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 ¶
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
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
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 (*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 (*DEXWallet) ChainSynced ¶ added in v1.1.0
currently unused
func (*DEXWallet) FetchInputInfo ¶ added in v1.1.0
func (*DEXWallet) ForceRescan ¶ added in v1.1.0
func (dw *DEXWallet) ForceRescan()
func (*DEXWallet) HaveAddress ¶ added in v1.1.0
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 (*DEXWallet) LockOutpoint ¶ added in v1.1.0
func (*DEXWallet) LockedOutpoints ¶ added in v1.1.0
func (dw *DEXWallet) LockedOutpoints() []btcjson.TransactionInput
func (*DEXWallet) NewAddress ¶ added in v1.1.0
func (*DEXWallet) NewChangeAddress ¶ added in v1.1.0
func (*DEXWallet) PrivKeyForAddress ¶ added in v1.1.0
func (*DEXWallet) PublishTransaction ¶ added in v1.1.0
func (*DEXWallet) Reconfigure ¶ added in v1.1.0
func (*DEXWallet) RemovePeer ¶ added in v1.1.0
func (*DEXWallet) RescanAsync ¶ added in v1.1.0
func (*DEXWallet) ResetLockedOutpoints ¶ added in v1.1.0
func (dw *DEXWallet) ResetLockedOutpoints()
func (*DEXWallet) SendOutputs ¶ added in v1.1.0
func (*DEXWallet) SyncedTo ¶ added in v1.1.0
func (dw *DEXWallet) SyncedTo() waddrmgr.BlockStamp
func (*DEXWallet) UnlockOutpoint ¶ added in v1.1.0
func (*DEXWallet) WaitForShutdown ¶ added in v1.1.0
func (dw *DEXWallet) WaitForShutdown()