Package com.syntifi.near.api.service
Interface NearService
-
public interface NearService
RPC client for the Near network- Since:
- 0.0.1
- Author:
- Alexandre Carvalho, Andre Bertolace
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description ContractFunctionCallResult
callContractFunction(long blockHeight, java.lang.String accountId, java.lang.String methodName, java.lang.String argsBase64)
Allows you to call a contract method as a view function.ContractFunctionCallResult
callContractFunction(Finality finality, java.lang.String accountId, java.lang.String methodName, java.lang.String argsBase64)
Allows you to call a contract method as a view function.ContractFunctionCallResult
callContractFunction(java.lang.String blockHash, java.lang.String accountId, java.lang.String methodName, java.lang.String argsBase64)
Allows you to call a contract method as a view function.Block
getBlock(long blockHeight)
Queries network and returns block for given height or hash.Block
getBlock(Finality finality)
Queries network and returns block for given height or hash.Block
getBlock(java.lang.String blockHash)
Queries network and returns block for given height or hash.BlockChanges
getBlockChanges(long blockHeight)
BlockChanges
getBlockChanges(Finality finality)
BlockChanges
getBlockChanges(java.lang.String blockHash)
Chunk
getChunkDetails(long blockId, long shardId)
Returns details of a specific chunk.Chunk
getChunkDetails(java.lang.String chunkId)
Returns details of a specific chunk.Chunk
getChunkDetails(java.lang.String blockId, long shardId)
Returns details of a specific chunk.GasPrice
getGasPrice(long blockHeight)
Returns gas price for a specific block_height or block_hash.GasPrice
getGasPrice(java.lang.String blockHash)
Returns gas price for a specific block_height or block_hash.GenesisConfig
getGenesisConfig()
Returns current genesis configuration.NetworkInfo
getNetworkInfo()
Returns the current state of node network connections (active peers, transmitted data, etc.)ValidationStatus
getNetworkValidationStatus(long blockHeight)
Queries active validators on the network returning details and the state of validation on the blockchain.ValidationStatus
getNetworkValidationStatus(java.lang.String blockHash)
Queries active validators on the network returning details and the state of validation on the blockchain.NodeStatus
getNodeStatus()
Returns general status of a given node (sync status, nearcore node version, protocol version, etc), and the current set of validators.ProtocolConfig
getProtocolConfig(long blockHeight)
Returns most recent protocol configuration or a specific queried block.ProtocolConfig
getProtocolConfig(Finality finality)
Returns most recent protocol configuration or a specific queried block.ProtocolConfig
getProtocolConfig(java.lang.String blockHash)
Returns most recent protocol configuration or a specific queried block.Receipt
getTransactionReceipt(java.lang.String receiptId)
Fetches a receipt by it's ID (as is, without a status or execution outcome)TransactionStatus
getTransactionStatus(java.lang.String transactionHash, java.lang.String senderAccountId)
Queries status of a transaction by hash and returns the final transaction result.TransactionStatus
getTransactionStatusWithReceipts(java.lang.String transactionHash, java.lang.String senderAccountId)
Queries status of a transaction by hash, returning the final transaction result and details of all receipts.java.lang.String
sendTransactionAsync(java.lang.String base64EncodedSignedTransaction)
Sends a transaction and immediately returns transaction hash.TransactionAwait
sendTransactionAwait(java.lang.String base64EncodedSignedTransaction)
Sends a transaction and waits until transaction is fully complete.static NearService
usingPeer(java.lang.String url)
NearService builderAccessKey
viewAccessKey(long blockHeight, java.lang.String accountId, java.lang.String publicKey)
Returns information about a single access key for given account.AccessKey
viewAccessKey(Finality finality, java.lang.String accountId, java.lang.String publicKey)
Returns information about a single access key for given account.AccessKey
viewAccessKey(java.lang.String blockHash, java.lang.String accountId, java.lang.String publicKey)
Returns information about a single access key for given account.AccessKeyList
viewAccessKeyList(long blockHeight, java.lang.String accountId)
Returns all access keys for a given account.AccessKeyList
viewAccessKeyList(Finality finality, java.lang.String accountId)
Returns all access keys for a given account.AccessKeyList
viewAccessKeyList(java.lang.String blockHash, java.lang.String accountId)
Returns all access keys for a given account.Account
viewAccount(long blockHeight, java.lang.String accountId)
Returns basic account information.Account
viewAccount(Finality finality, java.lang.String accountId)
Returns basic account information.Account
viewAccount(java.lang.String blockHash, java.lang.String accountId)
Returns basic account information.AccountChanges
viewAccountChanges(long blockHeight, java.lang.String[] accountIds)
Returns account changes from transactions in a given account.AccountChanges
viewAccountChanges(Finality finality, java.lang.String[] accountIds)
Returns account changes from transactions in a given account.AccountChanges
viewAccountChanges(java.lang.String blockHash, java.lang.String[] accountIds)
Returns account changes from transactions in a given account.AccessKeyChanges
viewAllAccessKeyChanges(long blockHeight, java.lang.String[] accountIds)
Returns changes to all access keys of a specific block.AccessKeyChanges
viewAllAccessKeyChanges(Finality finality, java.lang.String[] accountIds)
Returns changes to all access keys of a specific block.AccessKeyChanges
viewAllAccessKeyChanges(java.lang.String blockHash, java.lang.String[] accountIds)
Returns changes to all access keys of a specific block.ContractCode
viewContractCode(long blockHeight, java.lang.String accountId)
Returns the contract code (Wasm binary) deployed to the account.ContractCode
viewContractCode(Finality finality, java.lang.String accountId)
Returns the contract code (Wasm binary) deployed to the account.ContractCode
viewContractCode(java.lang.String blockHash, java.lang.String accountId)
Returns the contract code (Wasm binary) deployed to the account.ContractCodeChanges
viewContractCodeChanges(long blockHeight, java.lang.String[] accountIds)
Returns code changes made when deploying a contract.ContractCodeChanges
viewContractCodeChanges(Finality finality, java.lang.String[] accountIds)
Returns code changes made when deploying a contract.ContractCodeChanges
viewContractCodeChanges(java.lang.String blockHash, java.lang.String[] accountIds)
Returns code changes made when deploying a contract.ContractState
viewContractState(long blockHeight, java.lang.String accountId, java.lang.String prefixBase64)
Returns the state (key value pairs) of a contract based on the key prefix (base64 encoded).ContractState
viewContractState(Finality finality, java.lang.String accountId, java.lang.String prefixBase64)
Returns the state (key value pairs) of a contract based on the key prefix (base64 encoded).ContractState
viewContractState(java.lang.String blockHash, java.lang.String accountId, java.lang.String prefixBase64)
Returns the state (key value pairs) of a contract based on the key prefix (base64 encoded).ContractStateChanges
viewContractStateChanges(long blockHeight, java.lang.String[] accountIds, java.lang.String keyPrefixBase64)
Returns the state change details of a contract based on the key prefix (encoded to base64).ContractStateChanges
viewContractStateChanges(Finality finality, java.lang.String[] accountIds, java.lang.String keyPrefixBase64)
Returns the state change details of a contract based on the key prefix (encoded to base64).ContractStateChanges
viewContractStateChanges(java.lang.String blockHash, java.lang.String[] accountIds, java.lang.String keyPrefixBase64)
Returns the state change details of a contract based on the key prefix (encoded to base64).AccessKeyChanges
viewSingleAccessKeyChanges(long blockHeight, Key[] keys)
Returns individual access key changes in a specific block.AccessKeyChanges
viewSingleAccessKeyChanges(Finality finality, Key[] keys)
Returns individual access key changes in a specific block.AccessKeyChanges
viewSingleAccessKeyChanges(java.lang.String blockHash, Key[] keys)
Returns individual access key changes in a specific block.
-
-
-
Method Detail
-
getBlock
Block getBlock(Finality finality) throws NearServiceException
Queries network and returns block for given height or hash.- Parameters:
finality
- the finality param- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getBlock
Block getBlock(java.lang.String blockHash) throws NearServiceException
Queries network and returns block for given height or hash.- Parameters:
blockHash
- the block's hash- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getBlock
Block getBlock(long blockHeight) throws NearServiceException
Queries network and returns block for given height or hash.- Parameters:
blockHeight
- the block's height- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getBlockChanges
BlockChanges getBlockChanges(Finality finality) throws NearServiceException
- Parameters:
finality
- the finality param- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getBlockChanges
BlockChanges getBlockChanges(java.lang.String blockHash) throws NearServiceException
- Parameters:
blockHash
- the block's hash- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getBlockChanges
BlockChanges getBlockChanges(long blockHeight) throws NearServiceException
- Parameters:
blockHeight
- the block's height- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getChunkDetails
Chunk getChunkDetails(java.lang.String chunkId) throws NearServiceException
Returns details of a specific chunk. You can run a block details query to get a valid chunk hash.- Parameters:
chunkId
- the id of the chunk- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getChunkDetails
Chunk getChunkDetails(java.lang.String blockId, long shardId) throws NearServiceException
Returns details of a specific chunk. You can run a block details query to get a valid chunk hash.- Parameters:
blockId
- the block hashshardId
- the id of the shard- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getChunkDetails
Chunk getChunkDetails(long blockId, long shardId) throws NearServiceException
Returns details of a specific chunk. You can run a block details query to get a valid chunk hash.- Parameters:
blockId
- the block heightshardId
- the id of the shard- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getNodeStatus
NodeStatus getNodeStatus() throws NearServiceException
Returns general status of a given node (sync status, nearcore node version, protocol version, etc), and the current set of validators.- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getNetworkInfo
NetworkInfo getNetworkInfo() throws NearServiceException
Returns the current state of node network connections (active peers, transmitted data, etc.)- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getNetworkValidationStatus
ValidationStatus getNetworkValidationStatus(java.lang.String blockHash) throws NearServiceException
Queries active validators on the network returning details and the state of validation on the blockchain.- Parameters:
blockHash
- the block's hash- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getNetworkValidationStatus
ValidationStatus getNetworkValidationStatus(long blockHeight) throws NearServiceException
Queries active validators on the network returning details and the state of validation on the blockchain.- Parameters:
blockHeight
- the block's height- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getGasPrice
GasPrice getGasPrice(java.lang.String blockHash) throws NearServiceException
Returns gas price for a specific block_height or block_hash. - Using [null] will return the most recent block's gas price.- Parameters:
blockHash
- the block's hash- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getGasPrice
GasPrice getGasPrice(long blockHeight) throws NearServiceException
Returns gas price for a specific block_height or block_hash.- Parameters:
blockHeight
- the block's height- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getGenesisConfig
GenesisConfig getGenesisConfig() throws NearServiceException
Returns current genesis configuration.- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getProtocolConfig
ProtocolConfig getProtocolConfig(Finality finality) throws NearServiceException
Returns most recent protocol configuration or a specific queried block. Useful for finding current storage and transaction costs.- Parameters:
finality
- the finality param- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getProtocolConfig
ProtocolConfig getProtocolConfig(java.lang.String blockHash) throws NearServiceException
Returns most recent protocol configuration or a specific queried block. Useful for finding current storage and transaction costs.- Parameters:
blockHash
- the block's hash- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getProtocolConfig
ProtocolConfig getProtocolConfig(long blockHeight) throws NearServiceException
Returns most recent protocol configuration or a specific queried block. Useful for finding current storage and transaction costs.- Parameters:
blockHeight
- the block's height- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
sendTransactionAsync
java.lang.String sendTransactionAsync(java.lang.String base64EncodedSignedTransaction) throws NearServiceException
Sends a transaction and immediately returns transaction hash.- Parameters:
base64EncodedSignedTransaction
- the base64 encoded signed transaction string- Returns:
- the transaction hash
- Throws:
NearServiceException
- rpc call error exception
-
sendTransactionAwait
TransactionAwait sendTransactionAwait(java.lang.String base64EncodedSignedTransaction) throws NearServiceException
Sends a transaction and waits until transaction is fully complete. (Has a 10 second timeout)- Parameters:
base64EncodedSignedTransaction
- the base64 encoded signed transaction string- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
getTransactionStatus
TransactionStatus getTransactionStatus(java.lang.String transactionHash, java.lang.String senderAccountId) throws NearServiceException
Queries status of a transaction by hash and returns the final transaction result.- Parameters:
transactionHash
- the transaction hashsenderAccountId
- the sender's account id- Returns:
- the data holding object the final transaction result
- Throws:
NearServiceException
- rpc call error exception
-
getTransactionStatusWithReceipts
TransactionStatus getTransactionStatusWithReceipts(java.lang.String transactionHash, java.lang.String senderAccountId) throws NearServiceException
Queries status of a transaction by hash, returning the final transaction result and details of all receipts.- Parameters:
transactionHash
- the transaction hashsenderAccountId
- the sender's account id- Returns:
- the data holding object the final transaction result and details of all receipts
- Throws:
NearServiceException
- rpc call error exception
-
getTransactionReceipt
Receipt getTransactionReceipt(java.lang.String receiptId) throws NearServiceException
Fetches a receipt by it's ID (as is, without a status or execution outcome)- Parameters:
receiptId
- the receipt ID to query for info- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAccessKey
AccessKey viewAccessKey(Finality finality, java.lang.String accountId, java.lang.String publicKey) throws NearServiceException
Returns information about a single access key for given account.If permission of the key is FunctionCall, it will return more details such as the allowance, receiver_id, and method_names.
- Parameters:
finality
- the finality paramaccountId
- the account idpublicKey
- the associated public key- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAccessKey
AccessKey viewAccessKey(java.lang.String blockHash, java.lang.String accountId, java.lang.String publicKey) throws NearServiceException
Returns information about a single access key for given account.If permission of the key is FunctionCall, it will return more details such as the allowance, receiver_id, and method_names.
- Parameters:
blockHash
- the block's hashaccountId
- the account idpublicKey
- the associated public key- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAccessKey
AccessKey viewAccessKey(long blockHeight, java.lang.String accountId, java.lang.String publicKey) throws NearServiceException
Returns information about a single access key for given account.If permission of the key is FunctionCall, it will return more details such as the allowance, receiver_id, and method_names.
- Parameters:
blockHeight
- the block's heightaccountId
- the account idpublicKey
- the associated public key- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAccessKeyList
AccessKeyList viewAccessKeyList(Finality finality, java.lang.String accountId) throws NearServiceException
Returns all access keys for a given account.- Parameters:
finality
- the finality paramaccountId
- the account id- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAccessKeyList
AccessKeyList viewAccessKeyList(java.lang.String blockHash, java.lang.String accountId) throws NearServiceException
Returns all access keys for a given account.- Parameters:
blockHash
- the block's hashaccountId
- the account id- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAccessKeyList
AccessKeyList viewAccessKeyList(long blockHeight, java.lang.String accountId) throws NearServiceException
Returns all access keys for a given account.- Parameters:
blockHeight
- the block's heightaccountId
- the account id- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewSingleAccessKeyChanges
AccessKeyChanges viewSingleAccessKeyChanges(Finality finality, Key[] keys) throws NearServiceException
Returns individual access key changes in a specific block. You can query multiple keys by passing an array of objects containing the account_id and key.- Parameters:
finality
- the finality paramkeys
- the key data to query for changes- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewSingleAccessKeyChanges
AccessKeyChanges viewSingleAccessKeyChanges(java.lang.String blockHash, Key[] keys) throws NearServiceException
Returns individual access key changes in a specific block. You can query multiple keys by passing an array of objects containing the account_id and key.- Parameters:
blockHash
- the block's hashkeys
- the key data to query for changes- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewSingleAccessKeyChanges
AccessKeyChanges viewSingleAccessKeyChanges(long blockHeight, Key[] keys) throws NearServiceException
Returns individual access key changes in a specific block. You can query multiple keys by passing an array of objects containing the account_id and key.- Parameters:
blockHeight
- the block's heightkeys
- the key data to query for changes- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAllAccessKeyChanges
AccessKeyChanges viewAllAccessKeyChanges(Finality finality, java.lang.String[] accountIds) throws NearServiceException
Returns changes to all access keys of a specific block. Multiple accounts can be quereied by passing an array of account_ids.- Parameters:
finality
- the finality paramaccountIds
- the account ids- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAllAccessKeyChanges
AccessKeyChanges viewAllAccessKeyChanges(java.lang.String blockHash, java.lang.String[] accountIds) throws NearServiceException
Returns changes to all access keys of a specific block. Multiple accounts can be quereied by passing an array of account_ids.- Parameters:
blockHash
- the block's hashaccountIds
- the account ids- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAllAccessKeyChanges
AccessKeyChanges viewAllAccessKeyChanges(long blockHeight, java.lang.String[] accountIds) throws NearServiceException
Returns changes to all access keys of a specific block. Multiple accounts can be quereied by passing an array of account_ids.- Parameters:
blockHeight
- the block's heightaccountIds
- the account ids- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAccount
Account viewAccount(Finality finality, java.lang.String accountId) throws NearServiceException
Returns basic account information.- Parameters:
finality
- the finality paramaccountId
- the account id- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAccount
Account viewAccount(java.lang.String blockHash, java.lang.String accountId) throws NearServiceException
Returns basic account information.- Parameters:
blockHash
- the block's hashaccountId
- the account id- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAccount
Account viewAccount(long blockHeight, java.lang.String accountId) throws NearServiceException
Returns basic account information.- Parameters:
blockHeight
- the block's heightaccountId
- the account id- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAccountChanges
AccountChanges viewAccountChanges(Finality finality, java.lang.String[] accountIds) throws NearServiceException
Returns account changes from transactions in a given account.- Parameters:
finality
- the finality paramaccountIds
- the account ids- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAccountChanges
AccountChanges viewAccountChanges(java.lang.String blockHash, java.lang.String[] accountIds) throws NearServiceException
Returns account changes from transactions in a given account.- Parameters:
blockHash
- the block's hashaccountIds
- the account ids- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewAccountChanges
AccountChanges viewAccountChanges(long blockHeight, java.lang.String[] accountIds) throws NearServiceException
Returns account changes from transactions in a given account.- Parameters:
blockHeight
- the block's heightaccountIds
- the account ids- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewContractCode
ContractCode viewContractCode(Finality finality, java.lang.String accountId) throws NearServiceException
Returns the contract code (Wasm binary) deployed to the account. Please note that the returned code will be encoded in base64.- Parameters:
finality
- the finality paramaccountId
- the account id- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewContractCode
ContractCode viewContractCode(java.lang.String blockHash, java.lang.String accountId) throws NearServiceException
Returns the contract code (Wasm binary) deployed to the account. Please note that the returned code will be encoded in base64.- Parameters:
blockHash
- the block's hashaccountId
- the account id- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewContractCode
ContractCode viewContractCode(long blockHeight, java.lang.String accountId) throws NearServiceException
Returns the contract code (Wasm binary) deployed to the account. Please note that the returned code will be encoded in base64.- Parameters:
blockHeight
- the block's heightaccountId
- the account id- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewContractState
ContractState viewContractState(Finality finality, java.lang.String accountId, java.lang.String prefixBase64) throws NearServiceException
Returns the state (key value pairs) of a contract based on the key prefix (base64 encoded). Pass an empty string for prefix_base64 if you would like to return the entire state. Please note that the returned state will be base64 encoded as well.- Parameters:
finality
- the finality paramaccountId
- the account idprefixBase64
- the base64 encoded prefix- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewContractState
ContractState viewContractState(java.lang.String blockHash, java.lang.String accountId, java.lang.String prefixBase64) throws NearServiceException
Returns the state (key value pairs) of a contract based on the key prefix (base64 encoded). Pass an empty string for prefix_base64 if you would like to return the entire state. Please note that the returned state will be base64 encoded as well.- Parameters:
blockHash
- the block's hashaccountId
- the account idprefixBase64
- the base64 encoded prefix- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewContractState
ContractState viewContractState(long blockHeight, java.lang.String accountId, java.lang.String prefixBase64) throws NearServiceException
Returns the state (key value pairs) of a contract based on the key prefix (base64 encoded). Pass an empty string for prefix_base64 if you would like to return the entire state. Please note that the returned state will be base64 encoded as well.- Parameters:
blockHeight
- the block's heightaccountId
- the account idprefixBase64
- the base64 encoded prefix- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewContractStateChanges
ContractStateChanges viewContractStateChanges(Finality finality, java.lang.String[] accountIds, java.lang.String keyPrefixBase64) throws NearServiceException
Returns the state change details of a contract based on the key prefix (encoded to base64). Pass an empty string for this param if you would like to return all state changes.- Parameters:
finality
- the finality paramaccountIds
- the account idskeyPrefixBase64
- the base64 encoded key prefix- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewContractStateChanges
ContractStateChanges viewContractStateChanges(java.lang.String blockHash, java.lang.String[] accountIds, java.lang.String keyPrefixBase64) throws NearServiceException
Returns the state change details of a contract based on the key prefix (encoded to base64). Pass an empty string for this param if you would like to return all state changes.- Parameters:
blockHash
- the block's hashaccountIds
- the account idskeyPrefixBase64
- the base64 encoded key prefix- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewContractStateChanges
ContractStateChanges viewContractStateChanges(long blockHeight, java.lang.String[] accountIds, java.lang.String keyPrefixBase64) throws NearServiceException
Returns the state change details of a contract based on the key prefix (encoded to base64). Pass an empty string for this param if you would like to return all state changes.- Parameters:
blockHeight
- the block's heightaccountIds
- the account idskeyPrefixBase64
- the base64 encoded key prefix- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewContractCodeChanges
ContractCodeChanges viewContractCodeChanges(Finality finality, java.lang.String[] accountIds) throws NearServiceException
Returns code changes made when deploying a contract. Change is returned is a base64 encoded WASM file.- Parameters:
finality
- the finality paramaccountIds
- the account ids- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewContractCodeChanges
ContractCodeChanges viewContractCodeChanges(java.lang.String blockHash, java.lang.String[] accountIds) throws NearServiceException
Returns code changes made when deploying a contract. Change is returned is a base64 encoded WASM file.- Parameters:
blockHash
- the block's hashaccountIds
- the account ids- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
viewContractCodeChanges
ContractCodeChanges viewContractCodeChanges(long blockHeight, java.lang.String[] accountIds) throws NearServiceException
Returns code changes made when deploying a contract. Change is returned is a base64 encoded WASM file.- Parameters:
blockHeight
- the block's heightaccountIds
- the account ids- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
callContractFunction
ContractFunctionCallResult callContractFunction(Finality finality, java.lang.String accountId, java.lang.String methodName, java.lang.String argsBase64) throws NearServiceException
Allows you to call a contract method as a view function.- Parameters:
finality
- the finality paramaccountId
- the account idmethodName
- the name of the method to callthe name of the method to callargsBase64
- the method's base64 encoded arguments- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
callContractFunction
ContractFunctionCallResult callContractFunction(java.lang.String blockHash, java.lang.String accountId, java.lang.String methodName, java.lang.String argsBase64) throws NearServiceException
Allows you to call a contract method as a view function.- Parameters:
blockHash
- the block's hashaccountId
- the account idmethodName
- the name of the method to callargsBase64
- the method's base64 encoded arguments- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
callContractFunction
ContractFunctionCallResult callContractFunction(long blockHeight, java.lang.String accountId, java.lang.String methodName, java.lang.String argsBase64) throws NearServiceException
Allows you to call a contract method as a view function.- Parameters:
blockHeight
- the block's heightaccountId
- the account idmethodName
- the name of the method to callargsBase64
- the method's base64 encoded arguments- Returns:
- the data holding object
- Throws:
NearServiceException
- rpc call error exception
-
usingPeer
static NearService usingPeer(java.lang.String url) throws java.net.MalformedURLException
NearService builder- Parameters:
url
- the rpc peer url to connect to- Returns:
- the data holding object
- Throws:
java.net.MalformedURLException
- thrown when url is invalid or unparseable
-
-