Closed kvizyx closed 4 months ago
Hi, to make raw address you could do this way:
raw := fmt.Sprintf("%d:%x", internalMessage.SrcAddr.Workchain(), internalMessage.SrcAddr.Data())
internalMessage.SrcAddr.String()
returns user friendly address
I think i didn't put it that way. When user want to detect transactions from some address and send it to the app (0QAqow_s3o17yQk8h6QXVvE0yw_7IVzohVK1qcHfTCx_wVe_
for example) then i need to compare SrcAddr of each transaction to this address to detect whether it's transaction from address that user gave to us or not. But when i get the address from the transaction it's a bit different from one that user sent (EQAqow_s3o17yQk8h6QXVvE0yw_7IVzohVK1qcHfTCx_wbHw
for the address shown in the example above) so it's a problem for me how to compare them. If anything, I'm new to TON, so I apologize in advance if this is a stupid question :)
This is because address flags, your address which starts from 0 is address with testnet and nonboubce flags, you could set flag to src address too using SetTestnetOnly(true) and SetBounce(false), then call String(), then they should be the same.
Thanks!
Hi! In a nutshell, i'm building an app that detect transactions from specific addresses set by user so i need to compare user-friendly addresses (that user send to app) with raw addresses from subscription channel:
How can i do this comparison with tonutils or i have to implement it on my own?