Copy betslips shared by other users and use the returned data to populate your own bet slip flow.
CentralHubBetShareCopyProvider lets you copy an existing shared bet by its Central Hub message identifier.
When a copy succeeds, you can:
class BetCopyViewModel : ViewModel(), KoinComponent {
private val betCopyProvider: CentralHubBetShareCopyProvider = get()
suspend fun copyBet(betShareMessageId: String) {
betCopyProvider.copyBetShare(
betShareMessageId = betShareMessageId,
onSuccess = {
// Bet copied successfully.
// Use the returned data to populate your bet slip.
},
onFailure = { error ->
// Handle error.
}
)
}
}