Class TemplatesManager


  • public class TemplatesManager
    extends BaseManager
    Controller class to manage the SEA Template functions
    • Field Detail

      • log

        private static final org.apache.logging.log4j.Logger log
    • Constructor Detail

      • TemplatesManager

        private TemplatesManager​(io.keyko.common.web3.KeeperService keeperService,
                                 MetadataApiService metadataApiService)
    • Method Detail

      • getInstance

        public static TemplatesManager getInstance​(io.keyko.common.web3.KeeperService keeperService,
                                                   MetadataApiService metadataApiService)
        Given the KeeperService and MetadataApiService, returns a new instance of AccountsManager using them as attributes
        Parameters:
        keeperService - Keeper Dto
        metadataApiService - Provider Dto
        Returns:
        AccountsManager AccountsManager instance
      • proposeTemplate

        public org.web3j.protocol.core.methods.response.TransactionReceipt proposeTemplate​(String templateAddress)
                                                                                    throws EthereumException
        Suggest an agreement template smart contract to include in the white listed agreement templates
        Parameters:
        templateAddress - Hex str the ethereum address of the deployed template (smart contract address)
        Returns:
        TransactionReceipt tx receipt
        Throws:
        EthereumException - EVM error
      • approveTemplate

        public org.web3j.protocol.core.methods.response.TransactionReceipt approveTemplate​(String templateId)
                                                                                    throws EthereumException
        Approve (whitelist) an already proposed template
        Parameters:
        templateId - String
        Returns:
        TransactionReceipt tx receipt
        Throws:
        EthereumException - EVM error
      • revokeTemplate

        public org.web3j.protocol.core.methods.response.TransactionReceipt revokeTemplate​(String templateId)
                                                                                   throws EthereumException
        Cancel the propsed/approved template or essentially de-whitelist the template.
        Parameters:
        templateId - Hex str the ethereum address of the deployed template (smart contract address)
        Returns:
        TransactionReceipt tx receipt
        Throws:
        EthereumException - EVM error
      • isTemplateApproved

        public boolean isTemplateApproved​(String templateAddress)
                                   throws EthereumException
        Returns true or false depending if the template was approved
        Parameters:
        templateAddress - Hex str the ethereum address of the deployed template (smart contract address)
        Returns:
        boolean is approved
        Throws:
        EthereumException - EVM error