Versions in this module Expand all Collapse all v1 v1.1.4 May 14, 2024 v1.1.3 May 9, 2024 Changes in this version type Asset + HasWalletSeed func() bool + IsWalletBackedUp func() bool type Wallet + IsBackedUp bool + func (wallet *Wallet) HasWalletSeed() bool + func (wallet *Wallet) IsWalletBackedUp() bool v1.1.2 Mar 21, 2024 Changes in this version type InitParams + DEXTestAddr string v1.1.0 Jan 30, 2024 Changes in this version + const HideTotalBalanceConfigKey + const IsCEXFirstVisitConfigKey + func Balances(w Asset) (AssetAmount, AssetAmount, error) + func ParseWalletPeers(peerAddresses string, port string) ([]string, []error) + func SortTxs(txs []*Transaction, newestFirst bool) type Asset + GetWalletBalance func() (*Balance, error) + RemoveSendDestination func(id int) + SendDestination func(id int) *TransactionDestination + UpdateSendDestination func(id int, address string, atomAmount int64, sendMax bool) error type Balance + Locked AssetAmount type HeadersRescanProgressReport + WalletID int type TransactionDestination + ID int v1.0.1 Sep 14, 2023 v1.0.0 Jul 19, 2023 Changes in this version + const AccountMixerConfigSet + const AccountMixerMixTxChange + const AccountMixerMixedAccount + const AccountMixerUnmixedAccount + const AutoSyncConfigKey + const BeepNewBlocksConfigKey + const CurrencyConversionConfigKey + const DarkModeConfigKey + const ExchangeSourceDstnTypeConfigKey + const FetchProposalConfigKey + const HideBalanceConfigKey + const IncomingTxNotificationsConfigKey + const IsStartupSecuritySetConfigKey + const KnownDexServersConfigKey + const KnownVSPsConfigKey + const LanguagePreferenceKey + const LastTxHashConfigKey + const LogLevelConfigKey + const NetworkModeConfigKey + const PassphraseTypePass + const PassphraseTypePin + const PoliteiaNotificationConfigKey + const PrivacyModeConfigKey + const ProposalNotificationConfigKey + const SeedBackupNotificationConfigKey + const SpendUnconfirmedConfigKey + const SpendUnmixedFundsKey + const SpvPersistentPeerAddressesConfigKey + const StartupSecurityTypeConfigKey + const SyncOnCellularConfigKey + const TicketBuyerATMConfigKey + const TicketBuyerAccountConfigKey + const TicketBuyerVSPHostConfigKey + const TicketBuyerWalletConfigKey + const TransactionNotificationConfigKey + const UnminedTxHeight + const UseBiometricConfigKey + const UserAgentConfigKey + var InvalidBlock = &BlockInfo + func DecodeSeedMnemonic(seedMnemonic string, assetType utils.AssetType) (hashedSeed []byte, err error) + func UseLogger(logger slog.Logger) + func VerifySeed(seedMnemonic string, assetType utils.AssetType) bool + type Account struct + Balance *Balance + ExternalKeyCount int32 + ImportedKeyCount int32 + InternalKeyCount int32 + Name string + Number int32 + WalletID int + type AccountProperties struct + AccountName string + AccountNumber uint32 + AccountPubKey *btchdkeychain.ExtendedKey + AddrSchema *ScopeAddrSchema + ExternalKeyCount uint32 + ImportedKeyCount uint32 + InternalKeyCount uint32 + IsWatchOnly bool + KeyScope KeyScope + MasterKeyFingerprint uint32 + type Accounts struct + Accounts []*Account + CurrentBlockHash []byte + CurrentBlockHeight int32 + type AddressDiscoveryProgressReport struct + AddressDiscoveryProgress int32 + AddressDiscoveryStartTime int64 + TotalDiscoveryTimeSpent int64 + type AddressType uint8 + type Amount struct + CoinValue float64 + UnitValue int64 + type Asset interface + AccountName func(accountNumber int32) (string, error) + AccountNameRaw func(accountNumber uint32) (string, error) + AccountNumber func(accountName string) (int32, error) + AddSendDestination func(address string, unitAmount int64, sendMax bool) error + AddSyncProgressListener func(syncProgressListener SyncProgressListener, uniqueIdentifier string) error + AddTxAndBlockNotificationListener func(txAndBlockNotificationListener TxAndBlockNotificationListener, async bool, ...) error + Broadcast func(passphrase, label string) ([]byte, error) + CancelRescan func() + CancelSync func() + ChangePrivatePassphraseForWallet func(oldPrivatePassphrase, newPrivatePassphrase string, privatePassphraseType int32) error + ComputeTxSizeEstimation func(dstAddress string, utxos []*UnspentOutput) (int, error) + ConnectedPeers func() int32 + ContainsDiscoveredAccounts func() bool + CountTransactions func(txFilter int32) (int, error) + CreateNewAccount func(accountName, privPass string) (int32, error) + CurrentAddress func(account int32) (string, error) + DataDir func() string + DecryptSeed func(privatePassphrase string) (string, error) + DeleteWallet func(privPass string) error + EstimateFeeAndSize func() (*TxFeeAndSize, error) + GetAccount func(accountNumber int32) (*Account, error) + GetAccountBalance func(accountNumber int32) (*Balance, error) + GetAccountsRaw func() (*Accounts, error) + GetAssetType func() utils.AssetType + GetBestBlock func() *BlockInfo + GetBestBlockHeight func() int32 + GetBestBlockTimeStamp func() int64 + GetEncryptedSeed func() string + GetExtendedPubKey func(account int32) (string, error) + GetTransactionRaw func(txHash string) (*Transaction, error) + GetTransactionsRaw func(offset, limit, txFilter int32, newestFirst bool) ([]Transaction, error) + GetWalletID func() int + GetWalletName func() string + HaveAddress func(address string) bool + Internal func() *loader.LoadedWallets + IsAddressValid func(address string) bool + IsConnectedToNetwork func() bool + IsLocked func() bool + IsRescanning func() bool + IsSyncShuttingDown func() bool + IsSynced func() bool + IsSyncing func() bool + IsUnsignedTxExist func() bool + IsWaiting func() bool + IsWatchingOnlyWallet func() bool + LockWallet func() + LogFile func() string + NetType func() utils.NetworkType + NewUnsignedTx func(accountNumber int32, utxos []*UnspentOutput) error + NextAddress func(account int32) (string, error) + OpenWallet func() error + PublishUnminedTransactions func() error + ReadBoolConfigValueForKey func(key string, defaultValue bool) bool + ReadDoubleConfigValueForKey func(key string, defaultValue float64) float64 + ReadInt32ConfigValueForKey func(key string, defaultValue int32) int32 + ReadIntConfigValueForKey func(key string, defaultValue int) int + ReadLongConfigValueForKey func(key string, defaultValue int64) int64 + ReadStringConfigValueForKey func(key string, defaultValue string) string + ReadUserConfigValue func(key string, valueOut interface{}) error + RemovePeers func() + RemoveSyncProgressListener func(uniqueIdentifier string) + RemoveTxAndBlockNotificationListener func(uniqueIdentifier string) + RenameAccount func(accountNumber int32, newName string) error + RenameWallet func(newName string) error + RequiredConfirmations func() int32 + RescanBlocks func() error + RootDir func() string + SaveUserConfigValue func(key string, value interface{}) + SetBlocksRescanProgressListener func(blocksRescanProgressListener BlocksRescanProgressListener) + SetBoolConfigValueForKey func(key string, value bool) + SetDoubleConfigValueForKey func(key string, value float64) + SetInt32ConfigValueForKey func(key string, value int32) + SetIntConfigValueForKey func(key string, value int) + SetLongConfigValueForKey func(key string, value int64) + SetSpecificPeer func(address string) + SetStringConfigValueForKey func(key, value string) + Shutdown func() + ShutdownContextWithCancel func() (context.Context, context.CancelFunc) + SignMessage func(passphrase, address, message string) ([]byte, error) + SpvSync func() error + TargetTimePerBlockMinutes func() float64 + ToAmount func(v int64) AssetAmount + TxMatchesFilter func(tx *Transaction, txFilter int32) bool + UnlockWallet func(string) error + UnspentOutputs func(account int32) ([]*UnspentOutput, error) + VerifyMessage func(address, message, signatureBase64 string) (bool, error) + VerifySeedForWallet func(seedMnemonic, privpass string) (bool, error) + WalletOpened func() bool + type AssetAmount interface + MulF64 func(f float64) AssetAmount + String func() string + ToCoin func() float64 + ToInt func() int64 + type AssetsManagerDB interface + DeleteWalletConfigValue func(key string) + ReadWalletConfigValue func(key string, valueOut interface{}) error + SaveWalletConfigValue func(key string, value interface{}) + type AsyncTxAndBlockNotificationListener struct + func (asyncTxBlockListener *AsyncTxAndBlockNotificationListener) OnBlockAttached(walletID int, blockHeight int32) + func (asyncTxBlockListener *AsyncTxAndBlockNotificationListener) OnTransaction(transaction string) + func (asyncTxBlockListener *AsyncTxAndBlockNotificationListener) OnTransactionConfirmed(walletID int, hash string, blockHeight int32) + type AuthInfo struct + Name string + PrivatePass string + PrivatePassType int32 + type Balance struct + ImmatureReward AssetAmount + ImmatureStakeGeneration AssetAmount + LockedByTickets AssetAmount + Spendable AssetAmount + Total AssetAmount + UnConfirmed AssetAmount + VotingAuthority AssetAmount + type BlockInfo struct + Height int32 + Timestamp int64 + type BlocksRescanProgressListener interface + OnBlocksRescanEnded func(walletID int, err error) + OnBlocksRescanProgress func(*HeadersRescanProgressReport) + OnBlocksRescanStarted func(walletID int) + type CFiltersFetchProgressReport struct + BeginFetchCFiltersTimeStamp int64 + CFiltersFetchProgress int32 + CfiltersFetchTimeSpent int64 + CurrentCFilterHeight int32 + StartCFiltersHeight int32 + TotalCFiltersToFetch int32 + TotalFetchedCFiltersCount int32 + type DebugInfo struct + CurrentStageTimeElapsed int64 + CurrentStageTimeRemaining int64 + TotalTimeElapsed int64 + TotalTimeRemaining int64 + type ExchangeConfig struct + DestinationAccountNumber int32 + DestinationAsset utils.AssetType + DestinationWalletID int32 + SourceAccountNumber int32 + SourceAsset utils.AssetType + SourceWalletID int32 + type FeeEstimate struct + ConfirmedBlocks int32 + Feerate AssetAmount + type GeneralSyncProgress struct + TotalSyncProgress int32 + TotalTimeRemainingSeconds int64 + type HeadersFetchProgressReport struct + BeginFetchTimeStamp time.Time + HeadersFetchProgress int32 + HeadersFetchTimeSpent int64 + StartHeaderHeight *int32 + TotalHeadersToFetch int32 + type HeadersRescanProgressReport struct + CurrentRescanHeight int32 + RescanProgress int32 + RescanTimeRemaining int64 + TotalHeadersToScan int32 + type InitParams struct + DB *storm.DB + DbDriver string + LogDir string + NetType utils.NetworkType + RootDir string + type KeyScope struct + Coin uint32 + Purpose uint32 + type PeerInfo struct + Addr string + AddrLocal string + BanScore int32 + ID int32 + Services string + StartingHeight int64 + SubVer string + Version uint32 + type ScopeAddrSchema struct + ExternalAddrType AddressType + InternalAddrType AddressType + type SyncProgressListener interface + Debug func(debugInfo *DebugInfo) + OnAddressDiscoveryProgress func(addressDiscoveryProgress *AddressDiscoveryProgressReport) + OnCFiltersFetchProgress func(cfiltersFetchProgress *CFiltersFetchProgressReport) + OnHeadersFetchProgress func(headersFetchProgress *HeadersFetchProgressReport) + OnHeadersRescanProgress func(headersRescanProgress *HeadersRescanProgressReport) + OnPeerConnectedOrDisconnected func(numberOfConnectedPeers int32) + OnSyncCanceled func(willRestart bool) + OnSyncCompleted func() + OnSyncEndedWithError func(err error) + OnSyncStarted func() + type Transaction struct + Amount int64 + BlockHeight int32 + DaysToVoteOrRevoke int32 + Direction int32 + Expiry int32 + Fee int64 + FeeRate int64 + Hash string + Hex string + Inputs []*TxInput + Label string + LastBlockValid bool + LockTime int32 + MixCount int32 + MixDenomination int64 + Outputs []*TxOutput + Size int + TicketSpender string + TicketSpentHash string + Timestamp int64 + Type string + Version int32 + VoteBits string + VoteReward int64 + VoteVersion int32 + WalletID int + type TransactionDestination struct + Address string + SendMax bool + UnitAmount int64 + type TransactionOverview struct + All int + Coinbase int + Mixed int + Received int + Sent int + Staking int + Transferred int + type TxAndBlockNotificationListener interface + OnBlockAttached func(walletID int, blockHeight int32) + OnTransaction func(transaction string) + OnTransactionConfirmed func(walletID int, hash string, blockHeight int32) + type TxFeeAndSize struct + Change *Amount + EstimatedSignedSize int + Fee *Amount + FeeRate int64 + type TxInfoFromWallet struct + BlockHeight int32 + Hex string + Inputs []*WInput + Outputs []*WOutput + Timestamp int64 + WalletID int + type TxInput struct + AccountNumber int32 + Amount int64 + PreviousOutpoint string + PreviousTransactionHash string + PreviousTransactionIndex int32 + type TxOutput struct + AccountNumber int32 + Address string + Amount int64 + Index int32 + Internal bool + ScriptType string + Version int32 + type UnsignedTransaction struct + ChangeIndex int + EstimatedSignedSize int + TotalOutputAmount int64 + TotalPreviousOutputAmount int64 + UnsignedTransaction []byte + type UnspentOutput struct + Address string + Amount AssetAmount + Confirmations int32 + ReceiveTime time.Time + RedeemScript string + ScriptPubKey string + Spendable bool + Tree int8 + TxID string + Vout uint32 + type WAccount struct + AccountName string + AccountNumber int32 + type WConfig struct + AccountGapLimit int + AllowHighFees bool + DisableCoinTypeUpgrades bool + GapLimit uint32 + ManualTickets bool + MixSplitLimit int + RelayFee dcrutil.Amount + type WInput struct + AmountIn int64 + Index int32 + type WOutput struct + Address string + AmountOut int64 + Index int32 + Internal bool + type Wallet struct + Birthday time.Time + CreatedAt time.Time + EncryptedSeed []byte + HasDiscoveredAccounts bool + ID int + IsRestored bool + Name string + PrivatePassphraseType int32 + Type utils.AssetType + func CreateNewWallet(pass *AuthInfo, loader loader.AssetLoader, params *InitParams, ...) (*Wallet, error) + func CreateWatchOnlyWallet(walletName, extendedPublicKey string, loader loader.AssetLoader, ...) (*Wallet, error) + func RestoreWallet(seedMnemonic string, pass *AuthInfo, loader loader.AssetLoader, ...) (*Wallet, error) + func (wallet *Wallet) ChangePrivatePassphraseForWallet(oldPrivatePassphrase, newPrivatePassphrase string, privatePassphraseType int32) error + func (wallet *Wallet) ContainsDiscoveredAccounts() bool + func (wallet *Wallet) DataDir() string + func (wallet *Wallet) DecryptSeed(privatePassphrase string) (string, error) + func (wallet *Wallet) DeleteUserConfigValueForKey(key string) + func (wallet *Wallet) DeleteWallet(privPass string) error + func (wallet *Wallet) DeleteWalletConfigValue(key string) + func (wallet *Wallet) GetAssetType() utils.AssetType + func (wallet *Wallet) GetBirthday() time.Time + func (wallet *Wallet) GetEncryptedSeed() string + func (wallet *Wallet) GetWalletDataDb() *walletdata.DB + func (wallet *Wallet) GetWalletID() int + func (wallet *Wallet) GetWalletName() string + func (wallet *Wallet) Internal() *loader.LoadedWallets + func (wallet *Wallet) IsLocked() bool + func (wallet *Wallet) IsWatchingOnlyWallet() bool + func (wallet *Wallet) LockWallet() + func (wallet *Wallet) LogFile() string + func (wallet *Wallet) MarkWalletAsDiscoveredAccounts() error + func (wallet *Wallet) NetType() utils.NetworkType + func (wallet *Wallet) OpenWallet() error + func (wallet *Wallet) Prepare(loader loader.AssetLoader, params *InitParams) (err error) + func (wallet *Wallet) ReadBoolConfigValueForKey(key string, defaultValue bool) (valueOut bool) + func (wallet *Wallet) ReadDoubleConfigValueForKey(key string, defaultValue float64) (valueOut float64) + func (wallet *Wallet) ReadInt32ConfigValueForKey(key string, defaultValue int32) (valueOut int32) + func (wallet *Wallet) ReadIntConfigValueForKey(key string, defaultValue int) (valueOut int) + func (wallet *Wallet) ReadLongConfigValueForKey(key string, defaultValue int64) (valueOut int64) + func (wallet *Wallet) ReadStringConfigValueForKey(key string, defaultValue string) (valueOut string) + func (wallet *Wallet) ReadUserConfigValue(key string, valueOut interface{}) error + func (wallet *Wallet) ReadWalletConfigValue(key string, valueOut interface{}) error + func (wallet *Wallet) RenameWallet(newName string) error + func (wallet *Wallet) RequiredConfirmations() int32 + func (wallet *Wallet) RootDir() string + func (wallet *Wallet) SaveUserConfigValue(key string, value interface{}) + func (wallet *Wallet) SaveWalletConfigValue(key string, value interface{}) + func (wallet *Wallet) SetBirthday(birthday time.Time) + func (wallet *Wallet) SetBoolConfigValueForKey(key string, value bool) + func (wallet *Wallet) SetDoubleConfigValueForKey(key string, value float64) + func (wallet *Wallet) SetInt32ConfigValueForKey(key string, value int32) + func (wallet *Wallet) SetIntConfigValueForKey(key string, value int) + func (wallet *Wallet) SetLongConfigValueForKey(key string, value int64) + func (wallet *Wallet) SetNetType(netType utils.NetworkType) + func (wallet *Wallet) SetNetworkCancelCallback(callback func()) + func (wallet *Wallet) SetStringConfigValueForKey(key, value string) + func (wallet *Wallet) Shutdown() + func (wallet *Wallet) ShutdownContextWithCancel() (context.Context, context.CancelFunc) + func (wallet *Wallet) TargetTimePerBlockMinutes() float64 + func (wallet *Wallet) UnlockWallet(privPass string) (err error) + func (wallet *Wallet) VerifySeedForWallet(seedMnemonic, privpass string) (bool, error) + func (wallet *Wallet) WalletCreationTimeInMillis() (int64, error) + func (wallet *Wallet) WalletExists() (bool, error) + func (wallet *Wallet) WalletNameExists(walletName string) (bool, error) + func (wallet *Wallet) WalletOpened() bool