Documentation ¶
Overview ¶
Package btcsuite provides implementations of the privatebtc.RPCClientFactory and privatebtc.RPCClient interfaces using the https://github.com/ory/dockertest package.
Index ¶
- type RPCClient
- func (c RPCClient) AddPeer(_ context.Context, peer privatebtc.Node) error
- func (c RPCClient) CreateWallet(_ context.Context, walletName string) error
- func (c RPCClient) GenerateToAddress(_ context.Context, numBlocks int64, address string) ([]string, error)
- func (c RPCClient) GetBalance(context.Context) (privatebtc.Balance, error)
- func (c RPCClient) GetBestBlockHash(context.Context) (string, error)
- func (c RPCClient) GetBlockCount(context.Context) (int, error)
- func (c RPCClient) GetCoinbaseValue(context.Context) (int64, error)
- func (c RPCClient) GetConnectionCount(context.Context) (int, error)
- func (c RPCClient) GetNewAddress(_ context.Context, label string) (string, error)
- func (c RPCClient) GetPendingBalance() (float64, error)
- func (c RPCClient) GetRawMempool(context.Context) ([]string, error)
- func (c RPCClient) GetTransaction(_ context.Context, txHash string) (*privatebtc.Transaction, error)
- func (c RPCClient) ListAddresses(context.Context) ([]string, error)
- func (c RPCClient) RemovePeer(ctx context.Context, peer privatebtc.Node) error
- func (c RPCClient) SendCustomTransaction(_ context.Context, inputs []privatebtc.TransactionVin, ...) (string, error)
- func (c RPCClient) SendToAddress(_ context.Context, address string, amount float64) (string, error)
- type RPCClientFactory
- type WalletWarningError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
RPCClient is an RPC client for a BTC node.
func (RPCClient) CreateWallet ¶
CreateWallet creates a wallet with the given name.
func (RPCClient) GenerateToAddress ¶
func (c RPCClient) GenerateToAddress( _ context.Context, numBlocks int64, address string, ) ([]string, error)
GenerateToAddress generates numBlocks blocks and sends the coinbase to the given address.
func (RPCClient) GetBalance ¶
GetBalance returns the balance of the wallet.
func (RPCClient) GetBestBlockHash ¶
GetBestBlockHash returns the hash of the best (tip) block in the longest block chain.
func (RPCClient) GetBlockCount ¶
GetBlockCount returns the current block count.
func (RPCClient) GetCoinbaseValue ¶
GetCoinbaseValue returns the coinbase for the next block.
func (RPCClient) GetConnectionCount ¶
GetConnectionCount returns the number of connections to other nodes.
func (RPCClient) GetNewAddress ¶
GetNewAddress generates a new BTC address.
func (RPCClient) GetPendingBalance ¶
GetPendingBalance returns the pending balance of the wallet.
func (RPCClient) GetRawMempool ¶
GetRawMempool returns the hashes of all transactions in the mempool.
func (RPCClient) GetTransaction ¶
func (c RPCClient) GetTransaction( _ context.Context, txHash string, ) (*privatebtc.Transaction, error)
GetTransaction returns a transaction by its hash.
func (RPCClient) ListAddresses ¶
ListAddresses returns all addresses in the wallet.
func (RPCClient) RemovePeer ¶
RemovePeer removes a peer from the node.
func (RPCClient) SendCustomTransaction ¶
func (c RPCClient) SendCustomTransaction( _ context.Context, inputs []privatebtc.TransactionVin, amounts map[string]float64, ) (string, error)
SendCustomTransaction sends a custom transaction with the given inputs and amounts.
type RPCClientFactory ¶
type RPCClientFactory struct {
NoPing bool
}
RPCClientFactory is a factory for RPC clients.
func (RPCClientFactory) NewRPCClient ¶
func (f RPCClientFactory) NewRPCClient(hostPort, rpcUser, rpcPass string, ) (privatebtc.RPCClient, error)
NewRPCClient creates a new RPC client.
type WalletWarningError ¶
type WalletWarningError string
WalletWarningError is an error returned by the RPC client when a wallet warning is encountered.
func (WalletWarningError) Error ¶
func (e WalletWarningError) Error() string