Skip to content

settleTerminatedRailWithoutValidation

settleTerminatedRailWithoutValidation(client, options): Promise<`0x${string}`>

Defined in: packages/synapse-core/src/pay/settle-terminated-rail-without-validation.ts:70

Settle a terminated payment rail without validation

Emergency settlement for terminated rails only - bypasses service contract validation. This ensures payment even if the validator contract is buggy or unresponsive (pays in full). Can only be called by the client after the max settlement epoch has passed.

Parameter Type Description
client Client<Transport, Chain, Account> The viem client with account to use for the transaction.
options OptionsType settleTerminatedRailWithoutValidation.OptionsType

Promise<`0x${string}`>

The transaction hash

Errors settleTerminatedRailWithoutValidation.ErrorType

import { settleTerminatedRailWithoutValidation } from '@filoz/synapse-core/pay'
import { createWalletClient, http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { calibration } from '@filoz/synapse-core/chains'

const account = privateKeyToAccount('0x...')
const client = createWalletClient({
  account,
  chain: calibration,
  transport: http(),
})

// Settle terminated rail
const hash = await settleTerminatedRailWithoutValidation(client, {
  railId: 1n,
})

console.log(hash)