Skip to content

Commit

Permalink
Merge pull request #35 from chase1745/add-event-funcs
Browse files Browse the repository at this point in the history
Add flow client event functions
  • Loading branch information
andrew54068 authored Feb 24, 2023
2 parents 4cfcac3 + 36a4cf1 commit 43af334
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Sources/FCL-SDK/FCL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Foundation
import FlowSDK
import Cadence
import AuthenticationServices
import GRPC

public let fcl: FCL = FCL()

Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 43af334

Please sign in to comment.