xssnick / tonutils-go

TON SDK Library in pure Golang for interacting with The Open Network ecosystem using native protocols, such as ADNL, RLDP and etc.
Apache License 2.0
464 stars 95 forks source link

api.SubscribeOnTransactions cannot monitor transactions with ton transfer 0 #214

Closed daewoochen closed 1 month ago

daewoochen commented 1 month ago

Hi,

  1. I sent a ton transfer transaction bounce := false transfer, _ := w.BuildTransfer(to, tlb.MustFromTON("0"), bounce, "test") tx, _, _ := w.SendWaitTransaction(ctx, transfer)
  2. When monitoring the to address to use the following code, I cannot receive tx, but I can see the transaction in explorer go api.SubscribeOnTransactions(context.Background(), treasuryAddress, lastProcessedLT, transactions) for tx := range transactions {}
  3. But when I modify the sent ton amount to not be 0, I can monitor the transaction, so how should I modify code to monitor the transaction with ton transfer of 0? Thank you!
xssnick commented 1 month ago

Hi, could you please share transaction (explorer url)?

daewoochen commented 1 month ago

Hi, could you please share transaction (explorer url)?

transfer 0 ton: https://testnet.tonviewer.com/transaction/0193b117167bd24647b0b898da8bab43690f5e09b72a1c389202142bfe4790af

xssnick commented 1 month ago

It looks like you using tx.String(), it prints nothing if amount is 0, but transaction exists itself and you can use it, just print something like tx.LT or whatever you need :)

I will fix this print of tx data in the next version.

daewoochen commented 1 month ago

Yes, I used tx.String() to print the message, this problem has been solved, thanks!