From beb5049a1bca061ee2d0f105a614ad4e357bc010 Mon Sep 17 00:00:00 2001 From: crox-safe Date: Thu, 30 Jan 2025 16:58:42 -0300 Subject: [PATCH] BIT-10939 --- .../cosmos/address/_currencies_table.html.erb | 48 +++++++------------ .../_in_out_transfers_by_time.html.erb | 31 +++++------- 2 files changed, 30 insertions(+), 49 deletions(-) diff --git a/app/views/cosmos/address/_currencies_table.html.erb b/app/views/cosmos/address/_currencies_table.html.erb index 2aa2f487..c130f296 100644 --- a/app/views/cosmos/address/_currencies_table.html.erb +++ b/app/views/cosmos/address/_currencies_table.html.erb @@ -12,35 +12,23 @@ $( document ).ready(function() { var query = new widgets.query(` - query($network: CosmosNetwork!, - $address: String!, - $from: ISO8601DateTime, - $till: ISO8601DateTime, - $limit: Int!, - $offset: Int!){ - cosmos(network: $network) { - transfers(date: {since: $from, till: $till}, - any: [{receiver: {is: $address}}, {sender: {is: $address}}] - options: {limit: $limit, offset: $offset, desc: ["count_in","count_out"] asc: "currency.symbol"}){ - sum_in: value(calculate: sum, - receiver: {is: $address} - ) - sum_out: value(calculate: sum, - sender: {is: $address} - ) - count_in: count( - receiver: {is: $address} - ) - count_out: count( - sender: {is: $address} - ) - currency { - symbol - - } - } - } - }`); +query ($network: CosmosNetwork!, $address: String!, $limit: Int!, $offset: Int!) { + cosmos(network: $network) { + transfers( + any: [{receiver: {is: $address}}, {sender: {is: $address}}] + options: {limit: $limit, offset: $offset, desc: ["count_in", "count_out"], asc: "currency.symbol"} + ) { + sum_in: value(calculate: sum, receiver: {is: $address}) + sum_out: value(calculate: sum, sender: {is: $address}) + count_in: count(receiver: {is: $address}) + count_out: count(sender: {is: $address}) + currency { + symbol + } + } + } +} +`); new widgets.table('#currencies_table', query, 'cosmos.transfers', { title: '<%= t('widgets.headers.currencies_sent_received') %>', @@ -98,4 +86,4 @@ }); - \ No newline at end of file + diff --git a/app/views/cosmos/address/_in_out_transfers_by_time.html.erb b/app/views/cosmos/address/_in_out_transfers_by_time.html.erb index b9fa2ada..b96cdcfc 100644 --- a/app/views/cosmos/address/_in_out_transfers_by_time.html.erb +++ b/app/views/cosmos/address/_in_out_transfers_by_time.html.erb @@ -12,25 +12,18 @@ $( document ).ready(function() { var query = new widgets.query(` - query ($network: CosmosNetwork!, - $dateFormat: String!, - $address: String!, - $from: ISO8601DateTime, - $till: ISO8601DateTime){ - cosmos(network: $network ){ - transfers(date: { - since: $from - till: $till} - options: {asc: "date.date"} - ) { - date{ - date(format: $dateFormat) - } - in_count: countBigInt(receiver: {is: $address}) - out_count: countBigInt(sender: {is: $address}) - } - } - }`); +query ($network: CosmosNetwork!, $dateFormat: String!, $address: String!) { + cosmos(network: $network) { + transfers(options: {desc: "date.date", limit: 10}) { + date { + date(format: $dateFormat) + } + in_count: countBigInt(receiver: {is: $address}) + out_count: countBigInt(sender: {is: $address}) + } + } +} +`); new widgets.chartByTime('#in_out_transfers_by_time', query, 'cosmos.transfers', {