コンテンツにスキップ

deriveReceiptTimeoutMs

このコンテンツはまだ日本語訳がありません。

deriveReceiptTimeoutMs(chain, confirmations): number

Defined in: src/x402/facilitator.ts:282

Auto-sizes the settle receipt timeout to a confirmation depth and the chain’s block time: max(60_000, 15_000 + confirmations × blockTimeMs × 1.5). This is the default CreateSelfFacilitatorParams.receiptTimeoutMs when the operator does not pass one, so a deep-confirmation chain (Ethereum’s 32 × ~12 s ≈ 10 min) does not time out at the flat 60 s floor, while shallow chains (Polygon) keep the floor. Exposed so operators tuning confirmations per the finality recipe (docs/recipes/facilitator-finality-tuning.md) can compute a matching timeout.

Parameters

chain

KawaseChain

confirmations

number

Returns

number

Example

import { deriveReceiptTimeoutMs, ethereum } from "kawasekit";
deriveReceiptTimeoutMs(ethereum, 32); // ≈ 591_000 ms