calculateTrafficCostInDollars forwards to calculateTrafficCostInCents and divides by 100, sharing the same pricePerMBCents default.
Setup
import { calculateTrafficCostInDollars } from '@fairmint/canton-node-sdk';
Minimal example
const dollars = calculateTrafficCostInDollars(55 * 1024);
console.log(dollars.toFixed(2));
Parameters
bytes— Byte total to price.pricePerMBCents(optional) — Pricing override.
Returns
number — US dollar float (still imprecise for money; prefer cents for accounting).