@kagamidigital/salt-sdk-mirror
    Preparing search index...

    Type Alias PolicyParams

    PolicyParams:
        | { recipients: RecipientEntry[] }
        | { approvers: ApproverEntry[] }
        | { limits: LimitEntry[] }
        | { restrictions: ContractParamRestriction[] }

    Parameters for a policy. The active member depends on the policy type:

    • { recipients } (RecipientEntry) — allowed_recipients, denied_recipients and denied_proposers. Note denied_proposers keys its addresses under recipients for legacy reasons but is enforced against the transaction's sender (proposer), not its recipient.
    • { approvers } (ApproverEntry) — nominated_approvers (not yet implemented — see PolicyType).
    • { limits } (LimitEntry) — transaction_limit_token_denominated.
    • { restrictions } (ContractParamRestriction) — contract_param_restriction. Each entry is evaluated independently and ANDed: a single failing restriction is a policy breach.

    Policy evaluation note: at most one policy may exist per type + chain, but a '*'-chain policy and a specific-chain policy of the same type both apply on that chain — each is evaluated independently and any breach fails the transaction, so neither overrides the other. Likewise an allowed_recipients and a denied_recipients policy both apply, so an address present in both lists is effectively denied.

    The union is not discriminated in TypeScript, so narrow it with an in check:

    const policy = await salt.getAccountPolicy('policy-id');
    if ('limits' in policy.params) {
    for (const limit of policy.params.limits) {
    console.log(`${limit.address}: max ${limit.amount} per transaction`);
    }
    }