Expiry
Defined in: packages/agent/src/agent/http/transforms.ts:31
_isExpiry
Section titled “_isExpiry”
readonly
_isExpiry:true
=true
Defined in: packages/agent/src/agent/http/transforms.ts:32
Methods
Section titled “Methods”toBigInt()
Section titled “toBigInt()”toBigInt():
bigint
Defined in: packages/agent/src/agent/http/transforms.ts:59
Returns
Section titled “Returns”bigint
toHash()
Section titled “toHash()”toHash():
Uint8Array
Defined in: packages/agent/src/agent/http/transforms.ts:63
Returns
Section titled “Returns”Uint8Array
toJSON()
Section titled “toJSON()”toJSON():
JsonnableExpiry
Defined in: packages/agent/src/agent/http/transforms.ts:75
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:67
Returns
Section titled “Returns”string
fromDeltaInMilliseconds()
Section titled “fromDeltaInMilliseconds()”
static
fromDeltaInMilliseconds(deltaInMs
,clockDriftMs
):Expiry
Defined in: packages/agent/src/agent/http/transforms.ts:44
Creates an Expiry object from a delta in milliseconds. If the delta is less than 90 seconds, the expiry is rounded down to the nearest second. Otherwise, the expiry is rounded down to the nearest minute.
Parameters
Section titled “Parameters”deltaInMs
Section titled “deltaInMs”number
The milliseconds to add to the current time.
clockDriftMs
Section titled “clockDriftMs”number
= 0
The milliseconds to add to the current time, typically the clock drift between the client and the IC network clock. Defaults to 0
if not provided.
Returns
Section titled “Returns”Expiry
The constructed Expiry object.
fromJSON()
Section titled “fromJSON()”
static
fromJSON(input
):Expiry
Defined in: packages/agent/src/agent/http/transforms.ts:84
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()”
static
isExpiry(other
):other is Expiry
Defined in: packages/agent/src/agent/http/transforms.ts:99
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”other is Expiry