File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -81,13 +81,28 @@ SELECT
8181 LIMIT 1
8282 ) AS owner_id
8383
84- , (
84+ , COALESCE(
85+ (
8586 SELECT (safe_json_parse(REPLACE(l, ' EVENT_JSON:' , ' ' ))- > ' data' - > 0 - >> ' amount' )::NUMERIC
8687 FROM UNNEST(ra .logs ) AS t(l)
8788 WHERE safe_json_parse(REPLACE(l, ' EVENT_JSON:' , ' ' ))- >> ' error' IS NULL
8889 AND safe_json_parse(REPLACE(l, ' EVENT_JSON:' , ' ' ))- >> ' event' = ' ft_burn'
8990 LIMIT 1
90- ) AS near_amount
91+ ),
92+ (
93+ SELECT (safe_json_parse(REPLACE(l, ' EVENT_JSON:' , ' ' ))- > ' data' - > 0 - >> ' amount' )::NUMERIC
94+ FROM UNNEST(ra .logs ) AS t(l)
95+ WHERE safe_json_parse(REPLACE(l, ' EVENT_JSON:' , ' ' ))- >> ' error' IS NULL
96+ AND safe_json_parse(REPLACE(l, ' EVENT_JSON:' , ' ' ))- >> ' event' = ' ft_mint'
97+ AND safe_json_parse(REPLACE(l, ' EVENT_JSON:' , ' ' ))- > ' data' - > 0 - >> ' owner_id' =
98+ CASE
99+ WHEN safe_json_parse(CONVERT_FROM(ra .args , ' UTF8' ))- >> ' error' IS NULL
100+ THEN safe_json_parse(CONVERT_FROM(ra .args , ' UTF8' ))- >> ' receiver_id'
101+ ELSE NULL
102+ END
103+ LIMIT 1
104+ )
105+ ) AS near_amount
91106
92107 -- Block Data
93108 , ra .block_height
You can’t perform that action at this time.
0 commit comments