Logo van Accessing Data

Accessing Data

Organisatie
MystenLabs
accessing-data

Explains how to read data from Sui and which surface to use — gRPC, GraphQL RPC, the Archival Store, a custom sui-indexer-alt pipeline, or Walrus. Use when the user asks how to fetch a balance, owned objects, coins, NFTs, transactions or events; subscribe to on-chain activity in real time; read a historical or pruned object version; build a leaderboard, explorer, dashboard or analytics pipeline; where to store an image, video or multi-MB file "on Sui"; what the storage fund is; or how to fix code using SuiClient, getFullnodeUrl, JSON-RPC, getBalance, getOwnedObjects or getTransactionBlock. Also use when the request mentions SuiGrpcClient, SuiGraphQLClient, sui-indexer-alt, Archival Store, or Walrus.

Overzicht

UitgeverMystenLabs
Repositoryskills
Skillnaamaccessing-data
Sterren
21
Forks
12
Meegeleverde bestanden
7
LicentieApache-2.0
Links
  • Instructies in Markdown

    Een SKILL.md-bestand dat het model laadt wanneer nodig, zodat het alleen tokens kost als een verzoek er daadwerkelijk bij past.

  • Werkt met elk LLM

    AI-skills zijn gewone Markdown, geen aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • 7 meegeleverde bestanden

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. Bestanden zijn alleen-lezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door MystenLabs op GitHub. Lees de broninhoud voordat je de skill installeert.

Installatie

Installeer de AI-skill Accessing Data in TypingMind om deze met elke LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map — het leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/MystenLabs/skills/tree/main/accessing-data
  4. Schakel de skill in elke chat in waarin je deze beschikbaar wilt hebben.
Plug-ins → Skills → Nieuwe skill → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/MystenLabs/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/accessing-data .claude/skills/accessing-data
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Accessing Data in een willekeurige chat in TypingMind in en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek erbij past, laadt het model zelf de volledige instructies — je hoeft de skill nooit handmatig aan te roepen en deze kost pas tokens wanneer je de skill daadwerkelijk gebruikt.

Het model laadt Accessing Data automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Accessing Data niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Accessing Data on Sui

Two facts to state in every answer that touches them:

  1. JSON-RPC is deprecated. Sui Foundation mainnet full nodes disable it the week of July 27, 2026; code decommission by mid-October 2026. New code uses gRPC or GraphQL RPC. SuiJsonRpcClient survives only as a short-term migration stopgap.
  2. gRPC, GraphQL RPC, and the Archival Store are generally available. Never describe them as beta or experimental.

MCP tool: if https://sui.mcp.kapa.ai is available, query it to verify anything not covered here.

Quick start

ts
import { SuiGrpcClient } from '@mysten/sui/grpc';

const client = new SuiGrpcClient({
  network: 'mainnet',
  baseUrl: '<full node gRPC URL — see grpc.md>',   // both args required
});

const balances = await client.core.listBalances({ address });
const objects  = await client.core.listOwnedObjects({ address });

Default by client type: backend / indexer / typed systems language → gRPC; frontend / wallet / dashboard / dynamic language → GraphQL RPC. Switch only when you hit a real limitation. Temporary caveats: only gRPC has subscriptions; only GraphQL has filtered pagination over historical transactions and events.


Task: read balances, coins, or owned objects from a backend

Use gRPC. Everything is under client.core.*:

ts
await client.core.listBalances({ address });                                  // all coin types
await client.core.listCoins({ address, coinType });                           // individual coins
await client.core.listOwnedObjects({ address, include: { content: true } });  // NFTs & objects
await client.core.getObject({ objectId, include: { content: true } });
await client.core.getTransaction({ digest, include: { effects: true } });

Never emit client.getBalance, client.getOwnedObjects, client.getCoins, client.getObject, or client.getTransactionBlock — those are v1 JSON-RPC names.

Task: one query feeding a multi-panel UI (wallet, dashboard)

Use GraphQL RPC (GA). It reads from the General-Purpose Indexer's Postgres, the full node, and the Archival Store, so balances + recent transactions with effects + type-filtered owned objects arrive in one round trip instead of three or more, and the client asks for exactly the fields it renders. Shape (verify field names against graphql.md or the live schema):

graphql
query Dashboard($addr: SuiAddress!) {
  address(address: $addr) {
    balances { nodes { coinType { repr } totalBalance } }
    objects(filter: { type: "0xPKG::nft::NFT" }) { nodes { address contents { json } } }
    transactionBlocks(last: 10) { nodes { digest effects { status } } }
  }
}

Do not recommend a custom indexer here — the hosted APIs cover it.

GraphQL also submits transactions and dry-runs them. Read-after-write: select result fields inside executeTransaction / simulateTransaction; that scope evaluates just after the transaction without waiting for indexing. On gRPC, await client.waitForTransaction({ digest }) first. Cross-node reads after a write are never instantly guaranteed.

Task: react to on-chain activity in real time (<1s)

Use gRPC streaming via SuiGrpcClient's subscription service (subscription_service); see grpc.md for the exact streaming call and filter arguments. The node pushes each new transaction/effect as it lands.

Do not poll getEvents or transaction lists in a loop: polling pays full query cost on every tick, adds up to a poll-interval of latency, and still misses nothing more than the stream would. Do not use GraphQL RPC here — it is request/response, not streaming.

Task: read an object as it was months ago

Full nodes prune old object versions, transactions, and checkpoints, which is why a gRPC read returns only the current version. The Archival Store (GA) retains them.

  • GraphQL RPC routes supported historical lookups to the Archival Store transparently, when the operator has configured archival backing. Without that backing, retention is only what the primary store holds.
  • gRPC does not fall back. Point the client at a separate Archival Service endpoint, which serves the standard LedgerService API — there is no separate archival API, do not invent one.
graphql
query { object(address: $id, version: 12345678) { version contents { json } } }

Task: leaderboard, explorer, or analytics pipeline

A "top 100 users by SUM(volume) over the last 30 days" query is app-specific aggregation with a time-range filter: beyond gRPC's point lookups and beyond the General-Purpose Indexer's fixed schema. Build a custom sui-indexer-alt pipeline.

Pipeline model: stream checkpoints → handler decodes your events → write your own tables (running totals keyed by user and day), then serve the leaderboard with a plain ORDER BY ... LIMIT 100.

  • Backfill: GCS checkpoint buckets, e.g. gs://mysten-mainnet-checkpoints-use4.
  • Steady state: full node gRPC.
  • Storage: Postgres by default; any backend works via the framework's Store and Connection traits.
  • Config: pipeline TOML (events.toml, obj_versions.toml patterns), plus concurrency tuning.
  • Say the cost: you now operate a database, ingestion lag, and failure recovery. Check GraphQL RPC first.

Never solve this by polling JSON-RPC from app code.

Task: store an image, video, or large file

Max Move object size is 250 KB, so a 2 MB image cannot live on-chain. Put the bytes on Walrus: erasure-coded across off-chain storage nodes, with only an availability certificate and metadata recorded on Sui. The Move object stores the blob ID (plus optional MIME type and size) — never the bytes, and never the bytes as transaction inputs.

Use the @mysten/walrus client extension to write the blob, then mint with the returned blob ID. Mention IPFS/S3/Pinata only as lesser alternatives, never as the default.

Task: explain the storage fund

It is a tokenomics mechanism, not an API and not a service you can call. Each transaction's storage fee contributes to the fund; validators earn yield on the fund's stake, which pays for storing those objects over time, and fees are rebated when objects are deleted. It does not hold application data and is unrelated to the Archival Store and to Walrus. To actually store data: small structured state → Move objects; large files → Walrus.

Task: fix legacy JSON-RPC code

Checklist — apply all six, then verify no get* v1 name survives:

  1. Swap the import: @mysten/sui/client → @mysten/sui/grpc, SuiClient → SuiGrpcClient.
  2. Drop getFullnodeUrl; pass baseUrl directly.
  3. Add the network argument.
  4. Move every read under client.core.* using the table below.
  5. Replace options: { show* } with include: { ... }.
  6. State that JSON-RPC is deprecated and the mainnet shutdown date.
Deprecated (v1)Replacement (v2 Core API)
new SuiClient({ url: getFullnodeUrl('mainnet') })new SuiGrpcClient({ network, baseUrl })
client.getBalanceclient.core.listBalances
client.getCoinsclient.core.listCoins
client.getOwnedObjectsclient.core.listOwnedObjects
client.getObjectclient.core.getObject
client.getTransactionBlockclient.core.getTransaction
options: { showContent: true }include: { content: true }
options: { showEffects: true }include: { effects: true }

Before

ts
import { SuiClient, getFullnodeUrl } from '@mysten/sui/client';
const client = new SuiClient({ url: getFullnodeUrl('mainnet') });
const balance = await client.getBalance({ owner: addr });
const objs = await client.getOwnedObjects({ owner: addr, options: { showContent: true } });
const tx = await client.getTransactionBlock({ digest, options: { showEffects: true } });

After

ts
import { SuiGrpcClient } from '@mysten/sui/grpc';
const client = new SuiGrpcClient({ network: 'mainnet', baseUrl: '<full node gRPC URL>' });
const balances = await client.core.listBalances({ address: addr });
const objs = await client.core.listOwnedObjects({ address: addr, include: { content: true } });
const tx = await client.core.getTransaction({ digest, include: { effects: true } });

If the code must keep running against JSON-RPC during a staged migration, SuiJsonRpcClient exists — label it as a deprecated stopgap with a shutdown date, not as an option.


Reference files

Load the file, don't guess the detail.

FileLoad whenCovers
use-cases.mdfirst pass on any unfamiliar "how do I read X" requestuse case → API table with rationale
grpc.mdbackends, indexers, exchanges, streaming, dry runsledger_service, transaction_execution_service, move_package_service, name_service, subscription_service; endpoint URLs per network; SuiGrpcClient (TS), sui-rpc (Rust); code-gen
graphql.mdfrontends, composable or filtered historical queries, submit/dry-runendpoints, SuiGraphQLClient, query shapes, pagination, rate limits, execution-attached reads
indexers.mdleaderboards, explorers, "track X across history"pipeline model, GCS backfill vs gRPC steady state, pipeline TOML, concurrency, custom vs General-Purpose Indexer
archival.mddata pruned from full nodesretention, pruning, GraphQL routing vs Archival Service endpoint, compliance/analytics use cases
walrus.mdstoring or fetching filesblob lifecycle, erasure coding, availability certificates, @mysten/walrus

Sources: docs.sui.io /concepts/data-access/data-serving, /concepts/data-access/graphql-rpc, /concepts/data-access/archival-store, /guides/operator/indexer-stack-setup, and docs.wal.app. Fetch the page when unsure; never reason from Ethereum or Solana analogs.

Common mistakes

  • v1 method names or options: { show* } on a v2 client.
  • Saying "use the Sui API" without naming gRPC or GraphQL.
  • Polling instead of gRPC streaming.
  • A custom indexer for a query one hosted call covers.
  • Assuming gRPC reaches archival transparently, or that archival routing is automatic rather than operator-configured.
  • Assuming gRPC and GraphQL return identical shapes — field names and pagination differ.
  • Reading from a different node than you wrote to and expecting read-after-write consistency.

Meegeleverde bestanden

Het model leest deze bestanden wanneer nodig terwijl de skill geladen is. Ze worden beschikbaar gesteld als leesbare bestanden en worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Accessing Data?

Explains how to read data from Sui and which surface to use — gRPC, GraphQL RPC, the Archival Store, a custom sui-indexer-alt pipeline, or Walrus. Use when the user asks how to fetch a balance, owned objects, coins, NFTs, transactions or events; subscribe to on-chain activity in real time; read a historical or pruned object version; build a leaderboard, explorer, dashboard or analytics pipeline; where to store an image, video or multi-MB file "on Sui"; what the storage fund is; or how to fix code using SuiClient, getFullnodeUrl, JSON-RPC, getBalance, getOwnedObjects or getTransactionBlock....

Waarom Accessing Data gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Accessing Data bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model, en je kunt midden in een chat van model wisselen zonder dat de skill niet meer werkt. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Accessing Data in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/MystenLabs/skills/tree/main/accessing-data. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Accessing Data gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Accessing Data gebruiken?

Zoveel als je wilt. Zolang een model skills ondersteunt, kun je Accessing Data ermee gebruiken: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama en meer. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Accessing Data gratis?

Ja. Deze skill is door MystenLabs op GitHub gepubliceerd onder de licentie Apache-2.0. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. Deze volgt het open Agent Skills-formaat: een bestand met de naam SKILL.md met een naam en beschrijving, plus eventuele scripts, sjablonen of referentiebestanden die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇