Interface WalletRpcClient


public interface WalletRpcClient
Represents a connection to a Monero wallet.

See newInstance(URI) to create a new instance.

  • Method Details

    • newInstance

      static WalletRpcClient newInstance(URI address)
      Create a new instance of a WalletRpcClient
      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

      List<String> transfer(List<TransferDestination> destinations)
      Transfer Moneroj from this wallet to one or more recipients.

      Note that this actually calls transfer_split which means that it may be split up into many transactions if required.

      Parameters:
      destinations - list of recipients
      Returns:
      list of transaction hashes
    • transferAsync

      CompletableFuture<List<String>> transferAsync(List<TransferDestination> destinations)
      Asynchronously transfer Moneroj from this wallet to one or more recipients.

      Note that this actually calls transfer_split which 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()