Supported Criteria

On this page, you can find all the criteria supported by the Armory Policy Engine. These will be used to build policy conditions.

Have a use-case not supported? Additional criteria can be created to model nearly any scenario.

checkAction

{
  criterion: Criterion.CHECK_ACTION
  args: Action[]
}

checkPrincipalId

{
  criterion: Criterion.CHECK_PRINCIPAL_ID
  args: string[]
}

checkPrincipalRole

{
  criterion: Criterion.CHECK_PRINCIPAL_ROLE
  args: UserRole[]
}

checkPrincipalGroup

{
  criterion: Criterion.CHECK_PRINCIPAL_GROUP
  args: string[]
}

checkAccountId

{
  criterion: Criterion.CHECK_ACCOUNT_ID
  args: string[]
}

checkAccountAddress

{
  criterion: Criterion.CHECK_ACCOUNT_ADDRESS
  args: string[]
}

checkAccountType

{
  criterion: Criterion.CHECK_ACCOUNT_TYPE
  args: AccountType[]
}

checkAccountGroup

{
  criterion: Criterion.CHECK_ACCOUNT_GROUP
  args: string[]
}

checkDestinationId

{
  criterion: Criterion.CHECK_DESTINATION_ID
  args: AccountId[]
}

checkDestinationAddress

{
  criterion: Criterion.CHECK_DESTINATION_ADDRESS
  args: string[]
}

checkDestinationAccountType

{
  criterion: Criterion.CHECK_DESTINATION_ACCOUNT_TYPE
  args: AccountType[]
}

checkDestinationClassification

{
  criterion: Criterion.CHECK_DESTINATION_CLASSIFICATION
  args: string[]
}

checkChainId

{
  criterion: Criterion.CHECK_CHAIN_ID
  args: number[]
}

checkERC721TokenId

{
  criterion: Criterion.CHECK_ERC721_TOKEN_ID
  args: AssetId[]
}

checkERC1155TokenId

{
  criterion: Criterion.CHECK_ERC1155_TOKEN_ID
  args: AssetId[]
}

checkERC1155Transfers

{
  criterion: Criterion.CHECK_ERC1155_TRANSFERS
  args: AssetId[]
}

checkIntentAlgorithm

{
  criterion: Criterion.CHECK_INTENT_ALGORITHM
  args: Alg[]
}

checkIntentAmount

Intent amount by currency is not supported yet.

{
  criterion: Criterion.CHECK_INTENT_AMOUNT
  args: {
    currency: string
    operator: ValueOperators
    value: string
  }
}

checkIntentChainId

{
  criterion: Criterion.CHECK_INTENT_CHAIN_ID
  args: number[] 
}

checkIntentContract

{
  criterion: Criterion.CHECK_INTENT_CONTRACT
  args: AccountId[]
}

checkIntentDomain

{
  criterion: Criterion.CHECK_INTENT_DOMAIN
  args: {
    version?: string[]
    chainId?: string[]
    name?: string[]
    verifyingContract?: Address[]
  }
}

checkIntentHexSignature

{
  criterion: Criterion.CHECK_INTENT_HEX_SIGNATURE
  args: Hex[]
}

checkIntentMessage

{
  criterion: Criterion.CHECK_INTENT_MESSAGE
  args: {
    operator: ValueOperators.EQUAL | IdentityOperators.CONTAINS
    value: string
  }
}

checkIntentPayload

{
  criterion: Criterion.CHECK_INTENT_PAYLOAD
  args: string[]
}

checkIntentSpender

{
  criterion: Criterion.CHECK_INTENT_SPENDER
  args: AccountId[]
}

checkIntentToken

{
  criterion: Criterion.CHECK_INTENT_TOKEN
  args: AssetId[]
}

checkIntentType

{
  criterion: Criterion.CHECK_INTENT_TYPE
  args: string[]
}

checkNonceExists

{
  criterion: Criterion.CHECK_NONCE_EXISTS
  args: null
}

checkNonceNotExists

{
  criterion: Criterion.CHECK_NONCE_NOT_EXISTS
  args: null
}

checkPermitDeadline

{
  criterion: Criterion.CHECK_PERMIT_DEADLINE
  args: {
    operator: ValueOperators
    value: string
  }
}

checkResource

{
  criterion: Criterion.CHECK_RESOURCE
  args: string[]
}

checkPermission

{
  criterion: Criterion.CHECK_PERMISSION
  args: string[]
}

checkGasFeeAmount

Gas fee by currency is not supported yet.

{
  criterion: Criterion.CHECK_GAS_FEE_AMOUNT
  args: {
    currency: string
    operator: ValueOperators
    value: string
  }
}

checkSpendingLimit

Only Native Transfers and ERC20 Transfers are supported. So this criterion can only be combined with checkIntentType({"transferNative"}) OR checkIntentType({"transferERC20"})

Spending limit by currency is not supported yet.

{
  criterion: Criterion.CHECK_SPENDING_LIMIT
  args: {
    limit: string
    operator: ValueOperators
    currency?: string
    timeWindow?: {
      type?: TimeWindow // "rolling", "fixed"
      period?: TimePeriod // "1d", "1m", "1y"
      value?: number
      startDate?: number
      endDate?: number
    }
    filters?: {
      perPrincipal?: boolean
      tokens?: AssetId[]
      users?: string[]
      resources?: AccountId[]
      destinations?: AccountId[]
      chains?: number[]
      userGroups?: string[]
      accountGroups?: string[]
    }
  }
}

checkRateLimit

Only Native Transfers and ERC20 Transfers are supported. So this criterion can only be combined with checkIntentType({"transferNative"}) OR checkIntentType({"transferERC20"})

{
  criterion: Criterion.CHECK_RATE_LIMIT
  args: {
    limit: string
    timeWindow?: {
      type?: TimeWindow // "rolling", "fixed"
      period?: TimePeriod // "1d", "1m", "1y"
      value?: number
      startDate?: number
      endDate?: number
    }
    filters?: {
      perPrincipal?: boolean
      tokens?: AssetId[]
      users?: string[]
      resources?: AccountId[]
      destinations?: AccountId[]
      chains?: number[]
      userGroups?: string[]
      accountGroups?: string[]
    }
  }
}

checkApprovals

{
  criterion: Criterion.CHECK_APPROVALS
  args: [
    {
      approvalCount: number
      countPrincipal: boolean
      approvalEntityType: EntityType
      entityIds: string[]
    }
  ]
}

Last updated