Payload for IPFS_ADD operation

Uploads content to IPFS and automatically pins it to the sender's account. Content is base64 encoded for JSON compatibility.

interface IPFSAddPayload {
    content: string;
    custom_charges?: CustomCharges;
    duration?:
        | number
        | "permanent"
        | "week"
        | "month"
        | "quarter"
        | "year";
    filename?: string;
    metadata?: Record<string, unknown>;
    operation: "IPFS_ADD";
}

Properties

content: string

Base64-encoded content to upload

custom_charges?: CustomCharges

Optional custom charges configuration (from ipfsQuote)

duration?:
    | number
    | "permanent"
    | "week"
    | "month"
    | "quarter"
    | "year"

Optional pin duration

  • Preset string: 'permanent' | 'week' | 'month' | 'quarter' | 'year'
  • Custom number: duration in seconds (min 1 day, max 10 years)
  • undefined or 'permanent': pin never expires
filename?: string

Optional filename for the content

metadata?: Record<string, unknown>

Optional metadata to associate with the pin

operation

The IPFS operation type