Skip to content

OutputType

OutputType = object

Defined in: packages/synapse-core/src/pay/get-account-summary.ts:21

availableFunds: bigint

Defined in: packages/synapse-core/src/pay/get-account-summary.ts:30

Funds available for withdrawal or new rail commitments at epoch. Equal to funds - totalLockup, the unreserved portion described on runwayInEpochs. Active payments draw from this; once it reaches zero, settlement halts.


debt: bigint

Defined in: packages/synapse-core/src/pay/get-account-summary.ts:37

Outstanding payment obligation that couldn’t be moved into lockupCurrent because funds was insufficient. 0n when the account is healthy; positive when in deficit. Effectively the gap between the lockup the account should be holding and what it actually holds.


epoch: bigint

Defined in: packages/synapse-core/src/pay/get-account-summary.ts:99

The epoch used for all calculations.


funds: bigint

Defined in: packages/synapse-core/src/pay/get-account-summary.ts:23

Total deposited funds in the contract.


grossCoverageInEpochs: bigint

Defined in: packages/synapse-core/src/pay/get-account-summary.ts:97

Total spend the account’s funds would cover at lockupRatePerEpoch, calculated as funds / lockupRatePerEpoch. Treat as “how much coverage has the user prepaid in total?”.

Always >= runwayInEpochs, typically by roughly the size of the reserve held in totalLockup. runwayInEpochs accounts for the reserve as a floor that halts settlement; grossCoverageInEpochs treats funds as a single bucket without modeling whether the reserve is actually flowing as ongoing payment.

Useful as a complement to runwayInEpochs in user-facing displays, e.g. “your deposit covers ~X days of storage in total; you have ~Y days of runway before your account enters deficit”.

  • maxUint256 when lockupRatePerEpoch is 0n (nothing is being spent; takes precedence over funds === 0n).
  • 0n when funds is 0n and lockupRatePerEpoch is positive.

lockupRatePerEpoch: bigint

Defined in: packages/synapse-core/src/pay/get-account-summary.ts:40

Per-epoch lockup rate (aggregate across all rails).


lockupRatePerMonth: bigint

Defined in: packages/synapse-core/src/pay/get-account-summary.ts:42

Per-month lockup rate (lockupRatePerEpoch * EPOCHS_PER_MONTH).


runwayInEpochs: bigint

Defined in: packages/synapse-core/src/pay/get-account-summary.ts:77

Epochs from epoch until this account enters deficit and the standard payment flow to providers halts. Treat as “when must the user act?”.

The account holds a reserve in totalLockup that each rail has set aside under its terms. The funds are locked at the contract level: the user can’t withdraw them while the rail is active. Active payments draw from availableFunds (funds - totalLockup). Once availableFunds reaches zero, the account is in deficit: standard settlement of active rails halts even though funds is still positive. A provider can then terminate the rail to claim against the reserve for a final payment window of up to one lockupPeriod. Termination is one-way: once a rail has an endEpoch it’s heading to finalization and topping up the account won’t revive it. Top up before deficit to keep existing rails open.

  • maxUint256 when lockupRatePerEpoch is 0n (nothing is being spent).
  • 0n when the account is already past this point (in deficit).

To get the absolute epoch form, add epoch (skip when this is maxUint256).


totalFixedLockup: bigint

Defined in: packages/synapse-core/src/pay/get-account-summary.ts:51

Sum of lockupFixed across all rails. Reserved for one-time payments, for example, FWSS CDN egress and cache miss credits, rather than streaming rate.


totalLockup: bigint

Defined in: packages/synapse-core/src/pay/get-account-summary.ts:45

Total effective lockup at epoch (fixed + rate-based).


totalRateBasedLockup: bigint

Defined in: packages/synapse-core/src/pay/get-account-summary.ts:53

Rate-based portion of lockup (totalLockup - totalFixedLockup).