ChainClient
class HyperionApiClient::Clients::ChainClient
: public ClientExtensionsSummary
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
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Default Response
Exceptions
ApiExceptionA server side error occurred.
public async Task AbiJsonToBinAsync(string binargs, CancellationToken cancellationToken) = default
Convert JSON object to binary.
Parameters
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Default Response
Exceptions
ApiExceptionA 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
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Default Response
Exceptions
ApiExceptionA 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
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Default Response
Exceptions
ApiExceptionA 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
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Parameters
lower_boundLower boundupper_boundUpper boundlimitThe limit, default is 10search_by_block_numFlag to indicate it is has to search by block numberreverseFlag to indicate it has to search in reverse
Returns
Default Response
Exceptions
ApiExceptionA 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
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Parameters
block_num_or_idProvide ablock numberor ablock id
Returns
Default Response
Exceptions
ApiExceptionA server side error occurred.
public async Task< GetBlockHeaderStateResponse > GetBlockHeaderStateAsync(string blockNumOrId, CancellationToken cancellationToken) = default
Retrieves the block header state.
Parameters
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Parameters
blockNumOrIdProvide a block_number or a block_id
Returns
Default Response
Exceptions
ApiExceptionA server side error occurred.
public async Task< GetCodeResponse > GetCodeAsync(string accountName, bool codeAsWasm, CancellationToken cancellationToken) = default
Retrieves contract code.
Parameters
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Parameters
code_as_wasmThis must be 1 (true)
Returns
Default Response
Exceptions
ApiExceptionA server side error occurred.
public async Task< List< string > > GetCurrencyBalanceAsync(string code, string account, string symbol, CancellationToken cancellationToken) = default
Retrieves the current balance.
Parameters
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Parameters
symbolA symbol composed of capital letters between 1-7.
Returns
Default Response
Exceptions
ApiExceptionA server side error occurred.
public async Task< string > GetCurrencyStatsAsync(string code, string symbol, CancellationToken cancellationToken) = default
Retrieves currency stats.
Parameters
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Parameters
codecontract namesymboltoken symbol
Returns
Default Response
Exceptions
ApiExceptionA server side error occurred.
public async Task< GetInfoResponse > GetInfoAsync(CancellationToken cancellationToken) = default
Returns an object containing various details about the blockchain.
Parameters
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Default Response
Exceptions
ApiExceptionA server side error occurred.
public async Task< GetProducersResponse > GetProducersAsync(string limit, string lowerBound, bool? json, CancellationToken cancellationToken) = default
Retrieves producers list.
Parameters
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Parameters
limittotal number of producers to retrievelower_boundIn conjunction with limit can be used to paginate through the results. For example, limit=10 and lower_bound=10 would be page 2jsonreturn result in JSON format
Returns
Default Response
Exceptions
ApiExceptionA server side error occurred.
public async Task GetRawAbiAsync(string accountName, CancellationToken cancellationToken) = default
Retrieves raw ABI for a contract based on account name.
Parameters
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Default Response
Exceptions
ApiExceptionA 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
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Default Response
Exceptions
ApiExceptionA server side error occurred.
public async Task GetScheduledTransactionAsync(string lowerBound, int? limit, bool? json, CancellationToken cancellationToken) = default
Retrieves the scheduled transaction.
Parameters
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Parameters
lower_boundDate/time string in the format YYYY-MM-DDTHH:MM:SS.ssslimitThe maximum number of transactions to returnjsontrue/false whether the packed transaction is converted to json
Returns
Default Response
Exceptions
ApiExceptionA 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
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Parameters
codenameof the contract to return table data fortableFilter results by tablelower_boundFilters results to return the first element that is not less than provided value in setupper_boundFilters results to return the first element that is greater than provided value in setlimitLimit number of results returned.reverseReverse the order of returned results
Returns
Default Response
Exceptions
ApiExceptionA 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
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Parameters
codeThe name of the smart contract that controls the provided tabletableThe name of the table to queryscopeThe account to which this data belongsindex_positionPosition of the index used, accepted parametersprimary,secondary,tertiary,fourth,fifth,sixth,seventh,eighth,ninth,tenthkey_typeType of key specified by index_position (for example -uint64_torname)
Returns
Default Response
Exceptions
ApiExceptionA 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
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Default Response
Exceptions
ApiExceptionA 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
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Default Response
Exceptions
ApiExceptionA 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
cancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Default Response
Exceptions
ApiExceptionA server side error occurred.
private readonly HttpClient _httpClient
Last updated