maybeyonasnear_nft_type
Updated 2022-10-20
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with
flat_logs as (
select
block_timestamp,
tx_hash,
receiver_id,
value as log
from near.core.fact_receipts r,
lateral flatten(input => r.logs)
),
ft_tokens as (
select
tx_receiver as token_address,
case
when l.symbol is null then tx_receiver else l.symbol
end as token_symbol,
count( distinct
case when array_size(split(tx_signer,'.')) > 1 then tx_signer else null end
) as users,
count(
case when array_size(split(tx_signer,'.')) > 1 then f.tx_hash else null end
) as txs
from near.core.fact_actions_events_function_call f
join near.core.fact_transactions t on f.tx_hash=t.tx_hash
left outer join near.core.dim_token_labels l on t.tx_receiver = l.token_contract
where method_name = 'nft_transfer' or method_name = 'nft_transfer_call'
group by 1,2
),
nep_tokens as (
select distinct
receiver_id as token_contract,
try_parse_json(replace(log,'EVENT_JSON:','')):standard::string as type
from flat_logs
where true
and try_parse_json(replace(log,'EVENT_JSON:','')):standard::string is not null
)
Run a query to Download Data