mirror of
https://github.com/pezkuwichain/pezkuwi-telegram-miniapp.git
synced 2026-11-24 19:39:57 +00:00
The TON check walked every jetton transfer in the deposit address's event feed, including the ones it sends. An outgoing transfer whose comment matched a user's deposit code would have been credited to that user; the 2026-02-13 sweep of 41.9 USDT was reported as an unknown-memo deposit on every run. Resolve the configured address to its raw form and skip any transfer whose recipient is not the deposit address.
22 lines
847 B
TypeScript
22 lines
847 B
TypeScript
import { assert, assertFalse } from 'jsr:@std/assert@1';
|
|
import { isIncomingTonTransfer } from './ton.ts';
|
|
|
|
const DEPOSIT = '0:c35f028ad76a7003bcb164decaec61230a77ad05c724856409e9445014b0b7be';
|
|
|
|
Deno.test('a transfer to the deposit address is a deposit', () => {
|
|
assert(isIncomingTonTransfer({ recipient: { address: DEPOSIT } }, DEPOSIT));
|
|
});
|
|
|
|
Deno.test('a sweep out of the deposit address is not a deposit', () => {
|
|
// 2026-02-13: 41.9 USDT sent from the deposit address, no memo.
|
|
const sweep = {
|
|
recipient: { address: '0:ef28248f185d0000000000000000000000000000000000000000000000000000' },
|
|
};
|
|
assertFalse(isIncomingTonTransfer(sweep, DEPOSIT));
|
|
});
|
|
|
|
Deno.test('a transfer with no recipient is not a deposit', () => {
|
|
assertFalse(isIncomingTonTransfer({}, DEPOSIT));
|
|
assertFalse(isIncomingTonTransfer(undefined, DEPOSIT));
|
|
});
|