Function: createReplayGuard()
function createReplayGuard(maxSkewMs?: number): {
firstUse: boolean;
};Defined in: agent-core/src/verify.ts:620 (opens in a new tab)
Remembers the ids of accepted actions, so one signed action is acted on
once. An action passes the freshness bound for maxSkewMs either side of
its signed_at, so its id is kept until signed_at + maxSkewMs. In-memory and
per process: a server on several instances keeps the same record in a
shared store. Two identical calls signed in the same second share an id.
ParametersLink to this section
| Parameter | Type | Default |
|---|---|---|
maxSkewMs | number | Default DEFAULT_MAX_SKEW_MS |
ReturnsLink to this section
{
firstUse: boolean;
}| Name | Type | Defined in |
|---|---|---|
firstUse() | (action: Pick<ActionEnvelope, "id" | "signed_at">, now?: Date) => boolean | agent-core/src/verify.ts:621 (opens in a new tab) |