Skip to content
LogoLogo

getAsset

Resolve a published asset by its decentralized identifier.

In v1 this was getAquariusAsset. Aquarius no longer exists as a separate service — ocean-node serves the metadata API — so the method dropped the name.

Usage

const  = await .( 
  'did:ope:2a6ebce0af9361e2c7d1e1e7909ecac3e4cabb4f089f7edd51865e0b77a5c216'
) 

Returns

  • Type: AssetV5

The DDO v5 asset. Note that DDO v5 is a W3C Verifiable Credential: everything the v4 DDO carried at the top level now lives under credentialSubject.

Rather than indexing into that structure, read it through the exported helpers. They go through ddo-js's version-aware manager, so your code keeps working when a future DDO version moves fields again.

const  = await .('did:ope:2a6ebce0af...')
 
const  = (). 
const  = () 
const  = () 

Available helpers: getMetadata, getServices, getService, getServiceByType, getCredentials, getServiceCredentials, getDatatokens, getNft, getOwner, getLifecycleState, getIndexedMetadata, getStatsForService, getChainId, getNftAddress, getVersion, supportsSsi.

Throws

Unlike v1, which resolved to undefined for an unknown DID, this throws an OceanNodeError naming the DID. If the asset may not be indexed yet, use waitForIndexer instead.

Parameters

did

  • Type: string

The decentralized identifier of the asset. DDO v5 DIDs use the did:ope: prefix; v4 used did:op:.