java.lang.Object
java.lang.Record
tech.deplant.java4ever.framework.Account
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
accType()
Returns the value of theaccType
record component.balance()
Returns the value of thebalance
record component.boc()
Returns the value of theboc
record component.code()
Returns the value of thecode
record component.codeHash()
Returns the value of thecodeHash
record component.data()
Returns the value of thedata
record component.dataHash()
Returns the value of thedataHash
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.id()
Returns the value of theid
record component.Returns the value of theinitCodeHash
record component.isActive()
Checks if accType field of account query equals to 1.long
Returns the value of thelast_paid
record component.static Account
Factory method to create Account object.ofAddressList
(Sdk sdk, String... addresses) Does the same as ofAddress() factory, but uses an array of addresses as "in" filter for GraphQL queryrunGetter
(Sdk sdk, ContractAbi abi, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader, Credentials credentials) Encodes inputs and run getter method on account's boc then decodes answer.tech.deplant.java4ever.binding.Tvm.ResultOfRunExecutor
runLocal
(Sdk sdk, ContractAbi abi, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader, Credentials credentials, tech.deplant.java4ever.binding.Tvm.ExecutionOptions options) Encodes inputs and runs callExternal method on account's boc then decodes answer.final String
toString()
Returns a string representation of this record class.tvmPubkey
(Sdk sdk, ContractAbi abi) Method to extract pubkey from data field of account query.
-
Constructor Details
-
Account
public Account(String id, int accType, String balance, String boc, String data, String dataHash, String code, String codeHash, String initCodeHash, long last_paid) Creates an instance of aAccount
record class.- Parameters:
id
- the value for theid
record componentaccType
- the value for theaccType
record componentbalance
- the value for thebalance
record componentboc
- the value for theboc
record componentdata
- the value for thedata
record componentdataHash
- the value for thedataHash
record componentcode
- the value for thecode
record componentcodeHash
- the value for thecodeHash
record componentinitCodeHash
- the value for theinitCodeHash
record componentlast_paid
- the value for thelast_paid
record component
-
-
Method Details
-
ofAddress
public static Account ofAddress(Sdk sdk, String address) throws tech.deplant.java4ever.binding.EverSdkException Factory method to create Account object. Makes a net.query_collection request to EVER-SDK (accounts collection query), then constructs Account object from the result. If query doesn't find account, method will construct empty Account object with accType=0 (not deployed).- Parameters:
sdk
- that will be used for queryaddress
- of account- Returns:
- GraphQL result with fields (id acc_type balance boc data data_hash code code_hash init_code_hash last_paid) as Account object
- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
ofAddressList
public static List<Account> ofAddressList(Sdk sdk, String... addresses) throws tech.deplant.java4ever.binding.EverSdkException Does the same as ofAddress() factory, but uses an array of addresses as "in" filter for GraphQL query- Parameters:
sdk
- that will be used for queryaddresses
- vararg/array of account addresses to check- Returns:
- list of created Account objects
- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
runGetter
public Map<String,Object> runGetter(Sdk sdk, ContractAbi abi, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader, Credentials credentials) throws tech.deplant.java4ever.binding.EverSdkExceptionEncodes inputs and run getter method on account's boc then decodes answer. Important! When you run getters here on Account directly, your local copy of account's boc can be older than real boc in blockchain. If you need to run getter on actual boc, you need to use OwnedContract.runGetter() method that downloads new account before running getter on it.- Parameters:
sdk
-abi
-functionName
-functionInputs
-functionHeader
-credentials
-- Returns:
- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
runLocal
public tech.deplant.java4ever.binding.Tvm.ResultOfRunExecutor runLocal(Sdk sdk, ContractAbi abi, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader, Credentials credentials, tech.deplant.java4ever.binding.Tvm.ExecutionOptions options) throws tech.deplant.java4ever.binding.EverSdkExceptionEncodes inputs and runs callExternal method on account's boc then decodes answer. Important! When you run callExternal locally, directly on Account boc, your blockchain real info remains unchanged. If you need to make a call to actual boc, you need to use OwnedContract.callExternal() method that sends transaction to blockchain.- Parameters:
sdk
-abi
-functionName
-functionInputs
-functionHeader
-credentials
-- Returns:
- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
isActive
Checks if accType field of account query equals to 1.- Returns:
- true if account is active
-
tvmPubkey
public String tvmPubkey(Sdk sdk, ContractAbi abi) throws tech.deplant.java4ever.binding.EverSdkException Method to extract pubkey from data field of account query.- Parameters:
sdk
- that will be used for extractionabi
- of contract (needed to correctly find place of pubkey in the account data)- Returns:
- pubkey string
- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
accType
public int accType()Returns the value of theaccType
record component.- Returns:
- the value of the
accType
record component
-
balance
Returns the value of thebalance
record component.- Returns:
- the value of the
balance
record component
-
boc
Returns the value of theboc
record component.- Returns:
- the value of the
boc
record component
-
data
Returns the value of thedata
record component.- Returns:
- the value of the
data
record component
-
dataHash
Returns the value of thedataHash
record component.- Returns:
- the value of the
dataHash
record component
-
code
Returns the value of thecode
record component.- Returns:
- the value of the
code
record component
-
codeHash
Returns the value of thecodeHash
record component.- Returns:
- the value of the
codeHash
record component
-
initCodeHash
Returns the value of theinitCodeHash
record component.- Returns:
- the value of the
initCodeHash
record component
-
last_paid
public long last_paid()Returns the value of thelast_paid
record component.- Returns:
- the value of the
last_paid
record component
-