dannerNBA Top Shot Recent Lock Events
    Updated 2023-01-14
    with lock_events as
    (select
    tx_id,
    block_timestamp::date as lock_date,
    to_timestamp(event_data:expiryTimestamp::NUMERIC)::date as unlock_date,
    (event_data:duration::int)/86400 as days,
    event_data:id::int as moment_id
    from
    flow.core.fact_events
    where event_contract = 'A.0b2a3299cc857e29.TopShotLocking'
    -- and tx_id = '22860886f0cb731fd83c66f18c2e840cb477aaa5aa12a2f64c1d44249aa027f3'
    and tx_succeeded),
    metadata as
    (select
    nft_id::int as id,
    set_series_number as series,
    set_name,
    player,
    serial_number,
    total_circulation,
    team
    -- , video_urls[0]:url as vertical_video
    from
    flow.core.dim_topshot_metadata)

    select
    metadata.series as "Series",
    metadata.set_name as "Set",
    metadata.player as "Player",
    metadata.serial_number as "SN",
    lock_events.lock_date as "Locked At",
    lock_events.unlock_date as "Unlocks At",
    tx.proposer as "User",
    lock_events.tx_id as "Tx"
    from
    lock_events
    Run a query to Download Data