• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hicommonwealth / commonwealth / 17593662931

09 Sep 2025 07:34PM UTC coverage: 37.57% (-0.03%) from 37.602%
17593662931

push

github

web-flow
Thread Token Trade Activity (#12918)

* Holdar & Activity Tab

* Applying the Git Diff

* Get Token Trades EndPoint

* Moved Into Seprate Folders

* Refactor headings

* Price Formating

* Trade Activity Table Refactor

* Parse Amount

* Token Holder Tab Fields Adjusted

* Dummy Data & API Console.log

* Query fix

* Query fix

* Query fix

* Query fix

* Query fix

* Query fix

* Intergration Token Holder Data

* Removed Un used Refrences

* Fixed TS Types

* Moved Schema Defination to libs/schema

* Rename the route

* Add Type

* Type Defined

---------

Co-authored-by: Kurtis Assad <kurtisassad@gmail.com>

1942 of 5566 branches covered (34.89%)

Branch coverage included in aggregate %.

0 of 7 new or added lines in 2 files covered. (0.0%)

3426 of 8722 relevant lines covered (39.28%)

44.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/libs/model/src/aggregates/thread/GetThreadTokenTrades.query.ts
1
import { Query } from '@hicommonwealth/core';
2
import {
3
  ThreadTokenTradesOutput,
4
  ThreadTokenTradesSchema,
5
} from '@hicommonwealth/schemas';
6
import z from 'zod';
7
import { models } from '../../database';
8

9
export function GetThreadTokenTrades(): Query<typeof ThreadTokenTradesSchema> {
NEW
10
  return {
×
11
    ...ThreadTokenTradesSchema,
12
    auth: [],
13
    body: async ({ payload }) => {
NEW
14
      const [result] = await models.sequelize.query(
×
15
        `SELECT 
16
          TTT.transaction_hash as id,
17
          CASE WHEN TTT.is_buy THEN 'buy' ELSE 'sell' END as type,
18
          TTT.community_token_amount as amount,
19
          TTT.price as price,
20
          TTT.timestamp as timestamp,
21
          TTT.trader_address as address
22
        FROM "ThreadTokens" AS TT
23
        JOIN "ThreadTokenTrades" AS TTT ON TT.token_address = TTT.token_address
24
        WHERE TT.thread_id = :thread_id
25
        ORDER BY TTT.timestamp DESC
26
        `,
27
        {
28
          replacements: {
29
            thread_id: payload.thread_id,
30
          },
31
        },
32
      );
33

NEW
34
      if (!result || result.length === 0) {
×
NEW
35
        return {
×
36
          result: null,
37
        };
38
      }
39

NEW
40
      return {
×
41
        result: result as z.infer<typeof ThreadTokenTradesOutput>['result'],
42
      };
43
    },
44
  };
45
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc