跳到內容

本頁面的來源

本頁面的每項論述都對應固定的修訂版本。開啟路徑即可檢視驗證所依據的確切來源。

universe-index-atomicals-nfts-and-realms

Universe Atomicals NFT, Realm, and Subrealm index

修訂 1d9109c68d95

開啟固定路徑: server

Materialized read model for plain NFTs, Realms, and Subrealms projected from Atomicals ElectrumX.

universe-index-atomicals

Universe ARC-20 index and Marketplace v1 authority

修訂 670030e50071

開啟固定路徑: tokenExplorerServer

Universe ARC-20 token explorer feed and the durable Marketplace v1 protocol authority.

TypeScript client

Raw

A generated, strictly typed client for the public read APIs, with typed errors, pagination helpers, and no embedded secrets.

Universe implementation Verified 2026-08-31 Metadata & Sources

Describes what a Bitcoin Universe service actually does today. It is not a statement about the protocol in general.

Page ID
reference/client-sdk
Normative authority
Universe implementation documentation
Networks
mainnet
Documentation version
2026.08
Audience
developer, integrator
Owner
bitcoin-universe-docs
Sources
Known limitations
  • The client covers the public read surfaces and the safe Marketplace contract types. It does not sign, broadcast, or hold key material.

本頁內容尚未翻譯。

The client is generated from the OpenAPI documents and lives in packages/client. It is regenerated by npm run generate, and CI fails if the committed output differs.

The base URL is required. There is no default, because a default would be a production host baked into a package.

import { AtomicalsClient } from '@bitcoin-universe/atomicals-client'
const client = new AtomicalsClient({
baseUrl: process.env.ATOMICALS_API_URL!,
// Optional. Only for surfaces that require it. Never ship this in a browser.
bearerToken: process.env.ATOMICALS_API_TOKEN,
})
const asset = await client.getAsset({
atomicalId: '4d0b1f1c9c53a5b1e0b1b2c3d4e5f60718293a4b5c6d7e8f9a0b1c2d3e4f5061i0',
})
console.log(asset.data.atomicalId, asset.generationId, asset.requestId)

Failures throw a typed error carrying the status, the machine readable code, and the request identifier. Branch on the code, never on the message.

import { AtomicalsClient, AtomicalsApiError } from '@bitcoin-universe/atomicals-client'
try {
await client.getNft({ atomicalId })
} catch (error) {
if (error instanceof AtomicalsApiError) {
if (error.code === 'NFT_NOT_FOUND') {
// Not in the active generation. Check readiness before concluding it is gone.
}
console.error(error.status, error.code, error.requestId)
}
throw error
}

The helper restarts the listing when the generation changes, rather than continuing with a cursor that is no longer valid.

for await (const page of client.paginate.listNfts({ limit: 100 })) {
for (const asset of page.items) {
// page.generationId is stable across this loop.
}
}

Every response exposes the generation identifier, the indexed height, and the request identifier alongside the parsed body. Store them with anything you cache.

const page = await client.listRealms({ limit: 50 })
console.log(page.generationId, page.indexedHeight, page.requestId)
Included Not included
Public read operations for both indexes Anything that signs or broadcasts
Marketplace read operations and contract types Marketplace mutation request signing
Typed errors and pagination helpers Credential storage or management
Freshness metadata on every response A default base URL

Marketplace mutations require an HMAC over exact body bytes and an owner session. Those belong in your server, where the secret lives. The client exposes the types so you can build the request, and deliberately does not sign it for you.

OpenAPI and downloads and migration.