Flow.Net
Show / Hide Table of Contents

Class FlowHttpClient

Inheritance
Object
FlowHttpClient
Implements
IFlowClient
Namespace: Flow.Net.Sdk.Client.Http
Assembly: Flow.Net.Sdk.Client.Http.dll
Syntax
public class FlowHttpClient : IFlowClient

Constructors

| Improve this Doc View Source

FlowHttpClient(HttpClient, FlowClientOptions)

A HTTP client for the Flow v1 API.

Declaration
public FlowHttpClient(HttpClient httpClient, FlowClientOptions clientOptions)
Parameters
Type Name Description
HttpClient httpClient
FlowClientOptions clientOptions

Methods

| Improve this Doc View Source

ExecuteScriptAtBlockHeightAsync(FlowScript, UInt64)

Declaration
public Task<ICadence> ExecuteScriptAtBlockHeightAsync(FlowScript flowScript, ulong blockHeight)
Parameters
Type Name Description
FlowScript flowScript
UInt64 blockHeight
Returns
Type Description
Task<ICadence>
| Improve this Doc View Source

ExecuteScriptAtBlockHeightAsync(FlowScript, UInt64, CancellationToken)

Executes a ready-only Cadence script against the execution state at the given block height.

Declaration
public async Task<ICadence> ExecuteScriptAtBlockHeightAsync(FlowScript flowScript, ulong blockHeight, CancellationToken cancellationToken)
Parameters
Type Name Description
FlowScript flowScript
UInt64 blockHeight
CancellationToken cancellationToken
Returns
Type Description
Task<ICadence>

ICadence

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

ExecuteScriptAtBlockIdAsync(FlowScript, String)

Declaration
public Task<ICadence> ExecuteScriptAtBlockIdAsync(FlowScript flowScript, string blockId)
Parameters
Type Name Description
FlowScript flowScript
String blockId
Returns
Type Description
Task<ICadence>
| Improve this Doc View Source

ExecuteScriptAtBlockIdAsync(FlowScript, String, CancellationToken)

Executes a ready-only Cadence script against the execution state at the block with the given Id.

Declaration
public async Task<ICadence> ExecuteScriptAtBlockIdAsync(FlowScript flowScript, string blockId, CancellationToken cancellationToken)
Parameters
Type Name Description
FlowScript flowScript
String blockId
CancellationToken cancellationToken
Returns
Type Description
Task<ICadence>

ICadence

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

ExecuteScriptAtLatestBlockAsync(FlowScript)

Declaration
public Task<ICadence> ExecuteScriptAtLatestBlockAsync(FlowScript flowScript)
Parameters
Type Name Description
FlowScript flowScript
Returns
Type Description
Task<ICadence>
| Improve this Doc View Source

ExecuteScriptAtLatestBlockAsync(FlowScript, CancellationToken)

Executes a read-only Cadence script against the latest sealed execution state.

Declaration
public async Task<ICadence> ExecuteScriptAtLatestBlockAsync(FlowScript flowScript, CancellationToken cancellationToken)
Parameters
Type Name Description
FlowScript flowScript
CancellationToken cancellationToken
Returns
Type Description
Task<ICadence>

ICadence

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetAccountAtBlockHeightAsync(String, UInt64)

Declaration
public Task<FlowAccount> GetAccountAtBlockHeightAsync(string address, ulong blockHeight)
Parameters
Type Name Description
String address
UInt64 blockHeight
Returns
Type Description
Task<FlowAccount>
| Improve this Doc View Source

GetAccountAtBlockHeightAsync(String, UInt64, CancellationToken)

Gets an account by address at the given block height.

Declaration
public async Task<FlowAccount> GetAccountAtBlockHeightAsync(string address, ulong blockHeight, CancellationToken cancellationToken)
Parameters
Type Name Description
String address
UInt64 blockHeight
CancellationToken cancellationToken
Returns
Type Description
Task<FlowAccount>

FlowAccount

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetAccountAtLatestBlockAsync(String)

Declaration
public Task<FlowAccount> GetAccountAtLatestBlockAsync(string address)
Parameters
Type Name Description
String address
Returns
Type Description
Task<FlowAccount>
| Improve this Doc View Source

GetAccountAtLatestBlockAsync(String, CancellationToken)

Gets an account by address at the latest sealed block.

Declaration
public async Task<FlowAccount> GetAccountAtLatestBlockAsync(string address, CancellationToken cancellationToken)
Parameters
Type Name Description
String address
CancellationToken cancellationToken
Returns
Type Description
Task<FlowAccount>

FlowAccount

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetBlockByHeightAsync(UInt64)

Declaration
public Task<FlowBlock> GetBlockByHeightAsync(ulong height)
Parameters
Type Name Description
UInt64 height
Returns
Type Description
Task<FlowBlock>
| Improve this Doc View Source

GetBlockByHeightAsync(UInt64, CancellationToken)

Gets a full block by height.

Declaration
public async Task<FlowBlock> GetBlockByHeightAsync(ulong height, CancellationToken cancellationToken)
Parameters
Type Name Description
UInt64 height
CancellationToken cancellationToken
Returns
Type Description
Task<FlowBlock>

FlowBlock

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetBlockByIdAsync(String)

Declaration
public Task<FlowBlock> GetBlockByIdAsync(string blockId)
Parameters
Type Name Description
String blockId
Returns
Type Description
Task<FlowBlock>
| Improve this Doc View Source

GetBlockByIdAsync(String, CancellationToken)

Gets a full block by Id.

Declaration
public async Task<FlowBlock> GetBlockByIdAsync(string blockId, CancellationToken cancellationToken)
Parameters
Type Name Description
String blockId
CancellationToken cancellationToken
Returns
Type Description
Task<FlowBlock>

FlowBlock

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetBlockHeaderByHeightAsync(UInt64)

Declaration
public Task<FlowBlockHeader> GetBlockHeaderByHeightAsync(ulong height)
Parameters
Type Name Description
UInt64 height
Returns
Type Description
Task<FlowBlockHeader>
| Improve this Doc View Source

GetBlockHeaderByHeightAsync(UInt64, CancellationToken)

Gets a block header by height.

Declaration
public async Task<FlowBlockHeader> GetBlockHeaderByHeightAsync(ulong height, CancellationToken cancellationToken)
Parameters
Type Name Description
UInt64 height
CancellationToken cancellationToken
Returns
Type Description
Task<FlowBlockHeader>

FlowBlockHeader

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetBlockHeaderByIdAsync(String)

Declaration
public Task<FlowBlockHeader> GetBlockHeaderByIdAsync(string blockId)
Parameters
Type Name Description
String blockId
Returns
Type Description
Task<FlowBlockHeader>
| Improve this Doc View Source

GetBlockHeaderByIdAsync(String, CancellationToken)

Gets a block header by Id.

Declaration
public async Task<FlowBlockHeader> GetBlockHeaderByIdAsync(string blockId, CancellationToken cancellationToken)
Parameters
Type Name Description
String blockId
CancellationToken cancellationToken
Returns
Type Description
Task<FlowBlockHeader>

FlowBlockHeader

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetBlockHeadersByHeightAsync(IEnumerable<UInt64>)

Gets a block headers by heights.

Declaration
public Task<IEnumerable<FlowBlockHeader>> GetBlockHeadersByHeightAsync(IEnumerable<ulong> heights)
Parameters
Type Name Description
IEnumerable<UInt64> heights
Returns
Type Description
Task<IEnumerable<FlowBlockHeader>>

IEnumerable<T> of FlowBlockHeader

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetBlockHeadersByHeightAsync(IEnumerable<UInt64>, CancellationToken)

Gets a block headers by heights.

Declaration
public async Task<IEnumerable<FlowBlockHeader>> GetBlockHeadersByHeightAsync(IEnumerable<ulong> heights, CancellationToken cancellationToken)
Parameters
Type Name Description
IEnumerable<UInt64> heights
CancellationToken cancellationToken
Returns
Type Description
Task<IEnumerable<FlowBlockHeader>>

IEnumerable<T> of FlowBlockHeader

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetBlockHeadersByIdAsync(IEnumerable<String>)

Gets block headers by Ids.

Declaration
public Task<IEnumerable<FlowBlockHeader>> GetBlockHeadersByIdAsync(IEnumerable<string> blockIds)
Parameters
Type Name Description
IEnumerable<String> blockIds
Returns
Type Description
Task<IEnumerable<FlowBlockHeader>>

IEnumerable<T> of FlowBlockHeader

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetBlockHeadersByIdAsync(IEnumerable<String>, CancellationToken)

Gets block headers by Ids.

Declaration
public async Task<IEnumerable<FlowBlockHeader>> GetBlockHeadersByIdAsync(IEnumerable<string> blockIds, CancellationToken cancellationToken)
Parameters
Type Name Description
IEnumerable<String> blockIds
CancellationToken cancellationToken
Returns
Type Description
Task<IEnumerable<FlowBlockHeader>>

IEnumerable<T> of FlowBlockHeader

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetBlocksByHeightAsync(IEnumerable<UInt64>)

Gets full blocks by heights.

Declaration
public Task<IEnumerable<FlowBlock>> GetBlocksByHeightAsync(IEnumerable<ulong> heights)
Parameters
Type Name Description
IEnumerable<UInt64> heights
Returns
Type Description
Task<IEnumerable<FlowBlock>>

IEnumerable<T> of FlowBlock

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetBlocksByHeightAsync(IEnumerable<UInt64>, CancellationToken)

Gets full blocks by heights.

Declaration
public async Task<IEnumerable<FlowBlock>> GetBlocksByHeightAsync(IEnumerable<ulong> heights, CancellationToken cancellationToken)
Parameters
Type Name Description
IEnumerable<UInt64> heights
CancellationToken cancellationToken
Returns
Type Description
Task<IEnumerable<FlowBlock>>

IEnumerable<T> of FlowBlock

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetBlocksByIdAsync(IEnumerable<String>)

Gets full blocks by Ids.

Declaration
public Task<IEnumerable<FlowBlock>> GetBlocksByIdAsync(IEnumerable<string> blockIds)
Parameters
Type Name Description
IEnumerable<String> blockIds
Returns
Type Description
Task<IEnumerable<FlowBlock>>

IEnumerable<T> of FlowBlock

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetBlocksByIdAsync(IEnumerable<String>, CancellationToken)

Gets full blocks by Ids.

Declaration
public async Task<IEnumerable<FlowBlock>> GetBlocksByIdAsync(IEnumerable<string> blockIds, CancellationToken cancellationToken)
Parameters
Type Name Description
IEnumerable<String> blockIds
CancellationToken cancellationToken
Returns
Type Description
Task<IEnumerable<FlowBlock>>

IEnumerable<T> of FlowBlock

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetCollectionAsync(String)

Declaration
public Task<FlowCollection> GetCollectionAsync(string collectionId)
Parameters
Type Name Description
String collectionId
Returns
Type Description
Task<FlowCollection>
| Improve this Doc View Source

GetCollectionAsync(String, CancellationToken)

Gets a collection by Id.

Declaration
public async Task<FlowCollection> GetCollectionAsync(string collectionId, CancellationToken cancellationToken)
Parameters
Type Name Description
String collectionId
CancellationToken cancellationToken
Returns
Type Description
Task<FlowCollection>

FlowCollection

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetEventsForBlockIdsAsync(String, IEnumerable<String>)

Declaration
public Task<IEnumerable<FlowBlockEvent>> GetEventsForBlockIdsAsync(string eventType, IEnumerable<string> blockIds)
Parameters
Type Name Description
String eventType
IEnumerable<String> blockIds
Returns
Type Description
Task<IEnumerable<FlowBlockEvent>>
| Improve this Doc View Source

GetEventsForBlockIdsAsync(String, IEnumerable<String>, CancellationToken)

Retrieves events with the given type from the specified block Ids.

Declaration
public async Task<IEnumerable<FlowBlockEvent>> GetEventsForBlockIdsAsync(string eventType, IEnumerable<string> blockIds, CancellationToken cancellationToken)
Parameters
Type Name Description
String eventType
IEnumerable<String> blockIds
CancellationToken cancellationToken
Returns
Type Description
Task<IEnumerable<FlowBlockEvent>>

IEnumerable<T> of FlowBlockEvent

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetEventsForHeightRangeAsync(String, UInt64, UInt64)

Declaration
public Task<IEnumerable<FlowBlockEvent>> GetEventsForHeightRangeAsync(string eventType, ulong startHeight, ulong endHeight)
Parameters
Type Name Description
String eventType
UInt64 startHeight
UInt64 endHeight
Returns
Type Description
Task<IEnumerable<FlowBlockEvent>>
| Improve this Doc View Source

GetEventsForHeightRangeAsync(String, UInt64, UInt64, CancellationToken)

Retrieves events for all sealed blocks between the start and end block heights (inclusive) with the given type.

Declaration
public async Task<IEnumerable<FlowBlockEvent>> GetEventsForHeightRangeAsync(string eventType, ulong startHeight, ulong endHeight, CancellationToken cancellationToken)
Parameters
Type Name Description
String eventType
UInt64 startHeight
UInt64 endHeight
CancellationToken cancellationToken
Returns
Type Description
Task<IEnumerable<FlowBlockEvent>>

IEnumerable<T> of FlowBlockEvent

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetExecutionResultForBlockIdAsync(String)

Declaration
public Task<FlowExecutionResult> GetExecutionResultForBlockIdAsync(string blockId)
Parameters
Type Name Description
String blockId
Returns
Type Description
Task<FlowExecutionResult>
| Improve this Doc View Source

GetExecutionResultForBlockIdAsync(String, CancellationToken)

Retrieves execution result for the specified block Id.

Declaration
public async Task<FlowExecutionResult> GetExecutionResultForBlockIdAsync(string blockId, CancellationToken cancellationToken)
Parameters
Type Name Description
String blockId
CancellationToken cancellationToken
Returns
Type Description
Task<FlowExecutionResult>

FlowExecutionResult

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetLatestBlockAsync(Boolean)

Declaration
public Task<FlowBlock> GetLatestBlockAsync(bool isSealed = true)
Parameters
Type Name Description
Boolean isSealed
Returns
Type Description
Task<FlowBlock>
| Improve this Doc View Source

GetLatestBlockAsync(CancellationToken, Boolean)

Gets the full payload of the latest sealed or unsealed block.

Declaration
public async Task<FlowBlock> GetLatestBlockAsync(CancellationToken cancellationToken, bool isSealed = true)
Parameters
Type Name Description
CancellationToken cancellationToken
Boolean isSealed
Returns
Type Description
Task<FlowBlock>

FlowBlock

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetLatestBlockHeaderAsync(Boolean)

Declaration
public Task<FlowBlockHeader> GetLatestBlockHeaderAsync(bool isSealed = true)
Parameters
Type Name Description
Boolean isSealed
Returns
Type Description
Task<FlowBlockHeader>
| Improve this Doc View Source

GetLatestBlockHeaderAsync(CancellationToken, Boolean)

Gets the latest sealed or unsealed block header.

Declaration
public async Task<FlowBlockHeader> GetLatestBlockHeaderAsync(CancellationToken cancellationToken, bool isSealed = true)
Parameters
Type Name Description
CancellationToken cancellationToken
Boolean isSealed
Returns
Type Description
Task<FlowBlockHeader>

FlowBlockHeader

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetLatestProtocolStateSnapshotAsync()

Declaration
public Task<FlowProtocolStateSnapshot> GetLatestProtocolStateSnapshotAsync()
Returns
Type Description
Task<FlowProtocolStateSnapshot>
| Improve this Doc View Source

GetTransactionAsync(String)

Declaration
public Task<FlowTransactionResponse> GetTransactionAsync(string transactionId)
Parameters
Type Name Description
String transactionId
Returns
Type Description
Task<FlowTransactionResponse>
| Improve this Doc View Source

GetTransactionAsync(String, CancellationToken)

Gets a transaction by Id.

Declaration
public async Task<FlowTransactionResponse> GetTransactionAsync(string transactionId, CancellationToken cancellationToken)
Parameters
Type Name Description
String transactionId
CancellationToken cancellationToken
Returns
Type Description
Task<FlowTransactionResponse>

FlowTransactionResponse

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

GetTransactionResultAsync(String)

Declaration
public Task<FlowTransactionResult> GetTransactionResultAsync(string transactionId)
Parameters
Type Name Description
String transactionId
Returns
Type Description
Task<FlowTransactionResult>
| Improve this Doc View Source

GetTransactionResultAsync(String, CancellationToken)

Gets the result of a transaction.

Declaration
public async Task<FlowTransactionResult> GetTransactionResultAsync(string transactionId, CancellationToken cancellationToken)
Parameters
Type Name Description
String transactionId
CancellationToken cancellationToken
Returns
Type Description
Task<FlowTransactionResult>

FlowTransactionResult

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

PingAsync()

Declaration
public Task PingAsync()
Returns
Type Description
Task
| Improve this Doc View Source

PingAsync(CancellationToken)

Check if the access node is alive and healthy.

Declaration
public async Task PingAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task
Exceptions
Type Condition
FlowException
| Improve this Doc View Source

SendTransactionAsync(FlowTransaction)

Declaration
public Task<FlowTransactionId> SendTransactionAsync(FlowTransaction flowTransaction)
Parameters
Type Name Description
FlowTransaction flowTransaction
Returns
Type Description
Task<FlowTransactionId>
| Improve this Doc View Source

SendTransactionAsync(FlowTransaction, CancellationToken)

Submits a transaction to the network.

Declaration
public async Task<FlowTransactionId> SendTransactionAsync(FlowTransaction flowTransaction, CancellationToken cancellationToken)
Parameters
Type Name Description
FlowTransaction flowTransaction
CancellationToken cancellationToken
Returns
Type Description
Task<FlowTransactionId>

FlowTransactionId

Exceptions
Type Condition
FlowException
| Improve this Doc View Source

WaitForSealAsync(String, Int32, Int32)

Declaration
public Task<FlowTransactionResult> WaitForSealAsync(string transactionId, int delayMs = 1000, int timeoutMs = 30000)
Parameters
Type Name Description
String transactionId
Int32 delayMs
Int32 timeoutMs
Returns
Type Description
Task<FlowTransactionResult>
| Improve this Doc View Source

WaitForSealAsync(String, CancellationToken, Int32, Int32)

Waits for transaction result status to be sealed.

Declaration
public async Task<FlowTransactionResult> WaitForSealAsync(string transactionId, CancellationToken cancellationToken, int delayMs = 1000, int timeoutMs = 30000)
Parameters
Type Name Description
String transactionId
CancellationToken cancellationToken
Int32 delayMs
Int32 timeoutMs
Returns
Type Description
Task<FlowTransactionResult>

FlowTransactionResult

Exceptions
Type Condition
FlowException

Implements

IFlowClient
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX