ChainClient

class HyperionApiClient::Clients::ChainClient
  : public ClientExtensions

Summary

MembersDescriptions

public string BaseUrl

public ChainClient(HttpClient httpClient)

public async Task AbiBinToJsonAsync(string code, string action, string binargs, CancellationToken cancellationToken) = default

Returns an object containing rows from the specified table.

public async Task AbiJsonToBinAsync(string binargs, CancellationToken cancellationToken) = default

Convert JSON object to binary.

public async Task< GetAbiResponse > GetAbiAsync(string accountName, CancellationToken cancellationToken) = default

Retrieves the ABI for a contract based on its account name.

public async Task< GetAccountResponse2 > GetAccountAsync(string accountName, CancellationToken cancellationToken) = default

Returns an object containing various details about a specific account on the blockchain.

public async Task< GetActivatedProtocolFeaturesResponse > GetActivatedProtocolFeaturesAsync(int? lowerBound, int? upperBound, int? limit, bool? searchByBlockNum, bool? reverse, CancellationToken cancellationToken) = default

Retreives the activated protocol features for producer node.

public async Task< GetBlockResponse2 > GetBlockAsync(string blockNumOrId, CancellationToken cancellationToken) = default

Returns an object containing various details about a specific block on the blockchain.

public async Task< GetBlockHeaderStateResponse > GetBlockHeaderStateAsync(string blockNumOrId, CancellationToken cancellationToken) = default

Retrieves the block header state.

public async Task< GetCodeResponse > GetCodeAsync(string accountName, bool codeAsWasm, CancellationToken cancellationToken) = default

Retrieves contract code.

public async Task< List< string > > GetCurrencyBalanceAsync(string code, string account, string symbol, CancellationToken cancellationToken) = default

Retrieves the current balance.

public async Task< string > GetCurrencyStatsAsync(string code, string symbol, CancellationToken cancellationToken) = default

Retrieves currency stats.

public async Task< GetInfoResponse > GetInfoAsync(CancellationToken cancellationToken) = default

Returns an object containing various details about the blockchain.

public async Task< GetProducersResponse > GetProducersAsync(string limit, string lowerBound, bool? json, CancellationToken cancellationToken) = default

Retrieves producers list.

public async Task GetRawAbiAsync(string accountName, CancellationToken cancellationToken) = default

Retrieves raw ABI for a contract based on account name.

public async Task GetRawCodeAndAbiAsync(string accountName, CancellationToken cancellationToken) = default

Retrieves raw code and ABI for a contract based on account name.

public async Task GetScheduledTransactionAsync(string lowerBound, int? limit, bool? json, CancellationToken cancellationToken) = default

Retrieves the scheduled transaction.

public async Task< GetTableByScopeResponse > GetTableByScopeAsync(string code, string table, string lowerBound, string upperBound, int? limit, bool? reverse, CancellationToken cancellationToken) = default

Retrieves table scope.

public async Task GetTableRowsAsync(string code, string table, string scope, string indexPosition, string keyType, string encodeType, string upperBound, string lowerBound, CancellationToken cancellationToken) = default

Returns an object containing rows from the specified table.

public async Task PushTransactionAsync(object body, CancellationToken cancellationToken) = default

This method expects a transaction in JSON format and will attempt to apply it to the blockchain.

public async Task PushTransactionsAsync(IEnumerable< object > body, CancellationToken cancellationToken) = default

This method expects a transaction in JSON format and will attempt to apply it to the blockchain.

public async Task SendTransactionAsync(object body, CancellationToken cancellationToken) = default

This method expects a transaction in JSON format and will attempt to apply it to the blockchain.

private readonly HttpClient _httpClient

Members

public string BaseUrl

public ChainClient(HttpClient httpClient)

public async Task AbiBinToJsonAsync(string code, string action, string binargs, CancellationToken cancellationToken) = default

Returns an object containing rows from the specified table.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task AbiJsonToBinAsync(string binargs, CancellationToken cancellationToken) = default

Convert JSON object to binary.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task< GetAbiResponse > GetAbiAsync(string accountName, CancellationToken cancellationToken) = default

Retrieves the ABI for a contract based on its account name.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task< GetAccountResponse2 > GetAccountAsync(string accountName, CancellationToken cancellationToken) = default

Returns an object containing various details about a specific account on the blockchain.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task< GetActivatedProtocolFeaturesResponse > GetActivatedProtocolFeaturesAsync(int? lowerBound, int? upperBound, int? limit, bool? searchByBlockNum, bool? reverse, CancellationToken cancellationToken) = default

Retreives the activated protocol features for producer node.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Parameters

  • lower_bound Lower bound

  • upper_bound Upper bound

  • limit The limit, default is 10

  • search_by_block_num Flag to indicate it is has to search by block number

  • reverse Flag to indicate it has to search in reverse

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task< GetBlockResponse2 > GetBlockAsync(string blockNumOrId, CancellationToken cancellationToken) = default

Returns an object containing various details about a specific block on the blockchain.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Parameters

  • block_num_or_id Provide a block number or a block id

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task< GetBlockHeaderStateResponse > GetBlockHeaderStateAsync(string blockNumOrId, CancellationToken cancellationToken) = default

Retrieves the block header state.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Parameters

  • blockNumOrId Provide a block_number or a block_id

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task< GetCodeResponse > GetCodeAsync(string accountName, bool codeAsWasm, CancellationToken cancellationToken) = default

Retrieves contract code.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Parameters

  • code_as_wasm This must be 1 (true)

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task< List< string > > GetCurrencyBalanceAsync(string code, string account, string symbol, CancellationToken cancellationToken) = default

Retrieves the current balance.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Parameters

  • symbol A symbol composed of capital letters between 1-7.

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task< string > GetCurrencyStatsAsync(string code, string symbol, CancellationToken cancellationToken) = default

Retrieves currency stats.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Parameters

  • code contract name

  • symbol token symbol

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task< GetInfoResponse > GetInfoAsync(CancellationToken cancellationToken) = default

Returns an object containing various details about the blockchain.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task< GetProducersResponse > GetProducersAsync(string limit, string lowerBound, bool? json, CancellationToken cancellationToken) = default

Retrieves producers list.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Parameters

  • limit total number of producers to retrieve

  • lower_bound In conjunction with limit can be used to paginate through the results. For example, limit=10 and lower_bound=10 would be page 2

  • json return result in JSON format

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task GetRawAbiAsync(string accountName, CancellationToken cancellationToken) = default

Retrieves raw ABI for a contract based on account name.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task GetRawCodeAndAbiAsync(string accountName, CancellationToken cancellationToken) = default

Retrieves raw code and ABI for a contract based on account name.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task GetScheduledTransactionAsync(string lowerBound, int? limit, bool? json, CancellationToken cancellationToken) = default

Retrieves the scheduled transaction.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Parameters

  • lower_bound Date/time string in the format YYYY-MM-DDTHH:MM:SS.sss

  • limit The maximum number of transactions to return

  • json true/false whether the packed transaction is converted to json

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task< GetTableByScopeResponse > GetTableByScopeAsync(string code, string table, string lowerBound, string upperBound, int? limit, bool? reverse, CancellationToken cancellationToken) = default

Retrieves table scope.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Parameters

  • code name of the contract to return table data for

  • table Filter results by table

  • lower_bound Filters results to return the first element that is not less than provided value in set

  • upper_bound Filters results to return the first element that is greater than provided value in set

  • limit Limit number of results returned.

  • reverse Reverse the order of returned results

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task GetTableRowsAsync(string code, string table, string scope, string indexPosition, string keyType, string encodeType, string upperBound, string lowerBound, CancellationToken cancellationToken) = default

Returns an object containing rows from the specified table.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Parameters

  • code The name of the smart contract that controls the provided table

  • table The name of the table to query

  • scope The account to which this data belongs

  • index_position Position of the index used, accepted parameters primary, secondary, tertiary, fourth, fifth, sixth, seventh, eighth, ninth , tenth

  • key_type Type of key specified by index_position (for example - uint64_t or name)

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task PushTransactionAsync(object body, CancellationToken cancellationToken) = default

This method expects a transaction in JSON format and will attempt to apply it to the blockchain.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task PushTransactionsAsync(IEnumerable< object > body, CancellationToken cancellationToken) = default

This method expects a transaction in JSON format and will attempt to apply it to the blockchain.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

public async Task SendTransactionAsync(object body, CancellationToken cancellationToken) = default

This method expects a transaction in JSON format and will attempt to apply it to the blockchain.

Parameters

  • cancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Default Response

Exceptions

  • ApiException A server side error occurred.

private readonly HttpClient _httpClient

Last updated