Package dev.getelements.elements.sdk.dao
Interface SmartContractDao
- All Known Implementing Classes:
MongoSmartContractDao
public interface SmartContractDao
Manages smart contracts in the database.
-
Method Summary
Modifier and TypeMethodDescriptioncreateSmartContract(SmartContract smartContract) Creates aSmartContractin the database.voiddeleteContract(String contractId) Deletes aSmartContract.findSmartContractById(String contractId) Finds a specificSmartContract.findSmartContractByNameOrId(String contractNameOrId) Finds a specificSmartContract.default SmartContractgetSmartContractById(String contractId) Gets the specific smart contract.default SmartContractgetSmartContractByNameOrId(String contractNameOrId) Gets the specific smart contract.getSmartContracts(int offset, int count, BlockchainApi blockchainApi, List<BlockchainNetwork> blockchainNetworks) Gets the smart contracts in the database.default Pagination<SmartContract> getSmartContractsForSingleNetwork(int offset, int count, BlockchainApi blockchainApi, BlockchainNetwork blockchainNetwork) Gets the smart contracts in the database.updateSmartContract(SmartContract smartContract) Updates aSmartContractin the database.
-
Method Details
-
getSmartContracts
Pagination<SmartContract> getSmartContracts(int offset, int count, BlockchainApi blockchainApi, List<BlockchainNetwork> blockchainNetworks) Gets the smart contracts in the database.- Parameters:
offset- the offsetcount- the countblockchainApi- the blockchain API, or nullblockchainNetworks- the networks associated, or null- Returns:
- a
Pagination<SmartContract>
-
getSmartContractsForSingleNetwork
default Pagination<SmartContract> getSmartContractsForSingleNetwork(int offset, int count, BlockchainApi blockchainApi, BlockchainNetwork blockchainNetwork) Gets the smart contracts in the database.- Parameters:
offset- the offsetcount- the countblockchainApi- the blockchain API, or nullblockchainNetwork- the network associated, or null- Returns:
- a
Pagination<SmartContract>
-
getSmartContractById
Gets the specific smart contract.- Parameters:
contractId- the contract id- Returns:
- the contract, never null
-
findSmartContractById
Finds a specificSmartContract.- Parameters:
contractId-- Returns:
- the
Optional<SmartContract>
-
getSmartContractByNameOrId
Gets the specific smart contract.- Parameters:
contractNameOrId- the contract unique name or id- Returns:
- the contract, never null
-
findSmartContractByNameOrId
Finds a specificSmartContract.- Parameters:
contractNameOrId- the contract unique name or id- Returns:
- the
Optional<SmartContract>
-
updateSmartContract
Updates aSmartContractin the database.- Parameters:
smartContract- theSmartContract- Returns:
- the
SmartContract
-
createSmartContract
Creates aSmartContractin the database.- Parameters:
smartContract- theSmartContract- Returns:
- the
SmartContract
-
deleteContract
Deletes aSmartContract.- Parameters:
contractId- the contract ID.
-