java.lang.Object
tech.deplant.java4ever.framework.contract.AbstractContract
- All Implemented Interfaces:
Contract
- Direct Known Subclasses:
GiverContract
,TIP3TokenRootContract
,TIP3TokenWalletContract
,TIP4CollectionContract
,TIP4IndexBasisContract
,TIP4IndexContract
,TIP4NftContract
,TIP4WalletContract
Class that represents deployed contract in one of the networks. It holds info about
network (sdk), address and abi of contract. If you own this contract, initialize it
with correct credentials.
If it's you are not a contract owner, use shorter constructor or explicit Credentials.NONE.
You can make calls to contract with prepareCall() method.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractContract
(int contextId, String address, ContractAbi abi, Credentials credentials) Instantiates a new Abstract contract.AbstractContract
(int contextId, Address address, ContractAbi abi, Credentials credentials) Instantiates a new Abstract contract. -
Method Summary
Modifier and TypeMethodDescriptionabi()
Abi contract abi.address()
Address address.int
Context id int.Credentials that were provided in object constructor.boolean
Function call builder function handle . builder.int
hashCode()
subscribeOnAccount
(String resultFields, Consumer<com.fasterxml.jackson.databind.JsonNode> subscribeEventConsumer) Subscribe on account subscribe handle.subscribeOnIncomingMessages
(String resultFields, Consumer<com.fasterxml.jackson.databind.JsonNode> subscribeEventConsumer) Subscribe on incoming messages subscribe handle.subscribeOnOutgoingMessages
(String resultFields, Consumer<com.fasterxml.jackson.databind.JsonNode> subscribeEventConsumer) Subscribe on outgoing messages subscribe handle.subscribeOnTransactions
(String resultFields, Consumer<com.fasterxml.jackson.databind.JsonNode> subscribeEventConsumer) Subscribe on transactions subscribe handle.void
waitForTransaction
(Address from, boolean onlySuccessful, Runnable startEvent) Wait for transaction.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface tech.deplant.java4ever.framework.contract.Contract
account, accountBalance, decodeMessageBoc, prepareCall
-
Constructor Details
-
AbstractContract
Instantiates a new Abstract contract.- Parameters:
contextId
- the context idaddress
- the addressabi
- the abicredentials
- the credentials
-
AbstractContract
Instantiates a new Abstract contract.- Parameters:
contextId
- the context idaddress
- the addressabi
- the abicredentials
- the credentials
-
-
Method Details
-
waitForTransaction
public void waitForTransaction(Address from, boolean onlySuccessful, Runnable startEvent) throws tech.deplant.java4ever.binding.EverSdkException, InterruptedException, TimeoutException Wait for transaction.- Parameters:
from
- the fromonlySuccessful
- the only successfulstartEvent
- the start event- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exceptionInterruptedException
- the interrupted exceptionTimeoutException
- the timeout exception
-
subscribeOnIncomingMessages
public SubscribeHandle subscribeOnIncomingMessages(String resultFields, Consumer<com.fasterxml.jackson.databind.JsonNode> subscribeEventConsumer) throws tech.deplant.java4ever.binding.EverSdkException Subscribe on incoming messages subscribe handle.- Parameters:
resultFields
- the result fieldssubscribeEventConsumer
- the subscribe event consumer- Returns:
- the subscribe handle
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
subscribeOnOutgoingMessages
public SubscribeHandle subscribeOnOutgoingMessages(String resultFields, Consumer<com.fasterxml.jackson.databind.JsonNode> subscribeEventConsumer) throws tech.deplant.java4ever.binding.EverSdkException Subscribe on outgoing messages subscribe handle.- Parameters:
resultFields
- the result fieldssubscribeEventConsumer
- the subscribe event consumer- Returns:
- the subscribe handle
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
subscribeOnAccount
public SubscribeHandle subscribeOnAccount(String resultFields, Consumer<com.fasterxml.jackson.databind.JsonNode> subscribeEventConsumer) throws tech.deplant.java4ever.binding.EverSdkException Subscribe on account subscribe handle.- Parameters:
resultFields
- the result fieldssubscribeEventConsumer
- the subscribe event consumer- Returns:
- the subscribe handle
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
subscribeOnTransactions
public SubscribeHandle subscribeOnTransactions(String resultFields, Consumer<com.fasterxml.jackson.databind.JsonNode> subscribeEventConsumer) throws tech.deplant.java4ever.binding.EverSdkException Subscribe on transactions subscribe handle.- Parameters:
resultFields
- the result fieldssubscribeEventConsumer
- the subscribe event consumer- Returns:
- the subscribe handle
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
functionCallBuilder
Function call builder function handle . builder.- Returns:
- the function handle . builder
-
contextId
-
address
-
abi
Description copied from interface:Contract
Abi contract abi. -
credentials
Description copied from interface:Contract
Credentials that were provided in object constructor. They can be different from real pubkey inside contract's inside contract's initialData. To check real pubkey in account, use tvmPubkey() method.- Specified by:
credentials
in interfaceContract
- Returns:
- credentials
-
hashCode
-
equals
-