Skip to content

Conversation

@ignaciosantise
Copy link
Collaborator

@ignaciosantise ignaciosantise commented Oct 14, 2025

This pull request introduces support for the TON blockchain to the React Native CLI wallet and refactors the way blockchain networks and signing methods are defined and managed. It also updates several dependencies, applies important patches for cryptographic primitives, and adds new modal components for TON-specific actions. The changes are grouped below by theme.

TON Blockchain Integration:

  • Added constants and configuration for TON chains, signing methods, and network images in the new Ton.ts file.
  • Integrated TON wallet creation and restoration into the wallet initialization flow in useInitializeWalletKit.ts. [1] [2]
  • Added modal components and event handling for TON-specific actions (ton_sendMessage, ton_signData) in the modal system and event manager. [1] [2] [3]

Blockchain Network Refactoring:

  • Moved EIP-155 and SUI chain definitions, network images, and signing methods to dedicated files (Eip155.ts, Sui.ts), improving modularity and maintainability. [1] [2]
  • Updated references throughout the codebase to use the new constants and helpers for chain logos and signing methods. [1] [2]

Dependency Updates and Patches:

  • Upgraded key dependencies (@reown/walletkit, @walletconnect/react-native-compat, ethers, and added TON-related packages) in package.json.
  • Replaced and updated patches for @ethersproject/pbkdf2 and added a patch for @ton/crypto-primitives and bip39 to improve compatibility and use native crypto implementations. [1] [2] [3]

Configuration and Miscellaneous:

  • Added a placeholder for a TON Center API key in .env.example for future TON network interactions.
  • Removed an unused symmetric key prefix constant from storage constants.
  • Removed react-native-permissions and replaced with built-in permission handlers from camera package

These changes lay the groundwork for TON support and improve the modularity and maintainability of blockchain integrations in the wallet.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces comprehensive TON blockchain support to the React Native CLI wallet, including wallet creation, transaction signing, and data signing capabilities. The implementation follows established patterns for EVM and SUI support while refactoring blockchain configurations for better modularity.

  • Added TON wallet integration with keypair generation, message signing, and transaction handling
  • Refactored blockchain network definitions into dedicated constant files for improved organization
  • Updated dependency versions and added TON-specific packages with necessary patches

Reviewed Changes

Copilot reviewed 33 out of 38 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/utils/TypesUtil.ts Simplified Chain type to use chainId/namespace instead of legacy structure
src/utils/TonWalletUtil.ts Added TON wallet creation and management utilities
src/utils/TonRequestHandlerUtil.ts Implemented TON request handling for signing and transactions
src/utils/PresetsUtil.ts Refactored to use modular chain constants and updated chain data lookup
src/lib/TonLib.ts Core TON blockchain library with signing and transaction capabilities
src/constants/ New modular chain configuration files for TON, SUI, and EIP155
src/modals/SessionTon*.tsx Added TON-specific modal components for user interactions
src/hooks/useWalletKitEventsManager.ts Integrated TON method handling into event system
Various modal files Added error handling and improved chain rendering safety

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ignaciosantise ignaciosantise changed the title feat: added TON support feat: added TON support + performance improvements Oct 14, 2025
@ignaciosantise ignaciosantise merged commit ec01db3 into main Oct 15, 2025
4 checks passed
@ignaciosantise ignaciosantise deleted the feat/ton branch October 15, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants