Skip to content
Docs

Core

Capabilities

Catalog hints plus client helpers; live Cloud capabilities are plan-filtered.

Overview

Catalog entries describe each chain: family, path slots, and testnet siblings. Live Cloud capability flags (portfolio, nfts, swap, …) come from GET /v1/chains?include=capabilities and are plan-filtered. Client-side helpers expose a subset for wallet UX.

Signature

js
import { /* catalog fields */ } from "@gray3/core";
import {
  supportsNft,
  supportsDefi,
  supportsSwap,
  isTestnetChain,
  getMainnetSibling,
  getTestnetSibling,
} from "@gray3/client";

Parameters

FieldRequiredDescription
chainIdYes`GrayChainId` — mainnet or testnet id

Response

ts
supportsNft("ethereum")        // boolean (catalog/client helper)
supportsDefi("ethereum")
supportsSwap("ethereum")
isTestnetChain("ethereum-sepolia") // true
getMainnetSibling("ethereum-sepolia") // "ethereum"
getTestnetSibling("ethereum")  // testnet id if mapped

Usage

js
if (isTestnetChain(chainId)) {
  // hide prices / nfts / defi / swap in UI
}
if (!supportsNft(chainId)) {
  // disable NFT tab
}

// Authoritative runtime matrix for Cloud:
// GET /v1/chains?include=capabilities
const chains = await gray.chains.list({ include: "capabilities" });

Where to read the full matrix

Throws

FieldRequiredDescription
unsupported_capabilityNoRaised by client/cloud when an operation is not offered (e.g. watch Monero, signPrepared UTXO/Monero, testnet prices).