public class EthereumWalletAccountService extends Object
| Constructor and Description |
|---|
EthereumWalletAccountService(AccountStorage walletAccountStorage,
AddressLabelStorage labelStorage) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canAccessWallet(Wallet wallet,
String currentUser)
Return true if user can access wallet detailed information
|
void |
checkCanSaveWallet(Wallet wallet,
Wallet storedWallet,
String currentUser)
Throws an exception if the user is not allowed to modify wallet information
|
void |
enableWalletByAddress(String address,
boolean enable,
String currentUser)
Enable/Disable User or Space wallet
|
Set<AddressLabel> |
getAddressesLabelsVisibleBy(String currentUser)
List of labels that current user can access
|
Wallet |
getWalletByAddress(String address)
Retrieve wallet by address
|
Wallet |
getWalletByIdentityId(long identityId)
Retrieve wallet details by identity technical id
|
Wallet |
getWalletByTypeAndId(String type,
String remoteId)
Retrieve wallet details by identity type and remoteId
|
Wallet |
getWalletByTypeAndId(String type,
String remoteId,
String currentUser)
Retrieve wallet details by identity type and remoteId accessed by a user
|
long |
getWalletsCount()
Retrieve wallets count
|
Set<Wallet> |
listWallets()
Retrieves the list registered wallets
|
void |
removeWalletByAddress(String address,
String currentUser)
Remove User or Space wallet address association
|
AddressLabel |
saveOrDeleteAddressLabel(AddressLabel label,
String currentUser)
Saves label if label is not empty else, delete it
|
void |
saveWallet(Wallet wallet,
String currentUser,
boolean broadcast)
Save wallet address to currentUser or to a space managed by current user
|
public EthereumWalletAccountService(AccountStorage walletAccountStorage, AddressLabelStorage labelStorage)
public Set<Wallet> listWallets()
public long getWalletsCount()
public Wallet getWalletByIdentityId(long identityId)
identityId - User/Space identity technical idWallet wallet details identified by identity technical idpublic Wallet getWalletByTypeAndId(String type, String remoteId, String currentUser)
type - 'user' or 'space'remoteId - username or space pretty namecurrentUser - current user retrieving wallet detailsWallet wallet details identified by type and remote Idpublic Wallet getWalletByTypeAndId(String type, String remoteId)
type - 'user' or 'space'remoteId - username or space pretty nameWallet wallet details identified by type and remote Idpublic Wallet getWalletByAddress(String address)
address - address of wallet to retrieveWallet wallet details identified by type and remote Idpublic void saveWallet(Wallet wallet, String currentUser, boolean broadcast) throws Exception
public void removeWalletByAddress(String address, String currentUser) throws IllegalAccessException
address - wallet address association to removecurrentUser - current username removing wallet detailsIllegalAccessException - if current user is not an administratorpublic void enableWalletByAddress(String address, boolean enable, String currentUser) throws IllegalAccessException
address - address of wallet to enable/disableenable - whether enable or disable walletcurrentUser - username of current user making the operationIllegalAccessException - if current user is not an administratorpublic boolean canAccessWallet(Wallet wallet, String currentUser)
wallet - wallet details to checkcurrentUser - user accessing wallet detailspublic void checkCanSaveWallet(Wallet wallet, Wallet storedWallet, String currentUser) throws IllegalAccessException
wallet - wallet details to savestoredWallet - stored wallet in databasecurrentUser - current username that is making the modificationIllegalAccessException - if current user is not allowed to modify walletpublic AddressLabel saveOrDeleteAddressLabel(AddressLabel label, String currentUser)
label - label details object to processcurrentUser - current user making the label creation/modification/deletionAddressLabel saved or deleted label detailspublic Set<AddressLabel> getAddressesLabelsVisibleBy(String currentUser)
currentUser - current username accessing the list of addresses labelsSet of label detailsCopyright © 2003–2019 eXo Platform SAS. All rights reserved.