Package dev.getelements.elements.sdk.dao
Interface WalletDao
- All Known Implementing Classes:
MongoWalletDao
public interface WalletDao
-
Method Summary
Modifier and TypeMethodDescriptioncreateWallet
(Wallet wallet) Creates a new Wallet.void
deleteWallet
(String walletId) Deletes theWallet
with the supplied wallet ID.void
deleteWalletForUser
(String walletId, String userId) Deletes a wallet for the supplied user.void
deleteWalletForVault
(String walletId, String vaultId) Deletes a wallet for the supplied user and vault.findWallet
(String walletId) Finds aWallet
based on wallet id.findWalletForUser
(String walletId, String userId) Finds a wallet belonging to the specified user..findWalletInVault
(String walletId, String vaultId) Finds a wallet in the specified vault.getSingleWalletFromVaultForNetwork
(String vaultId, BlockchainNetwork blockchainNetwork) Attempts to find a single wallet for the supplied vault ID and blockchain network.default Wallet
Fetches a specificWallet
instance based on ID.default Wallet
getWalletForUser
(String walletId, String userId) Fetches a specificWallet
instance based on ID.default Wallet
getWalletInVault
(String walletId, String vaultId) Fetches a specificWallet
instance based on ID.getWallets
(int offset, int count, String vaultId, String userId, BlockchainApi protocol, List<BlockchainNetwork> networks) Lists allWallet
instances, specifying a search query.updateWallet
(Wallet Wallet) Updates the suppliedWallet
.
-
Method Details
-
getWallets
Pagination<Wallet> getWallets(int offset, int count, String vaultId, String userId, BlockchainApi protocol, List<BlockchainNetwork> networks) Lists allWallet
instances, specifying a search query.- Parameters:
offset
- the offsetcount
- the countvaultId
-userId
- the userId, or nullprotocol
- the protocol, or nullnetworks
- the network, or null- Returns:
- a
Pagination
ofWallet
instances
-
findWallet
Finds aWallet
based on wallet id. -
findWalletForUser
Finds a wallet belonging to the specified user.. -
findWalletInVault
Finds a wallet in the specified vault. -
getWallet
Fetches a specificWallet
instance based on ID. If not found, an exception is raised.- Parameters:
walletId
- the wallet id to- Returns:
- the
Wallet
, never null
-
getWalletInVault
Fetches a specificWallet
instance based on ID. If not found, an exception is raised.- Parameters:
walletId
- the wallet id tovaultId
-- Returns:
- the
Wallet
, never null
-
getWalletForUser
Fetches a specificWallet
instance based on ID. If not found, an exception is raised.- Parameters:
walletId
- the wallet id touserId
- the user id- Returns:
- the
Wallet
, never null
-
getSingleWalletFromVaultForNetwork
Attempts to find a single wallet for the supplied vault ID and blockchain network.- Parameters:
vaultId
- the vault idblockchainNetwork
- the network- Returns:
- the wallet
- Throws:
WalletNotFoundException
- if no wallet matchesDuplicateException
- if more than one wallet matches
-
updateWallet
Updates the suppliedWallet
.- Parameters:
Wallet
-- Returns:
- the
Wallet
as it was changed by the service.
-
createWallet
Creates a new Wallet. -
deleteWallet
Deletes theWallet
with the supplied wallet ID.- Parameters:
walletId
- the template ID.
-
deleteWalletForUser
Deletes a wallet for the supplied user.- Parameters:
walletId
- the wallet iduserId
- the user id
-
deleteWalletForVault
Deletes a wallet for the supplied user and vault.- Parameters:
walletId
- the wallet IDvaultId
- the vault ID
-