Skip to content

settleRailCall

settleRailCall(options): OutputType

Defined in: packages/synapse-core/src/pay/settle-rail.ts:217

Create a call to the settleRail function

This function is used to create a call to the settleRail function for use with sendCalls, sendTransaction, multicall, estimateContractGas, or simulateContract.

ParameterTypeDescription
optionsOptionsTypesettleRailCall.OptionsType

OutputType

The call to the settleRail function settleRailCall.OutputType

Errors settleRailCall.ErrorType

import { settleRailCall } from '@filoz/synapse-core/pay'
import { createWalletClient, http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { simulateContract } from 'viem/actions'
import { calibration } from '@filoz/synapse-core/chains'
const account = privateKeyToAccount('0x...')
const client = createWalletClient({
account,
chain: calibration,
transport: http(),
})
// Use with simulateContract
const { request } = await simulateContract(client, settleRailCall({
chain: calibration,
railId: 1n,
untilEpoch: 1000n,
}))
console.log(request)