Skip to content

terminateService

terminateService(client, options): Promise<`0x${string}`>

Defined in: packages/synapse-core/src/warm-storage/terminate-service.ts:66

Terminate a service (data set)

This function terminates a data set service, which will also result in the removal of all pieces in the data set.

Parameter Type Description
client Client<Transport, Chain, Account> The client to use to terminate the service.
options OptionsType terminateService.OptionsType

Promise<`0x${string}`>

The transaction hash terminateService.OutputType

Errors terminateService.ErrorType

import { terminateService } from '@filoz/synapse-core/warm-storage'
import { createWalletClient, http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { calibration } from '@filoz/synapse-core/chains'

const account = privateKeyToAccount('0x...')
const client = createWalletClient({
  account,
  chain: calibration,
  transport: http(),
})

const txHash = await terminateService(client, {
  dataSetId: 1n,
})

console.log(txHash)