We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
const senderPrivateKey = this.privateKey; let seqno = await this.wallet.methods.seqno().call(); if (seqno === null || seqno === undefined) { seqno = 0; } const amount = TonWeb.utils.toNano(tokenAmount); const payload = await jettonWallet.createTransferBody({ jettonAmount: amount, toAddress: new TonWeb.utils.Address(toAddress), forwardAmount: TonWeb.utils.toNano("0.1"), forwardPayload: new Uint8Array([ ...new Uint8Array(4), ...new TextEncoder().encode(memo), ]), responseAddress: new TonWeb.utils.Address(process.env.WALLET_ADDRESS), }); const result = await this.wallet.methods .transfer({ secretKey: senderPrivateKey, toAddress: tokenContractAddress, amount: TonWeb.utils.toNano("0.1"), // TON for transfer fees seqno: seqno, payload: payload, sendMode: 3, }) .send(); console.log("sendToken Transaction Result:", result); return { success: true, result }; } catch (error) { console.error("Error sending token:", error.message); throw new Error(error.message); }
}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
const senderPrivateKey = this.privateKey; let seqno = await this.wallet.methods.seqno().call(); if (seqno === null || seqno === undefined) { seqno = 0; } const amount = TonWeb.utils.toNano(tokenAmount); const payload = await jettonWallet.createTransferBody({ jettonAmount: amount, toAddress: new TonWeb.utils.Address(toAddress), forwardAmount: TonWeb.utils.toNano("0.1"), forwardPayload: new Uint8Array([ ...new Uint8Array(4), ...new TextEncoder().encode(memo), ]), responseAddress: new TonWeb.utils.Address(process.env.WALLET_ADDRESS), }); const result = await this.wallet.methods .transfer({ secretKey: senderPrivateKey, toAddress: tokenContractAddress, amount: TonWeb.utils.toNano("0.1"), // TON for transfer fees seqno: seqno, payload: payload, sendMode: 3, }) .send(); console.log("sendToken Transaction Result:", result); return { success: true, result }; } catch (error) { console.error("Error sending token:", error.message); throw new Error(error.message); }
}
The text was updated successfully, but these errors were encountered: