schedulePieceDeletions
schedulePieceDeletions(
client,options):Promise<OutputType>
Defined in: packages/synapse-core/src/sp/schedule-piece-deletion.ts:148
Schedule piece deletions in one transaction.
Call the Service Provider API to schedule the piece deletion.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client |
Client<Transport, Chain, Account> |
The client to use to schedule the piece deletion. |
options |
OptionsType |
schedulePieceDeletions.OptionsType |
Returns
Section titled “Returns”Schedule piece deletions operation hash schedulePieceDeletions.OutputType
Throws
Section titled “Throws”Errors schedulePieceDeletions.ErrorType
Example
Section titled “Example”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)