# obscureozy/ton-wallet-testnet architecture

> Architecture diagram of the GitHub repository obscureozy/ton-wallet-testnet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/obscureozy/ton-wallet-testnet
- Repository: https://github.com/obscureozy/ton-wallet-testnet

## Overview

##### Project type and purpose
- This is a small CLI-style wallet utility implemented in TypeScript. It provides three standalone scripts to
- Generate or import a wallet
- Query the wallet’s balance
- Send TON coins on the Testnet
- It is not a full-stack web app; it’s a command-line tool that interacts with the TON testnet via an RPC or SDK.

##### File structure
- Top-level script files:
- get-wallet.ts – create or restore a wallet
- wallet-address.ts – fetch and print the wallet’s public address
- send-tx.ts – send coins to a recipient
- Configuration:
- .env.example – template for environment variables (mnemonic, addresses, amounts)
- Support files:
- package.json – dependencies (e.g., ton-sdk, dotenv) and scripts
- README.md – usage and security notes

##### README for additional insights
- Confirms use of dotenv to inject sensitive credentials at runtime
- Emphasizes running via ts-node (on Node.js)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Developer Machine"
        direction TB
        dotenv["dotenv (.env)"]:::local
        readme["README.md"]:::local
        runtime["Node.js + ts-node"]:::runtime
        subgraph "Scripts"
            direction TB
            script1["get-wallet.ts"]:::local
            script2["wallet-address.ts"]:::local
            script3["send-tx.ts"]:::local
        end
        sdk["ton-sdk Module"]:::local
    end

    subgraph "TON Testnet"
        direction TB
        rpc["RPC Node(s)"]:::external
        chain["Blockchain Network"]:::external
    end

    dotenv -->|load env vars| runtime
    runtime -->|invoke script| script1
    runtime -->|invoke script| script2
    runtime -->|invoke script| script3

    script1 -->|uses SDK| sdk
    script2 -->|uses SDK| sdk
    script3 -->|uses SDK| sdk

    sdk -->|JSON-RPC call| rpc
    rpc -->|validate & confirm| chain
    chain -->|response| rpc
    rpc -->|response| sdk

    sdk -->|return result| script1
    sdk -->|return result| script2
    sdk -->|return result| script3
    script1 -->|console output| runtime
    script2 -->|console output| runtime
    script3 -->|console output| runtime

    click dotenv "https://github.com/obscureozy/ton-wallet-testnet/blob/main/.env.example"
    click runtime "https://github.com/obscureozy/ton-wallet-testnet/blob/main/package.json"
    click script1 "https://github.com/obscureozy/ton-wallet-testnet/blob/main/get-wallet.ts"
    click script2 "https://github.com/obscureozy/ton-wallet-testnet/blob/main/wallet-address.ts"
    click script3 "https://github.com/obscureozy/ton-wallet-testnet/blob/main/send-tx.ts"
    click readme "https://github.com/obscureozy/ton-wallet-testnet/blob/main/README.md"

    classDef local fill:#D0E8FF,stroke:#333,stroke-width:1px
    classDef runtime fill:#D0FFD0,stroke:#333,stroke-width:1px
    classDef external fill:#FFD0A0,stroke:#333,stroke-width:1px
```
