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://api.mercurydata.app/retroshades \
-H "Authorization: Bearer yourjwt \
-H 'Content-Type: application/json' \
-d '{
"query": "SELECT * FROM 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
.
Last updated