Skip to content

accounts

accounts(client, options): Promise<OutputType>

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

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.

Parameter Type Description
client Client<Transport, Chain> The client to use to get the account info.
options OptionsType accounts.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)