Created
July 26, 2022 13:02
-
-
Save bogoslavskiy/25be669b235f8733c0f1868263115b3a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// в компоненте | |
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