# u64

> **u64**(`value`): [`U64Value`](https://stage.docs.arkiv.network/typescript-sdk/api-reference/main/type-aliases/u64value/)

Defined in: [src/attr/values.ts:146](https://github.com/Arkiv-Network/arkiv-sdk-js/blob/488e08c3687cc5cfaf5dd8ab0fe0f7fed40930bb/src/attr/values.ts#L146)

A 64-bit unsigned integer, indexed for equality and range queries.

This is the width the protocol counts in: block heights, `$expiresAt` and the entity-nonce are
all `u64`, so it is the type to reach for when a value has to line up with one of them. Use
[u256](https://stage.docs.arkiv.network/typescript-sdk/api-reference/main/functions/u256/) for token amounts and anything else that can exceed 2⁶⁴.

## Parameters

### value

A non-negative integer, as a `bigint`, a safe `number`, or a decimal or `0x` hex
string.

`string` | `number` | `bigint`

## Returns

[`U64Value`](https://stage.docs.arkiv.network/typescript-sdk/api-reference/main/type-aliases/u64value/)

## Throws

If the value is negative, non-integral, or wider than 64 bits.

## Example

```ts
u64(1_200_000n)     // a block height
u64(Date.now())     // safe integers are accepted
u64("0x124f80")     // hex, as it comes back over JSON-RPC
```