(timeoutMs: unknown)
| 22 | }; |
| 23 | |
| 24 | function parseTimeoutMs(timeoutMs: unknown): number | undefined { |
| 25 | if (timeoutMs === undefined) return undefined; |
| 26 | if (typeof timeoutMs !== 'number' || !Number.isFinite(timeoutMs) || timeoutMs <= 0) { |
| 27 | throw new Error('Invalid gateway RPC timeout'); |
| 28 | } |
| 29 | return timeoutMs; |
| 30 | } |
| 31 | |
| 32 | export function createGatewayApi( |
| 33 | gatewayManager: GatewayManager, |