Interface WalletService


public interface WalletService
A storage service to save/load information used by users and spaces wallets
  • Method Details

    • saveInitialFundsSettings

      void saveInitialFundsSettings(InitialFundsSettings initialFundsSettings)
      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:
      GlobalSettings global settings of default watched blockchain network
    • getUserSettings

      UserSettings getUserSettings(String spaceId, String currentUser, boolean isAdministration)
      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 settings
      currentUser - username to include its preferences
      isAdministration - whether the settings to retrieve are for administration or not
      Returns:
      UserSettings user settings with user and space preferences included into it
    • saveUserPreferences

      void saveUserPreferences(String currentUser, WalletSettings userPreferences)
      Save user preferences of Wallet
      Parameters:
      currentUser - current user name to save its preferences
      userPreferences - user preferences to save
    • requestFunds

      void requestFunds(FundsRequest fundsRequest, String currentUser) throws IllegalAccessException
      Save funds request and send notifications
      Parameters:
      fundsRequest - funds request details to save
      currentUser - username of user sending request
      Throws:
      IllegalAccessException - if request sender is not allowed to send request to receiver wallet
    • markFundRequestAsSent

      void markFundRequestAsSent(String notificationId, String currentUser) throws IllegalAccessException
      Mark a fund request web notification as sent
      Parameters:
      notificationId - web notification id
      currentUser - current username that is marking the notification as sent
      Throws:
      IllegalAccessException - if current user is not the targetted user of notification
    • isFundRequestSent

      boolean isFundRequestSent(String notificationId, String currentUser) throws IllegalAccessException
      Get fund request status
      Parameters:
      notificationId - web notification id
      currentUser - current username
      Returns:
      true if fund request sent
      Throws:
      IllegalAccessException - if current user is not the targetted user of notification
    • setConfiguredContractDetail

      void setConfiguredContractDetail(ContractDetail contractDetail)
      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