OutputType
OutputType =
object
Defined in: packages/synapse-core/src/pay/get-account-summary.ts:21
Properties
Section titled “Properties”availableFunds
Section titled “availableFunds”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
Section titled “grossCoverageInEpochs”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”.
maxUint256whenlockupRatePerEpochis 0n (nothing is being spent; takes precedence overfunds === 0n).0nwhenfundsis 0n andlockupRatePerEpochis positive.
lockupRatePerEpoch
Section titled “lockupRatePerEpoch”lockupRatePerEpoch:
bigint
Defined in: packages/synapse-core/src/pay/get-account-summary.ts:40
Per-epoch lockup rate (aggregate across all rails).
lockupRatePerMonth
Section titled “lockupRatePerMonth”lockupRatePerMonth:
bigint
Defined in: packages/synapse-core/src/pay/get-account-summary.ts:42
Per-month lockup rate (lockupRatePerEpoch * EPOCHS_PER_MONTH).
runwayInEpochs
Section titled “runwayInEpochs”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.
maxUint256whenlockupRatePerEpochis 0n (nothing is being spent).0nwhen the account is already past this point (in deficit).
To get the absolute epoch form, add epoch (skip when this is
maxUint256).
totalFixedLockup
Section titled “totalFixedLockup”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
Section titled “totalLockup”totalLockup:
bigint
Defined in: packages/synapse-core/src/pay/get-account-summary.ts:45
Total effective lockup at epoch (fixed + rate-based).
totalRateBasedLockup
Section titled “totalRateBasedLockup”totalRateBasedLockup:
bigint
Defined in: packages/synapse-core/src/pay/get-account-summary.ts:53
Rate-based portion of lockup (totalLockup - totalFixedLockup).