Class WalletStorage

    • Method Detail

      • 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