public interface WalletRpcClient
Represents a connection to a Monero wallet.
See newInstance(URI) to create a new instance.
-
Method Summary
Modifier and TypeMethodDescriptionReturn the wallet's first address.Asynchronously get a wallet's first address.longGet the wallet's balance, including currently locked/un-spendable Moneroj.Asynchronously get the wallet's balance, including currently locked/un-spendable Moneroj.longGet the wallet's unlocked balance.Asynchronously get the wallet's unlocked balance.static WalletRpcClientnewInstance(URI address)Create a new instance of aWalletRpcClienttransfer(List<TransferDestination> destinations)Transfer Moneroj from this wallet to one or more recipients.transferAsync(List<TransferDestination> destinations)Asynchronously transfer Moneroj from this wallet to one or more recipients.
-
Method Details
-
newInstance
Create a new instance of aWalletRpcClient- Parameters:
address- address of JSON-RPC endpoint, e.g.URI.create("http://localhost:18083/json_rpc")- Returns:
- new instance of
WalletRpcClient
-
getAddress
String getAddress()Return the wallet's first address.- Returns:
- address of wallet as base-58 encoded string
- See Also:
getAddressAsync()
-
getAddressAsync
CompletableFuture<String> getAddressAsync()Asynchronously get a wallet's first address.- Returns:
- a future that completes to the wallet's first address
- See Also:
getAddress()
-
transfer
Transfer Moneroj from this wallet to one or more recipients.Note that this actually calls
transfer_splitwhich means that it may be split up into many transactions if required.- Parameters:
destinations- list of recipients- Returns:
- list of transaction hashes
-
transferAsync
Asynchronously transfer Moneroj from this wallet to one or more recipients.Note that this actually calls
transfer_splitwhich means that it may be split up into many transactions if required.- Parameters:
destinations- list of recipients- Returns:
- list of transaction hashes
-
getBalance
long getBalance()Get the wallet's balance, including currently locked/un-spendable Moneroj.- Returns:
- the wallet's balance, in atomic units. 1 moneroj = 1e12 atomic units
- See Also:
getBalanceAsync()
-
getBalanceAsync
CompletableFuture<Long> getBalanceAsync()Asynchronously get the wallet's balance, including currently locked/un-spendable Moneroj.- Returns:
- a future that completes to the wallet's balance, in atomic units. 1 moneroj = 1e12 atomic units
-
getUnlockedBalance
long getUnlockedBalance()Get the wallet's unlocked balance.- Returns:
- the wallet's balance, in atomic units. 1 moneroj = 1e12 atomic units
- See Also:
getUnlockedBalanceAsync(),getBalance()
-
getUnlockedBalanceAsync
CompletableFuture<Long> getUnlockedBalanceAsync()Asynchronously get the wallet's unlocked balance.- Returns:
- a future that completes to the wallet's balance, in atomic units. 1 moneroj = 1e12 atomic units
- See Also:
getUnlockedBalance(),getBalanceAsync()
-