waitForEnding
Wait for the call to reach the ending state. Returns immediately if the call
is already ending or past that state. A typed wait over waitFor().
Parameters
timeout
Maximum milliseconds to wait. Throws an Error if exceeded. undefined
waits indefinitely.
Returns
Promise<RelayEvent> — The state-change event.