getRail
getRail(
client,options):Promise<OutputType>
Defined in: packages/synapse-core/src/pay/get-rail.ts:89
Get rail information from the Filecoin Pay contract
Returns detailed information about a payment rail including payer, payee, payment rate, lockup details, settlement status, and termination status.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain> | The client to use to get the rail info. |
options | OptionsType | getRail.OptionsType |
Returns
Section titled “Returns”The rail information getRail.OutputType
Throws
Section titled “Throws”Errors getRail.ErrorType
Example
Section titled “Example”import { getRail } 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 rail = await getRail(client, { railId: 1n,})
console.log('Payer:', rail.from)console.log('Payee:', rail.to)console.log('Payment rate:', rail.paymentRate)console.log('Is terminated:', rail.endEpoch > 0n)