Upload content to IPFS (and auto-pin it), end to end.
// auto-broadcast within the 5 DEM fee cap:
await demos.run.ipfs.add("hello world", { filename: "hello.txt" })
// with a signed cost ceiling from a quote:
const quote = await demos.ipfs.quote(bytes.length, "IPFS_ADD")
await demos.run.ipfs.add(bytes, {
customCharges: IPFSOperations.quoteToCustomCharges(quote),
})
Content to upload (Buffer, Uint8Array or string).
OptionaladdOptions: AddOptionsWithChargesFilename, metadata and optional custom charges.
Optionalopts: ProgrammaticTxOptionsFee ceiling / confirmation strategy / wait behaviour.
Pin an existing CID to the sender's account, end to end.
The Content Identifier to pin (CIDv0 or CIDv1).
OptionalpinOptions: PinOptionsWithChargesDuration, metadata, fileSize and optional
custom charges.
Optionalopts: ProgrammaticTxOptionsFee ceiling / confirmation strategy / wait behaviour.
Remove a pin from the sender's account, end to end.
The Content Identifier to unpin (CIDv0 or CIDv1).
Optionalopts: ProgrammaticTxOptionsFee ceiling / confirmation strategy / wait behaviour.
IPFS operations as one-call programmatic transactions.
Unlike
pay/store/storagePrograms, there is no single Demos builder that returns a signedipfstransaction: the payloads come from IPFSOperations' static creators (createAddPayload,createPinPayload,createUnpinPayload) and the caller must assemble the transaction around them. This namespace does that assembly.Each method builds the payload, wraps it in an UNSIGNED
ipfstransaction (nonce set exactly likedemos.storagePrograms.sign), and hands a thunk producing it toctx.run(...). The shared runner signs it and confirms it against the fee ceiling before auto-broadcasting — keeping fee-cap policy, confirmation strategy and result shape uniform with the rest ofdemos.run.*.Cost control ("custom charges") is opt-in and stays simple: forward a
customChargesblock throughaddOptions/pinOptions(obtained fromIPFSOperations.quoteToCustomCharges(await demos.ipfs.quote(...))). The payload creators embed it in the payload; this namespace additionally mirrors it ontotx.content.custom_chargesso the node sees the ceiling the sender signed. No quote round-trip is performed here.