import { Address } from 'viem'; import { TokenActivity } from '../../types'; export const TOKEN_QUERY = `query token($id: ID) { token( id: $id ) { id address totalSupply totalUniqueSenders totalTransfers totalTransferAmount createdAt updatedAt } }`; export interface TokenEntity { token: { id: string; address: string; totalSupply: string; totalUniqueSenders: string; totalTransfers: string; totalTransferAmount: string; createdAt: string; updatedAt: string; }; } export function transform(entity: TokenEntity): TokenActivity { return { id: entity.token.id, address: entity.token.address as Address, totalSupply: BigInt(entity.token.totalSupply), totalUniqueSenders: Number(entity.token.totalUniqueSenders), totalTransfers: Number(entity.token.totalTransfers), totalTransferAmount: BigInt(entity.token.totalTransferAmount), createdAt: Number(entity.token.createdAt), updatedAt: Number(entity.token.updatedAt), }; }