Skip to content

schedulePieceDeletions

schedulePieceDeletions(client, options): Promise<OutputType>

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

Schedule piece deletions in one transaction.

Call the Service Provider API to schedule the piece deletion.

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

Promise<OutputType>

Schedule piece deletions operation hash schedulePieceDeletions.OutputType

Errors schedulePieceDeletions.ErrorType

import { schedulePieceDeletions } 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 schedulePieceDeletions(client, {
pieceIds: [1n, 2n],
dataSetId: 1n,
clientDataSetId: 1n,
serviceURL: 'https://pdp.example.com',
})
console.log(result.hash)