Skip to content

schedulePieceDeletion

schedulePieceDeletion(client, options): Promise<OutputType>

Defined in: packages/synapse-core/src/sp/schedule-piece-deletion.ts:54

Schedule a piece deletion

Call the Service Provider API to schedule the piece deletion.

ParameterTypeDescription
clientClient<Transport, Chain, Account>The client to use to schedule the piece deletion.
optionsOptionsTypeschedulePieceDeletion.OptionsType

Promise<OutputType>

schedule piece deletion operation hash schedulePieceDeletion.OutputType

Errors schedulePieceDeletion.ErrorType

import { schedulePieceDeletion } from '@filoz/synapse-core/sp'
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 result = await schedulePieceDeletion(client, {
pieceId: 1n,
dataSetId: 1n,
clientDataSetId: 1n,
serviceURL: 'https://pdp.example.com',
})
console.log(result.hash)