SShortSingh.
Back to feed

How to Properly Handle STON.fi Swap Failures Across All Execution Stages

0
·1 views

Developers building on STON.fi must account for swap failures at multiple distinct stages — including simulation, transaction building, wallet approval, submission, and on-chain execution — rather than treating all errors as a single generic exception. Because TON contract interactions are asynchronous, a successful TonConnect sendTransaction() call only confirms the message was broadcast, not that the swap completed successfully. Experts recommend implementing a multi-state status machine with states such as 'submitted', 'confirming', 'refunded', and 'failed' instead of relying on a simple loading flag. STON.fi's v2 integration guidance also advises against hardcoding router addresses, recommending an API-driven workflow that dynamically selects the correct router version. Pre-submission checks — including network validation, token decimals, and sufficient TON balance — are essential before opening the wallet connection.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer Builds Quote-of-the-Day MCP Server With Six Tools During AI Academy Training

Tala Saabneh, a student at NextFlows AI Academy, built a Quote-of-the-Day MCP Server as part of a team project aimed at applying Model Context Protocol concepts in practice. The server exposes six tools — three for reading and three for writing — allowing an AI client to interact with a quote dataset through well-defined interfaces. Saabneh was personally responsible for implementing the get_daily_quote and create_quote tools, while teammates Dareen and Saja handled the remaining four. The get_daily_quote tool was designed to fetch quotes from either a local dataset or an external API, with a local fallback to ensure reliability. The project was built using Node.js and TypeScript alongside the MCP SDK, giving the team hands-on experience in registering tools and handling client requests.

0
ProgrammingDEV Community ·

Why LLMs Drift Even at Temperature 0: The Floating-Point Batch Problem

Setting temperature to 0 in large language models does not guarantee deterministic outputs, as repeated identical requests can return different results. The root cause lies in floating-point arithmetic: GPU kernels reorder reduction operations based on batch shape, causing tiny numerical differences in logits that argmax then amplifies through autoregressive decoding. Because shared inference servers batch multiple users' requests together, the batch size and composition change constantly, altering internal computation paths even for byte-identical prompts. Additional factors such as mixture-of-experts routing and prefix caching further shift where compute boundaries fall, compounding the variability. Engineers are advised to test against parsed fields and behavioral invariants rather than exact output strings, since true bitwise reproducibility is only achievable on dedicated hardware running a single request at a time.

0
ProgrammingDEV Community ·

Developer Builds Open-Source, Self-Hostable File Transfer Tool as WeTransfer Alternative

A developer has launched Campsend, an open-source alternative to WeTransfer, built with Rails 8 and SQLite, allowing users to self-host their own file delivery service. The project was motivated by WeTransfer's 2025 Terms of Service update, which raised concerns about uploaded content being used for machine learning before the company reversed the changes. Campsend lets users send files to clients, brand the delivery page, track whether recipients opened or downloaded files, and point storage to their own object storage bucket. The app is designed for simplicity, requiring only a single application, database, and object storage instance — with no need for separate queues, caches, or managed databases. The source code is available on GitHub, and the developer is welcoming issues and pull requests from the community.

0
ProgrammingDEV Community ·

EU Pledges €200M to Boost Greenland's Digital and Energy Infrastructure

The European Union has announced a €200 million Global Gateway Partnership Package for Greenland, covering digital connectivity, satellite solutions, and data infrastructure for 2026–2027. European Commission President Ursula von der Leyen made the announcement in Nuuk on September 7, 2026. The package prioritises subsea cables — including the Tusass Connect project — satellite communications, and broader digital ecosystem development suited to Greenland's challenging Arctic geography. Beyond digital infrastructure, the initiative also encompasses sustainable energy, critical raw materials, education, fisheries, and tourism. Notably, while data centre feasibility will be assessed, no construction has been confirmed, and the package sets investment priorities rather than guaranteed outcomes.