• IPFS operations as one-call programmatic transactions.

    Unlike pay/store/storagePrograms, there is no single Demos builder that returns a signed ipfs transaction: 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 ipfs transaction (nonce set exactly like demos.storagePrograms.sign), and hands a thunk producing it to ctx.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 of demos.run.*.

    Cost control ("custom charges") is opt-in and stays simple: forward a customCharges block through addOptions/pinOptions (obtained from IPFSOperations.quoteToCustomCharges(await demos.ipfs.quote(...))). The payload creators embed it in the payload; this namespace additionally mirrors it onto tx.content.custom_charges so the node sees the ceiling the sender signed. No quote round-trip is performed here.

    Parameters

    Returns {
        add: ((content: string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>, addOptions?: AddOptionsWithCharges, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        pin: ((cid: string, pinOptions?: PinOptionsWithCharges, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        unpin: ((cid: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
    }

    • add: ((content: string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>, addOptions?: AddOptionsWithCharges, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

      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),
      })
    • pin: ((cid: string, pinOptions?: PinOptionsWithCharges, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

      Pin an existing CID to the sender's account, end to end.

      await demos.run.ipfs.pin("QmExampleCID...")
      
    • unpin: ((cid: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

      Remove a pin from the sender's account, end to end.

      await demos.run.ipfs.unpin("QmExampleCID...")