Common Utilities
Shared utilities and patterns used across STON.fi — transaction sending, best practices, and TON-specific guidance
Last updated
Shared utilities and patterns used across STON.fi — transaction sending, best practices, and TON-specific guidance
Shared functionality and utilities used across STON.fi products.
Common patterns and utilities for sending transactions on TON:
Via TON Core - Using @ton/ton library
Via TonWeb - Using TonWeb library
Via TonConnect - Using TonConnect for wallet integration
These guides apply to both DEX and Omniston integrations.
Always handle transaction failures gracefully
Implement proper retry logic with exponential backoff
Monitor transaction status until confirmation
Batch operations when possible
Use appropriate gas limits
Consider TON's async nature in your design
Validate all inputs before sending transactions
Never store private keys in code
Use secure wallet connections (TonConnect)
Catch and handle specific error types
Provide meaningful error messages to users
Log errors for debugging
Understanding TON's unique features is crucial:
Async Messages: Transactions are processed asynchronously
Sharding: Different contracts may be on different shards
Message Routing: Internal messages between contracts
Gas Model: Different from Ethereum-style blockchains
Last updated