const { apiKey, component } = props; const BASE_URL = "https://api-v2.flipsidecrypto.xyz/json-rpc"; State.init({ data: [], hasError: false, isLoading: false, isRunning: false, queryId: "", }); if (!apiKey) { return <div>Empty apiKey!</div>; } const getQueryResult = async () => {}; const getQueryStatus = async () => {}; const runQuery = (sql) => { console.log("here2"); let body = { jsonrpc: "2.0", method: "createQueryRun", params: [ { resultTTLHours: 1, maxAgeMinutes: 0, sql: "SELECT date_trunc('''hour''', block_timestamp) as hourly_datetime, count(distinct tx_hash) as tx_count from ethereum.core.fact_transactions where block_timestamp >= getdate() - interval'''1 month''' group by 1 order by 1 desc", dataSource: "snowflake-default", dataProvider: "flipside", }, ], id: 1, }; console.log("here"); asyncFetch(BASE_URL, { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": apiKey }, body: JSON.stringify(body), }).then((res) => { console.log(res); console.log(res.body); }); }; const cancelQuery = async () => {}; return ( <div> <div>Rendering Child: </div> <> {component({ data, hasError, isLoading, isRunning, runQuery, cancelQuery, })} </> </div> );