mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-15 05:13:23 +00:00
Add getAnsweredOffers API method for batch polling
Added RondevuAPI.getAnsweredOffers() and Rondevu.getAnsweredOffers() methods to efficiently retrieve all answered offers with optional timestamp filtering. This enables offerers to poll for incoming connections in a single request instead of polling each offer individually.
This commit is contained in:
@@ -280,6 +280,22 @@ export class Rondevu {
|
||||
return await this.api.getOfferAnswer(serviceFqn, offerId)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all answered offers (efficient batch polling for offerer)
|
||||
* Returns all offers that have been answered since the given timestamp
|
||||
*/
|
||||
async getAnsweredOffers(since?: number): Promise<{
|
||||
offers: Array<{
|
||||
offerId: string
|
||||
serviceId?: string
|
||||
answererId: string
|
||||
sdp: string
|
||||
answeredAt: number
|
||||
}>
|
||||
}> {
|
||||
return await this.api.getAnsweredOffers(since)
|
||||
}
|
||||
|
||||
/**
|
||||
* Add ICE candidates to specific offer
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user