Currently, the contract supports quering request data using these two functions:
pub fn get_requests(&self, account: AccountId, max_requests: U64) -> String to get requests published by a specific account.
pub fn get_requests_summary(&self, max_num_accounts: U64) -> String to get a summary of all requests. Basically getting a list of accounts that made a request.
To query all requests, we need to combine these two functions and execute N+1 RPC calls where N is the number of accounts using the oracle service. This complicates integration with Chainlink and other services, so ideally, we would like to support a function like get_all_requests that would return all requests in one function call.
On Ethereum we use events and we can query all events for a contract. As such we are able to query all requests in one RPC call.
As one of the design goals is to be as close as possible to the EVM oracle implementation, and NEAR currently does not support contract events, we should support a query like this.
Currently, the contract supports quering request data using these two functions:
pub fn get_requests(&self, account: AccountId, max_requests: U64) -> String
to get requests published by a specific account.pub fn get_requests_summary(&self, max_num_accounts: U64) -> String
to get a summary of all requests. Basically getting a list of accounts that made a request.To query all requests, we need to combine these two functions and execute N+1 RPC calls where N is the number of accounts using the oracle service. This complicates integration with Chainlink and other services, so ideally, we would like to support a function like
get_all_requests
that would return all requests in one function call.On Ethereum we use events and we can query all events for a contract. As such we are able to query all requests in one RPC call.
As one of the design goals is to be as close as possible to the EVM oracle implementation, and NEAR currently does not support contract events, we should support a query like this.