Module java4ever.framework
Record Class AbstractContract
java.lang.Object
java.lang.Record
tech.deplant.java4ever.framework.contract.AbstractContract
- All Implemented Interfaces:
Contract
public record AbstractContract(Sdk sdk, String address, ContractAbi abi, Credentials credentials)
extends Record
implements Contract
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 foreign contract, use shorter constructor oe explicit Credentials.NONE.
You can make calls to contract with prepareCall() method.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractContract
(Sdk sdk, String address, ContractAbi abi) AbstractContract
(Sdk sdk, String address, ContractAbi abi, Credentials credentials) Creates an instance of aAbstractContract
record class. -
Method Summary
Modifier and TypeMethodDescriptionabi()
Returns the value of theabi
record component.address()
Returns the value of theaddress
record component.Returns the value of thecredentials
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.sdk()
Returns the value of thesdk
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface tech.deplant.java4ever.framework.contract.Contract
account, accountBalance, decodeMessageBoc, prepareCall, subscribeOnAccount, subscribeOnIncomingMessages, subscribeOnOutgoingMessages, subscribeOnTransactions, tvmPubkey, waitForTransaction
-
Constructor Details
-
AbstractContract
-
AbstractContract
Creates an instance of aAbstractContract
record class.- Parameters:
sdk
- the value for thesdk
record componentaddress
- the value for theaddress
record componentabi
- the value for theabi
record componentcredentials
- the value for thecredentials
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
sdk
Returns the value of thesdk
record component. -
address
Returns the value of theaddress
record component. -
abi
Returns the value of theabi
record component. -
credentials
Returns the value of thecredentials
record component.- Specified by:
credentials
in interfaceContract
- Returns:
- the value of the
credentials
record component
-