> For the complete documentation index, see [llms.txt](https://ston-fi.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ston-fi.gitbook.io/docs/developer-section/common.md).

# Common Utilities

Shared functionality and utilities used across STON.fi products.

## Transaction Sending

Common patterns and utilities for sending transactions on TON:

* [Via TON Core](/docs/developer-section/common/transaction-sending/toncore.md) - Using @ton/ton library
* [Via TonWeb](/docs/developer-section/common/transaction-sending/tonweb.md) - Using TonWeb library
* [Via TonConnect](/docs/developer-section/common/transaction-sending/tonconnect.md) - Using TonConnect for wallet integration

These guides apply to both DEX and Omniston integrations.

## Best Practices

### Transaction Management

* Always handle transaction failures gracefully
* Implement proper retry logic with exponential backoff
* Monitor transaction status until confirmation

### Gas Optimization

* Batch operations when possible
* Use appropriate gas limits
* Consider TON's async nature in your design

### Security

* Validate all inputs before sending transactions
* Never store private keys in code
* Use secure wallet connections (TonConnect)

### Error Handling

* Catch and handle specific error types
* Provide meaningful error messages to users
* Log errors for debugging

## TON Blockchain Specifics

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
