Documentation
¶
Index ¶
- Constants
- func RandomPriority() wallet.Priority
- type ChurnableAccount
- type ChurnableAccounts
- type ChurnableSubAdddress
- type Client
- func (c *Client) AddressBalance(walletName string, address string, accountIndex uint64, addressIndex ...uint64) (uint64, error)
- func (c *Client) BlockHeight(walletName string) (*wallet.ResponseGetHeight, error)
- func (c *Client) CheckReserveProof(walletName, reserveAddress, message, signature string) (*wallet.ResponseCheckReserveProof, error)
- func (c *Client) Close() error
- func (c *Client) CreateWallet(walletName string) error
- func (c *Client) GetAccounts(walletName string) (*wallet.ResponseGetAccounts, error)
- func (c *Client) GetAddress(walletName string, accountIndex uint64, addressIndex ...uint64) (*wallet.ResponseGetAddress, error)
- func (c *Client) GetBulkPayments(walletName, paymentID string) (*wallet.ResponseGetBulkPayments, error)
- func (c *Client) GetChurnableAddresses(walletName string, churnAccountIndex, minBalance uint64) (*ChurnableAccounts, error)
- func (c *Client) GetPayments(walletName, paymentID string) (*wallet.ResponseGetPayments, error)
- func (c *Client) GetReserveProof(walletName, message string) (*wallet.ResponseGetReserveProof, error)
- func (c *Client) GetTxID(walletName, txHash string) (*wallet.ResponseGetTransferByTxID, error)
- func (c *Client) GetWalletAddress(walletName string) (string, error)
- func (c *Client) NewAccount(walletName, label string) (*wallet.ResponseCreateAccount, error)
- func (c *Client) NewAddress(walletName string, accountIndex uint64) (string, error)
- func (c *Client) NewIntegratedAddress(walletName string) (*wallet.ResponseMakeIntegratedAddress, error)
- func (c *Client) OpenWallet(walletName string) error
- func (c *Client) Refresh(walletName string) error
- func (c *Client) Relay(walletName, txMetadata string) (string, error)
- func (c *Client) Rescan(walletName string) error
- func (c *Client) SaveWallet() error
- func (c *Client) SplitIntegratedAddress(walletName string) (*wallet.ResponseSplitIntegratedAddress, error)
- func (c *Client) StartMining(walletName string, threads uint64) error
- func (c *Client) StopMining(walletName string) error
- func (c *Client) SweepAll(opts TransferOpts) (*wallet.ResponseSweepAll, error)
- func (c *Client) SweepDust(walletName string) (*wallet.ResponseSweepDust, error)
- func (c *Client) SweepSingle(opts TransferOpts) (*wallet.ResponseSweepSingle, error)
- func (c *Client) Transfer(opts TransferOpts) (*wallet.ResponseTransfer, error)
- func (c *Client) TransferSplit(opts TransferOpts) (*wallet.ResponseTransferSplit, error)
- func (c *Client) TxConfirmed(walletName, txHash string) (bool, error)
- func (c *Client) WalletBalance(walletName string) (uint64, error)
- type TransferOpts
Constants ¶
const ( // Mixing defines the number of outputs to include with ours in the ring Mixing = uint64(10) // RingSize defines the total number of outputs in the ring (N + 1) RingSize = uint64(11) )
Variables ¶
This section is empty.
Functions ¶
func RandomPriority ¶
RandomPriority returns a random transaction priority note that this can potentially become expensive
Types ¶
type ChurnableAccount ¶
type ChurnableAccount struct { AccountIndex uint64 BaseAddress string Subaddresses []ChurnableSubAdddress }
ChurnableAccount defines a group of sub addresses we can churn funds from
type ChurnableAccounts ¶
type ChurnableAccounts struct {
Accounts []ChurnableAccount
}
ChurnableAccounts bundles together all accounts we can churn funds from
type ChurnableSubAdddress ¶
ChurnableSubAdddress defines a given address that we can churn funds from
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper around the monero wallet rpc
func (*Client) AddressBalance ¶
func (c *Client) AddressBalance(walletName string, address string, accountIndex uint64, addressIndex ...uint64) (uint64, error)
AddressBalance returns the unlocked funds for the given address TODO(bonedaddy): accept account and subaddress index look up balance for the given address (not the wallet)
func (*Client) BlockHeight ¶
func (c *Client) BlockHeight(walletName string) (*wallet.ResponseGetHeight, error)
BlockHeight returns the current block ehgiht
func (*Client) CheckReserveProof ¶
func (c *Client) CheckReserveProof(walletName, reserveAddress, message, signature string) (*wallet.ResponseCheckReserveProof, error)
CheckReserveProof is used to validate a reserve proof
func (*Client) CreateWallet ¶
CreateWallet is used to create a new monero wallet
func (*Client) GetAccounts ¶
func (c *Client) GetAccounts(walletName string) (*wallet.ResponseGetAccounts, error)
GetAccounts returns all accounts under the wallet
func (*Client) GetAddress ¶
func (c *Client) GetAddress(walletName string, accountIndex uint64, addressIndex ...uint64) (*wallet.ResponseGetAddress, error)
GetAddress returns address information for a given account index optionally filtered by subaddress index
func (*Client) GetBulkPayments ¶
func (c *Client) GetBulkPayments(walletName, paymentID string) (*wallet.ResponseGetBulkPayments, error)
func (*Client) GetChurnableAddresses ¶
func (c *Client) GetChurnableAddresses(walletName string, churnAccountIndex, minBalance uint64) (*ChurnableAccounts, error)
GetChurnableAddresses is used to get addresses that we can churn by sending to ourselves. The account index matching churnAccountIndex is skipped, as this is the account for which we will use to send churned funds to
func (*Client) GetPayments ¶
func (c *Client) GetPayments(walletName, paymentID string) (*wallet.ResponseGetPayments, error)
func (*Client) GetReserveProof ¶
func (c *Client) GetReserveProof(walletName, message string) (*wallet.ResponseGetReserveProof, error)
GetReserveProof returns a reserve proof for the given wallet
func (*Client) GetTxID ¶
func (c *Client) GetTxID(walletName, txHash string) (*wallet.ResponseGetTransferByTxID, error)
TxConfirmed returns whether or not the given transaction is confirmed
func (*Client) GetWalletAddress ¶
GetWalletAddress is a convenience function to return wallet address information
func (*Client) NewAccount ¶
func (c *Client) NewAccount(walletName, label string) (*wallet.ResponseCreateAccount, error)
NewAccount is used to create a new account with an optional label
func (*Client) NewAddress ¶
NewAddress creates a new address under the given account index
func (*Client) NewIntegratedAddress ¶
func (c *Client) NewIntegratedAddress(walletName string) (*wallet.ResponseMakeIntegratedAddress, error)
func (*Client) OpenWallet ¶
OpenWallet is used to open the given wallet using it for all subsequent RPC requests
func (*Client) Refresh ¶
Refresh triggles a total refresh of a wallet scanning all addresses for incoming transactions
func (*Client) SaveWallet ¶
SaveWallet stores the state of the current actively opened wallet
func (*Client) SplitIntegratedAddress ¶
func (c *Client) SplitIntegratedAddress(walletName string) (*wallet.ResponseSplitIntegratedAddress, error)
func (*Client) StartMining ¶
StartMining starts actively mining blocks with the given threads
func (*Client) StopMining ¶
StopMining stops active mining processes
func (*Client) SweepAll ¶
func (c *Client) SweepAll(opts TransferOpts) (*wallet.ResponseSweepAll, error)
SweepAll is used to sweep all funds from the given account index sending it to the destination address
func (*Client) SweepDust ¶
func (c *Client) SweepDust(walletName string) (*wallet.ResponseSweepDust, error)
SweepDust is used to sweep all unspendable amounts pre-ringCT
func (*Client) SweepSingle ¶
func (c *Client) SweepSingle(opts TransferOpts) (*wallet.ResponseSweepSingle, error)
SweepSingle is used to spend all of a specified unlocked output to an address
func (*Client) Transfer ¶
func (c *Client) Transfer(opts TransferOpts) (*wallet.ResponseTransfer, error)
Transfer is used to transfer funds from the given wallet to the destination address
func (*Client) TransferSplit ¶
func (c *Client) TransferSplit(opts TransferOpts) (*wallet.ResponseTransferSplit, error)
TransferSplit allows splitting up a transaction into smaller one, useful for situations where Transfer returns an error due to to large of a transaction
func (*Client) TxConfirmed ¶
TxConfirmed returns whether or not the given transaction is confirmed
type TransferOpts ¶
type TransferOpts struct { Priority wallet.Priority // maps destination address to amount Destinations map[string]uint64 AccountIndex uint64 // defaults to 0 SubaddrIndices []uint64 // options, default is nil which means all WalletName string PaymentID string DoNotRelay bool }
TransferOpts defines options used to control transfers TODO(bonedaddy): support more than out destination address