accounts
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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain> | The client to use to get the account info. |
options | OptionsType | accounts.OptionsType |
Returns
Section titled “Returns”The account information accounts.OutputType
Throws
Section titled “Throws”Errors accounts.ErrorType
Example
Section titled “Example”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)