From 683d381a4090a1e6afcfcbe0183b6d514ad658e1 Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Thu, 5 Dec 2024 18:24:26 +0530 Subject: [PATCH] fix(torii/graphql): filter out tokens with zero balance commit-id:11f63cc1 --- crates/torii/graphql/src/object/erc/token_balance.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/torii/graphql/src/object/erc/token_balance.rs b/crates/torii/graphql/src/object/erc/token_balance.rs index db006dfea0..990939af33 100644 --- a/crates/torii/graphql/src/object/erc/token_balance.rs +++ b/crates/torii/graphql/src/object/erc/token_balance.rs @@ -106,6 +106,9 @@ async fn fetch_token_balances( let mut conditions = vec![ "(b.account_address = ?)".to_string(), "(t.metadata IS NULL OR length(t.metadata) > 0)".to_string(), + // Filter out zero balance + "b.balance != '0x0000000000000000000000000000000000000000000000000000000000000000'" + .to_string(), ]; let mut cursor_param = &connection.after;