From 36a4cf191ffecb79521bc0511d1492df99afe3d2 Mon Sep 17 00:00:00 2001 From: Chase McDermott Date: Thu, 23 Feb 2023 23:02:25 -0600 Subject: [PATCH] Add flow client event functions --- Sources/FCL-SDK/FCL.swift | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Sources/FCL-SDK/FCL.swift b/Sources/FCL-SDK/FCL.swift index f8a4281..6365288 100644 --- a/Sources/FCL-SDK/FCL.swift +++ b/Sources/FCL-SDK/FCL.swift @@ -9,6 +9,7 @@ import Foundation import FlowSDK import Cadence import AuthenticationServices +import GRPC public let fcl: FCL = FCL() @@ -440,6 +441,25 @@ extension FCL { public extension FCL { + func getEventsForHeightRange( + eventType: String, + startHeight: UInt64, + endHeight: UInt64, + options: CallOptions? = nil + ) async throws -> [BlockEvents] { + try await flowAPIClient + .getEventsForHeightRange(eventType: eventType, startHeight: startHeight, endHeight: endHeight, options: options) + } + + func getEventsForBlockIDs( + eventType: String, + blockIds: [Identifier], + options: CallOptions? = nil + ) async throws -> [BlockEvents] { + try await flowAPIClient + .getEventsForBlockIDs(eventType: eventType, blockIds: blockIds, options: options) + } + func getAccount(address: String) async throws -> FlowSDK.Account? { try await flowAPIClient .getAccountAtLatestBlock(address: Cadence.Address(hexString: address))