Skip to content

setServicePrice

Changes the price of a selected service offering.

Usage

import { Wallet } from 'ethers'
import { Nautilus } from '@deltadao/nautilus'
 
const nautilus = await Nautilus.create(new Wallet('0x...'))
const aquariusAsset = await nautilus.getAquariusAsset(
    'did:op:926098d069b017dcf3736370f3c3d77e6046ca6622af111229accf5f9c83e308'
)
const serviceId = aquariusAsset.services?.[0]?.id // '41b4f7004149620d9ffbc47e85cca980dda033dd824e0ddf7f9249e02284673b'
 
const newPrice = '0.1'
 
const txReceipt = await nautilus.setServicePrice( 
    aquariusAsset, 
    serviceId, 
    newPrice 
)

You have to query the aquarius asset via did:op and select the service via serviceId.

Returns

The receipt for the setAssetLifecycle transaction that was issued.

Parameters

aquaAsset

  • Type: Asset

The asset the service to set the new price for belongs to.

const aquariusAsset = await nautilus.getAquariusAsset( 
    'did:op:926098d069b017dcf3736370f3c3d77e6046ca6622af111229accf5f9c83e308'
) 
 
const tx = await nautilus.setServicePrice(
    aquariusAsset, 
    aquariusAsset.services?.[0]?.id, 
    '5'
)

serviceId

  • Type: string

The id of the service to set the new price for.

const aquariusAsset = await nautilus.getAquariusAsset( 
    'did:op:926098d069b017dcf3736370f3c3d77e6046ca6622af111229accf5f9c83e308'
) 
 
const tx = await nautilus.setServicePrice(
    aquariusAsset, 
    aquariusAsset.services?.[0]?.id, 
    '5'
)

price

  • Type: string

The new price for the service.

const tx = await nautilus.setServicePrice(
    aquariusAsset, 
    aquariusAsset.services?.[0]?.id,
    '5'
)