Skip to content

Reference

Traffic types and pricing constants

Exported traffic status, cost estimation, and pricing constants shared by Canton Node SDK traffic helpers.

Constants

NameValueMeaning
UPDATE_CONFIRMATION_OVERHEAD_BYTES5 * 1024Added to measured traffic before cost math in getEstimatedTrafficCost.
DEFAULT_PRICE_PER_MB_CENTS6000Default $60/MB expressed in cents for pricing helpers.

TrafficCostEstimate

Returned by getEstimatedTrafficCost / estimateTrafficCost when costEstimation present:

FieldMeaning
requestCostBytes attributed to confirmation request path.
responseCostBytes attributed to confirmation response path.
totalCostSum of request + response (no overhead).
totalCostWithOverheadAdds UPDATE_CONFIRMATION_OVERHEAD_BYTES.
costInCents / costInDollarsDerived using default or custom per-MB pricing.
estimatedAt?Optional timestamp when server stamps the estimate.

TrafficStatus

From getTrafficStatus:

FieldMeaning
consumedObserved consumed traffic.
limitCurrent cap.
purchasedPurchased traffic (may reflect inflight purchases).

Raw type re-export

CostEstimation — re-exported from ledger schema for advanced consumers.

Import

import {
  UPDATE_CONFIRMATION_OVERHEAD_BYTES,
  DEFAULT_PRICE_PER_MB_CENTS,
  type TrafficCostEstimate,
  type TrafficStatus,
} from '@fairmint/canton-node-sdk';

Source

src/utils/traffic/types.ts