Documentation ¶
Overview ¶
Package wallet Copyright (c) 2015-2016 The btcsuite developers
Package wallet provides ... TODO: Flesh out this section
Overview
Index ¶
- Constants
- Variables
- func AddMultiSigAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func Confirms(txHeight, curHeight int32) int32
- func Create(db walletdb.DB, pubPass, privPass, seed []byte, params *chaincfg.Params, ...) (e error)
- func CreateMultiSig(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func CreateNewAccount(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func CreateSimulationWallet(activenet *chaincfg.Params, cfg *config.Config) (e error)
- func CreateWallet(activenet *chaincfg.Params, config *config.Config) (e error)
- func DecodeAddress(s string, params *chaincfg.Params) (btcaddr.Address, error)
- func DecodeHexStr(hexStr string) ([]byte, error)
- func DropWalletHistory(w *Wallet, cfg *config.Config) (e error)
- func DumpPrivKey(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func GenerateRPCKeyPair(config *config.Config, writeKey bool) (tls.Certificate, error)
- func GetAccount(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func GetAccountAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func GetAddressesByAccount(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func GetBalance(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func GetBestBlock(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func GetBestBlockHash(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func GetBlockCount(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func GetInfo(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func GetNewAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func GetRawChangeAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func GetReceivedByAccount(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (ii interface{}, e error)
- func GetReceivedByAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func GetTransaction(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func GetUnconfirmedBalance(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func HTTPBasicAuth(username, password string) []byte
- func HandleDropWalletHistory(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (out interface{}, e error)
- func Help(icmd interface{}, w *Wallet, chainClient *chainclient.RPCClient) (interface{}, error)
- func HelpDescsEnUS() map[string]string
- func HelpNoChainRPC(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func HelpWithChainRPC(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func IDPointer(id interface{}) (p *interface{})
- func ImportPrivKey(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func IsNilOrEmpty(s *string) bool
- func JSONAuthFail(w http.ResponseWriter)
- func JSONError(e error) *btcjson.RPCError
- func KeypoolRefill(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func ListAccounts(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func ListAddressTransactions(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func ListAllTransactions(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func ListLockUnspent(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func ListReceivedByAccount(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func ListReceivedByAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func ListSinceBlock(icmd interface{}, w *Wallet, cc ...*chainclient.RPCClient) (interface{}, error)
- func ListTransactions(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (txs interface{}, e error)
- func ListUnspent(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func LoadWallet(loader *Loader, cx *state.State, legacyServer *Server) (e error)
- func LockUnspent(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func Main(cx *state.State) (e error)
- func MakeMultiSigScript(w *Wallet, keys []string, nRequired int) ([]byte, error)
- func MakeOutputs(pairs map[string]amt.Amount, chainParams *chaincfg.Params) ([]*wire.TxOut, error)
- func MakeResponse(id, result interface{}, e error) btcjson.Response
- func NetworkDir(dataDir string, chainParams *chaincfg.Params) string
- func OpenRPCKeyPair(config *config.Config) (tls.Certificate, error)
- func RenameAccount(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func RunAPI(chainRPC *chainclient.RPCClient, wallet *Wallet, quit qu.C)
- func SendFrom(icmd interface{}, w *Wallet, chainClient *chainclient.RPCClient) (interface{}, error)
- func SendMany(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func SendPairs(w *Wallet, amounts map[string]amt.Amount, account uint32, minconf int32, ...) (string, error)
- func SendToAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func SetTxFee(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func SignMessage(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func SignRawTransaction(icmd interface{}, w *Wallet, cc ...*chainclient.RPCClient) (interface{}, error)
- func StartChainRPC(config *config.Config, activeNet *chaincfg.Params, certs []byte, quit qu.C) (rpcC *chainclient.RPCClient, e error)
- func Throttled(threshold int64, h http.Handler) http.Handler
- func ThrottledFn(threshold int64, f http.HandlerFunc) http.Handler
- func Unimplemented(interface{}, *Wallet) (interface{}, error)
- func Unsupported(interface{}, *Wallet) (interface{}, error)
- func ValidateAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func VerifyMessage(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func WalletIsLocked(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func WalletLock(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func WalletPassphrase(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- func WalletPassphraseChange(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient) (interface{}, error)
- type API
- func (a API) AddMultiSigAddress(cmd *btcjson.AddMultisigAddressCmd) (e error)
- func (a API) AddMultiSigAddressCheck() (isNew bool)
- func (a API) AddMultiSigAddressGetRes() (out *string, e error)
- func (a API) AddMultiSigAddressWait(cmd *btcjson.AddMultisigAddressCmd) (out *string, e error)
- func (a API) CreateMultiSig(cmd *btcjson.CreateMultisigCmd) (e error)
- func (a API) CreateMultiSigCheck() (isNew bool)
- func (a API) CreateMultiSigGetRes() (out *btcjson.CreateMultiSigResult, e error)
- func (a API) CreateMultiSigWait(cmd *btcjson.CreateMultisigCmd) (out *btcjson.CreateMultiSigResult, e error)
- func (a API) CreateNewAccount(cmd *btcjson.CreateNewAccountCmd) (e error)
- func (a API) CreateNewAccountCheck() (isNew bool)
- func (a API) CreateNewAccountGetRes() (out *None, e error)
- func (a API) CreateNewAccountWait(cmd *btcjson.CreateNewAccountCmd) (out *None, e error)
- func (a API) DumpPrivKey(cmd *btcjson.DumpPrivKeyCmd) (e error)
- func (a API) DumpPrivKeyCheck() (isNew bool)
- func (a API) DumpPrivKeyGetRes() (out *string, e error)
- func (a API) DumpPrivKeyWait(cmd *btcjson.DumpPrivKeyCmd) (out *string, e error)
- func (a API) GetAccount(cmd *btcjson.GetAccountCmd) (e error)
- func (a API) GetAccountAddress(cmd *btcjson.GetAccountAddressCmd) (e error)
- func (a API) GetAccountAddressCheck() (isNew bool)
- func (a API) GetAccountAddressGetRes() (out *string, e error)
- func (a API) GetAccountAddressWait(cmd *btcjson.GetAccountAddressCmd) (out *string, e error)
- func (a API) GetAccountCheck() (isNew bool)
- func (a API) GetAccountGetRes() (out *string, e error)
- func (a API) GetAccountWait(cmd *btcjson.GetAccountCmd) (out *string, e error)
- func (a API) GetAddressesByAccount(cmd *btcjson.GetAddressesByAccountCmd) (e error)
- func (a API) GetAddressesByAccountCheck() (isNew bool)
- func (a API) GetAddressesByAccountGetRes() (out *[]string, e error)
- func (a API) GetAddressesByAccountWait(cmd *btcjson.GetAddressesByAccountCmd) (out *[]string, e error)
- func (a API) GetBalance(cmd *btcjson.GetBalanceCmd) (e error)
- func (a API) GetBalanceCheck() (isNew bool)
- func (a API) GetBalanceGetRes() (out *float64, e error)
- func (a API) GetBalanceWait(cmd *btcjson.GetBalanceCmd) (out *float64, e error)
- func (a API) GetBestBlock(cmd *None) (e error)
- func (a API) GetBestBlockCheck() (isNew bool)
- func (a API) GetBestBlockGetRes() (out *btcjson.GetBestBlockResult, e error)
- func (a API) GetBestBlockHash(cmd *None) (e error)
- func (a API) GetBestBlockHashCheck() (isNew bool)
- func (a API) GetBestBlockHashGetRes() (out *string, e error)
- func (a API) GetBestBlockHashWait(cmd *None) (out *string, e error)
- func (a API) GetBestBlockWait(cmd *None) (out *btcjson.GetBestBlockResult, e error)
- func (a API) GetBlockCount(cmd *None) (e error)
- func (a API) GetBlockCountCheck() (isNew bool)
- func (a API) GetBlockCountGetRes() (out *int32, e error)
- func (a API) GetBlockCountWait(cmd *None) (out *int32, e error)
- func (a API) GetInfo(cmd *None) (e error)
- func (a API) GetInfoCheck() (isNew bool)
- func (a API) GetInfoGetRes() (out *btcjson.InfoWalletResult, e error)
- func (a API) GetInfoWait(cmd *None) (out *btcjson.InfoWalletResult, e error)
- func (a API) GetNewAddress(cmd *btcjson.GetNewAddressCmd) (e error)
- func (a API) GetNewAddressCheck() (isNew bool)
- func (a API) GetNewAddressGetRes() (out *string, e error)
- func (a API) GetNewAddressWait(cmd *btcjson.GetNewAddressCmd) (out *string, e error)
- func (a API) GetRawChangeAddress(cmd *btcjson.GetRawChangeAddressCmd) (e error)
- func (a API) GetRawChangeAddressCheck() (isNew bool)
- func (a API) GetRawChangeAddressGetRes() (out *string, e error)
- func (a API) GetRawChangeAddressWait(cmd *btcjson.GetRawChangeAddressCmd) (out *string, e error)
- func (a API) GetReceivedByAccount(cmd *btcjson.GetReceivedByAccountCmd) (e error)
- func (a API) GetReceivedByAccountCheck() (isNew bool)
- func (a API) GetReceivedByAccountGetRes() (out *float64, e error)
- func (a API) GetReceivedByAccountWait(cmd *btcjson.GetReceivedByAccountCmd) (out *float64, e error)
- func (a API) GetReceivedByAddress(cmd *btcjson.GetReceivedByAddressCmd) (e error)
- func (a API) GetReceivedByAddressCheck() (isNew bool)
- func (a API) GetReceivedByAddressGetRes() (out *float64, e error)
- func (a API) GetReceivedByAddressWait(cmd *btcjson.GetReceivedByAddressCmd) (out *float64, e error)
- func (a API) GetTransaction(cmd *btcjson.GetTransactionCmd) (e error)
- func (a API) GetTransactionCheck() (isNew bool)
- func (a API) GetTransactionGetRes() (out *btcjson.GetTransactionResult, e error)
- func (a API) GetTransactionWait(cmd *btcjson.GetTransactionCmd) (out *btcjson.GetTransactionResult, e error)
- func (a API) GetUnconfirmedBalance(cmd *btcjson.GetUnconfirmedBalanceCmd) (e error)
- func (a API) GetUnconfirmedBalanceCheck() (isNew bool)
- func (a API) GetUnconfirmedBalanceGetRes() (out *float64, e error)
- func (a API) GetUnconfirmedBalanceWait(cmd *btcjson.GetUnconfirmedBalanceCmd) (out *float64, e error)
- func (a API) HandleDropWalletHistory(cmd *None) (e error)
- func (a API) HandleDropWalletHistoryCheck() (isNew bool)
- func (a API) HandleDropWalletHistoryGetRes() (out *string, e error)
- func (a API) HandleDropWalletHistoryWait(cmd *None) (out *string, e error)
- func (a API) HelpNoChainRPC(cmd btcjson.HelpCmd) (e error)
- func (a API) HelpNoChainRPCCheck() (isNew bool)
- func (a API) HelpNoChainRPCGetRes() (out *string, e error)
- func (a API) HelpNoChainRPCWait(cmd btcjson.HelpCmd) (out *string, e error)
- func (a API) ImportPrivKey(cmd *btcjson.ImportPrivKeyCmd) (e error)
- func (a API) ImportPrivKeyCheck() (isNew bool)
- func (a API) ImportPrivKeyGetRes() (out *None, e error)
- func (a API) ImportPrivKeyWait(cmd *btcjson.ImportPrivKeyCmd) (out *None, e error)
- func (a API) KeypoolRefill(cmd *None) (e error)
- func (a API) KeypoolRefillCheck() (isNew bool)
- func (a API) KeypoolRefillGetRes() (out *None, e error)
- func (a API) KeypoolRefillWait(cmd *None) (out *None, e error)
- func (a API) ListAccounts(cmd *btcjson.ListAccountsCmd) (e error)
- func (a API) ListAccountsCheck() (isNew bool)
- func (a API) ListAccountsGetRes() (out *map[string]float64, e error)
- func (a API) ListAccountsWait(cmd *btcjson.ListAccountsCmd) (out *map[string]float64, e error)
- func (a API) ListAddressTransactions(cmd *btcjson.ListAddressTransactionsCmd) (e error)
- func (a API) ListAddressTransactionsCheck() (isNew bool)
- func (a API) ListAddressTransactionsGetRes() (out *[]btcjson.ListTransactionsResult, e error)
- func (a API) ListAddressTransactionsWait(cmd *btcjson.ListAddressTransactionsCmd) (out *[]btcjson.ListTransactionsResult, e error)
- func (a API) ListAllTransactions(cmd *btcjson.ListAllTransactionsCmd) (e error)
- func (a API) ListAllTransactionsCheck() (isNew bool)
- func (a API) ListAllTransactionsGetRes() (out *[]btcjson.ListTransactionsResult, e error)
- func (a API) ListAllTransactionsWait(cmd *btcjson.ListAllTransactionsCmd) (out *[]btcjson.ListTransactionsResult, e error)
- func (a API) ListLockUnspent(cmd *None) (e error)
- func (a API) ListLockUnspentCheck() (isNew bool)
- func (a API) ListLockUnspentGetRes() (out *[]btcjson.TransactionInput, e error)
- func (a API) ListLockUnspentWait(cmd *None) (out *[]btcjson.TransactionInput, e error)
- func (a API) ListReceivedByAccount(cmd *btcjson.ListReceivedByAccountCmd) (e error)
- func (a API) ListReceivedByAccountCheck() (isNew bool)
- func (a API) ListReceivedByAccountGetRes() (out *[]btcjson.ListReceivedByAccountResult, e error)
- func (a API) ListReceivedByAccountWait(cmd *btcjson.ListReceivedByAccountCmd) (out *[]btcjson.ListReceivedByAccountResult, e error)
- func (a API) ListReceivedByAddress(cmd *btcjson.ListReceivedByAddressCmd) (e error)
- func (a API) ListReceivedByAddressCheck() (isNew bool)
- func (a API) ListReceivedByAddressGetRes() (out *btcjson.ListReceivedByAddressResult, e error)
- func (a API) ListReceivedByAddressWait(cmd *btcjson.ListReceivedByAddressCmd) (out *btcjson.ListReceivedByAddressResult, e error)
- func (a API) ListSinceBlock(cmd btcjson.ListSinceBlockCmd) (e error)
- func (a API) ListSinceBlockCheck() (isNew bool)
- func (a API) ListSinceBlockGetRes() (out *btcjson.ListSinceBlockResult, e error)
- func (a API) ListSinceBlockWait(cmd btcjson.ListSinceBlockCmd) (out *btcjson.ListSinceBlockResult, e error)
- func (a API) ListTransactions(cmd *btcjson.ListTransactionsCmd) (e error)
- func (a API) ListTransactionsCheck() (isNew bool)
- func (a API) ListTransactionsGetRes() (out *[]btcjson.ListTransactionsResult, e error)
- func (a API) ListTransactionsWait(cmd *btcjson.ListTransactionsCmd) (out *[]btcjson.ListTransactionsResult, e error)
- func (a API) ListUnspent(cmd *btcjson.ListUnspentCmd) (e error)
- func (a API) ListUnspentCheck() (isNew bool)
- func (a API) ListUnspentGetRes() (out *[]btcjson.ListUnspentResult, e error)
- func (a API) ListUnspentWait(cmd *btcjson.ListUnspentCmd) (out *[]btcjson.ListUnspentResult, e error)
- func (a API) LockUnspent(cmd btcjson.LockUnspentCmd) (e error)
- func (a API) LockUnspentCheck() (isNew bool)
- func (a API) LockUnspentGetRes() (out *bool, e error)
- func (a API) LockUnspentWait(cmd btcjson.LockUnspentCmd) (out *bool, e error)
- func (a API) RenameAccount(cmd *btcjson.RenameAccountCmd) (e error)
- func (a API) RenameAccountCheck() (isNew bool)
- func (a API) RenameAccountGetRes() (out *None, e error)
- func (a API) RenameAccountWait(cmd *btcjson.RenameAccountCmd) (out *None, e error)
- func (a API) SendMany(cmd *btcjson.SendManyCmd) (e error)
- func (a API) SendManyCheck() (isNew bool)
- func (a API) SendManyGetRes() (out *string, e error)
- func (a API) SendManyWait(cmd *btcjson.SendManyCmd) (out *string, e error)
- func (a API) SendToAddress(cmd *btcjson.SendToAddressCmd) (e error)
- func (a API) SendToAddressCheck() (isNew bool)
- func (a API) SendToAddressGetRes() (out *string, e error)
- func (a API) SendToAddressWait(cmd *btcjson.SendToAddressCmd) (out *string, e error)
- func (a API) SetTxFee(cmd *btcjson.SetTxFeeCmd) (e error)
- func (a API) SetTxFeeCheck() (isNew bool)
- func (a API) SetTxFeeGetRes() (out *bool, e error)
- func (a API) SetTxFeeWait(cmd *btcjson.SetTxFeeCmd) (out *bool, e error)
- func (a API) SignMessage(cmd *btcjson.SignMessageCmd) (e error)
- func (a API) SignMessageCheck() (isNew bool)
- func (a API) SignMessageGetRes() (out *string, e error)
- func (a API) SignMessageWait(cmd *btcjson.SignMessageCmd) (out *string, e error)
- func (a API) SignRawTransaction(cmd btcjson.SignRawTransactionCmd) (e error)
- func (a API) SignRawTransactionCheck() (isNew bool)
- func (a API) SignRawTransactionGetRes() (out *btcjson.SignRawTransactionResult, e error)
- func (a API) SignRawTransactionWait(cmd btcjson.SignRawTransactionCmd) (out *btcjson.SignRawTransactionResult, e error)
- func (a API) ValidateAddress(cmd *btcjson.ValidateAddressCmd) (e error)
- func (a API) ValidateAddressCheck() (isNew bool)
- func (a API) ValidateAddressGetRes() (out *btcjson.ValidateAddressWalletResult, e error)
- func (a API) ValidateAddressWait(cmd *btcjson.ValidateAddressCmd) (out *btcjson.ValidateAddressWalletResult, e error)
- func (a API) VerifyMessage(cmd *btcjson.VerifyMessageCmd) (e error)
- func (a API) VerifyMessageCheck() (isNew bool)
- func (a API) VerifyMessageGetRes() (out *bool, e error)
- func (a API) VerifyMessageWait(cmd *btcjson.VerifyMessageCmd) (out *bool, e error)
- func (a API) WalletIsLocked(cmd *None) (e error)
- func (a API) WalletIsLockedCheck() (isNew bool)
- func (a API) WalletIsLockedGetRes() (out *bool, e error)
- func (a API) WalletIsLockedWait(cmd *None) (out *bool, e error)
- func (a API) WalletLock(cmd *None) (e error)
- func (a API) WalletLockCheck() (isNew bool)
- func (a API) WalletLockGetRes() (out *None, e error)
- func (a API) WalletLockWait(cmd *None) (out *None, e error)
- func (a API) WalletPassphrase(cmd *btcjson.WalletPassphraseCmd) (e error)
- func (a API) WalletPassphraseChange(cmd *btcjson.WalletPassphraseChangeCmd) (e error)
- func (a API) WalletPassphraseChangeCheck() (isNew bool)
- func (a API) WalletPassphraseChangeGetRes() (out *None, e error)
- func (a API) WalletPassphraseChangeWait(cmd *btcjson.WalletPassphraseChangeCmd) (out *None, e error)
- func (a API) WalletPassphraseCheck() (isNew bool)
- func (a API) WalletPassphraseGetRes() (out *None, e error)
- func (a API) WalletPassphraseWait(cmd *btcjson.WalletPassphraseCmd) (out *None, e error)
- type AccountBalance
- type AccountBalanceResult
- type AccountNotification
- type AccountNotificationsClient
- type AccountResult
- type AccountTotalReceivedResult
- type AccountsResult
- type AddMultiSigAddressRes
- type Balances
- type Block
- type BlockIdentifier
- type BlockIdentity
- type BranchRecoveryState
- func (brs *BranchRecoveryState) AddAddr(index uint32, addr btcaddr.Address)
- func (brs *BranchRecoveryState) Addrs() map[uint32]btcaddr.Address
- func (brs *BranchRecoveryState) ExtendHorizon() (uint32, uint32)
- func (brs *BranchRecoveryState) GetAddr(index uint32) btcaddr.Address
- func (brs *BranchRecoveryState) MarkInvalidChild(index uint32)
- func (brs *BranchRecoveryState) NextUnfound() uint32
- func (brs *BranchRecoveryState) NumInvalidInHorizon() uint32
- func (brs *BranchRecoveryState) ReportFound(index uint32)
- type CAPI
- func (c *CAPI) AddMultiSigAddress(req *btcjson.AddMultisigAddressCmd, resp string) (e error)
- func (c *CAPI) CreateMultiSig(req *btcjson.CreateMultisigCmd, resp btcjson.CreateMultiSigResult) (e error)
- func (c *CAPI) CreateNewAccount(req *btcjson.CreateNewAccountCmd, resp None) (e error)
- func (c *CAPI) DumpPrivKey(req *btcjson.DumpPrivKeyCmd, resp string) (e error)
- func (c *CAPI) GetAccount(req *btcjson.GetAccountCmd, resp string) (e error)
- func (c *CAPI) GetAccountAddress(req *btcjson.GetAccountAddressCmd, resp string) (e error)
- func (c *CAPI) GetAddressesByAccount(req *btcjson.GetAddressesByAccountCmd, resp []string) (e error)
- func (c *CAPI) GetBalance(req *btcjson.GetBalanceCmd, resp float64) (e error)
- func (c *CAPI) GetBestBlock(req *None, resp btcjson.GetBestBlockResult) (e error)
- func (c *CAPI) GetBestBlockHash(req *None, resp string) (e error)
- func (c *CAPI) GetBlockCount(req *None, resp int32) (e error)
- func (c *CAPI) GetInfo(req *None, resp btcjson.InfoWalletResult) (e error)
- func (c *CAPI) GetNewAddress(req *btcjson.GetNewAddressCmd, resp string) (e error)
- func (c *CAPI) GetRawChangeAddress(req *btcjson.GetRawChangeAddressCmd, resp string) (e error)
- func (c *CAPI) GetReceivedByAccount(req *btcjson.GetReceivedByAccountCmd, resp float64) (e error)
- func (c *CAPI) GetReceivedByAddress(req *btcjson.GetReceivedByAddressCmd, resp float64) (e error)
- func (c *CAPI) GetTransaction(req *btcjson.GetTransactionCmd, resp btcjson.GetTransactionResult) (e error)
- func (c *CAPI) GetUnconfirmedBalance(req *btcjson.GetUnconfirmedBalanceCmd, resp float64) (e error)
- func (c *CAPI) HandleDropWalletHistory(req *None, resp string) (e error)
- func (c *CAPI) HelpNoChainRPC(req btcjson.HelpCmd, resp string) (e error)
- func (c *CAPI) ImportPrivKey(req *btcjson.ImportPrivKeyCmd, resp None) (e error)
- func (c *CAPI) KeypoolRefill(req *None, resp None) (e error)
- func (c *CAPI) ListAccounts(req *btcjson.ListAccountsCmd, resp map[string]float64) (e error)
- func (c *CAPI) ListAddressTransactions(req *btcjson.ListAddressTransactionsCmd, resp []btcjson.ListTransactionsResult) (e error)
- func (c *CAPI) ListAllTransactions(req *btcjson.ListAllTransactionsCmd, resp []btcjson.ListTransactionsResult) (e error)
- func (c *CAPI) ListLockUnspent(req *None, resp []btcjson.TransactionInput) (e error)
- func (c *CAPI) ListReceivedByAccount(req *btcjson.ListReceivedByAccountCmd, ...) (e error)
- func (c *CAPI) ListReceivedByAddress(req *btcjson.ListReceivedByAddressCmd, ...) (e error)
- func (c *CAPI) ListSinceBlock(req btcjson.ListSinceBlockCmd, resp btcjson.ListSinceBlockResult) (e error)
- func (c *CAPI) ListTransactions(req *btcjson.ListTransactionsCmd, resp []btcjson.ListTransactionsResult) (e error)
- func (c *CAPI) ListUnspent(req *btcjson.ListUnspentCmd, resp []btcjson.ListUnspentResult) (e error)
- func (c *CAPI) LockUnspent(req btcjson.LockUnspentCmd, resp bool) (e error)
- func (c *CAPI) RenameAccount(req *btcjson.RenameAccountCmd, resp None) (e error)
- func (c *CAPI) SendMany(req *btcjson.SendManyCmd, resp string) (e error)
- func (c *CAPI) SendToAddress(req *btcjson.SendToAddressCmd, resp string) (e error)
- func (c *CAPI) SetTxFee(req *btcjson.SetTxFeeCmd, resp bool) (e error)
- func (c *CAPI) SignMessage(req *btcjson.SignMessageCmd, resp string) (e error)
- func (c *CAPI) SignRawTransaction(req btcjson.SignRawTransactionCmd, resp btcjson.SignRawTransactionResult) (e error)
- func (c *CAPI) ValidateAddress(req *btcjson.ValidateAddressCmd, resp btcjson.ValidateAddressWalletResult) (e error)
- func (c *CAPI) VerifyMessage(req *btcjson.VerifyMessageCmd, resp bool) (e error)
- func (c *CAPI) WalletIsLocked(req *None, resp bool) (e error)
- func (c *CAPI) WalletLock(req *None, resp None) (e error)
- func (c *CAPI) WalletPassphrase(req *btcjson.WalletPassphraseCmd, resp None) (e error)
- func (c *CAPI) WalletPassphraseChange(req *btcjson.WalletPassphraseChangeCmd, resp None) (e error)
- type CAPIClient
- func (r *CAPIClient) AddMultiSigAddress(cmd ...*btcjson.AddMultisigAddressCmd) (res string, e error)
- func (r *CAPIClient) CreateMultiSig(cmd ...*btcjson.CreateMultisigCmd) (res btcjson.CreateMultiSigResult, e error)
- func (r *CAPIClient) CreateNewAccount(cmd ...*btcjson.CreateNewAccountCmd) (res None, e error)
- func (r *CAPIClient) DumpPrivKey(cmd ...*btcjson.DumpPrivKeyCmd) (res string, e error)
- func (r *CAPIClient) GetAccount(cmd ...*btcjson.GetAccountCmd) (res string, e error)
- func (r *CAPIClient) GetAccountAddress(cmd ...*btcjson.GetAccountAddressCmd) (res string, e error)
- func (r *CAPIClient) GetAddressesByAccount(cmd ...*btcjson.GetAddressesByAccountCmd) (res []string, e error)
- func (r *CAPIClient) GetBalance(cmd ...*btcjson.GetBalanceCmd) (res float64, e error)
- func (r *CAPIClient) GetBestBlock(cmd ...*None) (res btcjson.GetBestBlockResult, e error)
- func (r *CAPIClient) GetBestBlockHash(cmd ...*None) (res string, e error)
- func (r *CAPIClient) GetBlockCount(cmd ...*None) (res int32, e error)
- func (r *CAPIClient) GetInfo(cmd ...*None) (res btcjson.InfoWalletResult, e error)
- func (r *CAPIClient) GetNewAddress(cmd ...*btcjson.GetNewAddressCmd) (res string, e error)
- func (r *CAPIClient) GetRawChangeAddress(cmd ...*btcjson.GetRawChangeAddressCmd) (res string, e error)
- func (r *CAPIClient) GetReceivedByAccount(cmd ...*btcjson.GetReceivedByAccountCmd) (res float64, e error)
- func (r *CAPIClient) GetReceivedByAddress(cmd ...*btcjson.GetReceivedByAddressCmd) (res float64, e error)
- func (r *CAPIClient) GetTransaction(cmd ...*btcjson.GetTransactionCmd) (res btcjson.GetTransactionResult, e error)
- func (r *CAPIClient) GetUnconfirmedBalance(cmd ...*btcjson.GetUnconfirmedBalanceCmd) (res float64, e error)
- func (r *CAPIClient) HandleDropWalletHistory(cmd ...*None) (res string, e error)
- func (r *CAPIClient) HelpNoChainRPC(cmd ...btcjson.HelpCmd) (res string, e error)
- func (r *CAPIClient) ImportPrivKey(cmd ...*btcjson.ImportPrivKeyCmd) (res None, e error)
- func (r *CAPIClient) KeypoolRefill(cmd ...*None) (res None, e error)
- func (r *CAPIClient) ListAccounts(cmd ...*btcjson.ListAccountsCmd) (res map[string]float64, e error)
- func (r *CAPIClient) ListAddressTransactions(cmd ...*btcjson.ListAddressTransactionsCmd) (res []btcjson.ListTransactionsResult, e error)
- func (r *CAPIClient) ListAllTransactions(cmd ...*btcjson.ListAllTransactionsCmd) (res []btcjson.ListTransactionsResult, e error)
- func (r *CAPIClient) ListLockUnspent(cmd ...*None) (res []btcjson.TransactionInput, e error)
- func (r *CAPIClient) ListReceivedByAccount(cmd ...*btcjson.ListReceivedByAccountCmd) (res []btcjson.ListReceivedByAccountResult, e error)
- func (r *CAPIClient) ListReceivedByAddress(cmd ...*btcjson.ListReceivedByAddressCmd) (res btcjson.ListReceivedByAddressResult, e error)
- func (r *CAPIClient) ListSinceBlock(cmd ...btcjson.ListSinceBlockCmd) (res btcjson.ListSinceBlockResult, e error)
- func (r *CAPIClient) ListTransactions(cmd ...*btcjson.ListTransactionsCmd) (res []btcjson.ListTransactionsResult, e error)
- func (r *CAPIClient) ListUnspent(cmd ...*btcjson.ListUnspentCmd) (res []btcjson.ListUnspentResult, e error)
- func (r *CAPIClient) LockUnspent(cmd ...btcjson.LockUnspentCmd) (res bool, e error)
- func (r *CAPIClient) RenameAccount(cmd ...*btcjson.RenameAccountCmd) (res None, e error)
- func (r *CAPIClient) SendMany(cmd ...*btcjson.SendManyCmd) (res string, e error)
- func (r *CAPIClient) SendToAddress(cmd ...*btcjson.SendToAddressCmd) (res string, e error)
- func (r *CAPIClient) SetTxFee(cmd ...*btcjson.SetTxFeeCmd) (res bool, e error)
- func (r *CAPIClient) SignMessage(cmd ...*btcjson.SignMessageCmd) (res string, e error)
- func (r *CAPIClient) SignRawTransaction(cmd ...btcjson.SignRawTransactionCmd) (res btcjson.SignRawTransactionResult, e error)
- func (r *CAPIClient) ValidateAddress(cmd ...*btcjson.ValidateAddressCmd) (res btcjson.ValidateAddressWalletResult, e error)
- func (r *CAPIClient) VerifyMessage(cmd ...*btcjson.VerifyMessageCmd) (res bool, e error)
- func (r *CAPIClient) WalletIsLocked(cmd ...*None) (res bool, e error)
- func (r *CAPIClient) WalletLock(cmd ...*None) (res None, e error)
- func (r *CAPIClient) WalletPassphrase(cmd ...*btcjson.WalletPassphraseCmd) (res None, e error)
- func (r *CAPIClient) WalletPassphraseChange(cmd ...*btcjson.WalletPassphraseChangeCmd) (res None, e error)
- type CreateMultiSigRes
- type CreateNewAccountRes
- type CreditCategory
- type DeserializationError
- type DumpPrivKeyRes
- type GetAccountAddressRes
- type GetAccountRes
- type GetAddressesByAccountRes
- type GetBalanceRes
- type GetBestBlockHashRes
- type GetBestBlockRes
- type GetBlockCountRes
- type GetInfoRes
- type GetNewAddressRes
- type GetRawChangeAddressRes
- type GetReceivedByAccountRes
- type GetReceivedByAddressRes
- type GetTransactionRes
- type GetTransactionsResult
- type GetUnconfirmedBalanceRes
- type HandleDropWalletHistoryRes
- type HelpNoChainRPCRes
- type ImportPrivKeyRes
- type InvalidParameterError
- type KeypoolRefillRes
- type LazyHandler
- type ListAccountsRes
- type ListAddressTransactionsRes
- type ListAllTransactionsRes
- type ListLockUnspentRes
- type ListReceivedByAccountRes
- type ListReceivedByAddressRes
- type ListSinceBlockRes
- type ListTransactionsRes
- type ListUnspentRes
- type Loader
- func (ld *Loader) CreateNewWallet(pubPassphrase, privPassphrase, seed []byte, bday time.Time, noStart bool, ...) (w *Wallet, e error)
- func (ld *Loader) LoadedWallet() (*Wallet, bool)
- func (ld *Loader) OpenExistingWallet(pubPassphrase []byte, canConsolePrompt bool, podConfig *config.Config, ...) (w *Wallet, e error)
- func (ld *Loader) RunAfterLoad(fn func(*Wallet))
- func (ld *Loader) UnloadWallet() (e error)
- func (ld *Loader) WalletExists() (bool, error)
- type LockUnspentRes
- type None
- type NotificationServer
- type Options
- type OutputKind
- type OutputRedeemer
- type OutputSelectionPolicy
- type P2SHMultiSigOutput
- type ParseError
- type RecoveryManager
- func (rm *RecoveryManager) AddToBlockBatch(hash *chainhash.Hash, height int32, timestamp time.Time)
- func (rm *RecoveryManager) BlockBatch() []wtxmgr.BlockMeta
- func (rm *RecoveryManager) ResetBlockBatch()
- func (rm *RecoveryManager) Resurrect(ns walletdb.ReadBucket, ...) (e error)
- func (rm *RecoveryManager) State() *RecoveryState
- type RecoveryState
- type RenameAccountRes
- type RequestHandler
- type RescanFinishedMsg
- type RescanJob
- type RescanProgressMsg
- type ScopeRecoveryState
- type SendManyRes
- type SendToAddressRes
- type Server
- func (s *Server) CheckAuthHeader(r *http.Request) (e error)
- func (s *Server) HandlerClosure(request *btcjson.Request) LazyHandler
- func (s *Server) InvalidAuth(req *btcjson.Request) bool
- func (s *Server) POSTClientRPC(w http.ResponseWriter, r *http.Request)
- func (s *Server) RegisterWallet(w *Wallet)
- func (s *Server) RequestProcessShutdown()
- func (s *Server) RequestProcessShutdownChan() qu.C
- func (s *Server) Serve(lis net.Listener)
- func (s *Server) SetChainServer(chainClient chainclient.Interface)
- func (s *Server) Stop()
- func (s *Server) WebsocketClientRPC(wsc *WebsocketClient)
- func (s *Server) WebsocketClientRead(wsc *WebsocketClient)
- func (s *Server) WebsocketClientRespond(wsc *WebsocketClient)
- func (s *Server) WebsocketClientSend(wsc *WebsocketClient)
- type SetTxFeeRes
- type SignMessageRes
- type SignRawTransactionRes
- type SignatureError
- type SpentnessNotifications
- type SpentnessNotificationsClient
- type TransactionNotifications
- type TransactionNotificationsClient
- type TransactionOutput
- type TransactionSummary
- type TransactionSummaryInput
- type TransactionSummaryOutput
- type UnstableAPI
- type ValidateAddressRes
- type VerifyMessageRes
- type Wallet
- func (w *Wallet) AccountAddresses(account uint32) (addrs []btcaddr.Address, e error)
- func (w *Wallet) AccountBalances(scope waddrmgr.KeyScope, requiredConfs int32) ([]AccountBalanceResult, error)
- func (w *Wallet) AccountName(scope waddrmgr.KeyScope, accountNumber uint32) (string, error)
- func (w *Wallet) AccountNumber(scope waddrmgr.KeyScope, accountName string) (account uint32, e error)
- func (w *Wallet) AccountOfAddress(a btcaddr.Address) (account uint32, e error)
- func (w *Wallet) AccountProperties(scope waddrmgr.KeyScope, acct uint32) (*waddrmgr.AccountProperties, error)
- func (w *Wallet) Accounts(scope waddrmgr.KeyScope) (*AccountsResult, error)
- func (w *Wallet) AddressInfo(a btcaddr.Address) (waddrmgr.ManagedAddress, error)
- func (w *Wallet) CalculateAccountBalances(account uint32, confirms int32) (bals Balances, e error)
- func (w *Wallet) CalculateBalance(confirms int32) (balance amt.Amount, e error)
- func (w *Wallet) ChainClient() chainclient.Interface
- func (w *Wallet) ChainParams() *chaincfg.Params
- func (w *Wallet) ChainSynced() bool
- func (w *Wallet) ChangePassphrases(publicOld, publicNew, privateOld, privateNew []byte) (e error)
- func (w *Wallet) ChangePrivatePassphrase(old, new []byte) (e error)
- func (w *Wallet) ChangePublicPassphrase(old, new []byte) (e error)
- func (w *Wallet) CreateSimpleTx(account uint32, outputs []*wire.TxOut, minconf int32, satPerKb amt.Amount) (*txauthor.AuthoredTx, error)
- func (w *Wallet) CurrentAddress(account uint32, scope waddrmgr.KeyScope) (btcaddr.Address, error)
- func (w *Wallet) Database() walletdb.DB
- func (w *Wallet) DumpPrivKeys() (privkeys []string, e error)
- func (w *Wallet) DumpWIFPrivateKey(addr btcaddr.Address) (address string, e error)
- func (w *Wallet) GetTransactions(startBlock, endBlock *BlockIdentifier, cancel qu.C) (res *GetTransactionsResult, e error)
- func (w *Wallet) HaveAddress(a btcaddr.Address) (b bool, e error)
- func (w *Wallet) ImportP2SHRedeemScript(script []byte) (*btcaddr.ScriptHash, error)
- func (w *Wallet) ImportPrivateKey(scope waddrmgr.KeyScope, wif *util.WIF, bs *waddrmgr.BlockStamp, rescan bool) (string, error)
- func (w *Wallet) ListAddressTransactions(pkHashes map[string]struct{}) (txList []btcjson.ListTransactionsResult, e error)
- func (w *Wallet) ListAllTransactions() (txList []btcjson.ListTransactionsResult, e error)
- func (w *Wallet) ListSinceBlock(start, end, syncHeight int32) (txList []btcjson.ListTransactionsResult, e error)
- func (w *Wallet) ListTransactions(from, count int) (txList []btcjson.ListTransactionsResult, e error)
- func (w *Wallet) ListUnspent(minconf, maxconf int32, addresses map[string]struct{}) (results []*btcjson.ListUnspentResult, e error)
- func (w *Wallet) Lock()
- func (w *Wallet) LockOutpoint(op wire.OutPoint)
- func (w *Wallet) Locked() bool
- func (w *Wallet) LockedOutpoint(op wire.OutPoint) bool
- func (w *Wallet) LockedOutpoints() []btcjson.TransactionInput
- func (w *Wallet) MakeMultiSigScript(addrs []btcaddr.Address, nRequired int) ([]byte, error)
- func (w *Wallet) NewAddress(account uint32, scope waddrmgr.KeyScope, nochain bool) (addr btcaddr.Address, e error)
- func (w *Wallet) NewChangeAddress(account uint32, scope waddrmgr.KeyScope) (btcaddr.Address, error)
- func (w *Wallet) NextAccount(scope waddrmgr.KeyScope, name string) (uint32, error)
- func (w *Wallet) PrivKeyForAddress(a btcaddr.Address) (privKey *ec.PrivateKey, e error)
- func (w *Wallet) PubKeyForAddress(a btcaddr.Address) (pubKey *ec.PublicKey, e error)
- func (w *Wallet) PublishTransaction(tx *wire.MsgTx) (e error)
- func (w *Wallet) RenameAccount(scope waddrmgr.KeyScope, account uint32, newName string) (e error)
- func (w *Wallet) Rescan(addrs []btcaddr.Address, unspent []wtxmgr.Credit) (e error)
- func (w *Wallet) ResetLockedOutpoints()
- func (w *Wallet) SendOutputs(outputs []*wire.TxOut, account uint32, minconf int32, satPerKb amt.Amount) (*chainhash.Hash, error)
- func (w *Wallet) SetChainSynced(synced bool)
- func (w *Wallet) ShuttingDown() bool
- func (w *Wallet) SignTransaction(tx *wire.MsgTx, hashType txscript.SigHashType, ...) (signErrors []SignatureError, e error)
- func (w *Wallet) SortedActivePaymentAddresses() ([]string, error)
- func (w *Wallet) Start()
- func (w *Wallet) Stop()
- func (w *Wallet) SubmitRescan(job *RescanJob) <-chan error
- func (w *Wallet) SynchronizeRPC(chainClient chainclient.Interface)
- func (w *Wallet) SynchronizingToNetwork() bool
- func (w *Wallet) TotalReceivedForAccounts(scope waddrmgr.KeyScope, minConf int32) ([]AccountTotalReceivedResult, error)
- func (w *Wallet) TotalReceivedForAddr(addr btcaddr.Address, minConf int32) (amount amt.Amount, e error)
- func (w *Wallet) Unlock(passphrase []byte, lock <-chan time.Time) (e error)
- func (w *Wallet) UnlockOutpoint(op wire.OutPoint)
- func (w *Wallet) UnspentOutputs(policy OutputSelectionPolicy) ([]*TransactionOutput, error)
- func (w *Wallet) WaitForShutdown()
- type WalletIsLockedRes
- type WalletLockRes
- type WalletPassphraseChangeRes
- type WalletPassphraseRes
- type WebsocketClient
Constants ¶
const ( // InsecurePubPassphrase is the default outer encryption passphrase used for public data (everything but private // keys). Using a non-default public passphrase can prevent an attacker without the public passphrase from // discovering all past and future wallet addresses if they gain access to the wallet database. // // NOTE: at time of writing, public encryption only applies to public data in the waddrmgr namespace. Transactions // are not yet encrypted. InsecurePubPassphrase = "" )
const MaxRequestSize = 1024 * 1024 * 4
MaxRequestSize specifies the maximum number of bytes in the request body that may be read from a client. This is currently limited to 4MB.
Variables ¶
var ( ErrNeedPositiveAmount = InvalidParameterError{ errors.New("amount must be positive"), } ErrNeedPositiveMinconf = InvalidParameterError{ errors.New("minconf must be positive"), } ErrAddressNotInWallet = btcjson.RPCError{ Code: btcjson.ErrRPCWallet, Message: "address not found in wallet", } ErrAccountNameNotFound = btcjson.RPCError{ Code: btcjson.ErrRPCWalletInvalidAccountName, Message: "account name not found", } ErrUnloadedWallet = btcjson.RPCError{ Code: btcjson.ErrRPCWallet, Message: "Request requires a wallet but wallet has not loaded yet", } ErrWalletUnlockNeeded = btcjson.RPCError{ Code: btcjson.ErrRPCWalletUnlockNeeded, Message: "Enter the wallet passphrase with walletpassphrase first", } ErrNotImportedAccount = btcjson.RPCError{ Code: btcjson.ErrRPCWallet, Message: "imported addresses must belong to the imported account", } ErrNoTransactionInfo = btcjson.RPCError{ Code: btcjson.ErrRPCNoTxInfo, Message: "No information for transaction", } ErrReservedAccountName = btcjson.RPCError{ Code: btcjson.ErrRPCInvalidParameter, Message: "Account name is reserved by RPC server", } )
Errors variables that are defined once here to avoid duplication below.
var ( // ErrExists describes the error condition of attempting to create a new wallet when one exists already. ErrExists = errors.New("wallet already exists") // ErrLoaded describes the error condition of attempting to load or create a wallet when the loader has already done // so. ErrLoaded = errors.New("wallet already loaded") // ErrNotLoaded describes the error condition of attempting to close a loaded wallet when a wallet has not been // loaded. ErrNotLoaded = errors.New("wallet is not loaded") )
var ErrNoAuth = errors.New("no auth")
ErrNoAuth represents an error where authentication could not succeed due to a missing Authorization HTTP header.
var ErrNotSynced = errors.New("wallet is not synchronized with the chain server")
ErrNotSynced describes an error where an operation cannot complete due wallet being out of sync (and perhaps currently syncing with) the remote chain server.
var F, E, W, I, D, T log.LevelPrinter = log.GetLogPrinterSet(subsystem)
var HelpDescs map[string]string
var HelpDescsMutex sync.Mutex // Help may execute concurrently, so synchronize access.
var LocaleHelpDescs = map[string]func() map[string]string{ "en_US": HelpDescsEnUS, }
var RPCHandlers = map[string]struct { Handler RequestHandler // Function variables cannot be compared against anything but nil, so use a boolean to record whether help // generation is necessary. This is used by the tests to ensure that help can be generated for every implemented // method. // // A single map and this bool is here is used rather than several maps for the unimplemented handlers so every // method has exactly one handler function. // // The Return field returns a new channel of the type returned by this function. This makes it possible to use this // for callers to receive a response in the cpc library which implements the functions as channel pipes NoHelp bool Call chan API Params interface{} Result func() API }{ "addmultisigaddress": { Handler: AddMultiSigAddress, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan AddMultiSigAddressRes)} }}, "createmultisig": { Handler: CreateMultiSig, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan CreateMultiSigRes)} }}, "createnewaccount": { Handler: CreateNewAccount, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan CreateNewAccountRes)} }}, "dropwallethistory": { Handler: HandleDropWalletHistory, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan HandleDropWalletHistoryRes)} }}, "dumpprivkey": { Handler: DumpPrivKey, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan DumpPrivKeyRes)} }}, "getaccount": { Handler: GetAccount, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetAccountRes)} }}, "getaccountaddress": { Handler: GetAccountAddress, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetAccountAddressRes)} }}, "getaddressesbyaccount": { Handler: GetAddressesByAccount, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetAddressesByAccountRes)} }}, "getbalance": { Handler: GetBalance, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetBalanceRes)} }}, "getbestblock": { Handler: GetBestBlock, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetBestBlockRes)} }}, "getbestblockhash": { Handler: GetBestBlockHash, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetBestBlockHashRes)} }}, "getblockcount": { Handler: GetBlockCount, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetBlockCountRes)} }}, "getinfo": { Handler: GetInfo, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetInfoRes)} }}, "getnewaddress": { Handler: GetNewAddress, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetNewAddressRes)} }}, "getrawchangeaddress": { Handler: GetRawChangeAddress, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetRawChangeAddressRes)} }}, "getreceivedbyaccount": { Handler: GetReceivedByAccount, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetReceivedByAccountRes)} }}, "getreceivedbyaddress": { Handler: GetReceivedByAddress, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetReceivedByAddressRes)} }}, "gettransaction": { Handler: GetTransaction, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetTransactionRes)} }}, "getunconfirmedbalance": { Handler: GetUnconfirmedBalance, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan GetUnconfirmedBalanceRes)} }}, "help": { Handler: HelpNoChainRPC, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan HelpNoChainRPCRes)} }}, "importprivkey": { Handler: ImportPrivKey, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan ImportPrivKeyRes)} }}, "keypoolrefill": { Handler: KeypoolRefill, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan KeypoolRefillRes)} }}, "listaccounts": { Handler: ListAccounts, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan ListAccountsRes)} }}, "listaddresstransactions": { Handler: ListAddressTransactions, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan ListAddressTransactionsRes)} }}, "listalltransactions": { Handler: ListAllTransactions, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan ListAllTransactionsRes)} }}, "listlockunspent": { Handler: ListLockUnspent, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan ListLockUnspentRes)} }}, "listreceivedbyaccount": { Handler: ListReceivedByAccount, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan ListReceivedByAccountRes)} }}, "listreceivedbyaddress": { Handler: ListReceivedByAddress, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan ListReceivedByAddressRes)} }}, "listsinceblock": { Handler: ListSinceBlock, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan ListSinceBlockRes)} }}, "listtransactions": { Handler: ListTransactions, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan ListTransactionsRes)} }}, "listunspent": { Handler: ListUnspent, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan ListUnspentRes)} }}, "renameaccount": { Handler: RenameAccount, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan RenameAccountRes)} }}, "sendfrom": { Handler: LockUnspent, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan LockUnspentRes)} }}, "sendmany": { Handler: SendMany, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan SendManyRes)} }}, "sendtoaddress": { Handler: SendToAddress, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan SendToAddressRes)} }}, "settxfee": { Handler: SetTxFee, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan SetTxFeeRes)} }}, "signmessage": { Handler: SignMessage, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan SignMessageRes)} }}, "signrawtransaction": { Handler: SignRawTransaction, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan SignRawTransactionRes)} }}, "validateaddress": { Handler: ValidateAddress, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan ValidateAddressRes)} }}, "verifymessage": { Handler: VerifyMessage, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan VerifyMessageRes)} }}, "walletislocked": { Handler: WalletIsLocked, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan WalletIsLockedRes)} }}, "walletlock": { Handler: WalletLock, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan WalletLockRes)} }}, "walletpassphrase": { Handler: WalletPassphrase, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan WalletPassphraseRes)} }}, "walletpassphrasechange": { Handler: WalletPassphraseChange, Call: make(chan API, 32), Result: func() API { return API{Ch: make(chan WalletPassphraseChangeRes)} }}, }
RPCHandlers is all of the RPC calls available
- Handler is the handler function
- Call is a channel carrying a struct containing parameters and error that is listened to in RunAPI to dispatch the calls
- Result is a bundle of command parameters and a channel that the result will be sent back on
Get and save the Result function's return, and you can then call the call functions check, result and wait functions for asynchronous and synchronous calls to RPC functions
var RequestUsages = "" /* 1969-byte string literal not displayed */
Functions ¶
func AddMultiSigAddress ¶
func AddMultiSigAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) ( interface{}, error, )
AddMultiSigAddress handles an addmultisigaddress request by adding a multisig address to the given wallet.
func Confirms ¶
Confirms returns the number of confirmations for a transaction in a block at height txHeight (or -1 for an unconfirmed tx) given the chain height curHeight.
func Create ¶
func Create( db walletdb.DB, pubPass, privPass, seed []byte, params *chaincfg.Params, birthday time.Time, ) (e error)
Create creates an new wallet, writing it to an empty database. If the passed seed is non-nil, it is used. Otherwise, a secure random seed of the recommended length is generated.
func CreateMultiSig ¶
func CreateMultiSig(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
CreateMultiSig handles an createmultisig request by returning a multisig address for the given inputs.
func CreateNewAccount ¶
func CreateNewAccount(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
CreateNewAccount handles a createnewaccount request by creating and returning a new account. If the last account has no transaction history as per BIP 0044 a new account cannot be created so an error will be returned.
func CreateSimulationWallet ¶
CreateSimulationWallet is intended to be called from the rpcclient and used to create a wallet for actors involved in simulations.
func CreateWallet ¶
CreateWallet prompts the user for information needed to generate a new wallet and generates the wallet accordingly. The new wallet will reside at the provided path.
func DecodeHexStr ¶
DecodeHexStr decodes the hex encoding of a string, possibly prepending a leading '0' character if there is an odd number of bytes in the hex string. This is to prevent an error for an invalid hex string when using an odd number of bytes when calling hex.Decode.
func DumpPrivKey ¶
func DumpPrivKey(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
DumpPrivKey handles a dumpprivkey request with the private key for a single address, or an appropriate error if the wallet is locked.
func GenerateRPCKeyPair ¶
GenerateRPCKeyPair generates a new RPC TLS keypair and writes the cert and possibly also the key in PEM format to the paths specified by the config. If successful, the new keypair is returned.
func GetAccount ¶
func GetAccount( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
GetAccount handles a getaccount request by returning the account name associated with a single address.
func GetAccountAddress ¶
func GetAccountAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
GetAccountAddress handles a getaccountaddress by returning the most recently-created chained address that has not yet been used (does not yet appear in the blockchain, or any tx that has arrived in the pod mempool).
If the most recently-requested address has been used, a new address (the next chained address in the keypool) is used. This can fail if the keypool runs out (and will return json.ErrRPCWalletKeypoolRanOut if that happens).
func GetAddressesByAccount ¶
func GetAddressesByAccount(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) ( interface{}, error, )
GetAddressesByAccount handles a getaddressesbyaccount request by returning all addresses for an account, or an error if the requested account does not exist.
func GetBalance ¶
func GetBalance(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
GetBalance handles a getbalance request by returning the balance for an account (wallet), or an error if the requested account does not exist.
func GetBestBlock ¶
func GetBestBlock(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
GetBestBlock handles a getbestblock request by returning a JSON object with the height and hash of the most recently processed block.
func GetBestBlockHash ¶
func GetBestBlockHash(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
GetBestBlockHash handles a getbestblockhash request by returning the hash of the most recently processed block.
func GetBlockCount ¶
func GetBlockCount(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
GetBlockCount handles a getblockcount request by returning the chain height of the most recently processed block.
func GetInfo ¶
func GetInfo(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
GetInfo handles a getinfo request by returning the a structure containing information about the current state of btcwallet. exist.
func GetNewAddress ¶
func GetNewAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
GetNewAddress handles a getnewaddress request by returning a new address for an account. If the account does not exist an appropiate error is returned.
TODO: Follow BIP 0044 and warn if number of unused addresses exceeds the gap limit.
func GetRawChangeAddress ¶
func GetRawChangeAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) ( interface{}, error, )
GetRawChangeAddress handles a getrawchangeaddress request by creating and returning a new change address for an account.
Note: bitcoind allows specifying the account as an optional parameter, but ignores the parameter.
func GetReceivedByAccount ¶
func GetReceivedByAccount(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) ( ii interface{}, e error, )
GetReceivedByAccount handles a getreceivedbyaccount request by returning the total amount received by addresses of an account.
func GetReceivedByAddress ¶
func GetReceivedByAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) ( interface{}, error, )
GetReceivedByAddress handles a getreceivedbyaddress request by returning the total amount received by a single address.
func GetTransaction ¶
func GetTransaction(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
GetTransaction handles a gettransaction request by returning details about a single transaction saved by wallet.
func GetUnconfirmedBalance ¶
func GetUnconfirmedBalance(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) ( interface{}, error, )
GetUnconfirmedBalance handles a getunconfirmedbalance extension request by returning the current unconfirmed balance of an account.
func HTTPBasicAuth ¶
HTTPBasicAuth returns the UTF-8 bytes of the HTTP Basic authentication string:
"Basic " + base64(username + ":" + password)
func HandleDropWalletHistory ¶
func HandleDropWalletHistory(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) ( out interface{}, e error, )
func Help ¶
func Help(icmd interface{}, w *Wallet, chainClient *chainclient.RPCClient, ) (interface{}, error)
Help handles the Help request by returning one line usage of all available methods, or full Help for a specific method. The chainClient is optional, and this is simply a helper function for the HelpNoChainRPC and HelpWithChainRPC handlers.
func HelpDescsEnUS ¶
func HelpNoChainRPC ¶
func HelpNoChainRPC( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
HelpNoChainRPC handles the help request when the RPC server has not been associated with a consensus RPC client. No help messages are included for passthrough requests.
func HelpWithChainRPC ¶
func HelpWithChainRPC( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
HelpWithChainRPC handles the help request when the RPC server has been associated with a consensus RPC client. The additional RPC client is used to include help messages for methods implemented by the consensus server via RPC passthrough.
func IDPointer ¶
func IDPointer(id interface{}) (p *interface{})
IDPointer returns a pointer to the passed ID, or nil if the interface is nil. Interface pointers are usually a red flag of doing something incorrectly, but this is only implemented here to work around an oddity with json, which uses empty interface pointers for response IDs.
func ImportPrivKey ¶
func ImportPrivKey(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
ImportPrivKey handles an importprivkey request by parsing a WIF-encoded private key and adding it to an account.
func IsNilOrEmpty ¶
func JSONAuthFail ¶
func JSONAuthFail(w http.ResponseWriter)
JSONAuthFail sends a message back to the client if the http auth is rejected.
func KeypoolRefill ¶
func KeypoolRefill( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
KeypoolRefill handles the keypoolrefill command. Since we handle the keypool automatically this does nothing since refilling is never manually required.
func ListAccounts ¶
func ListAccounts( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
ListAccounts handles a listaccounts request by returning a map of account names to their balances.
func ListAddressTransactions ¶
func ListAddressTransactions( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
ListAddressTransactions handles a listaddresstransactions request by returning an array of maps with details of spent and received wallet transactions.
The form of the reply is identical to listtransactions, but the array elements are limited to transaction details which are about the addresess included in the request.
func ListAllTransactions ¶
func ListAllTransactions( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
ListAllTransactions handles a listalltransactions request by returning a map with details of sent and received wallet transactions. This is similar to ListTransactions, except it takes only a single optional argument for the account name and replies with all transactions.
func ListLockUnspent ¶
func ListLockUnspent( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
ListLockUnspent handles a listlockunspent request by returning an slice of all locked outpoints.
func ListReceivedByAccount ¶
func ListReceivedByAccount( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
ListReceivedByAccount handles a listreceivedbyaccount request by returning a slice of objects, each one containing:
"account": the receiving account; "amount": total amount received by the account; "confirmations": number of confirmations of the most recent transaction.
It takes two parameters:
"minconf": minimum number of confirmations to consider a transaction - default: one; "includeempty": whether or not to include addresses that have no transactions - default: false.
func ListReceivedByAddress ¶
func ListReceivedByAddress( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
ListReceivedByAddress handles a listreceivedbyaddress request by returning a slice of objects, each one containing:
"account": the account of the receiving address; "address": the receiving address; "amount": total amount received by the address; "confirmations": number of confirmations of the most recent transaction.
It takes two parameters:
"minconf": minimum number of confirmations to consider a transaction - default: one; "includeempty": whether or not to include addresses that have no transactions - default: false.
func ListSinceBlock ¶
func ListSinceBlock( icmd interface{}, w *Wallet, cc ...*chainclient.RPCClient, ) (interface{}, error)
ListSinceBlock handles a listsinceblock request by returning an array of maps with details of sent and received wallet transactions since the given block.
func ListTransactions ¶
func ListTransactions(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) ( txs interface{}, e error, )
ListTransactions handles a listtransactions request by returning an array of maps with details of sent and recevied wallet transactions.
func ListUnspent ¶
func ListUnspent( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
ListUnspent handles the listunspent command.
func LoadWallet ¶
LoadWallet ...
func LockUnspent ¶
func LockUnspent( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
LockUnspent handles the lockunspent command.
func Main ¶
Main is a work-around main function that is required since deferred functions (such as log flushing) are not called with calls to os.Exit. Instead, main runs this function and checks for a non-nil error, at point any defers have already run, and if the error is non-nil, the program can be exited with an error exit status.
func MakeMultiSigScript ¶
MakeMultiSigScript is a helper function to combine common logic for AddMultiSig and CreateMultiSig.
func MakeOutputs ¶
func MakeOutputs(pairs map[string]amt.Amount, chainParams *chaincfg.Params, ) ([]*wire.TxOut, error)
MakeOutputs creates a slice of transaction outputs from a pair of address strings to amounts. This is used to create the outputs to include in newly created transactions from a JSON object describing the output destinations and amounts.
func MakeResponse ¶
MakeResponse makes the JSON-RPC response struct for the result and error returned by a requestHandler. The returned response is not ready for marshaling and sending off to a client, but must be
func NetworkDir ¶
NetworkDir returns the directory name of a network directory to hold wallet files.
func OpenRPCKeyPair ¶
func OpenRPCKeyPair(config *config.Config) (tls.Certificate, error)
OpenRPCKeyPair creates or loads the RPC TLS keypair specified by the application config. This function respects the pod.Config.OneTimeTLSKey setting.
func RenameAccount ¶
func RenameAccount(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
RenameAccount handles a renameaccount request by renaming an account. If the account does not exist an appropiate error will be returned.
func RunAPI ¶
func RunAPI(chainRPC *chainclient.RPCClient, wallet *Wallet, quit qu.C)
RunAPI starts up the api handler server that receives rpc.API messages and runs the handler and returns the result Note that the parameters are type asserted to prevent the consumer of the API from sending wrong message types not because it's necessary since they are interfaces end to end
func SendFrom ¶
func SendFrom(icmd interface{}, w *Wallet, chainClient *chainclient.RPCClient, ) (interface{}, error)
SendFrom handles a sendfrom RPC request by creating a new transaction spending unspent transaction outputs for a wallet to another payment address. Leftover inputs not sent to the payment address or a fee for the miner are sent back to a new address in the wallet. Upon success, the TxID for the created transaction is returned.
func SendMany ¶
func SendMany( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
SendMany handles a sendmany RPC request by creating a new transaction spending unspent transaction outputs for a wallet to any number of payment addresses.
Leftover inputs not sent to the payment address or a fee for the miner are sent back to a new address in the wallet. Upon success, the TxID for the created transaction is returned.
func SendPairs ¶
func SendPairs( w *Wallet, amounts map[string]amt.Amount, account uint32, minconf int32, feeSatPerKb amt.Amount, ) (string, error)
SendPairs creates and sends payment transactions. It returns the transaction hash in string format upon success All errors are returned in json.RPCError format
func SendToAddress ¶
func SendToAddress( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
SendToAddress handles a sendtoaddress RPC request by creating a new transaction spending unspent transaction outputs for a wallet to another payment address.
Leftover inputs not sent to the payment address or a fee for the miner are sent back to a new address in the wallet. Upon success, the TxID for the created transaction is returned.
func SetTxFee ¶
func SetTxFee( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
SetTxFee sets the transaction fee per kilobyte added to transactions.
func SignMessage ¶
func SignMessage( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
SignMessage signs the given message with the private key for the given address
func SignRawTransaction ¶
func SignRawTransaction( icmd interface{}, w *Wallet, cc ...*chainclient.RPCClient, ) (interface{}, error)
SignRawTransaction handles the signrawtransaction command.
func StartChainRPC ¶
func StartChainRPC( config *config.Config, activeNet *chaincfg.Params, certs []byte, quit qu.C, ) (rpcC *chainclient.RPCClient, e error)
StartChainRPC opens a RPC client connection to a pod server for blockchain services. This function uses the RPC options from the global config and there is no recovery in case the server is not available or if there is an authentication error. Instead, all requests to the client will simply error.
func Throttled ¶
Throttled wraps an http.Handler with throttling of concurrent active clients by responding with an HTTP 429 when the threshold is crossed.
func ThrottledFn ¶
func ThrottledFn(threshold int64, f http.HandlerFunc) http.Handler
ThrottledFn wraps an http.HandlerFunc with throttling of concurrent active clients by responding with an HTTP 429 when the threshold is crossed.
func Unimplemented ¶
Unimplemented handles an Unimplemented RPC request with the appropiate error.
func Unsupported ¶
Unsupported handles a standard bitcoind RPC request which is Unsupported by btcwallet due to design differences.
func ValidateAddress ¶
func ValidateAddress(icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
ValidateAddress handles the validateaddress command.
func VerifyMessage ¶
func VerifyMessage( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
VerifyMessage handles the verifymessage command by verifying the provided compact signature for the given address and message.
func WalletIsLocked ¶
func WalletIsLocked( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
WalletIsLocked handles the walletislocked extension request by returning the current lock state (false for unlocked, true for locked) of an account.
func WalletLock ¶
func WalletLock( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
WalletLock handles a walletlock request by locking the all account wallets, returning an error if any wallet is not encrypted (for example, a watching-only wallet).
func WalletPassphrase ¶
func WalletPassphrase( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
WalletPassphrase responds to the walletpassphrase request by unlocking the wallet. The decryption key is saved in the wallet until timeout seconds expires, after which the wallet is locked.
func WalletPassphraseChange ¶
func WalletPassphraseChange( icmd interface{}, w *Wallet, chainClient ...*chainclient.RPCClient, ) (interface{}, error)
WalletPassphraseChange responds to the walletpassphrasechange request by unlocking all accounts with the provided old passphrase, and re-encrypting each private key with an AES key derived from the new passphrase.
If the old passphrase is correct and the passphrase is changed, all wallets will be immediately locked.
Types ¶
type API ¶
type API struct { Ch interface{} Params interface{} Result interface{} }
API stores the channel, parameters and result values from calls via the channel
func (API) AddMultiSigAddress ¶
func (a API) AddMultiSigAddress(cmd *btcjson.AddMultisigAddressCmd) (e error)
AddMultiSigAddress calls the method with the given parameters
func (API) AddMultiSigAddressCheck ¶
AddMultiSigAddressCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) AddMultiSigAddressGetRes ¶
AddMultiSigAddressGetRes returns a pointer to the value in the Result field
func (API) AddMultiSigAddressWait ¶
func (a API) AddMultiSigAddressWait(cmd *btcjson.AddMultisigAddressCmd) (out *string, e error)
AddMultiSigAddressWait calls the method and blocks until it returns or 5 seconds passes
func (API) CreateMultiSig ¶
func (a API) CreateMultiSig(cmd *btcjson.CreateMultisigCmd) (e error)
CreateMultiSig calls the method with the given parameters
func (API) CreateMultiSigCheck ¶
CreateMultiSigCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) CreateMultiSigGetRes ¶
func (a API) CreateMultiSigGetRes() (out *btcjson.CreateMultiSigResult, e error)
CreateMultiSigGetRes returns a pointer to the value in the Result field
func (API) CreateMultiSigWait ¶
func (a API) CreateMultiSigWait(cmd *btcjson.CreateMultisigCmd) (out *btcjson.CreateMultiSigResult, e error)
CreateMultiSigWait calls the method and blocks until it returns or 5 seconds passes
func (API) CreateNewAccount ¶
func (a API) CreateNewAccount(cmd *btcjson.CreateNewAccountCmd) (e error)
CreateNewAccount calls the method with the given parameters
func (API) CreateNewAccountCheck ¶
CreateNewAccountCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) CreateNewAccountGetRes ¶
CreateNewAccountGetRes returns a pointer to the value in the Result field
func (API) CreateNewAccountWait ¶
func (a API) CreateNewAccountWait(cmd *btcjson.CreateNewAccountCmd) (out *None, e error)
CreateNewAccountWait calls the method and blocks until it returns or 5 seconds passes
func (API) DumpPrivKey ¶
func (a API) DumpPrivKey(cmd *btcjson.DumpPrivKeyCmd) (e error)
DumpPrivKey calls the method with the given parameters
func (API) DumpPrivKeyCheck ¶
DumpPrivKeyCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) DumpPrivKeyGetRes ¶
DumpPrivKeyGetRes returns a pointer to the value in the Result field
func (API) DumpPrivKeyWait ¶
func (a API) DumpPrivKeyWait(cmd *btcjson.DumpPrivKeyCmd) (out *string, e error)
DumpPrivKeyWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetAccount ¶
func (a API) GetAccount(cmd *btcjson.GetAccountCmd) (e error)
GetAccount calls the method with the given parameters
func (API) GetAccountAddress ¶
func (a API) GetAccountAddress(cmd *btcjson.GetAccountAddressCmd) (e error)
GetAccountAddress calls the method with the given parameters
func (API) GetAccountAddressCheck ¶
GetAccountAddressCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetAccountAddressGetRes ¶
GetAccountAddressGetRes returns a pointer to the value in the Result field
func (API) GetAccountAddressWait ¶
func (a API) GetAccountAddressWait(cmd *btcjson.GetAccountAddressCmd) (out *string, e error)
GetAccountAddressWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetAccountCheck ¶
GetAccountCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetAccountGetRes ¶
GetAccountGetRes returns a pointer to the value in the Result field
func (API) GetAccountWait ¶
func (a API) GetAccountWait(cmd *btcjson.GetAccountCmd) (out *string, e error)
GetAccountWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetAddressesByAccount ¶
func (a API) GetAddressesByAccount(cmd *btcjson.GetAddressesByAccountCmd) (e error)
GetAddressesByAccount calls the method with the given parameters
func (API) GetAddressesByAccountCheck ¶
GetAddressesByAccountCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetAddressesByAccountGetRes ¶
GetAddressesByAccountGetRes returns a pointer to the value in the Result field
func (API) GetAddressesByAccountWait ¶
func (a API) GetAddressesByAccountWait(cmd *btcjson.GetAddressesByAccountCmd) (out *[]string, e error)
GetAddressesByAccountWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetBalance ¶
func (a API) GetBalance(cmd *btcjson.GetBalanceCmd) (e error)
GetBalance calls the method with the given parameters
func (API) GetBalanceCheck ¶
GetBalanceCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetBalanceGetRes ¶
GetBalanceGetRes returns a pointer to the value in the Result field
func (API) GetBalanceWait ¶
func (a API) GetBalanceWait(cmd *btcjson.GetBalanceCmd) (out *float64, e error)
GetBalanceWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetBestBlock ¶
GetBestBlock calls the method with the given parameters
func (API) GetBestBlockCheck ¶
GetBestBlockCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetBestBlockGetRes ¶
func (a API) GetBestBlockGetRes() (out *btcjson.GetBestBlockResult, e error)
GetBestBlockGetRes returns a pointer to the value in the Result field
func (API) GetBestBlockHash ¶
GetBestBlockHash calls the method with the given parameters
func (API) GetBestBlockHashCheck ¶
GetBestBlockHashCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetBestBlockHashGetRes ¶
GetBestBlockHashGetRes returns a pointer to the value in the Result field
func (API) GetBestBlockHashWait ¶
GetBestBlockHashWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetBestBlockWait ¶
func (a API) GetBestBlockWait(cmd *None) (out *btcjson.GetBestBlockResult, e error)
GetBestBlockWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetBlockCount ¶
GetBlockCount calls the method with the given parameters
func (API) GetBlockCountCheck ¶
GetBlockCountCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetBlockCountGetRes ¶
GetBlockCountGetRes returns a pointer to the value in the Result field
func (API) GetBlockCountWait ¶
GetBlockCountWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetInfoCheck ¶
GetInfoCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetInfoGetRes ¶
func (a API) GetInfoGetRes() (out *btcjson.InfoWalletResult, e error)
GetInfoGetRes returns a pointer to the value in the Result field
func (API) GetInfoWait ¶
func (a API) GetInfoWait(cmd *None) (out *btcjson.InfoWalletResult, e error)
GetInfoWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetNewAddress ¶
func (a API) GetNewAddress(cmd *btcjson.GetNewAddressCmd) (e error)
GetNewAddress calls the method with the given parameters
func (API) GetNewAddressCheck ¶
GetNewAddressCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetNewAddressGetRes ¶
GetNewAddressGetRes returns a pointer to the value in the Result field
func (API) GetNewAddressWait ¶
func (a API) GetNewAddressWait(cmd *btcjson.GetNewAddressCmd) (out *string, e error)
GetNewAddressWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetRawChangeAddress ¶
func (a API) GetRawChangeAddress(cmd *btcjson.GetRawChangeAddressCmd) (e error)
GetRawChangeAddress calls the method with the given parameters
func (API) GetRawChangeAddressCheck ¶
GetRawChangeAddressCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetRawChangeAddressGetRes ¶
GetRawChangeAddressGetRes returns a pointer to the value in the Result field
func (API) GetRawChangeAddressWait ¶
func (a API) GetRawChangeAddressWait(cmd *btcjson.GetRawChangeAddressCmd) (out *string, e error)
GetRawChangeAddressWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetReceivedByAccount ¶
func (a API) GetReceivedByAccount(cmd *btcjson.GetReceivedByAccountCmd) (e error)
GetReceivedByAccount calls the method with the given parameters
func (API) GetReceivedByAccountCheck ¶
GetReceivedByAccountCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetReceivedByAccountGetRes ¶
GetReceivedByAccountGetRes returns a pointer to the value in the Result field
func (API) GetReceivedByAccountWait ¶
func (a API) GetReceivedByAccountWait(cmd *btcjson.GetReceivedByAccountCmd) (out *float64, e error)
GetReceivedByAccountWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetReceivedByAddress ¶
func (a API) GetReceivedByAddress(cmd *btcjson.GetReceivedByAddressCmd) (e error)
GetReceivedByAddress calls the method with the given parameters
func (API) GetReceivedByAddressCheck ¶
GetReceivedByAddressCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetReceivedByAddressGetRes ¶
GetReceivedByAddressGetRes returns a pointer to the value in the Result field
func (API) GetReceivedByAddressWait ¶
func (a API) GetReceivedByAddressWait(cmd *btcjson.GetReceivedByAddressCmd) (out *float64, e error)
GetReceivedByAddressWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetTransaction ¶
func (a API) GetTransaction(cmd *btcjson.GetTransactionCmd) (e error)
GetTransaction calls the method with the given parameters
func (API) GetTransactionCheck ¶
GetTransactionCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetTransactionGetRes ¶
func (a API) GetTransactionGetRes() (out *btcjson.GetTransactionResult, e error)
GetTransactionGetRes returns a pointer to the value in the Result field
func (API) GetTransactionWait ¶
func (a API) GetTransactionWait(cmd *btcjson.GetTransactionCmd) (out *btcjson.GetTransactionResult, e error)
GetTransactionWait calls the method and blocks until it returns or 5 seconds passes
func (API) GetUnconfirmedBalance ¶
func (a API) GetUnconfirmedBalance(cmd *btcjson.GetUnconfirmedBalanceCmd) (e error)
GetUnconfirmedBalance calls the method with the given parameters
func (API) GetUnconfirmedBalanceCheck ¶
GetUnconfirmedBalanceCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) GetUnconfirmedBalanceGetRes ¶
GetUnconfirmedBalanceGetRes returns a pointer to the value in the Result field
func (API) GetUnconfirmedBalanceWait ¶
func (a API) GetUnconfirmedBalanceWait(cmd *btcjson.GetUnconfirmedBalanceCmd) (out *float64, e error)
GetUnconfirmedBalanceWait calls the method and blocks until it returns or 5 seconds passes
func (API) HandleDropWalletHistory ¶
HandleDropWalletHistory calls the method with the given parameters
func (API) HandleDropWalletHistoryCheck ¶
HandleDropWalletHistoryCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) HandleDropWalletHistoryGetRes ¶
HandleDropWalletHistoryGetRes returns a pointer to the value in the Result field
func (API) HandleDropWalletHistoryWait ¶
HandleDropWalletHistoryWait calls the method and blocks until it returns or 5 seconds passes
func (API) HelpNoChainRPC ¶
HelpNoChainRPC calls the method with the given parameters
func (API) HelpNoChainRPCCheck ¶
HelpNoChainRPCCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) HelpNoChainRPCGetRes ¶
HelpNoChainRPCGetRes returns a pointer to the value in the Result field
func (API) HelpNoChainRPCWait ¶
HelpNoChainRPCWait calls the method and blocks until it returns or 5 seconds passes
func (API) ImportPrivKey ¶
func (a API) ImportPrivKey(cmd *btcjson.ImportPrivKeyCmd) (e error)
ImportPrivKey calls the method with the given parameters
func (API) ImportPrivKeyCheck ¶
ImportPrivKeyCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) ImportPrivKeyGetRes ¶
ImportPrivKeyGetRes returns a pointer to the value in the Result field
func (API) ImportPrivKeyWait ¶
func (a API) ImportPrivKeyWait(cmd *btcjson.ImportPrivKeyCmd) (out *None, e error)
ImportPrivKeyWait calls the method and blocks until it returns or 5 seconds passes
func (API) KeypoolRefill ¶
KeypoolRefill calls the method with the given parameters
func (API) KeypoolRefillCheck ¶
KeypoolRefillCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) KeypoolRefillGetRes ¶
KeypoolRefillGetRes returns a pointer to the value in the Result field
func (API) KeypoolRefillWait ¶
KeypoolRefillWait calls the method and blocks until it returns or 5 seconds passes
func (API) ListAccounts ¶
func (a API) ListAccounts(cmd *btcjson.ListAccountsCmd) (e error)
ListAccounts calls the method with the given parameters
func (API) ListAccountsCheck ¶
ListAccountsCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) ListAccountsGetRes ¶
ListAccountsGetRes returns a pointer to the value in the Result field
func (API) ListAccountsWait ¶
ListAccountsWait calls the method and blocks until it returns or 5 seconds passes
func (API) ListAddressTransactions ¶
func (a API) ListAddressTransactions(cmd *btcjson.ListAddressTransactionsCmd) (e error)
ListAddressTransactions calls the method with the given parameters
func (API) ListAddressTransactionsCheck ¶
ListAddressTransactionsCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) ListAddressTransactionsGetRes ¶
func (a API) ListAddressTransactionsGetRes() (out *[]btcjson.ListTransactionsResult, e error)
ListAddressTransactionsGetRes returns a pointer to the value in the Result field
func (API) ListAddressTransactionsWait ¶
func (a API) ListAddressTransactionsWait(cmd *btcjson.ListAddressTransactionsCmd) (out *[]btcjson.ListTransactionsResult, e error)
ListAddressTransactionsWait calls the method and blocks until it returns or 5 seconds passes
func (API) ListAllTransactions ¶
func (a API) ListAllTransactions(cmd *btcjson.ListAllTransactionsCmd) (e error)
ListAllTransactions calls the method with the given parameters
func (API) ListAllTransactionsCheck ¶
ListAllTransactionsCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) ListAllTransactionsGetRes ¶
func (a API) ListAllTransactionsGetRes() (out *[]btcjson.ListTransactionsResult, e error)
ListAllTransactionsGetRes returns a pointer to the value in the Result field
func (API) ListAllTransactionsWait ¶
func (a API) ListAllTransactionsWait(cmd *btcjson.ListAllTransactionsCmd) (out *[]btcjson.ListTransactionsResult, e error)
ListAllTransactionsWait calls the method and blocks until it returns or 5 seconds passes
func (API) ListLockUnspent ¶
ListLockUnspent calls the method with the given parameters
func (API) ListLockUnspentCheck ¶
ListLockUnspentCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) ListLockUnspentGetRes ¶
func (a API) ListLockUnspentGetRes() (out *[]btcjson.TransactionInput, e error)
ListLockUnspentGetRes returns a pointer to the value in the Result field
func (API) ListLockUnspentWait ¶
func (a API) ListLockUnspentWait(cmd *None) (out *[]btcjson.TransactionInput, e error)
ListLockUnspentWait calls the method and blocks until it returns or 5 seconds passes
func (API) ListReceivedByAccount ¶
func (a API) ListReceivedByAccount(cmd *btcjson.ListReceivedByAccountCmd) (e error)
ListReceivedByAccount calls the method with the given parameters
func (API) ListReceivedByAccountCheck ¶
ListReceivedByAccountCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) ListReceivedByAccountGetRes ¶
func (a API) ListReceivedByAccountGetRes() (out *[]btcjson.ListReceivedByAccountResult, e error)
ListReceivedByAccountGetRes returns a pointer to the value in the Result field
func (API) ListReceivedByAccountWait ¶
func (a API) ListReceivedByAccountWait(cmd *btcjson.ListReceivedByAccountCmd) (out *[]btcjson.ListReceivedByAccountResult, e error)
ListReceivedByAccountWait calls the method and blocks until it returns or 5 seconds passes
func (API) ListReceivedByAddress ¶
func (a API) ListReceivedByAddress(cmd *btcjson.ListReceivedByAddressCmd) (e error)
ListReceivedByAddress calls the method with the given parameters
func (API) ListReceivedByAddressCheck ¶
ListReceivedByAddressCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) ListReceivedByAddressGetRes ¶
func (a API) ListReceivedByAddressGetRes() (out *btcjson.ListReceivedByAddressResult, e error)
ListReceivedByAddressGetRes returns a pointer to the value in the Result field
func (API) ListReceivedByAddressWait ¶
func (a API) ListReceivedByAddressWait(cmd *btcjson.ListReceivedByAddressCmd) (out *btcjson.ListReceivedByAddressResult, e error)
ListReceivedByAddressWait calls the method and blocks until it returns or 5 seconds passes
func (API) ListSinceBlock ¶
func (a API) ListSinceBlock(cmd btcjson.ListSinceBlockCmd) (e error)
ListSinceBlock calls the method with the given parameters
func (API) ListSinceBlockCheck ¶
ListSinceBlockCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) ListSinceBlockGetRes ¶
func (a API) ListSinceBlockGetRes() (out *btcjson.ListSinceBlockResult, e error)
ListSinceBlockGetRes returns a pointer to the value in the Result field
func (API) ListSinceBlockWait ¶
func (a API) ListSinceBlockWait(cmd btcjson.ListSinceBlockCmd) (out *btcjson.ListSinceBlockResult, e error)
ListSinceBlockWait calls the method and blocks until it returns or 5 seconds passes
func (API) ListTransactions ¶
func (a API) ListTransactions(cmd *btcjson.ListTransactionsCmd) (e error)
ListTransactions calls the method with the given parameters
func (API) ListTransactionsCheck ¶
ListTransactionsCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) ListTransactionsGetRes ¶
func (a API) ListTransactionsGetRes() (out *[]btcjson.ListTransactionsResult, e error)
ListTransactionsGetRes returns a pointer to the value in the Result field
func (API) ListTransactionsWait ¶
func (a API) ListTransactionsWait(cmd *btcjson.ListTransactionsCmd) (out *[]btcjson.ListTransactionsResult, e error)
ListTransactionsWait calls the method and blocks until it returns or 5 seconds passes
func (API) ListUnspent ¶
func (a API) ListUnspent(cmd *btcjson.ListUnspentCmd) (e error)
ListUnspent calls the method with the given parameters
func (API) ListUnspentCheck ¶
ListUnspentCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) ListUnspentGetRes ¶
func (a API) ListUnspentGetRes() (out *[]btcjson.ListUnspentResult, e error)
ListUnspentGetRes returns a pointer to the value in the Result field
func (API) ListUnspentWait ¶
func (a API) ListUnspentWait(cmd *btcjson.ListUnspentCmd) (out *[]btcjson.ListUnspentResult, e error)
ListUnspentWait calls the method and blocks until it returns or 5 seconds passes
func (API) LockUnspent ¶
func (a API) LockUnspent(cmd btcjson.LockUnspentCmd) (e error)
LockUnspent calls the method with the given parameters
func (API) LockUnspentCheck ¶
LockUnspentCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) LockUnspentGetRes ¶
LockUnspentGetRes returns a pointer to the value in the Result field
func (API) LockUnspentWait ¶
func (a API) LockUnspentWait(cmd btcjson.LockUnspentCmd) (out *bool, e error)
LockUnspentWait calls the method and blocks until it returns or 5 seconds passes
func (API) RenameAccount ¶
func (a API) RenameAccount(cmd *btcjson.RenameAccountCmd) (e error)
RenameAccount calls the method with the given parameters
func (API) RenameAccountCheck ¶
RenameAccountCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) RenameAccountGetRes ¶
RenameAccountGetRes returns a pointer to the value in the Result field
func (API) RenameAccountWait ¶
func (a API) RenameAccountWait(cmd *btcjson.RenameAccountCmd) (out *None, e error)
RenameAccountWait calls the method and blocks until it returns or 5 seconds passes
func (API) SendMany ¶
func (a API) SendMany(cmd *btcjson.SendManyCmd) (e error)
SendMany calls the method with the given parameters
func (API) SendManyCheck ¶
SendManyCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) SendManyGetRes ¶
SendManyGetRes returns a pointer to the value in the Result field
func (API) SendManyWait ¶
func (a API) SendManyWait(cmd *btcjson.SendManyCmd) (out *string, e error)
SendManyWait calls the method and blocks until it returns or 5 seconds passes
func (API) SendToAddress ¶
func (a API) SendToAddress(cmd *btcjson.SendToAddressCmd) (e error)
SendToAddress calls the method with the given parameters
func (API) SendToAddressCheck ¶
SendToAddressCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) SendToAddressGetRes ¶
SendToAddressGetRes returns a pointer to the value in the Result field
func (API) SendToAddressWait ¶
func (a API) SendToAddressWait(cmd *btcjson.SendToAddressCmd) (out *string, e error)
SendToAddressWait calls the method and blocks until it returns or 5 seconds passes
func (API) SetTxFee ¶
func (a API) SetTxFee(cmd *btcjson.SetTxFeeCmd) (e error)
SetTxFee calls the method with the given parameters
func (API) SetTxFeeCheck ¶
SetTxFeeCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) SetTxFeeGetRes ¶
SetTxFeeGetRes returns a pointer to the value in the Result field
func (API) SetTxFeeWait ¶
func (a API) SetTxFeeWait(cmd *btcjson.SetTxFeeCmd) (out *bool, e error)
SetTxFeeWait calls the method and blocks until it returns or 5 seconds passes
func (API) SignMessage ¶
func (a API) SignMessage(cmd *btcjson.SignMessageCmd) (e error)
SignMessage calls the method with the given parameters
func (API) SignMessageCheck ¶
SignMessageCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) SignMessageGetRes ¶
SignMessageGetRes returns a pointer to the value in the Result field
func (API) SignMessageWait ¶
func (a API) SignMessageWait(cmd *btcjson.SignMessageCmd) (out *string, e error)
SignMessageWait calls the method and blocks until it returns or 5 seconds passes
func (API) SignRawTransaction ¶
func (a API) SignRawTransaction(cmd btcjson.SignRawTransactionCmd) (e error)
SignRawTransaction calls the method with the given parameters
func (API) SignRawTransactionCheck ¶
SignRawTransactionCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) SignRawTransactionGetRes ¶
func (a API) SignRawTransactionGetRes() (out *btcjson.SignRawTransactionResult, e error)
SignRawTransactionGetRes returns a pointer to the value in the Result field
func (API) SignRawTransactionWait ¶
func (a API) SignRawTransactionWait(cmd btcjson.SignRawTransactionCmd) (out *btcjson.SignRawTransactionResult, e error)
SignRawTransactionWait calls the method and blocks until it returns or 5 seconds passes
func (API) ValidateAddress ¶
func (a API) ValidateAddress(cmd *btcjson.ValidateAddressCmd) (e error)
ValidateAddress calls the method with the given parameters
func (API) ValidateAddressCheck ¶
ValidateAddressCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) ValidateAddressGetRes ¶
func (a API) ValidateAddressGetRes() (out *btcjson.ValidateAddressWalletResult, e error)
ValidateAddressGetRes returns a pointer to the value in the Result field
func (API) ValidateAddressWait ¶
func (a API) ValidateAddressWait(cmd *btcjson.ValidateAddressCmd) (out *btcjson.ValidateAddressWalletResult, e error)
ValidateAddressWait calls the method and blocks until it returns or 5 seconds passes
func (API) VerifyMessage ¶
func (a API) VerifyMessage(cmd *btcjson.VerifyMessageCmd) (e error)
VerifyMessage calls the method with the given parameters
func (API) VerifyMessageCheck ¶
VerifyMessageCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) VerifyMessageGetRes ¶
VerifyMessageGetRes returns a pointer to the value in the Result field
func (API) VerifyMessageWait ¶
func (a API) VerifyMessageWait(cmd *btcjson.VerifyMessageCmd) (out *bool, e error)
VerifyMessageWait calls the method and blocks until it returns or 5 seconds passes
func (API) WalletIsLocked ¶
WalletIsLocked calls the method with the given parameters
func (API) WalletIsLockedCheck ¶
WalletIsLockedCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) WalletIsLockedGetRes ¶
WalletIsLockedGetRes returns a pointer to the value in the Result field
func (API) WalletIsLockedWait ¶
WalletIsLockedWait calls the method and blocks until it returns or 5 seconds passes
func (API) WalletLock ¶
WalletLock calls the method with the given parameters
func (API) WalletLockCheck ¶
WalletLockCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) WalletLockGetRes ¶
WalletLockGetRes returns a pointer to the value in the Result field
func (API) WalletLockWait ¶
WalletLockWait calls the method and blocks until it returns or 5 seconds passes
func (API) WalletPassphrase ¶
func (a API) WalletPassphrase(cmd *btcjson.WalletPassphraseCmd) (e error)
WalletPassphrase calls the method with the given parameters
func (API) WalletPassphraseChange ¶
func (a API) WalletPassphraseChange(cmd *btcjson.WalletPassphraseChangeCmd) (e error)
WalletPassphraseChange calls the method with the given parameters
func (API) WalletPassphraseChangeCheck ¶
WalletPassphraseChangeCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) WalletPassphraseChangeGetRes ¶
WalletPassphraseChangeGetRes returns a pointer to the value in the Result field
func (API) WalletPassphraseChangeWait ¶
func (a API) WalletPassphraseChangeWait(cmd *btcjson.WalletPassphraseChangeCmd) (out *None, e error)
WalletPassphraseChangeWait calls the method and blocks until it returns or 5 seconds passes
func (API) WalletPassphraseCheck ¶
WalletPassphraseCheck checks if a new message arrived on the result channel and returns true if it does, as well as storing the value in the Result field
func (API) WalletPassphraseGetRes ¶
WalletPassphraseGetRes returns a pointer to the value in the Result field
func (API) WalletPassphraseWait ¶
func (a API) WalletPassphraseWait(cmd *btcjson.WalletPassphraseCmd) (out *None, e error)
WalletPassphraseWait calls the method and blocks until it returns or 5 seconds passes
type AccountBalance ¶
AccountBalance associates a total (zero confirmation) balance with an account. Balances for other minimum confirmation counts require more expensive logic and it is not clear which minimums a client is interested in, so they are not included.
type AccountBalanceResult ¶
type AccountBalanceResult struct { AccountNumber uint32 AccountName string AccountBalance amt.Amount }
AccountBalanceResult is a single result for the Wallet.AccountBalances method.
type AccountNotification ¶
type AccountNotification struct { AccountNumber uint32 AccountName string ExternalKeyCount uint32 InternalKeyCount uint32 ImportedKeyCount uint32 }
AccountNotification contains properties regarding an account, such as its name and the number of derived and imported keys. When any of these properties change, the notification is fired.
type AccountNotificationsClient ¶
type AccountNotificationsClient struct { C chan *AccountNotification // contains filtered or unexported fields }
AccountNotificationsClient receives AccountNotifications over the channel C.
func (*AccountNotificationsClient) Done ¶
func (c *AccountNotificationsClient) Done()
Done unregisters the client from the server and drains any remaining messages. It must be called exactly once when the client is finished receiving notifications.
type AccountResult ¶
type AccountResult struct { waddrmgr.AccountProperties TotalBalance amt.Amount }
AccountResult is a single account result for the AccountsResult type.
type AccountTotalReceivedResult ¶
type AccountTotalReceivedResult struct { AccountNumber uint32 AccountName string TotalReceived amt.Amount LastConfirmation int32 }
AccountTotalReceivedResult is a single result for the Wallet.TotalReceivedForAccounts method.
type AccountsResult ¶
type AccountsResult struct { Accounts []AccountResult CurrentBlockHash *chainhash.Hash CurrentBlockHeight int32 }
AccountsResult is the result of the wallet's Accounts method. See that method for more details.
type AddMultiSigAddressRes ¶
type AddMultiSigAddressRes struct { Res *string // contains filtered or unexported fields }
AddMultiSigAddressRes is the result from a call to AddMultiSigAddress
type Balances ¶
Balances records total, spendable (by policy), and immature coinbase reward balance amounts.
type Block ¶
type Block struct { Hash *chainhash.Hash Height int32 Timestamp int64 Transactions []TransactionSummary }
Block contains the properties and all relevant transactions of an attached block.
type BlockIdentifier ¶
type BlockIdentifier struct {
// contains filtered or unexported fields
}
BlockIdentifier identifies a block by either a height or a hash.
func NewBlockIdentifierFromHash ¶
func NewBlockIdentifierFromHash(hash *chainhash.Hash) *BlockIdentifier
NewBlockIdentifierFromHash constructs a BlockIdentifier for a block hash.
func NewBlockIdentifierFromHeight ¶
func NewBlockIdentifierFromHeight(height int32) *BlockIdentifier
NewBlockIdentifierFromHeight constructs a BlockIdentifier for a block height.
type BlockIdentity ¶
BlockIdentity identifies a block, or the lack of one (used to describe an unmined transaction).
func (*BlockIdentity) None ¶
func (b *BlockIdentity) None() bool
None returns whether there is no block described by the instance. When associated with a transaction, this indicates the transaction is unmined.
type BranchRecoveryState ¶
type BranchRecoveryState struct {
// contains filtered or unexported fields
}
BranchRecoveryState maintains the required state in-order to properly recover addresses derived from a particular account's internal or external derivation branch.
A branch recovery state supports operations for:
Expanding the look-ahead horizon based on which indexes have been found.
Registering derived addresses with indexes within the horizon.
Reporting an invalid child index that falls into the horizon.
Reporting that an address has been found.
Retrieving all currently derived addresses for the branch.
Looking up a particular address by its child index.
func NewBranchRecoveryState ¶
func NewBranchRecoveryState(recoveryWindow uint32) *BranchRecoveryState
NewBranchRecoveryState creates a new BranchRecoveryState that can be used to track either the external or internal branch of an account's derivation path.
func (*BranchRecoveryState) AddAddr ¶
func (brs *BranchRecoveryState) AddAddr(index uint32, addr btcaddr.Address)
AddAddr adds a freshly derived address from our lookahead into the map of known addresses for this branch.
func (*BranchRecoveryState) Addrs ¶
func (brs *BranchRecoveryState) Addrs() map[uint32]btcaddr.Address
Addrs returns a map of all currently derived child indexes to the their corresponding addresses.
func (*BranchRecoveryState) ExtendHorizon ¶
func (brs *BranchRecoveryState) ExtendHorizon() (uint32, uint32)
ExtendHorizon returns the current horizon and the number of addresses that must be derived in order to maintain the desired recovery window.
func (*BranchRecoveryState) GetAddr ¶
func (brs *BranchRecoveryState) GetAddr(index uint32) btcaddr.Address
GetAddr returns the address derived from a given child index.
func (*BranchRecoveryState) MarkInvalidChild ¶
func (brs *BranchRecoveryState) MarkInvalidChild(index uint32)
MarkInvalidChild records that a particular child index results in deriving an invalid address. In addition, the branch's horizon is increment, as we expect the caller to perform an additional derivation to replace the invalid child. This is used to ensure that we are always have the proper lookahead when an invalid child is encountered.
func (*BranchRecoveryState) NextUnfound ¶
func (brs *BranchRecoveryState) NextUnfound() uint32
NextUnfound returns the child index of the successor to the highest found child index.
func (*BranchRecoveryState) NumInvalidInHorizon ¶
func (brs *BranchRecoveryState) NumInvalidInHorizon() uint32
NumInvalidInHorizon computes the number of invalid child indexes that lie between the last found and current horizon. This informs how many additional indexes to derive in order to maintain the proper number of valid addresses within our horizon.
func (*BranchRecoveryState) ReportFound ¶
func (brs *BranchRecoveryState) ReportFound(index uint32)
ReportFound updates the last found index if the reported index exceeds the current value.
type CAPI ¶
CAPI is the central structure for configuration and access to a net/rpc API access endpoint for this RPC API
func (*CAPI) AddMultiSigAddress ¶
func (c *CAPI) AddMultiSigAddress(req *btcjson.AddMultisigAddressCmd, resp string) (e error)
func (*CAPI) CreateMultiSig ¶
func (c *CAPI) CreateMultiSig(req *btcjson.CreateMultisigCmd, resp btcjson.CreateMultiSigResult) (e error)
func (*CAPI) CreateNewAccount ¶
func (c *CAPI) CreateNewAccount(req *btcjson.CreateNewAccountCmd, resp None) (e error)
func (*CAPI) DumpPrivKey ¶
func (c *CAPI) DumpPrivKey(req *btcjson.DumpPrivKeyCmd, resp string) (e error)
func (*CAPI) GetAccount ¶
func (c *CAPI) GetAccount(req *btcjson.GetAccountCmd, resp string) (e error)
func (*CAPI) GetAccountAddress ¶
func (c *CAPI) GetAccountAddress(req *btcjson.GetAccountAddressCmd, resp string) (e error)
func (*CAPI) GetAddressesByAccount ¶
func (c *CAPI) GetAddressesByAccount(req *btcjson.GetAddressesByAccountCmd, resp []string) (e error)
func (*CAPI) GetBalance ¶
func (c *CAPI) GetBalance(req *btcjson.GetBalanceCmd, resp float64) (e error)
func (*CAPI) GetBestBlock ¶
func (c *CAPI) GetBestBlock(req *None, resp btcjson.GetBestBlockResult) (e error)
func (*CAPI) GetNewAddress ¶
func (c *CAPI) GetNewAddress(req *btcjson.GetNewAddressCmd, resp string) (e error)
func (*CAPI) GetRawChangeAddress ¶
func (c *CAPI) GetRawChangeAddress(req *btcjson.GetRawChangeAddressCmd, resp string) (e error)
func (*CAPI) GetReceivedByAccount ¶
func (c *CAPI) GetReceivedByAccount(req *btcjson.GetReceivedByAccountCmd, resp float64) (e error)
func (*CAPI) GetReceivedByAddress ¶
func (c *CAPI) GetReceivedByAddress(req *btcjson.GetReceivedByAddressCmd, resp float64) (e error)
func (*CAPI) GetTransaction ¶
func (c *CAPI) GetTransaction(req *btcjson.GetTransactionCmd, resp btcjson.GetTransactionResult) (e error)
func (*CAPI) GetUnconfirmedBalance ¶
func (c *CAPI) GetUnconfirmedBalance(req *btcjson.GetUnconfirmedBalanceCmd, resp float64) (e error)
func (*CAPI) HandleDropWalletHistory ¶
func (*CAPI) HelpNoChainRPC ¶
func (*CAPI) ImportPrivKey ¶
func (c *CAPI) ImportPrivKey(req *btcjson.ImportPrivKeyCmd, resp None) (e error)
func (*CAPI) ListAccounts ¶
func (*CAPI) ListAddressTransactions ¶
func (c *CAPI) ListAddressTransactions(req *btcjson.ListAddressTransactionsCmd, resp []btcjson.ListTransactionsResult) (e error)
func (*CAPI) ListAllTransactions ¶
func (c *CAPI) ListAllTransactions(req *btcjson.ListAllTransactionsCmd, resp []btcjson.ListTransactionsResult) (e error)
func (*CAPI) ListLockUnspent ¶
func (c *CAPI) ListLockUnspent(req *None, resp []btcjson.TransactionInput) (e error)
func (*CAPI) ListReceivedByAccount ¶
func (c *CAPI) ListReceivedByAccount(req *btcjson.ListReceivedByAccountCmd, resp []btcjson.ListReceivedByAccountResult) (e error)
func (*CAPI) ListReceivedByAddress ¶
func (c *CAPI) ListReceivedByAddress(req *btcjson.ListReceivedByAddressCmd, resp btcjson.ListReceivedByAddressResult) (e error)
func (*CAPI) ListSinceBlock ¶
func (c *CAPI) ListSinceBlock(req btcjson.ListSinceBlockCmd, resp btcjson.ListSinceBlockResult) (e error)
func (*CAPI) ListTransactions ¶
func (c *CAPI) ListTransactions(req *btcjson.ListTransactionsCmd, resp []btcjson.ListTransactionsResult) (e error)
func (*CAPI) ListUnspent ¶
func (c *CAPI) ListUnspent(req *btcjson.ListUnspentCmd, resp []btcjson.ListUnspentResult) (e error)
func (*CAPI) LockUnspent ¶
func (c *CAPI) LockUnspent(req btcjson.LockUnspentCmd, resp bool) (e error)
func (*CAPI) RenameAccount ¶
func (c *CAPI) RenameAccount(req *btcjson.RenameAccountCmd, resp None) (e error)
func (*CAPI) SendToAddress ¶
func (c *CAPI) SendToAddress(req *btcjson.SendToAddressCmd, resp string) (e error)
func (*CAPI) SignMessage ¶
func (c *CAPI) SignMessage(req *btcjson.SignMessageCmd, resp string) (e error)
func (*CAPI) SignRawTransaction ¶
func (c *CAPI) SignRawTransaction(req btcjson.SignRawTransactionCmd, resp btcjson.SignRawTransactionResult) (e error)
func (*CAPI) ValidateAddress ¶
func (c *CAPI) ValidateAddress(req *btcjson.ValidateAddressCmd, resp btcjson.ValidateAddressWalletResult) (e error)
func (*CAPI) VerifyMessage ¶
func (c *CAPI) VerifyMessage(req *btcjson.VerifyMessageCmd, resp bool) (e error)
func (*CAPI) WalletPassphrase ¶
func (c *CAPI) WalletPassphrase(req *btcjson.WalletPassphraseCmd, resp None) (e error)
func (*CAPI) WalletPassphraseChange ¶
func (c *CAPI) WalletPassphraseChange(req *btcjson.WalletPassphraseChangeCmd, resp None) (e error)
type CAPIClient ¶
CAPIClient is a wrapper around RPC calls
func NewCAPIClient ¶
func NewCAPIClient(conn io.ReadWriteCloser) *CAPIClient
NewCAPIClient creates a new client for a kopach_worker. Note that any kind of connection can be used here, other than the StdConn
func (*CAPIClient) AddMultiSigAddress ¶
func (r *CAPIClient) AddMultiSigAddress(cmd ...*btcjson.AddMultisigAddressCmd) (res string, e error)
func (*CAPIClient) CreateMultiSig ¶
func (r *CAPIClient) CreateMultiSig(cmd ...*btcjson.CreateMultisigCmd) (res btcjson.CreateMultiSigResult, e error)
func (*CAPIClient) CreateNewAccount ¶
func (r *CAPIClient) CreateNewAccount(cmd ...*btcjson.CreateNewAccountCmd) (res None, e error)
func (*CAPIClient) DumpPrivKey ¶
func (r *CAPIClient) DumpPrivKey(cmd ...*btcjson.DumpPrivKeyCmd) (res string, e error)
func (*CAPIClient) GetAccount ¶
func (r *CAPIClient) GetAccount(cmd ...*btcjson.GetAccountCmd) (res string, e error)
func (*CAPIClient) GetAccountAddress ¶
func (r *CAPIClient) GetAccountAddress(cmd ...*btcjson.GetAccountAddressCmd) (res string, e error)
func (*CAPIClient) GetAddressesByAccount ¶
func (r *CAPIClient) GetAddressesByAccount(cmd ...*btcjson.GetAddressesByAccountCmd) (res []string, e error)
func (*CAPIClient) GetBalance ¶
func (r *CAPIClient) GetBalance(cmd ...*btcjson.GetBalanceCmd) (res float64, e error)
func (*CAPIClient) GetBestBlock ¶
func (r *CAPIClient) GetBestBlock(cmd ...*None) (res btcjson.GetBestBlockResult, e error)
func (*CAPIClient) GetBestBlockHash ¶
func (r *CAPIClient) GetBestBlockHash(cmd ...*None) (res string, e error)
func (*CAPIClient) GetBlockCount ¶
func (r *CAPIClient) GetBlockCount(cmd ...*None) (res int32, e error)
func (*CAPIClient) GetInfo ¶
func (r *CAPIClient) GetInfo(cmd ...*None) (res btcjson.InfoWalletResult, e error)
func (*CAPIClient) GetNewAddress ¶
func (r *CAPIClient) GetNewAddress(cmd ...*btcjson.GetNewAddressCmd) (res string, e error)
func (*CAPIClient) GetRawChangeAddress ¶
func (r *CAPIClient) GetRawChangeAddress(cmd ...*btcjson.GetRawChangeAddressCmd) (res string, e error)
func (*CAPIClient) GetReceivedByAccount ¶
func (r *CAPIClient) GetReceivedByAccount(cmd ...*btcjson.GetReceivedByAccountCmd) (res float64, e error)
func (*CAPIClient) GetReceivedByAddress ¶
func (r *CAPIClient) GetReceivedByAddress(cmd ...*btcjson.GetReceivedByAddressCmd) (res float64, e error)
func (*CAPIClient) GetTransaction ¶
func (r *CAPIClient) GetTransaction(cmd ...*btcjson.GetTransactionCmd) (res btcjson.GetTransactionResult, e error)
func (*CAPIClient) GetUnconfirmedBalance ¶
func (r *CAPIClient) GetUnconfirmedBalance(cmd ...*btcjson.GetUnconfirmedBalanceCmd) (res float64, e error)
func (*CAPIClient) HandleDropWalletHistory ¶
func (r *CAPIClient) HandleDropWalletHistory(cmd ...*None) (res string, e error)
func (*CAPIClient) HelpNoChainRPC ¶
func (r *CAPIClient) HelpNoChainRPC(cmd ...btcjson.HelpCmd) (res string, e error)
func (*CAPIClient) ImportPrivKey ¶
func (r *CAPIClient) ImportPrivKey(cmd ...*btcjson.ImportPrivKeyCmd) (res None, e error)
func (*CAPIClient) KeypoolRefill ¶
func (r *CAPIClient) KeypoolRefill(cmd ...*None) (res None, e error)
func (*CAPIClient) ListAccounts ¶
func (r *CAPIClient) ListAccounts(cmd ...*btcjson.ListAccountsCmd) (res map[string]float64, e error)
func (*CAPIClient) ListAddressTransactions ¶
func (r *CAPIClient) ListAddressTransactions(cmd ...*btcjson.ListAddressTransactionsCmd) (res []btcjson.ListTransactionsResult, e error)
func (*CAPIClient) ListAllTransactions ¶
func (r *CAPIClient) ListAllTransactions(cmd ...*btcjson.ListAllTransactionsCmd) (res []btcjson.ListTransactionsResult, e error)
func (*CAPIClient) ListLockUnspent ¶
func (r *CAPIClient) ListLockUnspent(cmd ...*None) (res []btcjson.TransactionInput, e error)
func (*CAPIClient) ListReceivedByAccount ¶
func (r *CAPIClient) ListReceivedByAccount(cmd ...*btcjson.ListReceivedByAccountCmd) (res []btcjson.ListReceivedByAccountResult, e error)
func (*CAPIClient) ListReceivedByAddress ¶
func (r *CAPIClient) ListReceivedByAddress(cmd ...*btcjson.ListReceivedByAddressCmd) (res btcjson.ListReceivedByAddressResult, e error)
func (*CAPIClient) ListSinceBlock ¶
func (r *CAPIClient) ListSinceBlock(cmd ...btcjson.ListSinceBlockCmd) (res btcjson.ListSinceBlockResult, e error)
func (*CAPIClient) ListTransactions ¶
func (r *CAPIClient) ListTransactions(cmd ...*btcjson.ListTransactionsCmd) (res []btcjson.ListTransactionsResult, e error)
func (*CAPIClient) ListUnspent ¶
func (r *CAPIClient) ListUnspent(cmd ...*btcjson.ListUnspentCmd) (res []btcjson.ListUnspentResult, e error)
func (*CAPIClient) LockUnspent ¶
func (r *CAPIClient) LockUnspent(cmd ...btcjson.LockUnspentCmd) (res bool, e error)
func (*CAPIClient) RenameAccount ¶
func (r *CAPIClient) RenameAccount(cmd ...*btcjson.RenameAccountCmd) (res None, e error)
func (*CAPIClient) SendMany ¶
func (r *CAPIClient) SendMany(cmd ...*btcjson.SendManyCmd) (res string, e error)
func (*CAPIClient) SendToAddress ¶
func (r *CAPIClient) SendToAddress(cmd ...*btcjson.SendToAddressCmd) (res string, e error)
func (*CAPIClient) SetTxFee ¶
func (r *CAPIClient) SetTxFee(cmd ...*btcjson.SetTxFeeCmd) (res bool, e error)
func (*CAPIClient) SignMessage ¶
func (r *CAPIClient) SignMessage(cmd ...*btcjson.SignMessageCmd) (res string, e error)
func (*CAPIClient) SignRawTransaction ¶
func (r *CAPIClient) SignRawTransaction(cmd ...btcjson.SignRawTransactionCmd) (res btcjson.SignRawTransactionResult, e error)
func (*CAPIClient) ValidateAddress ¶
func (r *CAPIClient) ValidateAddress(cmd ...*btcjson.ValidateAddressCmd) (res btcjson.ValidateAddressWalletResult, e error)
func (*CAPIClient) VerifyMessage ¶
func (r *CAPIClient) VerifyMessage(cmd ...*btcjson.VerifyMessageCmd) (res bool, e error)
func (*CAPIClient) WalletIsLocked ¶
func (r *CAPIClient) WalletIsLocked(cmd ...*None) (res bool, e error)
func (*CAPIClient) WalletLock ¶
func (r *CAPIClient) WalletLock(cmd ...*None) (res None, e error)
func (*CAPIClient) WalletPassphrase ¶
func (r *CAPIClient) WalletPassphrase(cmd ...*btcjson.WalletPassphraseCmd) (res None, e error)
func (*CAPIClient) WalletPassphraseChange ¶
func (r *CAPIClient) WalletPassphraseChange(cmd ...*btcjson.WalletPassphraseChangeCmd) (res None, e error)
type CreateMultiSigRes ¶
type CreateMultiSigRes struct { Res *btcjson.CreateMultiSigResult // contains filtered or unexported fields }
CreateMultiSigRes is the result from a call to CreateMultiSig
type CreateNewAccountRes ¶
type CreateNewAccountRes struct { Res *None // contains filtered or unexported fields }
CreateNewAccountRes is the result from a call to CreateNewAccount
type CreditCategory ¶
type CreditCategory byte
CreditCategory describes the type of wallet transaction output. The category of "sent transactions" (debits) is always "send", and is not expressed by this type.
TODO: This is a requirement of the RPC server and should be moved.
const ( CreditReceive CreditCategory = iota CreditGenerate CreditImmature )
These constants define the possible credit categories.
func RecvCategory ¶
func RecvCategory( details *wtxmgr.TxDetails, syncHeight int32, net *chaincfg.Params, ) CreditCategory
RecvCategory returns the category of received credit outputs from a transaction record. The passed block chain height is used to distinguish immature from mature coinbase outputs.
TODO: This is intended for use by the RPC server and should be moved out of this package at a later time.
func (CreditCategory) String ¶
func (c CreditCategory) String() string
String returns the category as a string. This string may be used as the JSON string for categories as part of listtransactions and gettransaction RPC responses.
type DeserializationError ¶
type DeserializationError struct {
// contains filtered or unexported fields
}
DeserializationError describes a failed deserializaion due to bad user input. It corresponds to json.ErrRPCDeserialization.
type DumpPrivKeyRes ¶
type DumpPrivKeyRes struct { Res *string // contains filtered or unexported fields }
DumpPrivKeyRes is the result from a call to DumpPrivKey
type GetAccountAddressRes ¶
type GetAccountAddressRes struct { Res *string // contains filtered or unexported fields }
GetAccountAddressRes is the result from a call to GetAccountAddress
type GetAccountRes ¶
type GetAccountRes struct { Res *string // contains filtered or unexported fields }
GetAccountRes is the result from a call to GetAccount
type GetAddressesByAccountRes ¶
type GetAddressesByAccountRes struct { Res *[]string // contains filtered or unexported fields }
GetAddressesByAccountRes is the result from a call to GetAddressesByAccount
type GetBalanceRes ¶
type GetBalanceRes struct { Res *float64 // contains filtered or unexported fields }
GetBalanceRes is the result from a call to GetBalance
type GetBestBlockHashRes ¶
type GetBestBlockHashRes struct { Res *string // contains filtered or unexported fields }
GetBestBlockHashRes is the result from a call to GetBestBlockHash
type GetBestBlockRes ¶
type GetBestBlockRes struct { Res *btcjson.GetBestBlockResult // contains filtered or unexported fields }
GetBestBlockRes is the result from a call to GetBestBlock
type GetBlockCountRes ¶
type GetBlockCountRes struct { Res *int32 // contains filtered or unexported fields }
GetBlockCountRes is the result from a call to GetBlockCount
type GetInfoRes ¶
type GetInfoRes struct { Res *btcjson.InfoWalletResult // contains filtered or unexported fields }
GetInfoRes is the result from a call to GetInfo
type GetNewAddressRes ¶
type GetNewAddressRes struct { Res *string // contains filtered or unexported fields }
GetNewAddressRes is the result from a call to GetNewAddress
type GetRawChangeAddressRes ¶
type GetRawChangeAddressRes struct { Res *string // contains filtered or unexported fields }
GetRawChangeAddressRes is the result from a call to GetRawChangeAddress
type GetReceivedByAccountRes ¶
type GetReceivedByAccountRes struct { Res *float64 // contains filtered or unexported fields }
GetReceivedByAccountRes is the result from a call to GetReceivedByAccount
type GetReceivedByAddressRes ¶
type GetReceivedByAddressRes struct { Res *float64 // contains filtered or unexported fields }
GetReceivedByAddressRes is the result from a call to GetReceivedByAddress
type GetTransactionRes ¶
type GetTransactionRes struct { Res *btcjson.GetTransactionResult // contains filtered or unexported fields }
GetTransactionRes is the result from a call to GetTransaction
type GetTransactionsResult ¶
type GetTransactionsResult struct { MinedTransactions []Block UnminedTransactions []TransactionSummary }
GetTransactionsResult is the result of the wallet's GetTransactions method. See GetTransactions for more details.
type GetUnconfirmedBalanceRes ¶
type GetUnconfirmedBalanceRes struct { Res *float64 // contains filtered or unexported fields }
GetUnconfirmedBalanceRes is the result from a call to GetUnconfirmedBalance
type HandleDropWalletHistoryRes ¶
type HandleDropWalletHistoryRes struct { Res *string // contains filtered or unexported fields }
HandleDropWalletHistoryRes is the result from a call to HandleDropWalletHistory
type HelpNoChainRPCRes ¶
type HelpNoChainRPCRes struct { Res *string // contains filtered or unexported fields }
HelpNoChainRPCRes is the result from a call to HelpNoChainRPC
type ImportPrivKeyRes ¶
type ImportPrivKeyRes struct { Res *None // contains filtered or unexported fields }
ImportPrivKeyRes is the result from a call to ImportPrivKey
type InvalidParameterError ¶
type InvalidParameterError struct {
// contains filtered or unexported fields
}
InvalidParameterError describes an invalid parameter passed by the user. It corresponds to json.ErrRPCInvalidParameter.
type KeypoolRefillRes ¶
type KeypoolRefillRes struct { Res *None // contains filtered or unexported fields }
KeypoolRefillRes is the result from a call to KeypoolRefill
type LazyHandler ¶
LazyHandler is a closure over a requestHandler or passthrough request with the RPC server's wallet and chain server variables as part of the closure context.
func LazyApplyHandler ¶
func LazyApplyHandler(request *btcjson.Request, w *Wallet, chainClient chainclient.Interface, ) LazyHandler
LazyApplyHandler looks up the best request handler func for the method, returning a closure that will execute it with the (required) wallet and (optional) consensus RPC server. If no handlers are found and the chainClient is not nil, the returned handler performs RPC passthrough.
type ListAccountsRes ¶
ListAccountsRes is the result from a call to ListAccounts
type ListAddressTransactionsRes ¶
type ListAddressTransactionsRes struct { Res *[]btcjson.ListTransactionsResult // contains filtered or unexported fields }
ListAddressTransactionsRes is the result from a call to ListAddressTransactions
type ListAllTransactionsRes ¶
type ListAllTransactionsRes struct { Res *[]btcjson.ListTransactionsResult // contains filtered or unexported fields }
ListAllTransactionsRes is the result from a call to ListAllTransactions
type ListLockUnspentRes ¶
type ListLockUnspentRes struct { Res *[]btcjson.TransactionInput // contains filtered or unexported fields }
ListLockUnspentRes is the result from a call to ListLockUnspent
type ListReceivedByAccountRes ¶
type ListReceivedByAccountRes struct { Res *[]btcjson.ListReceivedByAccountResult // contains filtered or unexported fields }
ListReceivedByAccountRes is the result from a call to ListReceivedByAccount
type ListReceivedByAddressRes ¶
type ListReceivedByAddressRes struct { Res *btcjson.ListReceivedByAddressResult // contains filtered or unexported fields }
ListReceivedByAddressRes is the result from a call to ListReceivedByAddress
type ListSinceBlockRes ¶
type ListSinceBlockRes struct { Res *btcjson.ListSinceBlockResult // contains filtered or unexported fields }
ListSinceBlockRes is the result from a call to ListSinceBlock
type ListTransactionsRes ¶
type ListTransactionsRes struct { Res *[]btcjson.ListTransactionsResult // contains filtered or unexported fields }
ListTransactionsRes is the result from a call to ListTransactions
type ListUnspentRes ¶
type ListUnspentRes struct { Res *[]btcjson.ListUnspentResult // contains filtered or unexported fields }
ListUnspentRes is the result from a call to ListUnspent
type Loader ¶
type Loader struct { Callbacks []func(*Wallet) ChainParams *chaincfg.Params DDDirPath string RecoveryWindow uint32 Wallet *Wallet Loaded bool DB walletdb.DB Mutex sync.Mutex }
Loader implements the creating of new and opening of existing wallets, while providing a callback system for other subsystems to handle the loading of a wallet. This is primarily intended for use by the RPC servers, to enable methods and services which require the wallet when the wallet is loaded by another subsystem.
Loader is safe for concurrent access.
func NewLoader ¶
NewLoader constructs a Loader with an optional recovery window. If the recovery window is non-zero, the wallet will attempt to recovery addresses starting from the last SyncedTo height.
func (*Loader) CreateNewWallet ¶
func (ld *Loader) CreateNewWallet( pubPassphrase, privPassphrase, seed []byte, bday time.Time, noStart bool, podConfig *config.Config, quit qu.C, ) (w *Wallet, e error)
CreateNewWallet creates a new wallet using the provided public and private passphrases. The seed is optional. If non-nil, addresses are derived from this seed. If nil, a secure random seed is generated.
func (*Loader) LoadedWallet ¶
LoadedWallet returns the loaded wallet, if any, and a bool for whether the wallet has been loaded or not. If true, the wallet pointer should be safe to dereference.
func (*Loader) OpenExistingWallet ¶
func (ld *Loader) OpenExistingWallet( pubPassphrase []byte, canConsolePrompt bool, podConfig *config.Config, quit qu.C, ) (w *Wallet, e error)
OpenExistingWallet opens the wallet from the loader's wallet database path and the public passphrase. If the loader is being called by a context where standard input prompts may be used during wallet upgrades, setting canConsolePrompt will enables these prompts.
func (*Loader) RunAfterLoad ¶
RunAfterLoad adds a function to be executed when the loader creates or opens a wallet. Functions are executed in a single goroutine in the order they are added.
func (*Loader) UnloadWallet ¶
UnloadWallet stops the loaded wallet, if any, and closes the wallet database. This returns ErrNotLoaded if the wallet has not been loaded with CreateNewWallet or LoadExistingWallet. The Loader may be reused if this function returns without error.
func (*Loader) WalletExists ¶
WalletExists returns whether a file exists at the loader's database path. This may return an error for unexpected I/O failures.
type LockUnspentRes ¶
type LockUnspentRes struct { Res *bool // contains filtered or unexported fields }
LockUnspentRes is the result from a call to LockUnspent
type NotificationServer ¶
type NotificationServer struct {
// contains filtered or unexported fields
}
NotificationServer is a server that interested clients may hook into to receive notifications of changes
in a wallet. A client is created for each registered notification. Clients are guaranteed to receive messages in the order wallet created them, but there is no guaranteed synchronization between different clients.
func (*NotificationServer) AccountNotifications ¶
func (s *NotificationServer) AccountNotifications() AccountNotificationsClient
AccountNotifications returns a client for receiving AccountNotifications over a channel. The channel is unbuffered. When finished, the client's Done method should be called to disassociate the client from the server.
func (*NotificationServer) AccountSpentnessNotifications ¶
func (s *NotificationServer) AccountSpentnessNotifications(account uint32) SpentnessNotificationsClient
AccountSpentnessNotifications registers a client for spentness changes of outputs controlled by the account.
func (*NotificationServer) TransactionNotifications ¶
func (s *NotificationServer) TransactionNotifications() TransactionNotificationsClient
TransactionNotifications returns a client for receiving TransactionNotifications notifications over a channel. The channel is unbuffered.
When finished, the Done method should be called on the client to disassociate it from the server.
type Options ¶
type Options struct { Username string Password string MaxPOSTClients int64 MaxWebsocketClients int64 }
Options contains the required options for running the legacy RPC server.
type OutputKind ¶
type OutputKind byte
OutputKind describes a kind of transaction output. This is used to differentiate between coinbase, stakebase, and normal outputs.
const ( OutputKindNormal OutputKind = iota OutputKindCoinbase )
Defined OutputKind constants
type OutputRedeemer ¶
OutputRedeemer identifies the transaction input which redeems an output.
type OutputSelectionPolicy ¶
OutputSelectionPolicy describes the rules for selecting an output from the wallet.
type P2SHMultiSigOutput ¶
type P2SHMultiSigOutput struct { // TODO: Add a TransactionOutput member to this struct and remove these fields which are duplicated by it. This // improves consistency. Only not done now because wtxmgr APIs don't support an efficient way of fetching other // Transactionoutput data together with the rest of the multisig info. OutPoint wire.OutPoint OutputAmount amt.Amount ContainingBlock BlockIdentity P2SHAddress *btcaddr.ScriptHash RedeemScript []byte M, N uint8 // M of N signatures required to redeem Redeemer *OutputRedeemer // nil unless spent }
P2SHMultiSigOutput describes a transaction output with a pay-to-script-hash output script and an imported redemption script. Along with common details of the output, this structure also includes the P2SH address the script was created from and the number of signatures required to redeem it.
TODO: Could be useful to return how many of the required signatures can be created by this wallet.
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
ParseError describes a failed parse due to bad user input. It corresponds to json.ErrRPCParse.
type RecoveryManager ¶
type RecoveryManager struct {
// contains filtered or unexported fields
}
RecoveryManager maintains the state required to recover previously used addresses, and coordinates batched processing of the blocks to search.
func NewRecoveryManager ¶
func NewRecoveryManager( recoveryWindow, batchSize uint32, chainParams *chaincfg.Params, ) *RecoveryManager
NewRecoveryManager initializes a new RecoveryManager with a derivation look-ahead of `recoveryWindow` child indexes, and pre-allocates a backing array for `batchSize` blocks to scan at once.
func (*RecoveryManager) AddToBlockBatch ¶
func (rm *RecoveryManager) AddToBlockBatch( hash *chainhash.Hash, height int32, timestamp time.Time, )
AddToBlockBatch appends the block information, consisting of hash and height, to the batch of blocks to be searched.
func (*RecoveryManager) BlockBatch ¶
func (rm *RecoveryManager) BlockBatch() []wtxmgr.BlockMeta
BlockBatch returns a buffer of blocks that have not yet been searched.
func (*RecoveryManager) ResetBlockBatch ¶
func (rm *RecoveryManager) ResetBlockBatch()
ResetBlockBatch resets the internal block buffer to conserve memory.
func (*RecoveryManager) Resurrect ¶
func (rm *RecoveryManager) Resurrect( ns walletdb.ReadBucket, scopedMgrs map[waddrmgr.KeyScope]*waddrmgr.ScopedKeyManager, credits []wtxmgr.Credit, ) (e error)
Resurrect restores all known addresses for the provided scopes that can be found in the walletdb namespace, in addition to restoring all outpoints that have been previously found. This method ensures that the recovery state's horizons properly start from the last found address of a prior recovery attempt.
func (*RecoveryManager) State ¶
func (rm *RecoveryManager) State() *RecoveryState
State returns the current RecoveryState.
type RecoveryState ¶
type RecoveryState struct {
// contains filtered or unexported fields
}
RecoveryState manages the initialization and lookup of ScopeRecoveryStates for any actively used key scopes.
In order to ensure that all addresses are properly recovered, the window should be sized as the sum of maximum possible inter-block and intra-block gap between used addresses of a particular branch.
These are defined as:
Inter-Block Gap: The maximum difference between the derived child indexes of the last addresses used in any block and the next address consumed by a later block.
Intra-Block Gap: The maximum difference between the derived child indexes of the first address used in any block and the last address used in the same block.
func NewRecoveryState ¶
func NewRecoveryState(recoveryWindow uint32) *RecoveryState
NewRecoveryState creates a new RecoveryState using the provided recoveryWindow. Each RecoveryState that is subsequently initialized for a particular key scope will receive the same recoveryWindow.
func (*RecoveryState) AddWatchedOutPoint ¶
func (rs *RecoveryState) AddWatchedOutPoint( outPoint *wire.OutPoint, addr btcaddr.Address, )
AddWatchedOutPoint updates the recovery state's set of known outpoints that we will monitor for spends during recovery.
func (*RecoveryState) StateForScope ¶
func (rs *RecoveryState) StateForScope( keyScope waddrmgr.KeyScope, ) *ScopeRecoveryState
StateForScope returns a ScopeRecoveryState for the provided key scope. If one does not already exist, a new one will be generated with the RecoveryState's recoveryWindow.
func (*RecoveryState) WatchedOutPoints ¶
func (rs *RecoveryState) WatchedOutPoints() map[wire.OutPoint]btcaddr.Address
WatchedOutPoints returns the global set of outpoints that are known to belong to the wallet during recovery.
type RenameAccountRes ¶
type RenameAccountRes struct { Res *None // contains filtered or unexported fields }
RenameAccountRes is the result from a call to RenameAccount
type RequestHandler ¶
type RequestHandler func(interface{}, *Wallet, ...*chainclient.RPCClient) (interface{}, error)
RequestHandler is a handler function to handle an unmarshaled and parsed request into a marshalable response. If the error is a *json.RPCError or any of the above special error classes, the server will respond with the JSON-RPC appropriate error code. All other errors use the wallet catch-all error code, json.ErrRPCWallet.
type RescanFinishedMsg ¶
type RescanFinishedMsg struct { Addresses []btcaddr.Address Notification *chainclient.RescanFinished }
RescanFinishedMsg reports the addresses that were rescanned when a rescanfinished message was received rescanning a batch of addresses.
type RescanJob ¶
type RescanJob struct { InitialSync bool Addrs []btcaddr.Address OutPoints map[wire.OutPoint]btcaddr.Address BlockStamp waddrmgr.BlockStamp // contains filtered or unexported fields }
RescanJob is a job to be processed by the RescanManager. The job includes a set of wallet addresses, a starting height to begin the rescan, and outpoints spendable by the addresses thought to be unspent. After the rescan completes, the error result of the rescan RPC is sent on the Err channel.
type RescanProgressMsg ¶
type RescanProgressMsg struct { Addresses []btcaddr.Address Notification *chainclient.RescanProgress }
RescanProgressMsg reports the current progress made by a rescan for a set of wallet addresses.
type ScopeRecoveryState ¶
type ScopeRecoveryState struct { // ExternalBranch is the recovery state of addresses generated for external use, i.e. receiving addresses. ExternalBranch *BranchRecoveryState // InternalBranch is the recovery state of addresses generated for internal use, i.e. change addresses. InternalBranch *BranchRecoveryState }
ScopeRecoveryState is used to manage the recovery of addresses generated under a particular BIP32 account. Each account tracks both an external and internal branch recovery state, both of which use the same recovery window.
func NewScopeRecoveryState ¶
func NewScopeRecoveryState(recoveryWindow uint32) *ScopeRecoveryState
NewScopeRecoveryState initializes an ScopeRecoveryState with the chosen recovery window.
type SendManyRes ¶
type SendManyRes struct { Res *string // contains filtered or unexported fields }
SendManyRes is the result from a call to SendMany
type SendToAddressRes ¶
type SendToAddressRes struct { Res *string // contains filtered or unexported fields }
SendToAddressRes is the result from a call to SendToAddress
type Server ¶
type Server struct { HTTPServer http.Server Wallet *Wallet WalletLoader *Loader ChainClient chainclient.Interface // handlerLookup func(string) (requestHandler, bool) HandlerMutex sync.Mutex Listeners []net.Listener AuthSHA [sha256.Size]byte Upgrader websocket.Upgrader MaxPostClients int64 // Max concurrent HTTP POST clients. MaxWebsocketClients int64 // Max concurrent websocket clients. WG sync.WaitGroup Quit qu.C QuitMutex sync.Mutex RequestShutdownChan qu.C }
Server holds the items the RPC server may need to access (auth, config, shutdown, etc.)
func NewServer ¶
NewServer creates a new server for serving legacy RPC client connections, both HTTP POST and websocket.
func (*Server) CheckAuthHeader ¶
CheckAuthHeader checks the HTTP Basic authentication supplied by a client in the HTTP request r. It errors with ErrNoAuth if the request does not contain the Authorization header, or another non-nil error if the authentication was provided but incorrect.
This check is time-constant.
func (*Server) HandlerClosure ¶
func (s *Server) HandlerClosure(request *btcjson.Request) LazyHandler
HandlerClosure creates a closure function for handling requests of the given method. This may be a request that is handled directly by btcwallet, or a chain server request that is handled by passing the request down to pod.
NOTE: These handlers do not handle special cases, such as the authenticate method. Each of these must be checked beforehand (the method is already known) and handled accordingly.
func (*Server) InvalidAuth ¶
InvalidAuth checks whether a websocket request is a valid (parsable) authenticate request and checks the supplied username and passphrase against the server auth.
func (*Server) POSTClientRPC ¶
func (s *Server) POSTClientRPC(w http.ResponseWriter, r *http.Request)
POSTClientRPC processes and replies to a JSON-RPC client request.
func (*Server) RegisterWallet ¶
RegisterWallet associates the legacy RPC server with the wallet. This function must be called before any wallet RPCs can be called by clients.
func (*Server) RequestProcessShutdown ¶
func (s *Server) RequestProcessShutdown()
func (*Server) RequestProcessShutdownChan ¶
RequestProcessShutdownChan returns a channel that is sent to when an authorized client requests remote shutdown.
func (*Server) Serve ¶
Serve serves HTTP POST and websocket RPC for the legacy JSON-RPC RPC server. This function does not block on lis.Accept.
func (*Server) SetChainServer ¶
func (s *Server) SetChainServer(chainClient chainclient.Interface)
SetChainServer sets the chain server client component needed to run a fully functional bitcoin wallet RPC server. This can be called to enable RPC passthrough even before a loaded wallet is set, but the wallet's RPC client is preferred.
func (*Server) Stop ¶
func (s *Server) Stop()
Stop gracefully shuts down the rpc server by stopping and disconnecting all clients, disconnecting the chain server connection, and closing the wallet's account files. This blocks until shutdown completes.
func (*Server) WebsocketClientRPC ¶
func (s *Server) WebsocketClientRPC(wsc *WebsocketClient)
WebsocketClientRPC starts the goroutines to serve JSON-RPC requests over a websocket connection for a single client.
func (*Server) WebsocketClientRead ¶
func (s *Server) WebsocketClientRead(wsc *WebsocketClient)
func (*Server) WebsocketClientRespond ¶
func (s *Server) WebsocketClientRespond(wsc *WebsocketClient)
func (*Server) WebsocketClientSend ¶
func (s *Server) WebsocketClientSend(wsc *WebsocketClient)
type SetTxFeeRes ¶
type SetTxFeeRes struct { Res *bool // contains filtered or unexported fields }
SetTxFeeRes is the result from a call to SetTxFee
type SignMessageRes ¶
type SignMessageRes struct { Res *string // contains filtered or unexported fields }
SignMessageRes is the result from a call to SignMessage
type SignRawTransactionRes ¶
type SignRawTransactionRes struct { Res *btcjson.SignRawTransactionResult // contains filtered or unexported fields }
SignRawTransactionRes is the result from a call to SignRawTransaction
type SignatureError ¶
SignatureError records the underlying error when validating a transaction input signature.
type SpentnessNotifications ¶
type SpentnessNotifications struct {
// contains filtered or unexported fields
}
SpentnessNotifications is a notification that is fired for transaction outputs controlled by some account's keys. The notification may be about a newly added unspent transaction output or that a previously unspent output is now spent. When spent, the notification includes the spending transaction's hash and input index.
func (*SpentnessNotifications) Hash ¶
func (n *SpentnessNotifications) Hash() *chainhash.Hash
Hash returns the transaction hash of the spent output.
func (*SpentnessNotifications) Index ¶
func (n *SpentnessNotifications) Index() uint32
Index returns the transaction output index of the spent output.
type SpentnessNotificationsClient ¶
type SpentnessNotificationsClient struct { C <-chan *SpentnessNotifications // contains filtered or unexported fields }
SpentnessNotificationsClient receives SpentnessNotifications from the NotificationServer over the channel C.
func (*SpentnessNotificationsClient) Done ¶
func (c *SpentnessNotificationsClient) Done()
Done unregisters the client from the server and drains any remaining messages. It must be called exactly once when the client is finished receiving notifications.
type TransactionNotifications ¶
type TransactionNotifications struct { AttachedBlocks []Block DetachedBlocks []*chainhash.Hash UnminedTransactions []TransactionSummary UnminedTransactionHashes []*chainhash.Hash NewBalances []AccountBalance }
TransactionNotifications is a notification of changes to the wallet's transaction set and the current chain tip that wallet is considered to be synced with. All transactions added to the blockchain are organized by the block they were mined in.
During a chain switch, all removed block hashes are included. Detached blocks are sorted in the reverse order they were mined. Attached blocks are sorted in the order mined.
All newly added unmined transactions are included. Removed unmined transactions are not explicitly included. Instead, the hashes of all transactions still unmined are included.
If any transactions were involved, each affected account's new total balance is included.
TODO: Because this includes stuff about blocks and can be fired without any changes to transactions, it needs a
better name.
type TransactionNotificationsClient ¶
type TransactionNotificationsClient struct { C <-chan *TransactionNotifications // contains filtered or unexported fields }
TransactionNotificationsClient receives TransactionNotifications from the NotificationServer over the channel C.
func (*TransactionNotificationsClient) Done ¶
func (c *TransactionNotificationsClient) Done()
Done unregisters the client from the server and drains any remaining messages. It must be called exactly once when the client is finished receiving notifications.
type TransactionOutput ¶
type TransactionOutput struct { OutPoint wire.OutPoint Output wire.TxOut OutputKind OutputKind // These should be added later when the DB can return them more efficiently: // // TxLockTime uint32 // TxExpiry uint32 ContainingBlock BlockIdentity ReceiveTime time.Time }
TransactionOutput describes an output that was or is at least partially controlled by the wallet. Depending on context, this could refer to an unspent output, or a spent one.
type TransactionSummary ¶
type TransactionSummary struct { Hash *chainhash.Hash Transaction []byte MyInputs []TransactionSummaryInput MyOutputs []TransactionSummaryOutput Fee amt.Amount Timestamp int64 }
TransactionSummary contains a transaction relevant to the wallet and marks which inputs and outputs were relevant.
type TransactionSummaryInput ¶
type TransactionSummaryInput struct { Index uint32 PreviousAccount uint32 PreviousAmount amt.Amount }
TransactionSummaryInput describes a transaction input that is relevant to the wallet. The Index field marks the transaction input index of the transaction (not included here). The PreviousAccount and PreviousAmount fields describe how much this input debits from a wallet account.
type TransactionSummaryOutput ¶
TransactionSummaryOutput describes wallet properties of a transaction output controlled by the wallet. The Index field marks the transaction output index of the transaction (not included here).
type UnstableAPI ¶
type UnstableAPI struct {
// contains filtered or unexported fields
}
UnstableAPI exposes unstable api in the wallet
func ExposeUnstableAPI ¶
func ExposeUnstableAPI(w *Wallet) UnstableAPI
ExposeUnstableAPI exposes additional unstable public APIs for a Wallet. These APIs may be changed or removed at any time. Currently this type exists to ease the transation (particularly for the legacy JSON-RPC server) from using exported manager packages to a unified wallet package that exposes all functionality by itself. New code should not be written using this API.
func (UnstableAPI) RangeTransactions ¶
func (u UnstableAPI) RangeTransactions(begin, end int32, f func([]wtxmgr.TxDetails) (bool, error), ) error
RangeTransactions calls wtxmgr.Store.RangeTransactions under a single database view transaction.
type ValidateAddressRes ¶
type ValidateAddressRes struct { Res *btcjson.ValidateAddressWalletResult // contains filtered or unexported fields }
ValidateAddressRes is the result from a call to ValidateAddress
type VerifyMessageRes ¶
type VerifyMessageRes struct { Res *bool // contains filtered or unexported fields }
VerifyMessageRes is the result from a call to VerifyMessage
type Wallet ¶
type Wallet struct { Manager *waddrmgr.Manager TxStore *wtxmgr.Store // Information for reorganization handling. // reorganizingLock sync.Mutex // reorganizeToHash chainhash.Hash // reorganizing bool NtfnServer *NotificationServer PodConfig *config.Config Update qu.C // contains filtered or unexported fields }
Wallet is a structure containing all the components for a complete wallet. It contains the Armory-style key store addresses and keys),
func Open ¶
func Open( db walletdb.DB, pubPass []byte, cbs *waddrmgr.OpenCallbacks, params *chaincfg.Params, recoveryWindow uint32, podConfig *config.Config, quit qu.C, ) (*Wallet, error)
Open loads an already-created wallet from the passed database and namespaces.
func (*Wallet) AccountAddresses ¶
AccountAddresses returns the addresses for every created address for an account.
func (*Wallet) AccountBalances ¶
func (w *Wallet) AccountBalances( scope waddrmgr.KeyScope, requiredConfs int32, ) ([]AccountBalanceResult, error)
AccountBalances returns all accounts in the wallet and their balances. Balances are determined by excluding transactions that have not met requiredConfs confirmations.
func (*Wallet) AccountName ¶
AccountName returns the name of an account.
func (*Wallet) AccountNumber ¶
func (w *Wallet) AccountNumber( scope waddrmgr.KeyScope, accountName string, ) (account uint32, e error)
AccountNumber returns the account number for an account name under a particular key scope.
func (*Wallet) AccountOfAddress ¶
AccountOfAddress finds the account that an address is associated with.
func (*Wallet) AccountProperties ¶
func (w *Wallet) AccountProperties( scope waddrmgr.KeyScope, acct uint32, ) (*waddrmgr.AccountProperties, error)
AccountProperties returns the properties of an account, including address indexes and name. It first fetches the desynced information from the address manager, then updates the indexes based on the address pools.
func (*Wallet) Accounts ¶
func (w *Wallet) Accounts(scope waddrmgr.KeyScope) (*AccountsResult, error)
Accounts returns the current names, numbers, and total balances of all accounts in the wallet restricted to a particular key scope. The current chain tip is included in the result for atomicity reasons.
TODO(jrick): Is the chain tip really needed, since only the total balances are included?
func (*Wallet) AddressInfo ¶
AddressInfo returns detailed information regarding a wallet address.
func (*Wallet) CalculateAccountBalances ¶
func (w *Wallet) CalculateAccountBalances( account uint32, confirms int32, ) (bals Balances, e error)
CalculateAccountBalances sums the amounts of all unspent transaction outputs to the given account of a wallet and returns the balance.
This function is much slower than it needs to be since transactions outputs are not indexed by the accounts they credit to, and all unspent transaction outputs must be iterated.
func (*Wallet) CalculateBalance ¶
CalculateBalance sums the amounts of all unspent transaction outputs to addresses of a wallet and returns the balance.
If confirmations is 0, all UTXOs, even those not present in a block (height -1), will be used to get the balance. Otherwise, a UTXO must be in a block. If confirmations is 1 or greater, the balance will be calculated based on how many how many blocks include a UTXO.
func (*Wallet) ChainClient ¶
func (w *Wallet) ChainClient() chainclient.Interface
ChainClient returns the optional consensus RPC client associated with the wallet.
This function is unstable and will be removed once sync logic is moved out of the wallet.
func (*Wallet) ChainParams ¶
ChainParams returns the network parameters for the blockchain the wallet belongs to.
func (*Wallet) ChainSynced ¶
ChainSynced returns whether the wallet has been attached to a chain server and synced up to the best block on the main chain.
func (*Wallet) ChangePassphrases ¶
func (w *Wallet) ChangePassphrases( publicOld, publicNew, privateOld, privateNew []byte, ) (e error)
ChangePassphrases modifies the public and private passphrase of the wallet atomically.
func (*Wallet) ChangePrivatePassphrase ¶
ChangePrivatePassphrase attempts to change the passphrase for a wallet from old to new. Changing the passphrase is synchronized with all other address manager locking and unlocking. The lock state will be the same as it was before the password change.
func (*Wallet) ChangePublicPassphrase ¶
ChangePublicPassphrase modifies the public passphrase of the wallet.
func (*Wallet) CreateSimpleTx ¶
func (w *Wallet) CreateSimpleTx( account uint32, outputs []*wire.TxOut, minconf int32, satPerKb amt.Amount, ) (*txauthor.AuthoredTx, error)
CreateSimpleTx creates a new signed transaction spending unspent P2PKH outputs with at least minconf confirmations spending to any number of address/amount pairs. Change and an appropriate transaction fee are automatically included, if necessary. All transaction creation through this function is serialized to prevent the creation of many transactions which spend the same outputs.
func (*Wallet) CurrentAddress ¶
func (w *Wallet) CurrentAddress( account uint32, scope waddrmgr.KeyScope, ) (btcaddr.Address, error)
CurrentAddress gets the most recently requested Bitcoin payment address from a wallet for a particular key-chain scope. If the address has already been used (there is at least one transaction spending to it in the blockchain or pod mempool), the next chained address is returned.
func (*Wallet) Database ¶
Database returns the underlying walletdb database. This method is provided in order to allow applications wrapping btcwallet to store node-specific data with the wallet's database.
func (*Wallet) DumpPrivKeys ¶
DumpPrivKeys returns the WIF-encoded private keys for all addresses with private keys in a wallet.
func (*Wallet) DumpWIFPrivateKey ¶
DumpWIFPrivateKey returns the WIF encoded private key for a single wallet address.
func (*Wallet) GetTransactions ¶
func (w *Wallet) GetTransactions( startBlock, endBlock *BlockIdentifier, cancel qu.C, ) ( res *GetTransactionsResult, e error, )
GetTransactions returns transaction results between a starting and ending block. BlockC in the block range may be specified by either a height or a hash.
Because this is a possibly lengthy operation, a cancel channel is provided to cancel the task. If this channel unblocks, the results created thus far will be returned.
Transaction results are organized by blocks in ascending order and unmined transactions in an unspecified order. Mined transactions are saved in a Block structure which records properties about the block.
func (*Wallet) HaveAddress ¶
HaveAddress returns whether the wallet is the owner of the address a.
func (*Wallet) ImportP2SHRedeemScript ¶
func (w *Wallet) ImportP2SHRedeemScript(script []byte) (*btcaddr.ScriptHash, error, )
ImportP2SHRedeemScript adds a P2SH redeem script to the wallet.
func (*Wallet) ImportPrivateKey ¶
func (w *Wallet) ImportPrivateKey( scope waddrmgr.KeyScope, wif *util.WIF, bs *waddrmgr.BlockStamp, rescan bool, ) (string, error)
ImportPrivateKey imports a private key to the wallet and writes the new wallet to disk.
func (*Wallet) ListAddressTransactions ¶
func (w *Wallet) ListAddressTransactions(pkHashes map[string]struct{}) ( txList []btcjson.ListTransactionsResult, e error, )
ListAddressTransactions returns a slice of objects with details about recorded transactions to or from any address belonging to a set. This is intended to be used for listaddresstransactions RPC replies.
func (*Wallet) ListAllTransactions ¶
func (w *Wallet) ListAllTransactions() ( txList []btcjson.ListTransactionsResult, e error, )
ListAllTransactions returns a slice of objects with details about a recorded transaction. This is intended to be used for listalltransactions RPC replies.
func (*Wallet) ListSinceBlock ¶
func (w *Wallet) ListSinceBlock(start, end, syncHeight int32) ( txList []btcjson.ListTransactionsResult, e error, )
ListSinceBlock returns a slice of objects with details about transactions since the given block. If the block is -1 then all transactions are included. This is intended to be used for listsinceblock RPC replies.
func (*Wallet) ListTransactions ¶
func (w *Wallet) ListTransactions(from, count int) ( txList []btcjson.ListTransactionsResult, e error, )
ListTransactions returns a slice of objects with details about a recorded transaction. This is intended to be used for listtransactions RPC replies.
func (*Wallet) ListUnspent ¶
func (w *Wallet) ListUnspent( minconf, maxconf int32, addresses map[string]struct{}, ) (results []*btcjson.ListUnspentResult, e error)
ListUnspent returns a slice of objects representing the unspent wallet transactions fitting the given criteria. The confirmations will be more than minconf, less than maxconf and if addresses is populated only the addresses contained within it will be considered. If we know nothing about a transaction an empty array will be returned.
func (*Wallet) LockOutpoint ¶
LockOutpoint marks an outpoint as locked, that is, it should not be used as an input for newly created transactions.
func (*Wallet) LockedOutpoint ¶
LockedOutpoint returns whether an outpoint has been marked as locked and should not be used as an input for created transactions.
func (*Wallet) LockedOutpoints ¶
func (w *Wallet) LockedOutpoints() []btcjson.TransactionInput
LockedOutpoints returns a slice of currently locked outpoints. This is intended to be used by marshaling the result as a JSON array for listlockunspent RPC results.
func (*Wallet) MakeMultiSigScript ¶
MakeMultiSigScript creates a multi-signature script that can be redeemed with nRequired signatures of the passed keys and addresses. If the address is a P2PKH address, the associated pubkey is looked up by the wallet if possible, otherwise an error is returned for a missing pubkey.
This function only works with pubkeys and P2PKH addresses derived from them.
func (*Wallet) NewAddress ¶
func (w *Wallet) NewAddress( account uint32, scope waddrmgr.KeyScope, nochain bool, ) (addr btcaddr.Address, e error)
NewAddress returns the next external chained address for a wallet.
func (*Wallet) NewChangeAddress ¶
func (w *Wallet) NewChangeAddress( account uint32, scope waddrmgr.KeyScope, ) (btcaddr.Address, error)
NewChangeAddress returns a new change address for a wallet.
func (*Wallet) NextAccount ¶
NextAccount creates the next account and returns its account number. The name must be unique to the account. In order to support automatic seed restoring, new accounts may not be created when all of the previous 100 accounts have no transaction history (this is a deviation from the BIP0044 spec, which allows no unused account gaps).
func (*Wallet) PrivKeyForAddress ¶
PrivKeyForAddress looks up the associated private key for a P2PKH or P2PK address.
func (*Wallet) PubKeyForAddress ¶
PubKeyForAddress looks up the associated public key for a P2PKH address.
func (*Wallet) PublishTransaction ¶
PublishTransaction sends the transaction to the consensus RPC server so it can be propagated to other nodes and eventually mined.
This function is unstable and will be removed once syncing code is moved out of the wallet.
func (*Wallet) RenameAccount ¶
func (w *Wallet) RenameAccount( scope waddrmgr.KeyScope, account uint32, newName string, ) (e error)
RenameAccount sets the name for an account number to newName.
func (*Wallet) Rescan ¶
Rescan begins a rescan for all active addresses and unspent outputs of a wallet. This is intended to be used to sync a wallet back up to the current best block in the main chain, and is considered an initial sync rescan.
func (*Wallet) ResetLockedOutpoints ¶
func (w *Wallet) ResetLockedOutpoints()
ResetLockedOutpoints resets the set of locked outpoints so all may be used as inputs for new transactions.
func (*Wallet) SendOutputs ¶
func (w *Wallet) SendOutputs( outputs []*wire.TxOut, account uint32, minconf int32, satPerKb amt.Amount, ) (*chainhash.Hash, error)
SendOutputs creates and sends payment transactions. It returns the transaction hash upon success.
func (*Wallet) SetChainSynced ¶
SetChainSynced marks whether the wallet is connected to and currently in sync with the latest block notified by the chain server.
NOTE: Due to an API limitation with rpcclient, this may return true after the client disconnected (and is attempting a reconnect). This will be unknown until the reconnect notification is received, at which point the wallet can be marked out of sync again until after the next rescan completes.
func (*Wallet) ShuttingDown ¶
ShuttingDown returns whether the wallet is currently in the process of shutting down or not.
func (*Wallet) SignTransaction ¶
func (w *Wallet) SignTransaction( tx *wire.MsgTx, hashType txscript.SigHashType, additionalPrevScripts map[wire.OutPoint][]byte, additionalKeysByAddress map[string]*util.WIF, p2shRedeemScriptsByAddress map[string][]byte, ) (signErrors []SignatureError, e error)
SignTransaction uses secrets of the wallet, as well as additional secrets passed in by the caller, to create and add input signatures to a transaction.
Transaction input script validation is used to confirm that all signatures are valid. For any invalid input, a SignatureError is added to the returns. The final error return is reserved for unexpected or fatal errors, such as being unable to determine a previous output script to redeem.
The transaction pointed to by tx is modified by this function.
func (*Wallet) SortedActivePaymentAddresses ¶
SortedActivePaymentAddresses returns a slice of all active payment addresses in a wallet.
func (*Wallet) Start ¶
func (w *Wallet) Start()
Start starts the goroutines necessary to manage a wallet.
func (*Wallet) SubmitRescan ¶
SubmitRescan submits a RescanJob to the RescanManager. A channel is returned with the final error of the rescan. The channel is buffered and does not need to be read to prevent a deadlock.
func (*Wallet) SynchronizeRPC ¶
func (w *Wallet) SynchronizeRPC(chainClient chainclient.Interface)
SynchronizeRPC associates the wallet with the consensus RPC client, synchronizes the wallet with the latest changes to the blockchain, and continuously updates the wallet through RPC notifications.
This method is unstable and will be removed when all syncing logic is moved outside of the wallet package.
func (*Wallet) SynchronizingToNetwork ¶
SynchronizingToNetwork returns whether the wallet is currently synchronizing with the Bitcoin network.
func (*Wallet) TotalReceivedForAccounts ¶
func (w *Wallet) TotalReceivedForAccounts( scope waddrmgr.KeyScope, minConf int32, ) ([]AccountTotalReceivedResult, error)
TotalReceivedForAccounts iterates through a wallet's transaction history, returning the total amount of Bitcoin received for all accounts.
func (*Wallet) TotalReceivedForAddr ¶
func (w *Wallet) TotalReceivedForAddr( addr btcaddr.Address, minConf int32, ) (amount amt.Amount, e error)
TotalReceivedForAddr iterates through a wallet's transaction history, returning the total amount of bitcoins received for a single wallet address.
func (*Wallet) Unlock ¶
Unlock unlocks the wallet's address manager and relocks it after timeout has expired. If the wallet is already unlocked and the new passphrase is correct, the current timeout is replaced with the new one. The wallet will be locked if the passphrase is incorrect or any other error occurs during the unlock.
func (*Wallet) UnlockOutpoint ¶
UnlockOutpoint marks an outpoint as unlocked, that is, it may be used as an input for newly created transactions.
func (*Wallet) UnspentOutputs ¶
func (w *Wallet) UnspentOutputs(policy OutputSelectionPolicy) ([]*TransactionOutput, error, )
UnspentOutputs fetches all unspent outputs from the wallet that match rules described in the passed policy.
func (*Wallet) WaitForShutdown ¶
func (w *Wallet) WaitForShutdown()
WaitForShutdown blocks until all wallet goroutines have finished executing.
type WalletIsLockedRes ¶
type WalletIsLockedRes struct { Res *bool // contains filtered or unexported fields }
WalletIsLockedRes is the result from a call to WalletIsLocked
type WalletLockRes ¶
type WalletLockRes struct { Res *None // contains filtered or unexported fields }
WalletLockRes is the result from a call to WalletLock
type WalletPassphraseChangeRes ¶
type WalletPassphraseChangeRes struct { Res *None // contains filtered or unexported fields }
WalletPassphraseChangeRes is the result from a call to WalletPassphraseChange
type WalletPassphraseRes ¶
type WalletPassphraseRes struct { Res *None // contains filtered or unexported fields }
WalletPassphraseRes is the result from a call to WalletPassphrase
type WebsocketClient ¶
type WebsocketClient struct {
// contains filtered or unexported fields
}
func NewWebsocketClient ¶
func NewWebsocketClient(c *websocket.Conn, authenticated bool, remoteAddr string, ) *WebsocketClient
func (*WebsocketClient) Send ¶
func (c *WebsocketClient) Send(b []byte) (e error)