Skip to content

resolveAccountState

resolveAccountState(params): OutputType

Defined in: packages/synapse-core/src/pay/resolve-account-state.ts:88

Project account state forward to currentEpoch by simulating settlement locally.

Pure function, no RPC call. Takes raw account fields from accounts() plus currentEpoch and returns availableFunds, runwayInEpochs, and grossCoverageInEpochs. See resolveAccountState.OutputType for each field’s full semantics.

Worked examples (in token units, with lockupRate = 1 token / day):

Healthy account: funds=100, lockupCurrent=30 runwayInEpochs ~= 70 days (unreserved 70 / 1) grossCoverageInEpochs = 100 days (100 / 1)

In deficit: funds=10, lockupCurrent=30 runwayInEpochs = 0 days (already past the trigger) grossCoverageInEpochs = 10 days (10 / 1)

The reserve in lockupCurrent is the sum of each rail’s contribution; its size depends on the operators and rails configured for this account. funds already includes fixed lockup (it’s reflected in lockupCurrent), so both numbers account for fixed and rate-based lockup automatically.

ParameterTypeDescription
paramsAccountStateRaw account fields + current epoch

OutputType

The projected account state resolveAccountState.OutputType