Skip to content

setLicense

Set the license for the asset.

Official OceanProtocol documentation: DDO Specification

Usage

import { AssetBuilder, Nautilus } from '@deltadao/nautilus'
import { Wallet } from 'ethers'
 
const nautilus = await Nautilus.create(new Wallet('0x1234'))
 
const assetBuilder = new AssetBuilder()
assetBuilder.setLicense('Apache-2.0') 
const asset = assetBuilder.build() 
 
await nautilus.publish(asset) 
ddo.metadata:
{
license: 'Apache-2.0'
}

Returns

The asset builder instance to chain building calls with.

Parameter

license

  • Type: string

The license you want to set to the asset's metadata to be built. Can be either a public domain or a SPDX license identifier.

assetBuilder.setLicense(
    'https://link.to/my/custom-license'
)