-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add jetton processing #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…n.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this 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 jetton (token) payment processing examples for the TON blockchain, demonstrating two distinct approaches: single-wallet invoice tracking and multi-wallet unique address deposits. The implementation provides educational TypeScript examples with proper blockchain subscription mechanisms.
Key changes:
- Two jetton deposit processing patterns: invoice-based (single wallet) and unique address per user (multi-wallet)
- Reusable subscription utilities for both block-level and account-level transaction monitoring
- Configuration management with environment variable loading
- Complete project setup with TypeScript, build tools, and code formatting
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | TypeScript compiler configuration with ES2020 target and strict mode |
| package.json | Project dependencies including @ton/ton, @ton/core, and @ton/crypto libraries |
| package-lock.json | Locked dependency versions for reproducible builds |
| src/utils/config.ts | Environment variable configuration loader for API keys and network settings |
| src/subscription/block-subscription.ts | Block-level subscription for monitoring all blockchain transactions |
| src/subscription/account-subscription.ts | Account-level subscription for monitoring specific wallet transactions |
| src/deposits/jetton-unique-addresses.ts | Multi-wallet deposit tracking with unique addresses per user |
| src/deposits/jetton-invoices.ts | Single-wallet deposit tracking using invoice/UUID comments |
| README.md | Documentation covering setup, usage examples, and development scripts |
| .prettierrc, .prettierignore | Code formatting configuration |
| .gitignore | Git ignore patterns for build artifacts and editor files |
| .env.example | Example environment configuration file |
Files not reviewed (1)
- guidebook/jetton-processing/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
guidebook/jetton-processing/src/deposits/jetton-unique-addresses.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- guidebook/jetton-processing/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| } catch (error) { | ||
| // Comment parsing failed - not critical, deposit is still valid | ||
| if (error instanceof Error && !error.message.includes('slice')) { |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error check uses !error.message.includes('slice') which will log the error when the message doesn't contain 'slice'. However, the intent is likely to suppress only the expected slice-related errors and log all other unexpected errors. The logic should be error.message.includes('slice') without the negation, or the entire check should be restructured to properly filter expected vs unexpected errors.
| if (tx.outMessages.size > 0) { | ||
| return; | ||
| } |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for handling transactions with outbound messages appears incorrect. The condition if (tx.outMessages.size > 0) { return; } filters out transactions that have any outgoing messages. However, valid jetton transfer notifications to deposit wallets can have outgoing messages (e.g., for gas refunds). This filter may cause legitimate jetton deposits to be ignored. Consider removing this check or making it more specific to the actual filtering requirement.
| if (tx.outMessages.size > 0) { | |
| return; | |
| } |
No description provided.