publish
Publishes a new asset as defined by customizable metadata.
If you want to learn more about how to build your metadata using nautilus' builder classes, the AssetBuilder documentation is a good place to start.
Usage
import { Nautilus } from '@deltadao/nautilus'
import { Wallet } from 'ethers'
import { asset } from './asset'
const nautilus = await Nautilus.create(new Wallet('0x1234'))
await nautilus.publish(asset) import { AssetBuilder, ServiceBuilder, ServiceTypes, FileTypes } from '@deltadao/nautilus'
const service = new ServiceBuilder({ serviceType: ServiceTypes.ACCESS, fileType: FileTypes.URL })
.addFile({
type: 'url',
method: 'GET',
url: 'https://some.url.to/my-file'
})
.build()
const builder = new AssetBuilder()
builder
.setType('dataset')
.setName('My Dataset')
.setDescription('A unique dataset description')
.setLicense('MIT')
.setAuthor('My Company')
.addService(service)
export const asset = builder.build() Returns
An object containing all relevant information that was created during the publish process.
Parameters
asset
- Type:
NautilusAsset
The asset that should be published.
Refer to the AssetBuilder documentation for more information on how to construct assets.