Skip to content
LogoLogo

access

Download an asset: order the service if needed, then get a one-time URL.

Usage

const {  } = await .({ 
  : 'did:ope:1234abcd...'
}) 
 
// fetch the actual data
const  = await ()

What happens in order:

  1. If the service is credential-gated, the configured credential provider satisfies the policy. This happens before any spend, so a failed presentation costs nothing.
  2. The node is asked for provider fees and whether a previous order can be reused.
  3. An existing order is reused where possible — extended if a new fee period is due, or used as-is if not. Otherwise a datatoken is bought and a new order placed.
  4. The download URL is built, carrying the verifier session if there was one.

Returns

  • Type: AccessResult

Properties

url
  • Type: string

The one-time URL to download the raw data.

did / serviceId
  • Type: string

The asset and the service that were actually accessed — useful when you let nautilus pick the service.

transferTxId
  • Type: string

The order authorising this download.

reusedOrder
  • Type: boolean

true when an existing order was reused rather than a new one paid for.

Parameters

config

  • Type: AccessConfig

Properties

assetDid
  • Type: string

The identifier of the asset to access.

serviceId (optional)
  • Type: string

Which service to download from. Defaults to the asset's first access service.

fileIndex (optional)
  • Type: number

Which file of the service to download. Defaults to 0.

userdata (optional)

Values for the service's consumer parameters. See the ConsumerParameterBuilder.

skipCredentials (optional)
  • Type: boolean

Skip the credential presentation even for a gated service. Only useful when you already hold a valid verifier session and supplied it as a StaticCredentialProvider.