updateProduct
updateProduct(
client,options):Promise<`0x${string}`>
Defined in: packages/synapse-core/src/sp-registry/update-product.ts:82
Update a product for the service provider
Updates an existing product (e.g., PDP) for the calling provider with new capabilities. Only the provider themselves can update their products.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain, Account> | The viem client with account to use for the transaction. |
options | OptionsType | updateProduct.OptionsType |
Returns
Section titled “Returns”Promise<`0x${string}`>
The transaction hash updateProduct.OutputType
Throws
Section titled “Throws”Errors updateProduct.ErrorType
Example
Section titled “Example”import { updateProduct } from '@filoz/synapse-core/sp-registry'import { createWalletClient, http, parseEther } 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 hash = await updateProduct(client, { pdpOffering: { serviceURL: 'https://provider.example.com', minPieceSizeInBytes: 1024n, maxPieceSizeInBytes: 1073741824n, storagePricePerTibPerDay: parseEther('0.15'), minProvingPeriodInEpochs: 2880n, location: 'us-west', paymentTokenAddress: '0x0000000000000000000000000000000000000000', }, capabilities: { region: 'us-west', tier: 'premium' },})
console.log(hash)