-
Hi, how can I set seqno when make transfer from wallet? Do I need to prepare Cell by myself and external message with it? |
Beta Was this translation helpful? Give feedback.
Answered by
xssnick
Nov 2, 2023
Replies: 1 comment 1 reply
-
Hi, you could use Example for V4R2: w, err := wallet.FromSeed(api, words, wallet.V4R2)
if err != nil {
log.Fatalln("FromSeed err:", err.Error())
return
}
// hooking seqno fetcher
w.GetSpec().(*wallet.SpecV4R2).SetCustomSeqnoFetcher(func() uint32 {
// get seqno from db or something
return 77 // seqno
})
// doing transfers as usual, our hook will be called each time when seqno is needed
transfer, err := w.BuildTransfer(addr, tlb.MustFromTON("0.003"), bounce, "Hello from tonutils-go!")
if err != nil {
log.Fatalln("Transfer err:", err.Error())
return
} If you are using wallet V3, then it will be |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lavrd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, you could use
SetCustomSeqnoFetcher
hook of wallet spec. It is exists for every wallet version with seqno.Example for V4R2:
If you are using wallet V3, then it will be