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.voiddeleteWallet(String walletId) Deletes theWalletwith the supplied wallet ID.voiddeleteWalletForUser(String walletId, String userId) Deletes a wallet for the supplied user.voiddeleteWalletForVault(String walletId, String vaultId) Deletes a wallet for the supplied user and vault.findWallet(String walletId) Finds aWalletbased 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 WalletFetches a specificWalletinstance based on ID.default WalletgetWalletForUser(String walletId, String userId) Fetches a specificWalletinstance based on ID.default WalletgetWalletInVault(String walletId, String vaultId) Fetches a specificWalletinstance based on ID.getWallets(int offset, int count, String vaultId, String userId, BlockchainApi protocol, List<BlockchainNetwork> networks) Lists allWalletinstances, 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 allWalletinstances, 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
PaginationofWalletinstances
-
findWallet
Finds aWalletbased on wallet id. -
findWalletForUser
Finds a wallet belonging to the specified user.. -
findWalletInVault
Finds a wallet in the specified vault. -
getWallet
Fetches a specificWalletinstance based on ID. If not found, an exception is raised.- Parameters:
walletId- the wallet id to- Returns:
- the
Wallet, never null
-
getWalletInVault
Fetches a specificWalletinstance based on ID. If not found, an exception is raised.- Parameters:
walletId- the wallet id tovaultId-- Returns:
- the
Wallet, never null
-
getWalletForUser
Fetches a specificWalletinstance 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
Walletas it was changed by the service.
-
createWallet
Creates a new Wallet. -
deleteWallet
Deletes theWalletwith 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
-