Skip to content

ismaildalgatov/ton-devtools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

ton-devtools

Python tooling monorepo for the ICP.

Packages

Package PyPI Description
ton-devtools-auth-sdk PyPI Server-side TON Connect 2.0 proof verification
ton-devtools-pytest PyPI pytest plugin for declarative ICP integration testing
ton-devtools-rpc-mock PyPI Deterministic Toncenter API v2 emulator (TRMS)

Structure

ton-devtools/
├── packages/
│   ├── ton-devtools-auth-sdk/           # PyPI: ton-devtools-auth-sdk
│   │   ├── ton_devtools_auth/
│   │   │   ├── models.py          # Pydantic v2: TonProof, TonAccount
│   │   │   ├── nonce.py           # NonceManager + storage backends
│   │   │   ├── crypto.py          # TonAuthManager — ICP §5.2 ed25519 verify
│   │   │   ├── rpc.py             # resolve_public_key — ICP §5.3
│   │   │   └── authenticator.py   # ICPAuthenticator — full pipeline
│   │   └── pyproject.toml
│   │
│   ├── ton-devtools-pytest/       # PyPI: ton-devtools-pytest
│   │   ├── ton_devtools_pytest/
│   │   │   ├── plugin.py          # pytest11 entry point
│   │   │   ├── fixtures.py        # ICPHarness: create_mock_user, .client
│   │   │   ├── mock_provider.py   # MockWallet (real ed25519), MockUser
│   │   │   └── asserts.py         # assert_authenticated, assert_unauthorized
│   │   └── pyproject.toml
│   │
│   └── ton-devtools-rpc-mock/           # PyPI: ton-devtools-rpc-mock
│       ├── ton_devtools_rpc_mock/
│       │   ├── server.py          # FastAPI app — Toncenter API v2 emulator
│       │   ├── __init__.py        # public re-exports
│       │   └── __main__.py        # CLI: ton-devtools-rpc-mock --port 8080 --control
│       ├── Dockerfile
│       └── pyproject.toml
│
└── pyproject.toml                 # root: ruff + mypy + pytest config

Quick start

# Install all packages from source
pip install -e packages/ton-devtools-auth-sdk
pip install -e packages/ton-devtools-rpc-mock
pip install -e packages/ton-devtools-pytest

# Run all tests
pytest

# Start the mock server
ton-devtools-rpc-mock --port 8080 --control

The three-package stack

Test framework
    │
    ├─ ton-devtools-pytest   create_mock_user(), icp_harness, icp_strict_mode
    │       │
    │       └─ ton-devtools-auth-sdk  ICPAuthenticator, TonAuthManager, NonceManager
    │               │
    │               └─ ton-devtools-rpc-mock  POST /jsonRPC  (replaces live Toncenter node)
    │
    └─ ICP Core Service under test

License

MIT — see LICENSE in each package directory.

About

Production-ready testing utilities and SDK for TON ecosystem. Includes a deterministic Toncenter API v2 mock server, PEP 420 namespace authentication SDK, and declarative pytest fixtures.

Topics

Resources

Stars

Watchers

Forks

Contributors