Skip to content

accounts(client, options): Promise<OutputType>

Defined in: packages/synapse-core/src/pay/accounts.ts:77

Get account information from the Filecoin Pay contract

Returns the raw account state including deposited funds and lockup details. The lockup mechanism ensures funds are available for ongoing payment rails.

ParameterTypeDescription
clientClient<Transport, Chain>The client to use to get the account info.
optionsOptionsTypeaccounts.OptionsType

Promise<OutputType>

The account information accounts.OutputType

Errors accounts.ErrorType

import { accounts } 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 accountInfo = await accounts(client, {
address: '0x1234567890123456789012345678901234567890',
})
console.log(accountInfo.funds)
console.log(accountInfo.lockupCurrent)