Theme

Introduction

Display Options

The DAS API provides display options that allow you to control what additional information is included in the response. These options are available as an options object parameter in several API methods.

Available Display Options

OptionTypeDescriptionDefault
showCollectionMetadatabooleanWhen true, includes collection metadata in the response. This provides information about the collection the asset belongs to.false
showFungiblebooleanWhen true, includes fungible token information in the response. This is useful for assets that represent fungible tokens or if you want to getAssetsByOwner and actually see all assets.false
showInscriptionbooleanWhen true, includes inscription data in the response. This provides information about any inscriptions associated with the included asset.false
showUnverifiedCollectionsbooleanWhen true, includes unverified collections in the response. By default, only verified collections are shown.false
showZeroBalancebooleanWhen true, includes token accounts with zero balance in the response. By default, only accounts with non-zero balances are shown.false

Usage Examples

Basic Usage

import { publicKey } from '@metaplex-foundation/umi'
import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
import { dasApi } from '@metaplex-foundation/digital-asset-standard-api'

const umi = createUmi('<ENDPOINT>').use(dasApi())

// Get an asset with collection metadata
const asset = await umi.rpc.getAsset({
  id: publicKey('your-asset-id'),
  displayOptions: {
    showCollectionMetadata: true
  }
})

Multiple Options

import { publicKey } from '@metaplex-foundation/umi'
import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
import { dasApi } from '@metaplex-foundation/digital-asset-standard-api'

const umi = createUmi('<ENDPOINT>').use(dasApi())

// Get assets with multiple display options enabled
const assets = await umi.rpc.getAssetsByOwner({
  owner: publicKey('owner-address'),
  displayOptions: {
    showCollectionMetadata: true,
    showFungible: true,
    showInscription: true
  }
})

All Options Enabled

import { publicKey } from '@metaplex-foundation/umi'
import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
import { dasApi } from '@metaplex-foundation/digital-asset-standard-api'

const umi = createUmi('<ENDPOINT>').use(dasApi())

// Enable all display options
const assets = await umi.rpc.searchAssets({
  owner: publicKey('owner-address'),
  displayOptions: {
    showCollectionMetadata: true,
    showFungible: true,
    showInscription: true,
    showUnverifiedCollections: true,
    showZeroBalance: true
  }
})

Methods That Support Display Options

The following DAS API methods support the options parameter with display options:

Performance Considerations

Enabling display options may increase response size and processing time. Only enable the options you need for your specific use case to optimize performance.

Previous
DAS API RPC Providers