binhachon1 NEAR Tournament Round 1: The Arts District - #2
Updated 2022-07-28
999
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 TX AS (
SELECT
blocK_timestamp,
txn_hash,
tx_receiver,
tx:receipt as receipt,
tx:public_key as public_key,
tx:signer_id as signer_id,
tx:receiver_id as receiver_id
--,action_data:deposit/pow(10,24) as deposit, action_data:gas/pow(10,24) as gas*/
FROM flipside_prod_db.mdao_near.transactions
where substr(tx_receipt[0]:"outcome":"status",3,7) != 'Failure' --Remove failed txn
-- WHERE txn_hash = 'AS5QLqtdQKz4fGZeqtBgXHhLbkA1HpVCM4fRaSoBqK5y' -- sale https://paras.id/token/x.paras.near::426086
),
JSON_PARSING AS (
SELECT
block_timestamp,
txn_hash,
public_key,
signer_id,
receiver_id,
seq,key,path,index,
replace(value:outcome:logs[0], '\\') as logs, -- remove // | convert variant | parse json
replace(logs, 'EVENT_JSON:') as logs_1,
replace(logs_1, '"{"', '{"') as logs_2,
replace(logs_2, '"}"', '"}') as logs_3,
-- case when logs like 'EVENT_JSON:%' then substr(logs, 12) else logs end as adj_logs,
check_json(logs_3) as checks
--,
--check_json(adj_logs) as checks_1
FROM tx,
table(flatten(input => receipt))
),
nft_tx_log AS (
SELECT
--PARSE_JSON(LOGS):PARAMS
Run a query to Download Data