# fahim-web-and-app-dev/ton-assets architecture

> Architecture diagram of the GitHub repository fahim-web-and-app-dev/ton-assets, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fahim-web-and-app-dev/ton-assets
- Repository: https://github.com/fahim-web-and-app-dev/ton-assets

## Overview

TON Assets is a curated registry of TON addresses and assets, with scripts to refresh and consolidate catalog data and a separate tool for reviewing candidate assets from ton-labels. The main registry flow gathers selected DEX data, normalizes and validates YAML catalogs, then emits JSON catalogs and a README. The review flow filters known, skipped, and blacklisted addresses, classifies candidates using TON API account interfaces, and produces review artifacts. Arrows are limited to relationships visible in the sampled source or README; unsampled catalog details are represented at directory level.

Main entry points: [`generator.py`](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/generator.py) (Catalog generator), [`parser.py`](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/parser.py) (Candidate scanner), [`utlis.py`](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/utlis.py) (Address normalization), [`to_review/readers.py`](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/to_review/readers.py) (Known and skip lists)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Catalog generation"]
  node_generator["Catalog generator<br/>[generator.py]"]
  node_dexes["DEX importers<br/>[dexes.py]"]
  node_normalizer["Address normalization<br/>[utlis.py]"]
end

subgraph group_registry["Asset registry"]
  node_account_sources["Account catalogs"]
  node_jetton_sources["Jetton catalogs"]
  node_collection_sources["Collection catalogs"]
  node_accounts_json[("Accounts index<br/>[accounts.json]")]
  node_jettons_json[("Jettons index<br/>[jettons.json]")]
  node_collections_json[("Collections index<br/>[collections.json]")]
  node_readme["Asset directory README<br/>[README.md]"]
end

subgraph group_review["Candidate review"]
  node_review_parser["Candidate scanner<br/>[parser.py]"]
  node_review_readers["Known and skip lists<br/>[readers.py]"]
  node_asset_model["Candidate asset record<br/>[models.py]"]
  node_review_output["Review presenter<br/>[presenter.py]"]
  node_review_lists["Review lists"]
end

node_contributor(("Contributors"))
node_ton_labels["ton-labels assets"]
node_dex_services{{"DEX and token APIs"}}
node_ton_api{{"TON API"}}

node_contributor -.->|"maintains"| node_account_sources
node_contributor -.->|"maintains"| node_jetton_sources
node_contributor -.->|"maintains"| node_collection_sources
node_generator -->|"fetches assets"| node_dexes
node_generator -->|"requests catalog data"| node_dex_services
node_generator -->|"normalizes addresses"| node_normalizer
node_generator -->|"merges YAML"| node_account_sources
node_generator -->|"reads and writes YAML"| node_jetton_sources
node_generator -->|"reads YAML"| node_collection_sources
node_generator -->|"writes index"| node_accounts_json
node_generator -->|"writes index"| node_jettons_json
node_generator -->|"writes index"| node_collections_json
node_generator -->|"renders directory"| node_readme
node_review_parser -->|"loads address lists"| node_review_readers
node_review_parser -->|"normalizes addresses"| node_normalizer
node_review_parser -->|"reads and appends"| node_review_lists
node_review_parser -->|"scans asset JSON"| node_ton_labels
node_review_parser -->|"checks account interfaces"| node_ton_api
node_review_parser -->|"creates records"| node_asset_model
node_review_parser -->|"generates review outputs"| node_review_output
node_review_readers -->|"normalizes addresses"| node_normalizer
node_review_output -->|"appends blacklist"| node_review_lists

click node_generator "https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/generator.py"
click node_dexes "https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/dexes.py"
click node_normalizer "https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/utlis.py"
click node_account_sources "https://github.com/fahim-web-and-app-dev/ton-assets/tree/main/accounts"
click node_jetton_sources "https://github.com/fahim-web-and-app-dev/ton-assets/tree/main/jettons"
click node_collection_sources "https://github.com/fahim-web-and-app-dev/ton-assets/tree/main/collections"
click node_accounts_json "https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/accounts.json"
click node_jettons_json "https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/jettons.json"
click node_collections_json "https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/collections.json"
click node_readme "https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/README.md"
click node_review_parser "https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/parser.py"
click node_review_readers "https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/to_review/readers.py"
click node_asset_model "https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/to_review/models.py"
click node_review_output "https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/to_review/presenter.py"
click node_review_lists "https://github.com/fahim-web-and-app-dev/ton-assets/tree/main/to_review"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_generator,node_dexes,node_normalizer toneBlue
class node_account_sources,node_jetton_sources,node_collection_sources,node_accounts_json,node_jettons_json,node_collections_json,node_readme toneAmber
class node_review_parser,node_review_readers,node_asset_model,node_review_output,node_review_lists,node_dex_services,node_ton_api toneMint
class node_contributor,node_ton_labels toneIndigo
```

## Components

### Catalog generation

- [Catalog generator](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/generator.py): `generator.py`
- [DEX importers](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/dexes.py): `dexes.py`
- [Address normalization](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/utlis.py): `utlis.py`

### Asset registry

- [Account catalogs](https://github.com/fahim-web-and-app-dev/ton-assets/tree/main/accounts): `accounts`
- [Jetton catalogs](https://github.com/fahim-web-and-app-dev/ton-assets/tree/main/jettons): `jettons`
- [Collection catalogs](https://github.com/fahim-web-and-app-dev/ton-assets/tree/main/collections): `collections`
- [Accounts index](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/accounts.json): `accounts.json`
- [Jettons index](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/jettons.json): `jettons.json`
- [Collections index](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/collections.json): `collections.json`
- [Asset directory README](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/README.md): `README.md`

### Candidate review

- [Candidate scanner](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/parser.py): `parser.py`
- [Known and skip lists](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/to_review/readers.py): `to_review/readers.py`
- [Candidate asset record](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/to_review/models.py): `to_review/models.py`
- [Review presenter](https://github.com/fahim-web-and-app-dev/ton-assets/blob/main/to_review/presenter.py): `to_review/presenter.py`
- [Review lists](https://github.com/fahim-web-and-app-dev/ton-assets/tree/main/to_review): `to_review`

### Other components

- **Contributors**
- **ton-labels assets**
- **DEX and token APIs**
- **TON API**

## Connections

- Contributors → Account catalogs: maintains (evidence: `README.md`)
- Contributors → Jetton catalogs: maintains (evidence: `README.md`)
- Contributors → Collection catalogs: maintains (evidence: `README.md`)
- Catalog generator → DEX importers: fetches assets (evidence: `generator.py`)
- Catalog generator → DEX and token APIs: requests catalog data
- Catalog generator → Address normalization: normalizes addresses (evidence: `generator.py`)
- Catalog generator → Account catalogs: merges YAML (evidence: `generator.py`)
- Catalog generator → Jetton catalogs: reads and writes YAML (evidence: `generator.py`)
- Catalog generator → Collection catalogs: reads YAML (evidence: `generator.py`)
- Catalog generator → Accounts index: writes index (evidence: `generator.py`)
- Catalog generator → Jettons index: writes index (evidence: `generator.py`)
- Catalog generator → Collections index: writes index (evidence: `generator.py`)
- Catalog generator → Asset directory README: renders directory (evidence: `generator.py`)
- Candidate scanner → Known and skip lists: loads address lists (evidence: `parser.py`)
- Candidate scanner → Address normalization: normalizes addresses (evidence: `parser.py`)
- Candidate scanner → Review lists: reads and appends (evidence: `parser.py`)
- Candidate scanner → ton-labels assets: scans asset JSON (evidence: `parser.py`)
- Candidate scanner → TON API: checks account interfaces (evidence: `parser.py`)
- Candidate scanner → Candidate asset record: creates records (evidence: `parser.py`)
- Candidate scanner → Review presenter: generates review outputs (evidence: `parser.py`)
- Known and skip lists → Address normalization: normalizes addresses (evidence: `to_review/readers.py`)
- Review presenter → Review lists: appends blacklist (evidence: `to_review/presenter.py`)
