• Calculate the storage fee for a TLSNotary proof.

    Fee structure:

    • 1 DEM base fee
    • 1 DEM per KB of proof data

    P4: returns bigint in OS (the SDK's internal canonical representation) instead of number in DEM. This is a breaking change vs v2.x — callers must pass the result through denomination.osToDem() before display.

    Parameters

    • proofSizeKB: number

      Size of proof in kilobytes (non-negative integer).

    Returns bigint

    Total fee as a bigint in OS.

    import { calculateStorageFee } from '@kynesyslabs/demosdk/tlsnotary';
    import { denomination } from '@kynesyslabs/demosdk';

    const proofSize = Math.ceil(proof.length / 1024);
    const feeOs = calculateStorageFee(proofSize);
    const feeDem = denomination.osToDem(feeOs); // e.g. "6.0" for 5KB