Type alias ActionPolicyInfo

ActionPolicyInfo: {
    contractAddress: Hex;
    sudo?: boolean;
    tokenLimits?: SpendingLimitPolicyData[];
    usageLimit?: bigint;
    validAfter?: number;
    validUntil?: number;
    valueLimit?: bigint;
} & OneOf<{
    functionSelector: string | AbiFunction;
    rules?: Rule[];
} | {
    abi: Abi;
}>

Represents the data structure for an action policy.

Get the universal action policy to use when creating a new session. The universal action policy can be used to ensure that only actions where the calldata has certain parameters can be used. For example, it could restrict swaps on Uniswap to be only under X amount of input token.

Type declaration

  • contractAddress: Hex

    The address of the contract to be included in the policy

  • Optional sudo?: boolean

    The sudo policy is an action policy that will allow any action for the specified target and selector.

  • Optional tokenLimits?: SpendingLimitPolicyData[]

    The spending limits policy can be used to ensure that only a certain amount of ERC-20 tokens can be spent. For native value spends, use the value limit policy

  • Optional usageLimit?: bigint

    The value limit policy can be used to enforce that only a certain amount of native value can be spent. For ERC-20 limits, use the spending limit policy.

  • Optional validAfter?: number

    Timestamp after which the policy becomes valid

  • Optional validUntil?: number

    The timeframe policy can be used to restrict a session to only be able to be used within a certain timeframe

  • Optional valueLimit?: bigint

    The value limit policy can be used to enforce that only a certain amount of native value can be spent. For ERC-20 limits, use the spending limit policy