Response from ipfsQuote nodeCall

Provides cost estimation before transaction is built and signed. Use this to populate custom_charges in the transaction.

P4 dual-shape compatibility:

  • Pre-fork node returns cost_dem (decimal string, DEM).
  • Post-fork node returns cost_os (decimal string, OS).

SDK helpers (quoteToCustomCharges, createCustomCharges) prefer cost_os when present and otherwise convert cost_dem via denomination.demToOs. Likewise breakdown.{base_cost,size_cost} is shape-stable across the fork.

interface IpfsQuoteResponse {
    breakdown: {
        base_cost: string;
        chargeable_bytes: number;
        free_tier_bytes: number;
        size_cost: string;
    };
    cost_dem?: string;
    cost_os?: string;
    file_size_bytes: number;
    is_genesis: boolean;
    operation: string;
}

Properties

breakdown: {
    base_cost: string;
    chargeable_bytes: number;
    free_tier_bytes: number;
    size_cost: string;
}

Detailed cost breakdown

Type declaration

  • base_cost: string

    Base cost component

  • chargeable_bytes: number

    Bytes that will be charged

  • free_tier_bytes: number

    Bytes covered by free tier (genesis only)

  • size_cost: string

    Cost for file size

cost_dem?: string

Estimated cost in DEM as a decimal string (legacy/pre-fork shape). Kept for back-compat with current node responses.

cost_os?: string

Estimated cost in OS as a decimal string (post-fork shape). Preferred when present.

file_size_bytes: number

File size used for calculation

is_genesis: boolean

Whether sender is a genesis account

operation: string

Operation quoted for