getAccountSummary
getAccountSummary(
client,options):Promise<OutputType>
Defined in: packages/synapse-core/src/pay/get-account-summary.ts:81
Get a comprehensive account summary from the Payments contract.
Fetches account state, fixed lockup totals, and (optionally) current epoch in parallel, then derives debt, available funds, lockup breakdown, and funded-until timeline client-side.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain> | The client to use for the query. |
options | OptionsType | getAccountSummary.OptionsType |
Returns
Section titled “Returns”Full account summary getAccountSummary.OutputType
Throws
Section titled “Throws”Errors getAccountSummary.ErrorType
Example
Section titled “Example”import { getAccountSummary } from '@filoz/synapse-core/pay'import { createPublicClient, http } from 'viem'import { calibration } from '@filoz/synapse-core/chains'
const client = createPublicClient({ chain: calibration, transport: http(),})
const summary = await getAccountSummary(client, { address: '0x1234567890123456789012345678901234567890',})
console.log('Available:', summary.availableFunds)console.log('Funded until epoch:', summary.fundedUntilEpoch)