Interface WalletDao

All Known Implementing Classes:
MongoWalletDao

public interface WalletDao
  • Method Details

    • getWallets

      Pagination<Wallet> getWallets(int offset, int count, String vaultId, String userId, BlockchainApi protocol, List<BlockchainNetwork> networks)
      Lists all Wallet instances, specifying a search query.
      Parameters:
      offset - the offset
      count - the count
      vaultId -
      userId - the userId, or null
      protocol - the protocol, or null
      networks - the network, or null
      Returns:
      a Pagination of Wallet instances
    • findWallet

      Optional<Wallet> findWallet(String walletId)
      Finds a Wallet based on wallet id.
      Parameters:
      walletId - the wallet id
      Returns:
      the Optional<Wallet>
    • findWalletForUser

      Optional<Wallet> findWalletForUser(String walletId, String userId)
      Finds a wallet belonging to the specified user..
      Parameters:
      walletId - the wallet id
      userId - the user id
      Returns:
      the Optional<Wallet>
    • findWalletInVault

      Optional<Wallet> findWalletInVault(String walletId, String vaultId)
      Finds a wallet in the specified vault.
      Parameters:
      walletId - the wallet id
      vaultId - the vault id
      Returns:
      the Optional<Wallet>
    • getWallet

      default Wallet getWallet(String walletId)
      Fetches a specific Wallet instance based on ID. If not found, an exception is raised.
      Parameters:
      walletId - the wallet id to
      Returns:
      the Wallet, never null
    • getWalletInVault

      default Wallet getWalletInVault(String walletId, String vaultId)
      Fetches a specific Wallet instance based on ID. If not found, an exception is raised.
      Parameters:
      walletId - the wallet id to
      vaultId -
      Returns:
      the Wallet, never null
    • getWalletForUser

      default Wallet getWalletForUser(String walletId, String userId)
      Fetches a specific Wallet instance based on ID. If not found, an exception is raised.
      Parameters:
      walletId - the wallet id to
      userId - the user id
      Returns:
      the Wallet, never null
    • getSingleWalletFromVaultForNetwork

      Wallet getSingleWalletFromVaultForNetwork(String vaultId, BlockchainNetwork blockchainNetwork)
      Attempts to find a single wallet for the supplied vault ID and blockchain network.
      Parameters:
      vaultId - the vault id
      blockchainNetwork - the network
      Returns:
      the wallet
      Throws:
      WalletNotFoundException - if no wallet matches
      DuplicateException - if more than one wallet matches
    • updateWallet

      Wallet updateWallet(Wallet Wallet)
      Updates the supplied Wallet.
      Parameters:
      Wallet -
      Returns:
      the Wallet as it was changed by the service.
    • createWallet

      Wallet createWallet(Wallet wallet)
      Creates a new Wallet.
      Parameters:
      wallet - the Wallet with the information to create
      Returns:
      the Wallet as it was created by the service.
    • deleteWallet

      void deleteWallet(String walletId)
      Deletes the Wallet with the supplied wallet ID.
      Parameters:
      walletId - the template ID.
    • deleteWalletForUser

      void deleteWalletForUser(String walletId, String userId)
      Deletes a wallet for the supplied user.
      Parameters:
      walletId - the wallet id
      userId - the user id
    • deleteWalletForVault

      void deleteWalletForVault(String walletId, String vaultId)
      Deletes a wallet for the supplied user and vault.
      Parameters:
      walletId - the wallet ID
      vaultId - the vault ID