$ show tonwhales/wallet
This repository is the Tonhub Wallet, a non‑custodial mobile cryptocurrency wallet for the TON blockchain with additional Solana support. It is a full‑featured wallet that supports multi‑account management, token transfers (jettons), staking (liquid staking, native pools), hardware wallet integration (Ledger), a dApp browser using TonConnect v2, and financial products such as the Holders card program and Changelly exchange. The application also includes an AI chat assistant for transaction markup and operations, push notifications via Firebase, and deep‑link navigation for seamless URL handling. Built using React Native and Expo, the codebase is structured around a fragment‑based screen architecture, with custom hooks and React Query for data fetching, Recoil for state management, and a centralized query key factory. Despite its breadth, the codebase exhibits well‑defined separation of concerns with reusable UI components (e.g., ItemButton, RoundButton, WImage) and data patterns (e.g., batched metadata fetching, structural sharing for transaction lists). However, there are signs of technical drift, such as hardcoded endpoints, some deprecated library usage, and platform‑specific native modules that require ongoing maintenance.
The LLM identified 3 files worth highlighting for reuse:
Builds TonConnect proof messages (including Solana support) using a chain‑agnostic interface. It encapsulates address derivation, domain binding, and cryptographic signature packing into a single, testable function. This pattern is directly reusable for any TonConnect integration and demonstrates clear separation of protocol logic from UI.
Provides a generic wrapper around Automerge CRDT for syncing JSON‑serializable values to a cloud endpoint. It handles encryption, decryption, and automatic conflict resolution via a WebSocket subscription. The pattern is reusable for any collaborative or multi‑device state that requires offline‑first sync, not just wallet metadata.
A pure function that scrubs sensitive data (seed phrases, private keys, hex/base64/base58 strings) from error logs before reporting. It uses configurable thresholds to avoid false positives and is thoroughly tested. This pattern is directly applicable to any application that needs to prevent credential leakage in error telemetry.