-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add toncoin processing #7
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
Open
Kaladin13
wants to merge
15
commits into
main
Choose a base branch
from
processing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
70d9f56
init deposit with invoices
Kaladin13 28cfb0d
readme
Kaladin13 0afa976
lint
Kaladin13 adcaaa1
persist lt+hash
Kaladin13 4c46c2c
add folders and readme
Kaladin13 6e0b4d1
scripts
Kaladin13 fcc3616
implement unique
Kaladin13 2c2a472
Update guidebook/payment-processing/src/subscription/BlockSubscriptio…
Kaladin13 c1e2cf6
add jettons multi-address
Kaladin13 bb42f62
add jetton deposits
Kaladin13 c76b996
fixes
Kaladin13 8a11691
fix opcode
Kaladin13 72516f5
Merge branch 'main' into processing
Kaladin13 80ffb4b
chore: scope processing branch to toncoin-processing only
Kaladin13 269386b
fix
Kaladin13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Toncoin Payment Processing Configuration | ||
|
|
||
| # Network Configuration | ||
| # Set to "false" for mainnet, leave as "true" or omit for testnet | ||
| IS_TESTNET=true | ||
|
|
||
| # TonCenter API Key | ||
| # Get your API key at https://toncenter.com (mainnet) or https://testnet.toncenter.com (testnet) | ||
| # Or run your own API: https://github.com/toncenter/ton-http-api | ||
| API_KEY=your_api_key_here | ||
|
|
||
| # Wallet Address | ||
| # Your wallet address that will receive deposits (for single-wallet examples) | ||
| # Or your HOT wallet address (for multi-wallet examples) | ||
| WALLET_ADDRESS=UQB22lH8P_P2OitCe8UYRxpuDF5GVqCfYTL7PDz3OzbuHebu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| node_modules | ||
| temp | ||
| build | ||
| dist | ||
| .DS_Store | ||
| package.ts | ||
|
|
||
| # VS Code | ||
| .vscode/* | ||
| .history/ | ||
| *.vsix | ||
|
|
||
| # IDEA files | ||
| .idea | ||
|
|
||
| # VIM | ||
| Session.vim | ||
| .vim/ | ||
|
|
||
| # Other private editor folders | ||
| .nvim/ | ||
| .emacs/ | ||
| .helix/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| build | ||
Kaladin13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "printWidth": 120, | ||
| "tabWidth": 4, | ||
| "singleQuote": true, | ||
| "bracketSpacing": true, | ||
| "semi": true | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Toncoin Payment Processing Examples | ||
|
|
||
| Educational TypeScript examples demonstrating Toncoin payment processing on the TON blockchain. | ||
|
|
||
| ## Libraries Used | ||
|
|
||
| - [@ton/ton](https://github.com/ton-org/ton) - High-level TON blockchain API client | ||
| - [@ton/core](https://github.com/ton-org/ton-core) - Core primitives for TON blockchain | ||
| - [@ton/crypto](https://github.com/ton-org/ton-crypto) - Cryptographic primitives for TON | ||
|
|
||
| ## Examples | ||
|
|
||
| ### 1. Single Wallet with Invoices (`src/deposits/invoices.ts`) | ||
|
|
||
| Demonstrates accepting Toncoin deposits to a single wallet using unique text comments (UUIDs) to identify each payment. | ||
|
|
||
| **Use case**: Payment processing where each payment is tracked by a unique identifier in the transaction comment. | ||
|
|
||
| ### 2. Multi-Wallet Deposits (`src/deposits/unique-addresses.ts`) | ||
|
|
||
| Demonstrates accepting Toncoin deposits where each user has their own unique deposit wallet that forwards funds to a master HOT wallet. | ||
|
|
||
| **Use case**: Exchange or service where users need permanent deposit addresses. | ||
|
|
||
| ## Setup | ||
|
|
||
| 1. Install dependencies: | ||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| 2. Configure your environment: | ||
| - Copy `.env.example` to `.env` | ||
| - Set your API key and wallet address | ||
| - Choose mainnet or testnet | ||
|
|
||
| 3. Run an example: | ||
| ```bash | ||
| # Single wallet invoices example | ||
| npm start | ||
|
|
||
| # Multi-wallet example | ||
| npm run start:unique | ||
| ``` | ||
|
|
||
| ## Development Scripts | ||
|
|
||
| - `npm start` - Run the single-wallet invoices example | ||
| - `npm run start:unique` - Run the multi-wallet deposits example | ||
| - `npm run build` - Type-check the project (does not produce executable output) | ||
| - `npm run format` - Format code with Prettier | ||
|
|
||
| ## ⚠️ Educational Use Only | ||
|
|
||
| These examples are for learning purposes. Do not deploy to production without: | ||
| - Thorough security review | ||
| - Proper error handling | ||
| - Database persistence | ||
| - Monitoring and alerting | ||
| - Rate limiting and retry strategies |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
.gitignorefile is missing the.enventry. While.env.exampleis provided for configuration, the actual.envfile containing sensitive API keys and wallet addresses should be excluded from version control to prevent credential exposure.