Package com.syntifi.casper.sdk.service
Interface CasperService
-
public interface CasperService
Interface to be used as Dynamic Proxy for RPC method operation- Since:
- 0.0.1
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description BalanceData
getBalance(java.lang.String stateRootHash, java.lang.String purseUref)
Fetches balance valueJsonBlockData
getBlock()
Get latest block infoJsonBlockData
getBlock(BlockIdentifier blockIdentifier)
Retrieve block info by itsBlockIdentifier
TransferData
getBlockTransfers()
Retrieve last block's transfersTransferData
getBlockTransfers(BlockIdentifier blockIdentifier)
Retrieve block transfers by itsBlockIdentifier
DeployData
getDeploy(java.lang.String deployHash)
Returns a Deploy from the networkEraInfoData
getEraInfoBySwitchBlock(BlockIdentifier blockIdentifier)
Returns an EraInfo from the networkPeerData
getPeerData()
Get network peers dataAccountData
getStateAccountInfo(java.lang.String publicKey, BlockIdentifier blockIdentifier)
Returns an Account from the networkAuctionData
getStateAuctionInfo(BlockIdentifier blockIdentifier)
Returns the Auction info for a given blockDictionaryData
getStateDictionaryItem(java.lang.String stateRootHash, DictionaryIdentifier dictionaryIdentifier)
Lookup a dictionary item via an Contract's named keys.StoredValueData
getStateItem(java.lang.String stateRootHash, java.lang.String key, java.util.List<java.lang.String> path)
Returns a stored value from the networkStateRootHashData
getStateRootHash()
Returns a state root hash at the last BlockStateRootHashData
getStateRootHash(BlockIdentifier blockIdentifier)
Returns a state root hash at a given aBlockIdentifier
StatusData
getStatus()
Returns the current status of the nodeDeployResult
putDeploy(Deploy deploy)
Sends a deploy to be received by the networkstatic CasperService
usingPeer(java.lang.String ip, int port)
Builds a CasperService for the node ip/port pair
-
-
-
Method Detail
-
getPeerData
PeerData getPeerData()
Get network peers data- Returns:
- Object holding the api version and peer list
-
getBlock
JsonBlockData getBlock()
Get latest block info- Returns:
- Object holding the api version and block
-
getBlock
JsonBlockData getBlock(BlockIdentifier blockIdentifier)
Retrieve block info by itsBlockIdentifier
- Parameters:
blockIdentifier
- BlockIdentifier data- Returns:
- Object holding the api version and block
-
getBlockTransfers
TransferData getBlockTransfers()
Retrieve last block's transfers- Returns:
- Object holding the api version and transfer data
-
getBlockTransfers
TransferData getBlockTransfers(BlockIdentifier blockIdentifier)
Retrieve block transfers by itsBlockIdentifier
- Parameters:
blockIdentifier
- BlockIdentifier data- Returns:
- Object holding the api version and transfer data
-
getStateRootHash
StateRootHashData getStateRootHash()
Returns a state root hash at the last Block- Returns:
- Object holding the api version and state root hash data
-
getStateRootHash
StateRootHashData getStateRootHash(BlockIdentifier blockIdentifier)
Returns a state root hash at a given aBlockIdentifier
- Parameters:
blockIdentifier
- BlockIdentifier data- Returns:
- Object holding the api version and state root hash data
-
getStateItem
StoredValueData getStateItem(java.lang.String stateRootHash, java.lang.String key, java.util.List<java.lang.String> path)
Returns a stored value from the network- Parameters:
stateRootHash
- Hash of the state rootkey
- `casper_types::Key` as formatted stringpath
- The path components starting from the key as base- Returns:
- Object holding the api version, the merkle proof and the stored value data
-
getEraInfoBySwitchBlock
EraInfoData getEraInfoBySwitchBlock(BlockIdentifier blockIdentifier)
Returns an EraInfo from the network- Parameters:
blockIdentifier
- BlockIdentifier data- Returns:
- Object holding api version and EraInfo
-
getDeploy
DeployData getDeploy(java.lang.String deployHash)
Returns a Deploy from the network- Parameters:
deployHash
- The deploy hash- Returns:
- Object holding the api version, the deploy and the map of block hash to execution result
-
getStatus
StatusData getStatus()
Returns the current status of the node- Returns:
- Object holding the apiversion, minimal block information, build version and other properties
-
getStateAccountInfo
AccountData getStateAccountInfo(java.lang.String publicKey, BlockIdentifier blockIdentifier)
Returns an Account from the network- Parameters:
publicKey
- the account's public keyblockIdentifier
- BlockIdentifier data- Returns:
- Oject holding the api version, the account data and the merkle proof
-
getStateAuctionInfo
AuctionData getStateAuctionInfo(BlockIdentifier blockIdentifier)
Returns the Auction info for a given block- Parameters:
blockIdentifier
- BlockIdentifier data- Returns:
- Object holding the api version and auction state data
-
getStateDictionaryItem
DictionaryData getStateDictionaryItem(java.lang.String stateRootHash, DictionaryIdentifier dictionaryIdentifier)
Lookup a dictionary item via an Contract's named keys. Returns an item from a Dictionary given the AccountNamedKey/ContractNamedKey/Dictionary/Uref- Parameters:
stateRootHash
- the hash of state rootdictionaryIdentifier
- any concrete DictionaryIdentifier- Returns:
- Object holding the api version, the dictionary key, the merkle proof and the stored value
-
getBalance
BalanceData getBalance(java.lang.String stateRootHash, java.lang.String purseUref)
Fetches balance value- Parameters:
stateRootHash
- the hash of state rootpurseUref
- formatted URef- Returns:
- Result for "state_get_balance" RPC response
-
putDeploy
DeployResult putDeploy(Deploy deploy)
Sends a deploy to be received by the network- Parameters:
deploy
- the deploy object to send to the network- Returns:
- Object holding the api version and the deploy hash
-
usingPeer
static CasperService usingPeer(java.lang.String ip, int port) throws java.net.MalformedURLException
Builds a CasperService for the node ip/port pair- Parameters:
ip
- the peer ip to connect toport
- the service port of the peer- Returns:
- A Dynamic Proxy to CasperService
- Throws:
java.net.MalformedURLException
- is thrown if ip/port are not compliant
-
-