Casper.Network.SDK
Show / Hide Table of Contents

Class NetCasperClient

Client to communicate with a Casper node.

Inheritance
object
NetCasperClient
Implements
ICasperClient
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Casper.Network.SDK
Assembly: Casper.Network.SDK.dll
Syntax
public class NetCasperClient : ICasperClient, IDisposable

Constructors

| Edit this page View Source

NetCasperClient(string, RpcLoggingHandler)

Create a new instance of the Casper client for a specific node in the network determined by the node address. Optionally, indicate a logging handler to log the requests and responses exchanged with tne node.

Declaration
public NetCasperClient(string nodeAddress, RpcLoggingHandler loggingHandler = null)
Parameters
Type Name Description
string nodeAddress

URL of the node. Example: 'http://127.0.0.1:7777/rpc'.

RpcLoggingHandler loggingHandler

Optional. An instance of a logging handler to log the requests and responses exchanged with the network.

| Edit this page View Source

NetCasperClient(string, HttpClient)

Declaration
public NetCasperClient(string nodeAddress, HttpClient httpClient)
Parameters
Type Name Description
string nodeAddress
HttpClient httpClient

Methods

| Edit this page View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
| Edit this page View Source

Dispose(bool)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing
| Edit this page View Source

GetAccountInfo(AccountHashKey, string)

Request the information of an Account in the network.

Declaration
public Task<RpcResponse<GetAccountInfoResult>> GetAccountInfo(AccountHashKey accountHash, string blockHash = null)
Parameters
Type Name Description
AccountHashKey accountHash

The account hash of the account.

string blockHash

A block hash for which the information of the account is queried. Null for most recent information.

Returns
Type Description
Task<RpcResponse<GetAccountInfoResult>>
| Edit this page View Source

GetAccountInfo(AccountHashKey, ulong)

Request the information of an Account in the network.

Declaration
public Task<RpcResponse<GetAccountInfoResult>> GetAccountInfo(AccountHashKey accountHash, ulong blockHeight)
Parameters
Type Name Description
AccountHashKey accountHash

The account hash of the account.

ulong blockHeight

A block height for which the information of the account is queried.

Returns
Type Description
Task<RpcResponse<GetAccountInfoResult>>
| Edit this page View Source

GetAccountInfo(PublicKey, string)

Request the information of an Account in the network.

Declaration
public Task<RpcResponse<GetAccountInfoResult>> GetAccountInfo(PublicKey publicKey, string blockHash = null)
Parameters
Type Name Description
PublicKey publicKey

The public key of the account.

string blockHash

A block hash for which the information of the account is queried. Null for most recent information.

Returns
Type Description
Task<RpcResponse<GetAccountInfoResult>>
| Edit this page View Source

GetAccountInfo(PublicKey, ulong)

Request the information of an Account in the network.

Declaration
public Task<RpcResponse<GetAccountInfoResult>> GetAccountInfo(PublicKey publicKey, ulong blockHeight)
Parameters
Type Name Description
PublicKey publicKey

The public key of the account.

ulong blockHeight

A block height for which the information of the account is queried.

Returns
Type Description
Task<RpcResponse<GetAccountInfoResult>>
| Edit this page View Source

GetAccountInfo(string, string)

Request the information of an Account in the network.

Declaration
[Obsolete("For Casper node v1.5.5 or newer use the new method signature with PublicKey or AccountHashKey, ", false)]
public Task<RpcResponse<GetAccountInfoResult>> GetAccountInfo(string publicKey, string blockHash = null)
Parameters
Type Name Description
string publicKey

The public key of the account formatted as a string.

string blockHash

A block hash for which the information of the account is queried. Null for most recent information.

Returns
Type Description
Task<RpcResponse<GetAccountInfoResult>>
| Edit this page View Source

GetAccountInfo(string, ulong)

Request the information of an Account in the network.

Declaration
[Obsolete("For Casper node v1.5.5 or newer use the new method signature with PublicKey or AccountHashKey, ", false)]
public Task<RpcResponse<GetAccountInfoResult>> GetAccountInfo(string publicKey, ulong blockHeight)
Parameters
Type Name Description
string publicKey

The public key of the account formatted as an hex-string.

ulong blockHeight

A block height for which the information of the account is queried.

Returns
Type Description
Task<RpcResponse<GetAccountInfoResult>>
| Edit this page View Source

GetAuctionInfo(string)

Request the bids and validators at a given block.

Declaration
public Task<RpcResponse<GetAuctionInfoResult>> GetAuctionInfo(string blockHash = null)
Parameters
Type Name Description
string blockHash

Block hash for which the auction info is queried. Null for the most recent auction info.

Returns
Type Description
Task<RpcResponse<GetAuctionInfoResult>>
| Edit this page View Source

GetAuctionInfo(ulong)

Request the bids and validators at a given block.

Declaration
public Task<RpcResponse<GetAuctionInfoResult>> GetAuctionInfo(ulong blockHeight)
Parameters
Type Name Description
ulong blockHeight

Block height for which the auction info is queried.

Returns
Type Description
Task<RpcResponse<GetAuctionInfoResult>>
| Edit this page View Source

GetBalance(string, string)

Request a purse's balance from the network.

Declaration
public Task<RpcResponse<GetBalanceResult>> GetBalance(string purseURef, string stateRootHash = null)
Parameters
Type Name Description
string purseURef

Purse URef formatted as a string.

string stateRootHash

Hash of the state root. Null to get latest available.

Returns
Type Description
Task<RpcResponse<GetBalanceResult>>
| Edit this page View Source

GetBlock(string)

Retrieves a Block from the network by its hash.

Declaration
public Task<RpcResponse<GetBlockResult>> GetBlock(string blockHash = null)
Parameters
Type Name Description
string blockHash

Hash of the block to retrieve. Null for the most recent block.

Returns
Type Description
Task<RpcResponse<GetBlockResult>>
| Edit this page View Source

GetBlock(ulong)

Request a Block from the network by its height number.

Declaration
public Task<RpcResponse<GetBlockResult>> GetBlock(ulong blockHeight)
Parameters
Type Name Description
ulong blockHeight

Height of the block to retrieve.

Returns
Type Description
Task<RpcResponse<GetBlockResult>>
| Edit this page View Source

GetBlockTransfers(string)

Request all transfers for a Block by its block hash.

Declaration
public Task<RpcResponse<GetBlockTransfersResult>> GetBlockTransfers(string blockHash = null)
Parameters
Type Name Description
string blockHash

Hash of the block to retrieve the transfers from. Null for the most recent block

Returns
Type Description
Task<RpcResponse<GetBlockTransfersResult>>
| Edit this page View Source

GetBlockTransfers(ulong)

Request all transfers for a Block by its height number.

Declaration
public Task<RpcResponse<GetBlockTransfersResult>> GetBlockTransfers(ulong blockHeight)
Parameters
Type Name Description
ulong blockHeight

Height of the block to retrieve the transfers from.

Returns
Type Description
Task<RpcResponse<GetBlockTransfersResult>>
| Edit this page View Source

GetChainspec()

Request the the chainspec.toml, genesis accounts.toml, and global_state.toml files of the node.

Declaration
public Task<RpcResponse<GetChainspecResult>> GetChainspec()
Returns
Type Description
Task<RpcResponse<GetChainspecResult>>
| Edit this page View Source

GetDelegatorReward(PublicKey, PublicKey, string)

Returns the reward for a given era and a delegator

Declaration
public Task<RpcResponse<GetRewardResult>> GetDelegatorReward(PublicKey validator, PublicKey delegator, string blockHash = null)
Parameters
Type Name Description
PublicKey validator

The public key of the validator.

PublicKey delegator

The public key of the delegator.

string blockHash

Hash of the block to retrieve the rewards from. Null for the most recent era

Returns
Type Description
Task<RpcResponse<GetRewardResult>>
| Edit this page View Source

GetDelegatorReward(PublicKey, PublicKey, ulong)

Returns the reward for a given era and a delegator

Declaration
public Task<RpcResponse<GetRewardResult>> GetDelegatorReward(PublicKey validator, PublicKey delegator, ulong blockHeight)
Parameters
Type Name Description
PublicKey validator

The public key of the validator.

PublicKey delegator

The public key of the delegator.

ulong blockHeight

Height of the block to retrieve the rewards from.

Returns
Type Description
Task<RpcResponse<GetRewardResult>>
| Edit this page View Source

GetDelegatorRewardWithEraId(PublicKey, PublicKey, ulong)

Returns the reward for a given era and a delegator

Declaration
public Task<RpcResponse<GetRewardResult>> GetDelegatorRewardWithEraId(PublicKey validator, PublicKey delegator, ulong eraId)
Parameters
Type Name Description
PublicKey validator

The public key of the validator.

PublicKey delegator

The public key of the delegator.

ulong eraId

Id of the Era to retrieve the rewards from.

Returns
Type Description
Task<RpcResponse<GetRewardResult>>
| Edit this page View Source

GetDeploy(string, bool, CancellationToken)

Request a Deploy object from the network by the deploy hash. When a cancellation token is included this method waits until the deploy is executed, i.e. until the deploy contains the execution results information.

Declaration
public Task<RpcResponse<GetDeployResult>> GetDeploy(string deployHash, bool finalizedApprovals, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string deployHash

Hash of the deploy to retrieve.

bool finalizedApprovals

Whether to return the deploy with the finalized approvals substituted. If false or omitted, returns the deploy with the approvals that were originally received by the node.

CancellationToken cancellationToken

A CancellationToken. Do not include this parameter to return with the first deploy object returned by the network, even it's not executed.

Returns
Type Description
Task<RpcResponse<GetDeployResult>>
Exceptions
Type Condition
TaskCanceledException

The token has cancelled the operation before the deploy has been executed.

| Edit this page View Source

GetDeploy(string, CancellationToken)

Request a Deploy object from the network by the deploy hash. When a cancellation token is included this method waits until the deploy is executed, i.e. until the deploy contains the execution results information.

Declaration
public Task<RpcResponse<GetDeployResult>> GetDeploy(string deployHash, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string deployHash

Hash of the deploy to retrieve.

CancellationToken cancellationToken

A CancellationToken. Do not include this parameter to return with the first deploy object returned by the network, even it's not executed.

Returns
Type Description
Task<RpcResponse<GetDeployResult>>
Exceptions
Type Condition
TaskCanceledException

The token has cancelled the operation before the deploy has been executed.

| Edit this page View Source

GetDictionaryItem(string, string)

Lookup a dictionary item from its dictionary key.

Declaration
public Task<RpcResponse<GetDictionaryItemResult>> GetDictionaryItem(string dictionaryKey, string stateRootHash = null)
Parameters
Type Name Description
string dictionaryKey

The dictionary key to retrieve.

string stateRootHash

Hash of the state root.

Returns
Type Description
Task<RpcResponse<GetDictionaryItemResult>>
| Edit this page View Source

GetDictionaryItemByAccount(string, string, string, string)

Lookup a dictionary item via an Account's named keys.

Declaration
public Task<RpcResponse<GetDictionaryItemResult>> GetDictionaryItemByAccount(string accountKey, string dictionaryName, string dictionaryItem, string stateRootHash = null)
Parameters
Type Name Description
string accountKey

The account key as a formatted string whose named keys contains dictionaryName.

string dictionaryName

The named key under which the dictionary seed URef is stored.

string dictionaryItem

The dictionary item key.

string stateRootHash

Hash of the state root.

Returns
Type Description
Task<RpcResponse<GetDictionaryItemResult>>
| Edit this page View Source

GetDictionaryItemByContract(string, string, string, string)

Lookup a dictionary item via a Contract named keys.

Declaration
public Task<RpcResponse<GetDictionaryItemResult>> GetDictionaryItemByContract(string contractKey, string dictionaryName, string dictionaryItem, string stateRootHash = null)
Parameters
Type Name Description
string contractKey

The contract key as a formatted string whose named keys contains dictionaryName.

string dictionaryName

The named key under which the dictionary seed URef is stored.

string dictionaryItem

The dictionary item key.

string stateRootHash

Hash of the state root.

Returns
Type Description
Task<RpcResponse<GetDictionaryItemResult>>
| Edit this page View Source

GetDictionaryItemByURef(string, string, string)

Lookup a dictionary item via its seed URef.

Declaration
public Task<RpcResponse<GetDictionaryItemResult>> GetDictionaryItemByURef(string seedURef, string dictionaryItem, string stateRootHash = null)
Parameters
Type Name Description
string seedURef

The dictionary's seed URef.

string dictionaryItem

The dictionary item key.

string stateRootHash

Hash of the state root.

Returns
Type Description
Task<RpcResponse<GetDictionaryItemResult>>
| Edit this page View Source

GetEntity(IEntityIdentifier, string)

Returns an AddressableEntity or a legacy Accountfrom the network for a Block from the network

Declaration
public Task<RpcResponse<GetEntityResult>> GetEntity(IEntityIdentifier entityIdentifier, string blockHash = null)
Parameters
Type Name Description
IEntityIdentifier entityIdentifier

A PublicKey, an AccoountHashKey, or an AddressableEntityKey

string blockHash

A block hash for which the information of the entity is queried. Null for most recent information.

Returns
Type Description
Task<RpcResponse<GetEntityResult>>
| Edit this page View Source

GetEntity(IEntityIdentifier, ulong)

Returns an AddressableEntity or a legacy Accountfrom the network for a Block from the network

Declaration
public Task<RpcResponse<GetEntityResult>> GetEntity(IEntityIdentifier entityIdentifier, ulong blockHeight)
Parameters
Type Name Description
IEntityIdentifier entityIdentifier

A PublicKey, an AccoountHashKey, or an AddressableEntityKey

ulong blockHeight

A block height for which the information of the entity is queried..

Returns
Type Description
Task<RpcResponse<GetEntityResult>>
| Edit this page View Source

GetEntity(string, string)

Returns an AddressableEntity or a legacy Accountfrom the network for a Block from the network

Declaration
public Task<RpcResponse<GetEntityResult>> GetEntity(string entityAddr, string blockHash = null)
Parameters
Type Name Description
string entityAddr

The entity address to get information of.

string blockHash

A block hash for which the information of the entity is queried. Null for most recent information.

Returns
Type Description
Task<RpcResponse<GetEntityResult>>
| Edit this page View Source

GetEntity(string, ulong)

Returns an AddressableEntity or a legacy Accountfrom the network for a Block from the network

Declaration
public Task<RpcResponse<GetEntityResult>> GetEntity(string entityAddr, ulong blockHeight)
Parameters
Type Name Description
string entityAddr

The entity address to get information of.

ulong blockHeight

A block height for which the information of the entity is queried..

Returns
Type Description
Task<RpcResponse<GetEntityResult>>
| Edit this page View Source

GetEraInfoBySwitchBlock(string)

Request an EraInfo from the network given a switch block. For a non-switch block this method returns an empty response.

Declaration
public Task<RpcResponse<GetEraInfoBySwitchBlockResult>> GetEraInfoBySwitchBlock(string blockHash = null)
Parameters
Type Name Description
string blockHash

Block hash of a switch block. Null for the latest block.

Returns
Type Description
Task<RpcResponse<GetEraInfoBySwitchBlockResult>>
| Edit this page View Source

GetEraInfoBySwitchBlock(ulong)

Request an EraInfo from the network given a switch block. For a non-switch block this method returns an empty response.

Declaration
public Task<RpcResponse<GetEraInfoBySwitchBlockResult>> GetEraInfoBySwitchBlock(ulong blockHeight)
Parameters
Type Name Description
ulong blockHeight

Block height of a switch block.

Returns
Type Description
Task<RpcResponse<GetEraInfoBySwitchBlockResult>>
| Edit this page View Source

GetEraSummary(string)

Request current Era Info from the network given a block hash

Declaration
public Task<RpcResponse<GetEraSummaryResult>> GetEraSummary(string blockHash = null)
Parameters
Type Name Description
string blockHash

Block hash. Null for the latest block.

Returns
Type Description
Task<RpcResponse<GetEraSummaryResult>>
| Edit this page View Source

GetEraSummary(ulong)

Request current Era Info from the network given a block hash

Declaration
public Task<RpcResponse<GetEraSummaryResult>> GetEraSummary(ulong blockHeight)
Parameters
Type Name Description
ulong blockHeight

Block height.

Returns
Type Description
Task<RpcResponse<GetEraSummaryResult>>
| Edit this page View Source

GetNodeMetrics(string)

Request the performance metrics of a node in the network.

Declaration
public static Task<string> GetNodeMetrics(string nodeAddress)
Parameters
Type Name Description
string nodeAddress

URL of the performance metrics endpoint. Example: 'http://127.0.0.1:8888/metrics'.

Returns
Type Description
Task<string>
| Edit this page View Source

GetNodeMetrics(string, int)

Request the performance metrics of a node in the network.

Declaration
public static Task<string> GetNodeMetrics(string host, int port)
Parameters
Type Name Description
string host

IP of the network node.

int port

Port of the performance metrics endpoint (usually 8888).

Returns
Type Description
Task<string>
| Edit this page View Source

GetNodePeers()

Request a list of peers connected to the node.

Declaration
public Task<RpcResponse<GetNodePeersResult>> GetNodePeers()
Returns
Type Description
Task<RpcResponse<GetNodePeersResult>>
| Edit this page View Source

GetNodeStatus()

Request the current status of the node.

Declaration
public Task<RpcResponse<GetNodeStatusResult>> GetNodeStatus()
Returns
Type Description
Task<RpcResponse<GetNodeStatusResult>>
| Edit this page View Source

GetPackage(string, string)

Returns a Package from the network

Declaration
public Task<RpcResponse<GetPackageResult>> GetPackage(string packageHash, string blockHash = null)
Parameters
Type Name Description
string packageHash

The entity address to get information of.

string blockHash

A block hash for which the information of the entity is queried. Null for most recent information.

Returns
Type Description
Task<RpcResponse<GetPackageResult>>
| Edit this page View Source

GetPackage(string, ulong)

Returns a Package from the network

Declaration
public Task<RpcResponse<GetPackageResult>> GetPackage(string packageHash, ulong blockHeight)
Parameters
Type Name Description
string packageHash

The package address or contract package hash to get information of.

ulong blockHeight

A block height for which the information of the package is queried.

Returns
Type Description
Task<RpcResponse<GetPackageResult>>
| Edit this page View Source

GetRpcSchema()

Request the RPC Json schema to the network node.

Declaration
public Task<string> GetRpcSchema()
Returns
Type Description
Task<string>
| Edit this page View Source

GetStateRootHash(string)

Request the state root hash at a given Block.

Declaration
public Task<string> GetStateRootHash(string blockHash = null)
Parameters
Type Name Description
string blockHash

Block hash for which the state root is queried. Null for the most recent.

Returns
Type Description
Task<string>
| Edit this page View Source

GetStateRootHash(ulong)

Request the state root hash at a given Block.

Declaration
public Task<string> GetStateRootHash(ulong blockHeight)
Parameters
Type Name Description
ulong blockHeight

Block height for which the state root is queried.

Returns
Type Description
Task<string>
| Edit this page View Source

GetTransaction(TransactionHash, bool, CancellationToken)

Request a Transaction object from the network by the transaction (or deploy) hash. When a cancellation token is included this method waits until the transaction is executed, i.e. until the transaction contains the execution result information.

Declaration
public Task<RpcResponse<GetTransactionResult>> GetTransaction(TransactionHash transactionHash, bool finalizedApprovals, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TransactionHash transactionHash

An v1 transaction hash or a deploy hash

bool finalizedApprovals

Whether to return the transaction with the finalized approvals substituted. If false or omitted, returns the transaction with the approvals that were originally received by the node.

CancellationToken cancellationToken

A CancellationToken. Do not include this parameter to return with the first transaction object returned by the network, even it's not executed.

Returns
Type Description
Task<RpcResponse<GetTransactionResult>>
Exceptions
Type Condition
TaskCanceledException

The token has cancelled the operation before the deploy has been executed.

| Edit this page View Source

GetTransaction(TransactionHash, CancellationToken)

Request a Transaction object from the network by the transaction (or deploy) hash. When a cancellation token is included this method waits until the transaction is executed, i.e. until the transaction contains the execution result information.

Declaration
public Task<RpcResponse<GetTransactionResult>> GetTransaction(TransactionHash transactionHash, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TransactionHash transactionHash

An v1 transaction hash or a deploy hash

CancellationToken cancellationToken

A CancellationToken. Do not include this parameter to return with the first transaction object returned by the network, even it's not executed.

Returns
Type Description
Task<RpcResponse<GetTransactionResult>>
Exceptions
Type Condition
TaskCanceledException

The token has cancelled the operation before the deploy has been executed.

| Edit this page View Source

GetTransaction(string, bool, CancellationToken)

Request a Transaction object from the network by the transaction hash. When a cancellation token is included this method waits until the transaction is executed, i.e. until the transaction contains the execution result information.

Declaration
public Task<RpcResponse<GetTransactionResult>> GetTransaction(string transactionV1Hash, bool finalizedApprovals, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string transactionV1Hash

A TransactionV1 hash

bool finalizedApprovals

Whether to return the transaction with the finalized approvals substituted. If false or omitted, returns the transaction with the approvals that were originally received by the node.

CancellationToken cancellationToken

A CancellationToken. Do not include this parameter to return with the first transaction object returned by the network, even it's not executed.

Returns
Type Description
Task<RpcResponse<GetTransactionResult>>
Exceptions
Type Condition
TaskCanceledException

The token has cancelled the operation before the deploy has been executed.

| Edit this page View Source

GetTransaction(string, CancellationToken)

Request a Transaction object from the network by the transaction hash. When a cancellation token is included this method waits until the transaction is executed, i.e. until the transaction contains the execution result information.

Declaration
public Task<RpcResponse<GetTransactionResult>> GetTransaction(string transactionV1Hash, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string transactionV1Hash

A TransactionV1 hash

CancellationToken cancellationToken

A CancellationToken. Do not include this parameter to return with the first transaction object returned by the network, even it's not executed.

Returns
Type Description
Task<RpcResponse<GetTransactionResult>>
Exceptions
Type Condition
TaskCanceledException

The token has cancelled the operation before the deploy has been executed.

| Edit this page View Source

GetValidatorBid(PublicKey, string)

Returns the validator bid.

Declaration
public Task<RpcResponse<QueryGlobalStateResult>> GetValidatorBid(PublicKey validator, string blockHash = null)
Parameters
Type Name Description
PublicKey validator

The public key of the validator.

string blockHash

Hash of the block to retrieve the rewards from. Null for the most recent era

Returns
Type Description
Task<RpcResponse<QueryGlobalStateResult>>
| Edit this page View Source

GetValidatorChanges()

Request the status changes of active validators.

Declaration
public Task<RpcResponse<GetValidatorChangesResult>> GetValidatorChanges()
Returns
Type Description
Task<RpcResponse<GetValidatorChangesResult>>
| Edit this page View Source

GetValidatorReward(PublicKey, string)

Returns the reward for a given era and a validator

Declaration
public Task<RpcResponse<GetRewardResult>> GetValidatorReward(PublicKey validator, string blockHash = null)
Parameters
Type Name Description
PublicKey validator

The public key of the validator.

string blockHash

Hash of the block to retrieve the rewards from. Null for the most recent era

Returns
Type Description
Task<RpcResponse<GetRewardResult>>
| Edit this page View Source

GetValidatorReward(PublicKey, ulong)

Returns the reward for a given era and a validator

Declaration
public Task<RpcResponse<GetRewardResult>> GetValidatorReward(PublicKey validator, ulong blockHeight)
Parameters
Type Name Description
PublicKey validator

The public key of the validator.

ulong blockHeight

Height of the block to retrieve the rewards from.

Returns
Type Description
Task<RpcResponse<GetRewardResult>>
| Edit this page View Source

GetValidatorRewardWithEraId(PublicKey, ulong)

Returns the reward for a given era and a validator

Declaration
public Task<RpcResponse<GetRewardResult>> GetValidatorRewardWithEraId(PublicKey validator, ulong eraId)
Parameters
Type Name Description
PublicKey validator

The public key of the validator.

ulong eraId

Id of the Era to retrieve the rewards from.

Returns
Type Description
Task<RpcResponse<GetRewardResult>>
| Edit this page View Source

PutDeploy(Deploy)

Send a Deploy to the network for its execution.

Declaration
public Task<RpcResponse<PutDeployResult>> PutDeploy(Deploy deploy)
Parameters
Type Name Description
Deploy deploy

The deploy object.

Returns
Type Description
Task<RpcResponse<PutDeployResult>>
Exceptions
Type Condition
Exception

Throws an exception if the deploy is not signed.

| Edit this page View Source

PutTransaction(Transaction)

Send a Transaction to the network for its execution.

Declaration
public Task<RpcResponse<PutTransactionResult>> PutTransaction(Transaction transaction)
Parameters
Type Name Description
Transaction transaction

The transaction object.

Returns
Type Description
Task<RpcResponse<PutTransactionResult>>
Exceptions
Type Condition
Exception

Throws an exception if the transaction is not signed.

| Edit this page View Source

PutTransaction(TransactionV1)

Send a Transaction to the network for its execution.

Declaration
public Task<RpcResponse<PutTransactionResult>> PutTransaction(TransactionV1 transaction)
Parameters
Type Name Description
TransactionV1 transaction

The transaction object.

Returns
Type Description
Task<RpcResponse<PutTransactionResult>>
Exceptions
Type Condition
Exception

Throws an exception if the transaction is not signed.

| Edit this page View Source

QueryBalance(IPurseIdentifier, string)

Request the balance information from a PublicKey, AccountHashKey, URef or EntityAddr.

Declaration
public Task<RpcResponse<QueryBalanceResult>> QueryBalance(IPurseIdentifier purseIdentifier, string blockHash = null)
Parameters
Type Name Description
IPurseIdentifier purseIdentifier

A PublicKey, AccountHashKey, URef or EntityAddr to identify a purse.

string blockHash

Hash of the block. Null to get latest available.

Returns
Type Description
Task<RpcResponse<QueryBalanceResult>>
| Edit this page View Source

QueryBalance(IPurseIdentifier, ulong)

Request the balance information from a PublicKey, AccountHashKey, URef or EntityAddr.

Declaration
public Task<RpcResponse<QueryBalanceResult>> QueryBalance(IPurseIdentifier purseIdentifier, ulong blockHeight)
Parameters
Type Name Description
IPurseIdentifier purseIdentifier

A PublicKey, AccountHashKey, URef or EntityAddr to identify a purse.

ulong blockHeight

Height of the block.

Returns
Type Description
Task<RpcResponse<QueryBalanceResult>>
| Edit this page View Source

QueryBalanceDetails(IPurseIdentifier, string)

Queries the balance information including total, available, and holds.

Declaration
public Task<RpcResponse<QueryBalanceDetailsResult>> QueryBalanceDetails(IPurseIdentifier purseIdentifier, string blockHash = null)
Parameters
Type Name Description
IPurseIdentifier purseIdentifier

A PublicKey, AccountHashKey, URef or EntityAddr to identify a purse.

string blockHash

Hash of the block. Null to get latest available.

Returns
Type Description
Task<RpcResponse<QueryBalanceDetailsResult>>
| Edit this page View Source

QueryBalanceDetails(IPurseIdentifier, ulong)

Queries the balance information including total, available, and holds.

Declaration
public Task<RpcResponse<QueryBalanceDetailsResult>> QueryBalanceDetails(IPurseIdentifier purseIdentifier, ulong blockHeight)
Parameters
Type Name Description
IPurseIdentifier purseIdentifier

A PublicKey, AccountHashKey, URef or EntityAddr to identify a purse.

ulong blockHeight

Height of the block.

Returns
Type Description
Task<RpcResponse<QueryBalanceDetailsResult>>
| Edit this page View Source

QueryBalanceDetailsWithStateRootHash(IPurseIdentifier, string)

Queries the balance information including total, available, and holds.

Declaration
public Task<RpcResponse<QueryBalanceDetailsResult>> QueryBalanceDetailsWithStateRootHash(IPurseIdentifier purseIdentifier, string stateRootHash)
Parameters
Type Name Description
IPurseIdentifier purseIdentifier

A PublicKey, AccountHashKey, URef or EntityAddr to identify a purse.

string stateRootHash

the state root hash.

Returns
Type Description
Task<RpcResponse<QueryBalanceDetailsResult>>
| Edit this page View Source

QueryBalanceWithStateRootHash(IPurseIdentifier, string)

Request the balance information from a PublicKey, AccountHashKey, URef or EntityAddr.

Declaration
public Task<RpcResponse<QueryBalanceResult>> QueryBalanceWithStateRootHash(IPurseIdentifier purseIdentifier, string stateRootHash)
Parameters
Type Name Description
IPurseIdentifier purseIdentifier

A PublicKey, AccountHashKey, URef or EntityAddr to identify a purse.

string stateRootHash

the state root hash.

Returns
Type Description
Task<RpcResponse<QueryBalanceResult>>
| Edit this page View Source

QueryGlobalState(GlobalStateKey, string, string)

Request the stored value in a global state key.

Declaration
public Task<RpcResponse<QueryGlobalStateResult>> QueryGlobalState(GlobalStateKey key, string stateRootHash = null, string path = null)
Parameters
Type Name Description
GlobalStateKey key

The global state key to query the value from the network.

string stateRootHash

Hash of the state root. Null for the most recent stored value..

string path

The path components starting from the key as base (use '/' as separator).

Returns
Type Description
Task<RpcResponse<QueryGlobalStateResult>>
| Edit this page View Source

QueryGlobalState(string, string, string)

Request the stored value in a global state key.

Declaration
public Task<RpcResponse<QueryGlobalStateResult>> QueryGlobalState(string key, string stateRootHash = null, string path = null)
Parameters
Type Name Description
string key

The global state key formatted as a string to query the value from the network.

string stateRootHash

Hash of the state root. Null for the most recent stored value..

string path

The path components starting from the key as base (use '/' as separator).

Returns
Type Description
Task<RpcResponse<QueryGlobalStateResult>>
| Edit this page View Source

QueryGlobalState(string, ulong, string)

Request the stored value in a global state key.

Declaration
public Task<RpcResponse<QueryGlobalStateResult>> QueryGlobalState(string key, ulong height, string path = null)
Parameters
Type Name Description
string key

The global state key formatted as a string to query the value from the network.

ulong height

Height of the block to check the stored value in.

string path

The path components starting from the key as base (use '/' as separator).

Returns
Type Description
Task<RpcResponse<QueryGlobalStateResult>>
| Edit this page View Source

QueryGlobalStateWithBlockHash(GlobalStateKey, string, string)

Request the stored value in a global state key.

Declaration
public Task<RpcResponse<QueryGlobalStateResult>> QueryGlobalStateWithBlockHash(GlobalStateKey key, string blockHash, string path = null)
Parameters
Type Name Description
GlobalStateKey key

The global state key to query the value from the network.

string blockHash

The block hash.

string path

The path components starting from the key as base (use '/' as separator).

Returns
Type Description
Task<RpcResponse<QueryGlobalStateResult>>
| Edit this page View Source

QueryGlobalStateWithBlockHash(string, string, string)

Request the stored value in a global state key.

Declaration
public Task<RpcResponse<QueryGlobalStateResult>> QueryGlobalStateWithBlockHash(string key, string blockHash, string path = null)
Parameters
Type Name Description
string key

The global state key formatted as a string to query the value from the network.

string blockHash

The block hash.

string path

The path components starting from the key as base (use '/' as separator).

Returns
Type Description
Task<RpcResponse<QueryGlobalStateResult>>
| Edit this page View Source

QueryState(string, List<string>, string)

Request a stored value from the network. This RPC is deprecated, use QueryGlobalState instead.

Declaration
[Obsolete("Use QueryGlobalState() to retrieve stored values from the network.", false)]
public Task<RpcResponse<GetItemResult>> QueryState(string keyHash, List<string> path = null, string stateRootHash = null)
Parameters
Type Name Description
string keyHash

A global state key formatted as a string

List<string> path

The path components starting from the key as base (use '/' as separator).

string stateRootHash
Returns
Type Description
Task<RpcResponse<GetItemResult>>
| Edit this page View Source

SpeceulativeExecution(Deploy, string)

Sends a "deploy dry run" to the network. It will execute the deploy on top of the specified block and return the results of the execution to the caller. The effects of the execution won't be committed to the trie (blockchain database/GlobalState). This method runs in a different port of the network (e.g.: 7778) and can be used for debugging, discovery. For example price estimation.

Declaration
public Task<RpcResponse<SpeculativeExecutionResult>> SpeceulativeExecution(Deploy deploy, string stateRootHash = null)
Parameters
Type Name Description
Deploy deploy

The deploy to execute.

string stateRootHash

Hash of the state root. null if deploy is to be executed on top of the latest block.

Returns
Type Description
Task<RpcResponse<SpeculativeExecutionResult>>
| Edit this page View Source

SpeceulativeExecutionWithBlockHash(Deploy, string)

Sends a "deploy dry run" to the network. It will execute the deploy on top of the specified block and return the results of the execution to the caller. The effects of the execution won't be committed to the trie (blockchain database/GlobalState). This method runs in a different port of the network (e.g.: 7778) and can be used for debugging, discovery. For example price estimation.

Declaration
public Task<RpcResponse<PutDeployResult>> SpeceulativeExecutionWithBlockHash(Deploy deploy, string blockHash = null)
Parameters
Type Name Description
Deploy deploy

The deploy to execute.

string blockHash

Hash of the block on top of which the deploy is executed.

Returns
Type Description
Task<RpcResponse<PutDeployResult>>

Implements

ICasperClient
IDisposable
  • Edit this page
  • View Source
In this article
Back to top Maintained by MAKE Technology LLC