Package io.meeds.wallet.service
Interface WalletService
public interface WalletService
A storage service to save/load information used by users and spaces wallets
-
Method Summary
Modifier and TypeMethodDescriptiondoubleRetrieves global stored settings used for all users.getUserSettings(String spaceId, String currentUser, boolean isAdministration) Retrieves user settings including global setting, network settings and contract detail.booleanbooleanisFundRequestSent(String notificationId, String currentUser) Get fund request statusvoidmarkFundRequestAsSent(String notificationId, String currentUser) Mark a fund request web notification as sentvoidrequestFunds(FundsRequest fundsRequest, String currentUser) Save funds request and send notificationsvoidsaveInitialFundsSettings(InitialFundsSettings initialFundsSettings) Save initial fundsvoidsaveUserPreferences(String currentUser, WalletSettings userPreferences) Save user preferences of WalletvoidsetConfiguredContractDetail(ContractDetail contractDetail) Sets contract detail object in global settingsvoidsetGasPrice(double blockchainGasPrice) Sets gas price from blockchain network
-
Method Details
-
saveInitialFundsSettings
Save initial funds- Parameters:
initialFundsSettings- initial funds to save
-
getInitialFundsSettings
InitialFundsSettings getInitialFundsSettings()- Returns:
- saved initial funds in internal store
-
getSettings
GlobalSettings getSettings()Retrieves global stored settings used for all users.- Returns:
GlobalSettingsglobal settings of default watched blockchain network
-
getUserSettings
Retrieves user settings including global setting, network settings and contract detail. if username is not null, the personal settings will be included. if spaceId is not null wallet address will be retrieved- Parameters:
spaceId- space pretty name to include its settingscurrentUser- username to include its preferencesisAdministration- whether the settings to retrieve are for administration or not- Returns:
UserSettingsuser settings with user and space preferences included into it
-
saveUserPreferences
Save user preferences of Wallet- Parameters:
currentUser- current user name to save its preferencesuserPreferences- user preferences to save
-
requestFunds
Save funds request and send notifications- Parameters:
fundsRequest- funds request details to savecurrentUser- username of user sending request- Throws:
IllegalAccessException- if request sender is not allowed to send request to receiver wallet
-
markFundRequestAsSent
Mark a fund request web notification as sent- Parameters:
notificationId- web notification idcurrentUser- current username that is marking the notification as sent- Throws:
IllegalAccessException- if current user is not the targetted user of notification
-
isFundRequestSent
Get fund request status- Parameters:
notificationId- web notification idcurrentUser- current username- Returns:
- true if fund request sent
- Throws:
IllegalAccessException- if current user is not the targetted user of notification
-
setConfiguredContractDetail
Sets contract detail object in global settings- Parameters:
contractDetail-
-
isEnabled
boolean isEnabled()- Returns:
- true if wallet admin is enabled on Token contract else return false
-
setGasPrice
void setGasPrice(double blockchainGasPrice) Sets gas price from blockchain network- Parameters:
blockchainGasPrice- gas price in WEI
-
getGasPrice
double getGasPrice()- Returns:
- gas price retrieved from blockchain
-