Documentation ¶
Overview ¶
Package wallet provides a client that encapsulates RPC methods that can be hit in a wallet rpc server.
Index ¶
- type AutoRefreshResult
- type Client
- func (c *Client) AutoRefresh(ctx context.Context, enable bool, period int64) (*AutoRefreshResult, error)
- func (c *Client) CreateAddress(ctx context.Context, accountIndex uint, count uint, label string) (*CreateAddressResult, error)
- func (c *Client) GetAccounts(ctx context.Context, params GetAccountsRequestParameters) (*GetAccountsResult, error)
- func (c *Client) GetAddress(ctx context.Context, params GetAddressRequestParameters) (*GetAddressResult, error)
- func (c *Client) GetBalance(ctx context.Context, params GetBalanceRequestParameters) (*GetBalanceResult, error)
- func (c *Client) GetHeight(ctx context.Context) (*GetHeightResult, error)
- func (c *Client) Refresh(ctx context.Context, startHeight uint64) (*RefreshResult, error)
- type CreateAddressResult
- type GetAccountsRequestParameters
- type GetAccountsResult
- type GetAddressRequestParameters
- type GetAddressResult
- type GetBalanceRequestParameters
- type GetBalanceResult
- type GetHeightResult
- type RefreshResult
- type Requester
- type SubAddress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoRefreshResult ¶
type AutoRefreshResult struct { }
type Client ¶
type Client struct {
Requester
}
Client provides access to the daemon's JSONRPC methods and regular endpoints.
func (*Client) AutoRefresh ¶
func (*Client) CreateAddress ¶
func (*Client) GetAccounts ¶
func (c *Client) GetAccounts( ctx context.Context, params GetAccountsRequestParameters, ) (*GetAccountsResult, error)
func (*Client) GetAddress ¶
func (c *Client) GetAddress( ctx context.Context, params GetAddressRequestParameters, ) (*GetAddressResult, error)
func (*Client) GetBalance ¶
func (c *Client) GetBalance( ctx context.Context, params GetBalanceRequestParameters, ) (*GetBalanceResult, error)
GetBalance gets the balance of the wallet configured for the wallet rpc server.
type CreateAddressResult ¶
type GetAccountsResult ¶
type GetAccountsResult struct { SubaddressAccounts []struct { AccountIndex uint `json:"account_index"` Balance uint64 `json:"balance"` BaseAddress string `json:"base_address"` Label string `json:"label"` Tag string `json:"tag"` UnlockedBalance uint64 `json:"unlocked_balance"` } `json:"subaddress_accounts"` TotalBalance uint64 `json:"total_balance"` TotalUnlockedBalance uint64 `json:"total_unlocked_balance"` }
type GetAddressResult ¶
type GetBalanceResult ¶
type GetBalanceResult struct { // Balance is the total balance of the current monero-wallet-rpc in // session. // Balance uint64 `json:"balance"` // BlocksToUnlock indicates how many blocks are necessary for all the // funds to be unclocked. // BlocksToUnlock uint `json:"blocks_to_unlock"` // MultisigImportNeeded is True if importing multisig data is needed // for returning a correct balance // MultisigImportNeeded bool `json:"multisig_import_needed"` // PerSubaddress is an array of subaddress information; Balance // information for each subaddress in an account. // PerSubaddress []SubAddress `json:"per_subaddress"` // TimeToUnlock TODO // TimeToUnlock int `json:"time_to_unlock"` // UnlockedBalance TODO // UnlockedBalance int64 `json:"unlocked_balance"` }
type GetHeightResult ¶
type GetHeightResult struct {
Height uint64 `json:"height"`
}
type RefreshResult ¶
type Requester ¶
type Requester interface { // JSONRPC is used for callind methods under `/json_rpc` that follow // monero's `v2` response and error encapsulation. // JSONRPC( ctx context.Context, method string, params, result interface{}, ) error }
Requester is responsible for making HTTP requests to `monero-wallet-rpc` JSONRPC endpoints.
type SubAddress ¶
type SubAddress struct { // AccountIndex is the index of the account. // AccountIndex uint `json:"account_index"` // Address at this index. Base58 representation of the public // keys. // Address string `json:"address"` // AddressIndex is the index of the subaddress in the account. // AddressIndex uint `json:"address_index"` // Balance is the balance for the subaddress. // Balance uint64 `json:"balance"` // BlocksToUnlock TODO // BlocksToUnlock uint `json:"blocks_to_unlock"` // Label TODO // Label string `json:"label"` // NumUnspentOutputs TODO // NumUnspentOutputs uint `json:"num_unspent_outputs"` // TimeToUnlock TODO // TimeToUnlock uint `json:"time_to_unlock"` // UnlockedBalance TODO // UnlockedBalance int64 `json:"unlocked_balance"` }
Click to show internal directories.
Click to hide internal directories.