Skip to content
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

how to get jetton USDT transfer detail by transaction hash? #209

Open
zy166317 opened this issue Jul 1, 2024 · 1 comment
Open

how to get jetton USDT transfer detail by transaction hash? #209

zy166317 opened this issue Jul 1, 2024 · 1 comment

Comments

@zy166317
Copy link

zy166317 commented Jul 1, 2024

No description provided.

@xssnick
Copy link
Owner

xssnick commented Jul 12, 2024

Hi, to get transaction you need address, lt and hash and use method GetTransaction or ListTransactions, then you can parse it same as here

if tx.IO.In != nil && tx.IO.In.MsgType == tlb.MsgTypeInternal {
ti := tx.IO.In.AsInternal()
src := ti.SrcAddr
// verify that sender is our jetton wallet
if ti.SrcAddr.Equals(treasuryJettonWallet.Address()) {
var transfer jetton.TransferNotification
if err = tlb.LoadFromCell(&transfer, ti.Body.BeginParse()); err == nil {
// convert decimals to 6 for USDT (it can be fetched from jetton details too), default is 9
amt := tlb.MustFromNano(transfer.Amount.Nano(), 6)
// reassign sender to real jetton sender instead of its jetton wallet contract
src = transfer.Sender
log.Println("received", amt.String(), "USDT from", src.String())
}
}
// show received ton amount
log.Println("received", ti.Amount.String(), "TON from", src.String())
}

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

No branches or pull requests

2 participants