# Period

Utilities for constructing period durations (in seconds) for recurring spending limits.

Periods define the reset interval for access key spending limits. A spending limit with a
period will reset every `period` seconds. For example, a daily spending limit uses
`Period.days(1)` (86400 seconds).

## Examples

```ts twoslash
import { Value } from 'ox'
import { KeyAuthorization, Period } from 'ox/tempo'

const authorization = KeyAuthorization.from({
  address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
  chainId: 4217n,
  type: 'secp256k1',
  limits: [
    {
      token: '0x20c0000000000000000000000000000000000001',
      limit: Value.from('100', 6),
      period: Period.days(1) // resets daily
    }
  ]
})
```

[Access Keys Specification](https://docs.tempo.xyz/protocol/transactions/spec-tempo-transaction#access-keys)

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Period.days`](/tempo/reference/Period/days) | Returns the number of seconds in `n` days. |
| [`Period.hours`](/tempo/reference/Period/hours) | Returns the number of seconds in `n` hours. |
| [`Period.minutes`](/tempo/reference/Period/minutes) | Returns the number of seconds in `n` minutes. |
| [`Period.months`](/tempo/reference/Period/months) | Returns the number of seconds in `n` months (30 days). |
| [`Period.seconds`](/tempo/reference/Period/seconds) | Returns the number of seconds in `n` seconds. |
| [`Period.weeks`](/tempo/reference/Period/weeks) | Returns the number of seconds in `n` weeks. |
| [`Period.years`](/tempo/reference/Period/years) | Returns the number of seconds in `n` years (365 days). |
