Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tonConnectUI.sendTransaction #63

Open
lv-xiaobu opened this issue Jul 19, 2024 · 0 comments
Open

tonConnectUI.sendTransaction #63

lv-xiaobu opened this issue Jul 19, 2024 · 0 comments

Comments

@lv-xiaobu
Copy link

`import { useTonConnectUI } from '@tonconnect/ui-react';
import { Sender, SenderArguments } from '@ton/core';

export function useTonConnect(): { sender: Sender; connected: boolean } {
const [tonConnectUI] = useTonConnectUI();

return {
sender: {
send: async (args: SenderArguments) => {
tonConnectUI.sendTransaction({
messages: [
{
address: args.to.toString(),
amount: args.value.toString(),
payload: args.body?.toBoc().toString('base64'),
},
],
validUntil: Date.now() + 5 * 60 * 1000, // 5 minutes for user to approve
});
},
},
connected: tonConnectUI.connected,
};
}`
tonConnectUI.sendTransaction has a return value,
It seems that it cannot be returned if written like this
How should I modify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant