Skip to content

Commit c7694d4

Browse files
authored
Merge pull request #24 from grassrootseconomics/williamluke4/ignore-celo-tx
Exclude CELO token transfers from graph data
2 parents cb0e439 + 82add3f commit c7694d4

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

config/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// External addresses
66
export const FAUCET_ADDRESS = "0x5523058cdFfe5F3c1EaDADD5015E55C6E00fb439";
77

8+
// CELO native token (ERC20) contract on Celo mainnet — excluded from graph data
9+
export const CELO_TOKEN_ADDRESS = "0x471EcE3750Da237f93B8E339c536989b8978a438";
10+
811
// External URLs
912
export const CELOSCAN_BASE_URL = "https://celoscan.io";
1013
export const SARAFU_NETWORK_BASE_URL = "https://sarafu.network";

config/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// Application constants
66
export {
77
FAUCET_ADDRESS,
8+
CELO_TOKEN_ADDRESS,
89
CELOSCAN_BASE_URL,
910
SARAFU_NETWORK_BASE_URL,
1011
TWO_MONTHS_MS,

lib/api/queries/transactions.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
*/
44

55
import { federatedDB } from "@db/db";
6-
import { FAUCET_ADDRESS, ONE_YEAR_MS } from "@/config/constants";
6+
import {
7+
CELO_TOKEN_ADDRESS,
8+
FAUCET_ADDRESS,
9+
ONE_YEAR_MS,
10+
} from "@/config/constants";
711

812
/**
913
* Fetch transactions from the database
@@ -31,6 +35,11 @@ export function fetchTransactions() {
3135
.where("chain_data.tx.success", "=", true)
3236
.where("chain_data.token_transfer.sender_address", "!=", FAUCET_ADDRESS)
3337
.where("chain_data.token_transfer.recipient_address", "!=", FAUCET_ADDRESS)
38+
.where(
39+
"chain_data.token_transfer.contract_address",
40+
"!=",
41+
CELO_TOKEN_ADDRESS
42+
)
3443
.where(
3544
"chain_data.tx.date_block",
3645
">=",

0 commit comments

Comments
 (0)