ZSaed6.1 Widget Top users
    Updated 2023-10-02
    -- forked from 86d71f52-0e20-422b-9e95-99d9e68ed6c9

    with create_widget as (
    select SIGNER_ID,key, min(a.BLOCK_TIMESTAMP) as create_time from near.social.fact_decoded_actions a INNER join near.core.fact_transactions b on a.tx_hash = b.tx_hash and b.TX_STATUS ='Success' , table(FLATTEN(input=> node_data))
    where node ilike '%widget%'
    group by signer_id , key )
    select count( key) as num_tx , SIGNER_ID
    from create_widget
    group by SIGNER_ID
    ORDER by num_tx DESC

    Run a query to Download Data