theericstonehelius livequery demo
Updated 2024-11-27
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
›
⌄
with raw as (
SELECT livequery.live.udf_api(
'GET',
'https://api.helius.xyz/v0/addresses/{{soladdress}}/balances?api-key={apikey}',
{'accept': 'application/json'},
{},
'helius'
) as response
),
tokens as (
select
value:mint::string as token,
value:amount / pow(10,value:decimals) as amount
from raw,
lateral flatten (input => response:data:tokens)
),
nativesol as (
select 'sol' as token,
response:data:nativeBalance / pow(10,9) as amount
from raw
)
select * from tokens
UNION
select * from nativesol
order by amount desc;
QueryRunArchived: QueryRun has been archived