Constants
| Name | Value | Meaning |
|---|---|---|
UPDATE_CONFIRMATION_OVERHEAD_BYTES | 5 * 1024 | Added to measured traffic before cost math in getEstimatedTrafficCost. |
DEFAULT_PRICE_PER_MB_CENTS | 6000 | Default $60/MB expressed in cents for pricing helpers. |
TrafficCostEstimate
Returned by getEstimatedTrafficCost / estimateTrafficCost when costEstimation present:
| Field | Meaning |
|---|---|
requestCost | Bytes attributed to confirmation request path. |
responseCost | Bytes attributed to confirmation response path. |
totalCost | Sum of request + response (no overhead). |
totalCostWithOverhead | Adds UPDATE_CONFIRMATION_OVERHEAD_BYTES. |
costInCents / costInDollars | Derived using default or custom per-MB pricing. |
estimatedAt? | Optional timestamp when server stamps the estimate. |
TrafficStatus
From getTrafficStatus:
| Field | Meaning |
|---|---|
consumed | Observed consumed traffic. |
limit | Current cap. |
purchased | Purchased 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';