FlowAccessProtocol
public protocol FlowAccessProtocol
Flow Access API Protocol
Defines the interface for interacting with Flow blockchain nodes. Provides methods for querying blockchain state and submitting transactions.
This protocol supports:
- Block queries
- Account information
- Transaction submission
- Script execution
- Event querying
Implementation examples:
- HTTP API client
- gRPC client
- Mock client for testing
-
ping()AsynchronousCheck node connectivity
Declaration
Swift
func ping() async throws -> BoolReturn Value
True if node is accessible
-
getLatestBlockHeader()AsynchronousGet latest block header
Declaration
Swift
func getLatestBlockHeader() async throws -> Flow.BlockHeaderReturn Value
Most recent block header
-
getBlockHeaderById(id:Asynchronous) Get block header by ID
Parameters
idBlock identifier
Return Value
Block header for specified ID
-
getBlockHeaderByHeight(height:Asynchronous) Declaration
Swift
func getBlockHeaderByHeight(height: UInt64) async throws -> Flow.BlockHeader -
getLatestBlock(sealed:Default implementation, asynchronous) Default Implementation
Declaration
Swift
func getLatestBlock(sealed: Bool) async throws -> Flow.Block -
getBlockById(id:Asynchronous) -
getBlockByHeight(height:Asynchronous) Declaration
Swift
func getBlockByHeight(height: UInt64) async throws -> Flow.Block -
getCollectionById(id:Asynchronous) -
sendTransaction(transaction:Asynchronous) -
getTransactionById(id:Default implementation, asynchronous) Default Implementation
-
getTransactionResultById(id:Default implementation, asynchronous) Default Implementation
-
getAccountAtLatestBlock(address:Default implementation, asynchronous) Default Implementation
-
getAccountByBlockHeight(address:Asynchronousheight: ) Declaration
-
executeScriptAtLatestBlock(script:Default implementation, asynchronousarguments: ) Default Implementation
Declaration
-
executeScriptAtLatestBlock(script:Asynchronousarguments: ) Declaration
-
executeScriptAtBlockId(script:Default implementation, asynchronousblockId: arguments: ) Default Implementation
Declaration
-
executeScriptAtBlockId(script:AsynchronousblockId: arguments: ) Declaration
-
executeScriptAtBlockHeight(script:Default implementation, asynchronousheight: arguments: ) Default Implementation
Declaration
-
executeScriptAtBlockHeight(script:Asynchronousheight: arguments: ) Declaration
-
getEventsForHeightRange(type:Asynchronousrange: ) Declaration
Swift
func getEventsForHeightRange(type: String, range: ClosedRange<UInt64>) async throws -> [Flow.Event.Result] -
getEventsForBlockIds(type:Asynchronousids: ) Declaration
-
getNetworkParameters()AsynchronousDeclaration
Swift
func getNetworkParameters() async throws -> Flow.ChainID -
executeScriptAtLatestBlock(cadence:Extension method, asynchronousarguments: ) Declaration
-
executeScriptAtLatestBlock(cadence:Extension method, asynchronousarguments: ) Declaration
-
executeScriptAtLatestBlock(script:Extension method, asynchronous) Declaration
View on GitHub