Skip to content

Expiry

Defined in: packages/agent/src/agent/http/transforms.ts:32

readonly _isExpiry: true = true

Defined in: packages/agent/src/agent/http/transforms.ts:33

toBigInt(): bigint

Defined in: packages/agent/src/agent/http/transforms.ts:64

bigint


toHash(): Uint8Array

Defined in: packages/agent/src/agent/http/transforms.ts:68

Uint8Array


toJSON(): JsonnableExpiry

Defined in: packages/agent/src/agent/http/transforms.ts:80

Serializes to JSON

JsonnableExpiry

a JSON object with a single key, JSON_KEY_EXPIRY, whose value is the expiry as a string


toString(): string

Defined in: packages/agent/src/agent/http/transforms.ts:72

string


static fromDeltaInMilliseconds(deltaInMs, clockDriftInMs): Expiry

Defined in: packages/agent/src/agent/http/transforms.ts:47

Creates an Expiry object from a delta in milliseconds. The expiry is calculated as: current_time + delta + clock_drift The resulting expiry is then rounded:

  • If rounding down to the nearest minute still provides at least 60 seconds in the future, use minute precision
  • Otherwise, use second precision

number

The milliseconds to add to the current time.

number = 0

The milliseconds to add to the current time, typically the clock drift between IC network clock and the client’s clock. Defaults to 0 if not provided.

Expiry

The constructed Expiry object.


static fromJSON(input): Expiry

Defined in: packages/agent/src/agent/http/transforms.ts:89

Deserializes a JsonnableExpiry object from a JSON string.

string

The JSON string to deserialize.

Expiry

The deserialized Expiry object.


static isExpiry(other): other is Expiry

Defined in: packages/agent/src/agent/http/transforms.ts:104

unknown

other is Expiry