Event Wait
Wait for events registered with Event Register. POST only.
Request:
- requestType is eventWait
- timeout is the amount of time (in seconds) to wait for an event before the call returns (optional, default and maximum is the xin.apiEventTimeout property)
- requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
- requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)
Notes: The call returns immediately if one or more events have occurred since the last call; multiple events are all returned together. If a new call is made before the last one returns, the timeout timer resets to the new value. Event registration expires if wait calls are not made frequently enough, according to the xin.apiEventTimeoutproperty.
Response:
- events (A) is an array of event objects each of which has the following fields:
- name (S) is the name of the event
- ids (A) is an array of identifiers, depending on the type of event:
- block string identifier (S) for a block event
- peer network address (S) for a peer event
- transaction string identifier (S) for a transaction event
- lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
- requestProcessingTime (N) is the API request processing time (in millisec)