Skip to main content

Overview

TUNA provides strongly-typed interfaces for all data structures used in the platform. These types ensure type safety when working with articles, comments, and Walrus content.

NewsArticle

Represents a news article in the TUNA platform.
interface NewsArticle {
  id: string;
  blob_id: string;
  title: string;
  category: string;
  source: 'twitter' | 'rss' | 'onchain';
  timestamp: number;
  content?: string;
  summary?: string;
  url?: string;
  image?: string;
  author?: string;
  totalTips: number;
  tipCount: number;
  commentCount: number;
}

Required Fields

id
string
required
Unique identifier for the article
blob_id
string
required
Walrus blob ID containing the full article content
title
string
required
Article title
category
string
required
Article category (e.g., ‘DeFi’, ‘Gaming’, ‘NFT’, ‘Dev’, ‘Governance’, ‘General’)
source
'twitter' | 'rss' | 'onchain'
required
The source of the article
timestamp
number
required
Unix timestamp when the article was published
totalTips
number
required
Total tips received in MIST (1 SUI = 1,000,000,000 MIST)
tipCount
number
required
Number of tips received
commentCount
number
required
Number of comments on the article

Optional Fields

content
string
Full article content (fetched from Walrus)
summary
string
Article summary or excerpt
url
string
Original article URL (for RSS/Twitter sources)
image
string
Article featured image URL
author
string
Article author name

Comment

Represents a comment on an article.
interface Comment {
  id: string;
  blob_id: string;
  author: string;
  preview_text: string;
  content_blob_id: string | null;
  comment_type: 'text' | 'text_long' | 'media';
  timestamp: number;
  tips_received: number;
  fullContent?: {
    text: string;
    media?: Array<{
      type: 'image' | 'video';
      url: string;
      caption?: string;
    }>;
  };
}

Required Fields

id
string
required
Unique identifier for the comment
blob_id
string
required
The article blob ID this comment belongs to
author
string
required
Wallet address of the comment author
preview_text
string
required
Preview text of the comment (up to 280 characters)
content_blob_id
string | null
required
Walrus blob ID for long text or media content (null for short text comments)
comment_type
'text' | 'text_long' | 'media'
required
Type of comment:
  • text: Short text comment (≤280 chars)
  • text_long: Long text comment stored in Walrus
  • media: Comment with attached media (images/videos)
timestamp
number
required
Unix timestamp when the comment was posted
tips_received
number
required
Total tips received in MIST

Optional Fields


ArticleEngagement

Aggregated engagement metrics for an article.
interface ArticleEngagement {
  totalTips: number;
  tipCount: number;
  commentCount: number;
}
totalTips
number
Total tips received in MIST
tipCount
number
Number of tips received
commentCount
number
Number of comments

WalrusArticleContent

Structure for article content stored in Walrus.
interface WalrusArticleContent {
  title: string;
  content: string;
  summary?: string;
  source: string;
  url?: string;
  image?: string;
  author?: string;
  timestamp: number;
}
title
string
required
Article title
content
string
required
Full article content (can be HTML or plain text)
source
string
required
Article source identifier
timestamp
number
required
Unix timestamp
summary
string
Article summary
url
string
Original article URL
image
string
Article image URL
author
string
Author name

WalrusCommentContent

Structure for comment content stored in Walrus.
interface WalrusCommentContent {
  text: string;
  media?: Array<{
    type: 'image' | 'video';
    url: string;
    caption?: string;
  }>;
  timestamp: number;
}
text
string
required
Full comment text
timestamp
number
required
Unix timestamp when the comment was created
media
Array
Array of media attachments (for media-type comments)

Build docs developers (and LLMs) love