0

How to implement a return to telegram after confirming a transaction in the Tonkeeper wallet?

I'm using a tonconnect-sdk and sending transactions as stated in the documentation:

connector.sendTransaction({
  validUntil: Math.floor(new Date() / 1000) + 360,
  messages: [
    {
      address: "0:b2a1ecf5545e076cd36ae516ea7ebdf32aea008caa2b84af9866becb208895ad",
      amount: "100000000"
    }
  ]
})
Pavel T.
  • 1
  • 1

1 Answers1

0

sendTransaction returns a promise, so use then() to trigger an event after the sendTransaction completed:

connector.sendTransaction({
    validUntil: 111111
    messages: [
        {
            amount: '1000000',
            address: '0:foobar'
        }
    ]
})
.then(() => {
    bot.sendMessage(chatId, `Transaction sent successfully`);
})
0stone0
  • 34,288
  • 4
  • 39
  • 64