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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain, Account> | The client to use to schedule the piece deletion. |
options | OptionsType | schedulePieceDeletion.OptionsType |
Returns
Section titled “Returns”schedule piece deletion operation hash schedulePieceDeletion.OutputType
Throws
Section titled “Throws”Errors schedulePieceDeletion.ErrorType
Example
Section titled “Example”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)