bro-n-bro / spacebox-api

Flask api for services on top of spacebox
MIT License
4 stars 0 forks source link

Add fees_paid API #83

Closed bro-n-bro-0 closed 12 months ago

bro-n-bro-0 commented 1 year ago

The amount of fees paid in different coins

bro-n-bro-0 commented 1 year ago
SELECT 
    height, 
    JSONExtractString(arrayJoin(JSONExtractArrayRaw(JSONExtractString(fee, 'coins'))), 'denom') as denom,
    sum(toUInt256OrZero(JSONExtractString(arrayJoin(JSONExtractArrayRaw(JSONExtractString(fee, 'coins'))), 'amount'))) as amount
FROM spacebox.`transaction` FINAL 
GROUP BY height, denom

Here is a nice example Now we can get all currencies as fee

iljagrabar14 commented 1 year ago

return structure ['y': date, 'x': [{'denom': denom, 'amount': amount}, ...]

bro-n-bro-2 commented 12 months ago

Historical and static endpoints.

iljagrabar14 commented 12 months ago

@bro-n-bro-0 @bro-n-bro-2 please check apis, if everything is ok, please close issue

bro-n-bro-2 commented 12 months ago

Thanks !