Querying Retroshades

For each Retroshades struct defined in the contract, a table on the database will be created that can be queried:

curl -X POST https://mainnet.mercurydata.app/rest/retroshadesv1 \
-H "Authorization: Bearer yourjwt" \
-H 'Content-Type: application/json' \
-d '{
  "query": "SELECT * FROM retroshade.liquidity_event660d1d2a8c1accf4adc7c03cf95d3fee"
}'

Until Mercury's stable release, to get the name of the tables created, just take the name of the struct used to define the Retroshade in the contract, and accompany it with the md5 hash of the Retroshades contract binary id.

In our case we defined pub struct LiquidityEvent : the query will be SELECT * FROM liquidity_event+the_hashed_id .

Make sure to change the endpoint if you're on testnet.

Last updated