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
It's working fine locally using npm run dev, but it fails when I deploy to Vercel or send it to a web server.
Vercel URL: https://ton-swap-chi.vercel.app/
Error:
My code:
import { Buffer } from 'buffer'; window.Buffer = Buffer; // Importando as bibliotecas necessárias import { TonClient, toNano } from "@ton/ton"; import { DEX, pTON } from "@ston-fi/sdk"; // Verificando o conteúdo de DEX console.log("DEX:", DEX); (async () => { try { // Inicializando o cliente const client = new TonClient({ endpoint: "https://testnet.toncenter.com/api/v2/jsonRPC", }); // Inicializando o router usando a versão v1 const router = client.open( DEX.v2_1.Router.create( "kQALh-JBBIKK7gr0o4AVf9JZnEsFndqO0qTCyT-D-yBsWk0v" // CPI Router v1 ) ); // Inicializando o proxy para pTON usando a versão v1 const proxyTon = pTON.v2_1.create( "kQACS30DNoUQ7NfApPvzh7eBmSZ9L4ygJ-lkNWtba8TQT-Px" // pTON v1 ); // Definindo os parâmetros da transação de swap const userWalletAddress = "UQBry_ewauy7EZ8UzqQwAkQY4T402qNlvyUYyldsE4XhY-xy"; const txParams = await router.getSwapTonToJettonTxParams({ userWalletAddress: userWalletAddress, proxyTon: proxyTon, offerAmount: toNano("1"), // 1 TON askJettonAddress: "kQDLvsZol3juZyOAVG8tWsJntOxeEZWEaWCbbSjYakQpuYN5", // TestRED minAskAmount: "1", // Não menos que 1 nano TestRED queryId: 12345, }); console.log("Transaction Parameters:", txParams); // Send tx //const result = await client.net.sendTransaction(txParams); //console.log("Transaction Result:", result); // console.log("Transaction Result:", result); } catch (error) { console.error("Erro:", error); } })();
The text was updated successfully, but these errors were encountered:
This does not look like an SDK issue. More like build specific issue
Did you install the ton package according to their installation guide?
Besides that, my only other recommendation will be to check the way you build the app
Sorry, something went wrong.
No branches or pull requests
It's working fine locally using npm run dev, but it fails when I deploy to Vercel or send it to a web server.
Vercel URL:
https://ton-swap-chi.vercel.app/
Error:
My code:
The text was updated successfully, but these errors were encountered: