Skip to main content

RecipientAllowlistPolicy

@totemsdk/agent-policy


@totemsdk/agent-policy / RecipientAllowlistPolicy

Class: RecipientAllowlistPolicy

RecipientAllowlistPolicy — only allows proposals whose recipient address appears in a predefined allowlist. Proposals without a recipient pass through (lookups, receipts).

Addresses are compared as case-sensitive strings. Include all valid address formats (Mx-prefixed, 0x-prefixed, raw hex) that your agents may use.

Example​

const allowlist = new RecipientAllowlistPolicy([
'MxABC...', // supplier A
'MxDEF...', // supplier B
]);

Implements​

Constructors​

Constructor​

new RecipientAllowlistPolicy(allowedAddresses): RecipientAllowlistPolicy

Parameters​

allowedAddresses​

string[]

Returns​

RecipientAllowlistPolicy

Methods​

evaluate()​

evaluate(proposal): Promise<PolicyEvalResult>

Evaluate a proposal. Called in sequence by ComposablePolicy.

Parameters​

proposal​

AgentProposal

Returns​

Promise<PolicyEvalResult>

Implementation of​

PolicyMiddleware.evaluate