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, tech.deplant.java4ever.binding.Abi.Signer signer) 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()
tech.deplant.java4ever.binding.Abi.Signer
signer()
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
(Consumer<com.fasterxml.jackson.databind.JsonNode> subscribeEventConsumer, String... resultFields) Subscribe on transactions subscribe handle.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
-
AbstractContract
public AbstractContract(int contextId, Address address, ContractAbi abi, tech.deplant.java4ever.binding.Abi.Signer signer) Instantiates a new Abstract contract.- Parameters:
contextId
- the context idaddress
- the addressabi
- the abisigner
- the signer
-
-
Method Details
-
subscribeOnIncomingMessages
public Subscriptions.Builder 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 Subscriptions.Builder 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 Subscriptions.Builder 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 Subscriptions.Builder subscribeOnTransactions(Consumer<com.fasterxml.jackson.databind.JsonNode> subscribeEventConsumer, String... resultFields) throws tech.deplant.java4ever.binding.EverSdkException Subscribe on transactions subscribe handle.- Parameters:
subscribeEventConsumer
- the subscribe event consumerresultFields
- the result fields- 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
-
signer
-
hashCode
-
equals
-