Dapps can receive data from Zap Oracles by simply implementing callback method that match the data type users expect from the Oracle. Zap platform provides multiple types of responses :
Response method | Response Type | Callback to implement |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Check out Onchain subscriber example for solidity code example of dapps that use data from Zap Oracles
If User's address is not a contract address, all above response method will automatically emit Event of responses instead of calling callback method. User can listen to Events for each method to receive data offchain. Following table includes all offchain events with response method
Response method | Event |
|
|
|
|
|
|
|
|
|
|
|
|
Check out Offchain Subscriber Example for code example of receiving offchain responses