Query editor
-- This query used incompatible data types from Dune SQL alpha and may need to be updated.-- More details can be found on https://dune.com/docs/query/dunesql-changes/with decodes as (SELECT--types to hex here https://dune.com/queries/1981638?d=11--uncaught types filtering here https://dune.com/queries/1981648?d=11output_value/*, from_utf8(from_hex(--get the content type hashsubstr(cast(t.hex as varchar), position('2270223a20226272632d323022' in cast(t.hex as varchar)),position('7d6821' in cast(t.hex as varchar))-position('2270223a20226272632d323022' in cast(t.hex as varchar)) --start from portion where standard ends)))) as test*/, from_utf8(from_hex(regexp_extract(cast(hex as varchar), '7b2(?:[^7]|7[^bd])*7d(?=[06])'))) as test, t.block_time as mint_time, t.block_height, t.size, t.virtual_size, t.fee*1e8 as fee, t.fee*1e8/t.virtual_size as sat_per_vbyte, t.output[1].script_pub_key.address as minter_address, t.index, t.id as tx_idFROM bitcoin.transactions twhere t.block_height > 767429-- and t.block_height < 779965AND cast(t.hex as varchar) LIKE '%0063036f726401%'and cast(t.hex as varchar) LIKE '%226272632d323022%' -- OP_FALSE (0x00) OP_IF (0x63) OP_PUSHBYTES3 (0x03) "ord" (0x6f7264) OP_1 (0x01) https://docs.ordinals.com/inscriptions.html-- AND t.input[1].witness_data[2] LIKE '%0063036f726401%' AND t.input[1].type = 'witness_v1_taproot' thenthis doesn't wwhenk because of array length checks--order by ordinal_number descand MOD(length(regexp_extract(cast(hex as varchar), '7b2(?:[^7]|7[^bd])*7d(?=[06])')),2) = 0 -- 7b2(?:[^7]|7[^bd])*7d(?=[06])-- 7b2(?:[^7]|7[^bd])*7d -- (?=7b2(?:.{2})*7d(?:[06])?(?=[06]))7b2(?:.{2}){1,153}7d(?:[06])?(?=[06]) -- (?<=7b2)(?:.{2}(?!7d))*.{1,246}(?<=7d[06])(?:[06])?)/*,formatted as (select case when op = 'deploy' then CAST(replace(regexp_extract(test, '[“"]max[”"]\s*:\s*[“"]?([\d,]+)[”"]?', 1), ',', '') AS BIGINT)else 0 end as supply, case when op = 'deploy' then CAST(replace(regexp_extract(test, '[“"]lim[”"]\s*:\s*[“"]?([\d,]+)[”"]?', 1), ',', '') AS BIGINT)else 0 end as max_mint, case when op = 'mint' then CAST(replace(regexp_extract(test, '[“"]amt[”"]\s*:\s*[“"]?([\d,]+)[”"]?', 1), ',', '') AS BIGINT)else 0 end as mint_amount, case when op = 'transfer' then CAST(replace(regexp_extract(test, '[“"]amt[”"]\s*:\s*[“"]?([\d,]+)[”"]?', 1), ',', '') AS BIGINT)else 0 end as tfer_amount, case when op = 'transfer' then substr(test, position('"to"' in test)+7,position('"fee"' in test)-12-position('"to"' in test))else '' end as tfer_to, case when op = 'transfer' then CAST(replace(regexp_extract(test, '[“"]fee[”"]\s*:\s*[“"]?([\d,]+)[”"]?', 1), ',', '') AS BIGINT)else 0 end as tfer_fee, *from (select substr(test, position('brc-20' in test)+18, position('tick' in test)-24-position('brc-20' in test)) as op, substr(test, position('"tick"' in test)+9,4) as tick, *from decodes) as aaa),