# isValidNanoseconds

Industry: Core

## Signature

```ts
isValidNanoseconds(value: unknown): value is bigint
```

Validate whether a value is an epoch-nanosecond `bigint` the `precision/` namespace accepts.

- Every `precision/` function gates on this range, so anything it accepts is renderable by `fromNanoseconds`. Reach for it before `truncateNanoseconds`, whose `0n` return is both a legitimate result and the invalid-input sentinel.
- Requires a `bigint`. A `number` is rejected outright rather than coerced: nanoseconds since the epoch passed `Number.MAX_SAFE_INTEGER` in April 1970, so a `number` cannot carry one exactly and silently accepting it would defeat the namespace.
- The range is ±8_640_000_000_000_000_000_000n — what `Temporal.Instant` can represent.
- **A span is not an epoch nanosecond value.** `spanNs` reaches twice this range, because it measures a duration rather than naming an instant. Do not validate one with this.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `unknown` | candidate epoch-nanosecond value |

## Returns

boolean indicating whether the value is an in-range epoch-nanosecond bigint

## Examples

```ts
import { isValidNanoseconds } from "@northguild/gmt/precision/validate";

isValidNanoseconds(0n) // true — the epoch
```

## Source

[precision/validate/isValidNanoseconds.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/precision/validate/isValidNanoseconds.ts)
