{"version":"1.0","type":"rich","title":"Uses midpointapi.com to return a single cell value from any table or sql request on Tableland","description":"This example demonstrates how a Solidity smart contract can use the Midpoint API to retrieve a single cell value from any Tableland table or SQL query. The contract wraps the user’s SQL query into a `SELECT ... LIMIT 1` statement and sends it to the Midpoint contract via `callMidpoint`, then handles the asynchronous string response through a callback interface. It uses OpenZeppelin’s `Strings` and `EnumerableMap` libraries to manage request IDs and callback addresses, emitting events for each request and received response. The code shows both a basic query without a callback and a version that routes the response to a user-specified contract implementing `IStringCallback`.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-ea3f82bc9fc07fe90818307a2b1c8052?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}