Overview
TUNA uses the Sui blockchain as its decentralized index layer. TheNewsRegistry smart contract is deployed as a Shared Object, making it accessible to all users without gas fees for reading.
Sui Testnet Deployment
- Package:
0xadf0a6ce11dd75d3d44930ab5bf55781801dea2bfead056eb0bb59c1aa1e9e66 - Registry:
0x68c01d2c08923d5257a5a9959d7c9250c4053dbe4641e229ccff2f35e6a3bb6d - Network: Sui Testnet (
https://fullnode.testnet.sui.io:443)
Sui Client Setup
All interactions with Sui use the official@mysten/sui.js SDK:
The
SuiClient is used for reading data. For writing transactions, you need a wallet connection (e.g., @mysten/dapp-kit).Reading the NewsRegistry
Fetching the Registry Object
The NewsRegistry is a Shared Object that can be queried by anyone:Registry Structure
The NewsRegistry contains several key fields:Extracting Blob IDs
Articles are stored in chronological order. To get the most recent articles:Writing Transactions
TUNA provides several transaction builders insrc/lib/sui.ts for user interactions:
Tipping an Article
Posting Comments
TUNA supports three types of comments:1. Short Text Comments (≤280 chars)
1. Short Text Comments (≤280 chars)
2. Long Text Comments (>280 chars)
2. Long Text Comments (>280 chars)
3. Media Comments
3. Media Comments
Comment Tipping and Withdrawal
Comments are individual objects that can receive tips:Transaction Utilities
TUNA provides helper functions for working with SUI amounts:Move Call Structure
All TUNA transactions follow this pattern:The
target format is package_id::module_name::function_name. All TUNA functions are in the news_registry module.Querying Engagement Data
Article engagement (tips, comments) is stored in the registry’sengagement_map:
Gas Considerations
- Reading: Free! No gas required for querying Shared Objects
- Tipping: Gas + tip amount (typically ~0.001 SUI gas)
- Commenting: Gas only (typically ~0.001-0.002 SUI)
- Uploading to Walrus: Free on testnet, may have costs on mainnet
Walrus upload costs are handled by the Walrus network, not Sui gas fees.
React Integration
TUNA uses@tanstack/react-query for data fetching:
useLatestNews hook automatically:
- Fetches the registry from Sui
- Extracts blob IDs
- Fetches content from Walrus in parallel
- Merges engagement data
- Caches results for 30 seconds
Next Steps
Walrus Storage
Learn how content is stored
NewsRegistry Contract
Understand the Move contract
Integration Guide
Build with TUNA
