Files
pezkuwi-telegram-miniapp/supabase/functions/check-deposits/ton.ts
T
SatoshiQaziMuhammed e0d56a5fb5 fix(check-deposits): count only TON transfers sent to the deposit address (#38)
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.
2026-10-18 19:48:14 +04:00

14 lines
449 B
TypeScript

// A deposit address's event feed also carries the transfers it sends, such as
// sweeps to the hot wallet. Only a transfer whose recipient is the deposit
// address itself is a deposit.
export interface TonJettonTransfer {
recipient?: { address?: string };
}
export function isIncomingTonTransfer(
transfer: TonJettonTransfer | undefined,
depositRawAddress: string
): boolean {
return transfer?.recipient?.address === depositRawAddress;
}