Query editor
-- Silencio Total Transactions (no regex version)WITH base AS (SELECTblock_time,LOWER(section) AS section_lc,method,COALESCE(data_decoded, data) AS payloadFROM peaq.eventsWHERE LOWER(section) IN ('peaqstorage','peaqdid')),-- Storage: wallet = [0].data, key = [1].data (hex, may start with '0x' and a SCALE prefix byte)storage AS (SELECTblock_time,JSON_EXTRACT_SCALAR(payload, '$[0].data') AS wallet,/* drop 0x if present, then try hex→utf8; if that fails, keep the original */COALESCE(TRY(FROM_UTF8(FROM_HEX(CASEWHEN LOWER(JSON_EXTRACT_SCALAR(payload,'$[1].data')) LIKE '0x%'THEN SUBSTR(JSON_EXTRACT_SCALAR(payload,'$[1].data'), 3)ELSE JSON_EXTRACT_SCALAR(payload,'$[1].data')END))),JSON_EXTRACT_SCALAR(payload,'$[1].data')) AS itemKeyFROM baseWHERE section_lc = 'peaqstorage' AND method = 'ItemAdded'),-- DID: attribute name is plain text at [2].data (no hex-decode needed)did AS (SELECTblock_time,JSON_EXTRACT_SCALAR(payload, '$[0].data') AS wallet,JSON_EXTRACT_SCALAR(payload, '$[2].data') AS itemKeyFROM baseWHERE section_lc = 'peaqdid'AND method IN ('AttributeAdded','AttributeUpdated','AttributeRemoved')),A AS (SELECT block_time, wallet, itemKey, 'storage' AS src FROM storageUNION ALLSELECT block_time, wallet, itemKey, 'did' AS src FROM did)SELECT COUNT(*) AS total_transactionsFROM AWHERE itemKey IS NOT NULLAND (-- STORAGE: match direct OR skip the first char (handles the SCALE prefix byte)(src = 'storage' AND (itemKey LIKE 'SLC_Street%' OR SUBSTR(itemKey,2) LIKE 'SLC_Street%' ORitemKey LIKE 'SLC_Venue%' OR SUBSTR(itemKey,2) LIKE 'SLC_Venue%' ORitemKey LIKE 'SLC_Consent_Given%' OR SUBSTR(itemKey,2) LIKE 'SLC_Consent_Given%' ORitemKey LIKE 'SLC_Consent_Revoked%' OR SUBSTR(itemKey,2) LIKE 'SLC_Consent_Revoked%' ORitemKey LIKE 'SLC_GET_REAL%' OR SUBSTR(itemKey,2) LIKE 'SLC_GET_REAL%' OR