I'm trying to integrate a fee transfer to a separate wallet within the sendTransaction function using TON Connect SDK. I’ve attempted to append a fee transfer message to the messages array before sending the transaction. The code looks like this:
const messages = tx.transaction.ton.messages;
const feeAmountInNanotons = (0.01 * 1e9).toString();
// // Append the fee transfer message to the existing messages array
messages.push({
targetAddress: feeWallet,
sendAmount: feeAmountInNanotons,
payload: "",
});
// Send the transaction using TON Connect UI
await tonConnect.sendTransaction({
validUntil: Date.now() + 1000000, // Transaction validity period
messages: messages.map((message) => ({
address: message.targetAddress,
amount: message.sendAmount,
payload: message.payload,
})),
});
The transaction does not include the additional fee transfer message as expected. It seems the fee message isn’t being appended correctly, or there’s an issue with the way the SDK processes multiple messages. I need to ensure that the fee goes to the feeWallet while keeping the rest of the transaction intact.
The sendTransaction function should include both the original transaction message and the appended fee transfer message to the feeWallet address.
I'm trying to integrate a fee transfer to a separate wallet within the sendTransaction function using TON Connect SDK. I’ve attempted to append a fee transfer message to the messages array before sending the transaction. The code looks like this:
The transaction does not include the additional fee transfer message as expected. It seems the fee message isn’t being appended correctly, or there’s an issue with the way the SDK processes multiple messages. I need to ensure that the fee goes to the feeWallet while keeping the rest of the transaction intact.
The sendTransaction function should include both the original transaction message and the appended fee transfer message to the feeWallet address.
Would you guys be able to help me.