Class WalletStorage

java.lang.Object
org.exoplatform.wallet.storage.WalletStorage
Direct Known Subclasses:
CachedAccountStorage

public class WalletStorage extends Object
  • Constructor Details

  • Method Details

    • listWallets

      public Set<org.exoplatform.wallet.model.Wallet> listWallets()
      Retrieves the list registered wallets
      Returns:
      Set of Wallet details with associated addresses
    • getWalletsCount

      public long getWalletsCount()
      Returns:
      associated wallets counts
    • getWalletByIdentityId

      public org.exoplatform.wallet.model.Wallet getWalletByIdentityId(long identityId, String contractAddress)
      Parameters:
      identityId - user/space technical identty id
      contractAddress - contract address to use for wallet blockchain state
      Returns:
      Wallet details for identity
    • getWalletByAddress

      public org.exoplatform.wallet.model.Wallet getWalletByAddress(String address, String contractAddress)
      Parameters:
      address - wallet address
      contractAddress - contract address to use for wallet blockchain state
      Returns:
      Wallet details identified by address
    • retrieveWalletBlockchainState

      public void retrieveWalletBlockchainState(org.exoplatform.wallet.model.Wallet wallet, String contractAddress)
      Get wallet blockchain state from internal database
      Parameters:
      wallet - object to refresh
      contractAddress - contract address to use for wallet blockchain state
    • saveWallet

      public org.exoplatform.wallet.model.Wallet saveWallet(org.exoplatform.wallet.model.Wallet wallet, boolean isNew)
      Parameters:
      wallet - wallet details to save
      isNew - whether this is a new wallet association or not
      Returns:
      saved wallet entity
    • saveWalletBackupState

      public org.exoplatform.wallet.model.Wallet saveWalletBackupState(long identityId, boolean backupState)
      Change wallet backup state
      Parameters:
      identityId - user/space technical identty id
      backupState - true if backedUp else false
      Returns:
      modified Wallet
    • removeWallet

      public org.exoplatform.wallet.model.Wallet removeWallet(long identityId)
      Removes a wallet identitied by user/space identity technical id
      Parameters:
      identityId - user/space technical identty id
      Returns:
      removed Wallet
    • getWalletPrivateKey

      public String getWalletPrivateKey(long walletId)
      Find Wallet encoded private key by wallet identifier.
      Parameters:
      walletId - wallet unique identifier that is equals to identity ID
      Returns:
      private key encoded content
    • removeWalletPrivateKey

      public void removeWalletPrivateKey(long walletId)
      Remove Wallet encoded private key by wallet identifier
      Parameters:
      walletId - wallet unique identifier that is equals to identity ID
    • saveWalletPrivateKey

      public void saveWalletPrivateKey(long walletId, String content)
      Save wallet private key
      Parameters:
      walletId - wallet unique identifier that is equals to identity ID
      content - private key content
    • saveWalletBlockchainState

      public void saveWalletBlockchainState(org.exoplatform.wallet.model.Wallet wallet, String contractAddress)
      Save wallet state in blockchain
      Parameters:
      wallet - wallet to save its state
      contractAddress - address of the contract on which the state is associated
    • hasWalletBackup

      public boolean hasWalletBackup(long walletId)
      Checks whether identity has a wallet Backup or not
      Parameters:
      walletId - Wallet unique identifier
      Returns:
      true if an internal wallet address is backed up, else return false
    • hasWallet

      public boolean hasWallet(long walletId)
      Checks whether identity has a wallet or not
      Parameters:
      walletId - Wallet unique identifier
      Returns:
      true if wallet exists for selected identity
    • switchToInternalWallet

      public void switchToInternalWallet(long walletId)
      Switches Wallet to internal provider and transaction signer
      Parameters:
      walletId - Wallet unique identifier
    • switchToWalletProvider

      public void switchToWalletProvider(long walletId, org.exoplatform.wallet.model.WalletProvider provider, String newAddress)
      Switches Wallet to a new wallet provider and transaction signer
      Parameters:
      walletId - Wallet unique identifier
      provider - WalletProvider that must be different from Internal Wallet
      newAddress - Selected address provided from new Wallet Provider Tool