Skip to main content
The asset namespace provides methods to discover and find token assets from registries on the Canton Network. In v1, the asset namespace introduces a dedicated API for asset discovery and management.

Key changes from v0 to v1

v0 required accessing asset information through the token standard service or by manually querying registries. v1 introduces a dedicated asset namespace with a clean API for asset discovery. This enables:
  • Simplified asset discovery from multiple registries
  • Type-safe asset information retrieval
  • Centralized asset registry management
  • Built-in error handling for asset not found scenarios

Availability and extensibility

The asset namespace is an extended namespace that requires configuration. You can initialize it either during SDK creation or later using the extend() method. Option 1: Initialize during SDK creation
Option 2: Add asset namespace later using extend()

Configuration

The AssetConfig type defines the configuration for the asset namespace:
  • auth: Authentication configuration for accessing registries
  • registries: Array of registry URLs to fetch assets from
You can preview the example config here:
Example LocalNet namespace configs

Listing assets

The asset namespace provides a list getter to retrieve all assets from configured registries.

Finding a specific asset

The find method allows you to search for a specific asset by ID, optionally filtering by registry URL.

Finding an asset with a specific registry

When multiple registries contain assets with the same ID, you can specify the registry URL to disambiguate:

Error handling

The asset namespace includes built-in error handling for common scenarios: Asset not found If an asset with the specified ID does not exist in any registry:
Multiple assets found If multiple assets with the same ID exist across different registries and no registry URL is provided:

Usage example

In the below example you can find the usage of the find method:
Full example: find assets in an OTC trade flow

Migration reference

See also