Skip to content

Add deposit monitoring script for HighloadWalletV3#21

Merged
4 commits merged intomasterfrom
LucasL160-patch-12
Jan 25, 2026
Merged

Add deposit monitoring script for HighloadWalletV3#21
4 commits merged intomasterfrom
LucasL160-patch-12

Conversation

@ghost
Copy link
Copy Markdown

This script monitors deposits for a specified contract address, polling for incoming transactions and handling deposits with a placeholder function.

This script monitors deposits for a specified contract address, polling for incoming transactions and handling deposits with a placeholder function.
Copilot AI review requested due to automatic review settings January 25, 2026 04:20
Copy link
Copy Markdown

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 adds a template TypeScript monitoring script for tracking deposits to HighloadWalletV3 contracts. The script provides a skeleton implementation that computes contract addresses from configuration and sets up polling infrastructure, though the actual RPC interaction and transaction processing logic remains to be implemented.

Changes:

  • Adds a new monitoring script template with configuration via environment variables
  • Includes placeholder functions for deposit detection and transaction polling
  • Sets up a 15-second polling interval with basic error handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


setInterval(() => {
pollOnce().catch(console.error);
}, 15_000);
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

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

The polling starts only after the first 15-second interval. Consider calling pollOnce() immediately after the setInterval to begin monitoring right away when the script starts, rather than waiting for the first interval to elapse.

Suggested change
}, 15_000);
}, 15_000);
// Perform an initial poll immediately so monitoring starts without waiting for the first interval.
pollOnce().catch(console.error);

Copilot uses AI. Check for mistakes.
import { HighloadWalletV3Code } from '../wrappers/compiled';
import { highloadWalletV3ConfigToCell } from '../wrappers/HighloadWalletV3';

const RPC_URL = process.env.RPC_URL || 'https://net.ton.dev';
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

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

'RPC_URL' is assigned a value but never used.

Copilot uses AI. Check for mistakes.
updatescripts/monitor -deposts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 25, 2026 04:30
LucasL160 and others added 2 commits January 24, 2026 22:30
updates to TON RPC endpoint

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
i added wrong info to wrong repo, this change is to fix scripts to correct repo structure

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented Jan 25, 2026

@LucasL160 I've opened a new pull request, #23, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import { HighloadWalletV3Code } from '../wrappers/compiled';
import { beginCell } from '@ton/core';


Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

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

The RPC_URL default 'https://net.ton.dev' may not be a valid or current TON RPC endpoint. This should be verified and updated to a known, working endpoint (such as from the TON documentation), or the script should require this environment variable to be set explicitly to avoid confusion.

Copilot uses AI. Check for mistakes.

const RPC_URL = process.env.RPC_URL || 'https://net.ton.dev';
const WORKCHAIN = Number(process.env.WORKCHAIN || 0);
const SUBWALLET_ID = Number(process.env.SUBWALLET_ID || 0x10ad);
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

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

The SUBWALLET_ID default value 0x10ad (4269) appears to be an arbitrary constant. For better clarity in a template script, consider adding a comment explaining what this value represents and whether users should customize it, or use a more conventional default like 0.

Suggested change
const SUBWALLET_ID = Number(process.env.SUBWALLET_ID || 0x10ad);
// Default subwallet id for this template; override via SUBWALLET_ID env var for your deployment.
const SUBWALLET_ID = Number(process.env.SUBWALLET_ID || 0);

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +33
async function onDeposit(tx: any) {
// TODO: implement mapping from tx -> user (memo, query_id, off-chain mapping)
console.log('Deposit detected:', tx);
// Example: credit internal DB, notify user, etc.
}

Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

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

'onDeposit' is defined but never used.

Suggested change
async function onDeposit(tx: any) {
// TODO: implement mapping from tx -> user (memo, query_id, off-chain mapping)
console.log('Deposit detected:', tx);
// Example: credit internal DB, notify user, etc.
}

Copilot uses AI. Check for mistakes.

console.log('Monitoring deposits for address:', address.toString({ urlSafe: true, bounceable: true }));

async function onDeposit(tx: any) {
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

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

Unexpected any. Specify a different type.

Suggested change
async function onDeposit(tx: any) {
async function onDeposit(tx: unknown) {

Copilot uses AI. Check for mistakes.
@ghost ghost merged commit 61fc350 into master Jan 25, 2026
5 checks passed
@ghost
Copy link
Copy Markdown
Author

Copilot open a new pull request to apply changes based on the comments in this thread

This pull request was closed.
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