Query editor
with inputs as (select block_height, tx_id, array_join(witness_data,',') payloadfrombitcoin.inputs twhere t.block_height>=793000 and t.block_height<800000 and t.index=0),txns as (select t.id txid,t.indexfrom bitcoin.transactions twhere t.block_height>=793000 and t.block_height<800000),rawdata as (SELECT'{' || from_utf8(from_hex(substr(payload,position('2270223a226272632d3230' in payload),position('7d68' in payload) - position('2270223a226272632d3230' in payload)))) || '}' as body,block_height,t.tx_id as txidFROM inputs tWHERE 1=1AND t.payload LIKE '%0063036f726401%'AND t.payload LIKE '%2270223a226272632d3230%'AND t.payload LIKE '%227469636b223a226f69637022%'),formatted as (select *, COALESCE(TRY(JSON_PARSE(body)), NULL) as data from rawdata),parsed as (SELECT t.txid,block_height,json_extract_scalar(t.data, '$.p') as p,json_extract_scalar(t.data, '$.tick') as tick,json_extract_scalar(t.data, '$.op') as op,COALESCE(TRY(CAST (json_extract_scalar(t.data, '$.amt') AS integer)),0) as amtFROM formatted twhere t.data is not null),filtered as (select * from parsed t where (t.p='brc-20' or t.p='brc-20c') and t.tick='oicp' and t.op='mint' and t.amt>0 and t.amt<=1000),integrated as (selectt.*, f.indexfromfiltered tjointxns f on t.txid=f.txid),