API Module
Example API Call
Task { @MainActor [weak self] in
guard let self else { return }
do {
let matchup = try await lucraClient.api.createGamesMatchup(gameTypeId: "DARTS", atStake: wagerAmount)
createClientMatchup(lucraMatchup: matchup)
} catch let userError as UserStateError {
switch userError {
case .notInitialized:
flow = .onboarding
case .unverified:
flow = .verifyIdentity
case .notAllowed:
self.errorMessage = "You are not allowed to perform this action."
case .insufficientFunds:
flow = .addFunds
@unknown default:
fatalError()
}
} catch let locationError as LocationError {
// Could also show custom location handling here
self.errorMessage = locationError.localizedDescription
} catch let error {
self.errorMessage = error.localizedDescription
}
}Event Listeners
Overview
Listening for Events
Example Usage
Configure User
Receive User Updates
Last updated