Skip to content

Instantly share code, notes, and snippets.

@bogoslavskiy
Created July 26, 2022 13:02
Show Gist options
  • Save bogoslavskiy/25be669b235f8733c0f1868263115b3a to your computer and use it in GitHub Desktop.
Save bogoslavskiy/25be669b235f8733c0f1868263115b3a to your computer and use it in GitHub Desktop.
// в компоненте
const walletStore = useWallet();
const unlockVault = useUnlockVault();
// в коллбеке
const wallet = walletStore.vault.tonWallet;
const vault = await unlockVault(); // Показываем ввод пина и ждем анлока
const secretKey = await vault.getTonPrivateKey(); // достаем приватный ключ
const seqno = await wallet.methods.seqno().call();
const transfer = wallet.methods.transfer({
amount: '10000000', // Сюда эмаунт из инпута в нано
payload: '', // Сюда комментарий из инпута (если он есть) прям строкой
toAddress: address, // Сюда адрес куда отправлять
sendMode: 3, // Это код операции, он должен быть 3 числом
seqno: seqno ?? 0, // Это не знаю для чего, но оно тут должно быть в таком виде
secretKey,
});
const response = await transfer.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment