Expiry
Defined in: packages/agent/src/agent/http/transforms.ts:32
Properties
Section titled “Properties”_isExpiry
Section titled “_isExpiry”
readonly_isExpiry:true=true
Defined in: packages/agent/src/agent/http/transforms.ts:33
Methods
Section titled “Methods”toBigInt()
Section titled “toBigInt()”toBigInt():
bigint
Defined in: packages/agent/src/agent/http/transforms.ts:64
Returns
Section titled “Returns”bigint
toHash()
Section titled “toHash()”toHash():
Uint8Array
Defined in: packages/agent/src/agent/http/transforms.ts:68
Returns
Section titled “Returns”Uint8Array
toJSON()
Section titled “toJSON()”toJSON():
JsonnableExpiry
Defined in: packages/agent/src/agent/http/transforms.ts:80
Serializes to JSON
Returns
Section titled “Returns”a JSON object with a single key, JSON_KEY_EXPIRY, whose value is the expiry as a string
toString()
Section titled “toString()”toString():
string
Defined in: packages/agent/src/agent/http/transforms.ts:72
Returns
Section titled “Returns”string
fromDeltaInMilliseconds()
Section titled “fromDeltaInMilliseconds()”
staticfromDeltaInMilliseconds(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
Parameters
Section titled “Parameters”deltaInMs
Section titled “deltaInMs”number
The milliseconds to add to the current time.
clockDriftInMs
Section titled “clockDriftInMs”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.
Returns
Section titled “Returns”Expiry
The constructed Expiry object.
fromJSON()
Section titled “fromJSON()”
staticfromJSON(input):Expiry
Defined in: packages/agent/src/agent/http/transforms.ts:89
Deserializes a JsonnableExpiry object from a JSON string.
Parameters
Section titled “Parameters”string
The JSON string to deserialize.
Returns
Section titled “Returns”Expiry
The deserialized Expiry object.
isExpiry()
Section titled “isExpiry()”
staticisExpiry(other):other is Expiry
Defined in: packages/agent/src/agent/http/transforms.ts:104
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”other is Expiry