Skip to main content

Guard functions

Guard functions are used to create and manage account principals for different types of guards and to enforce guard predicate functions.

FunctionDescription
create‑capability‑guardCreate a predicate function that ensures that specific conditions are true and can be enforced to grant the specified CAPABILITY.
create‑capability‑pact&#8209guardCreate a predicate function that ensures that specific conditions are true and can be enforced to grant the specified CAPABILITY for steps defined in a defpact multi-step transaction.
create‑module‑guardCreate a predicate function with the specified name that ensures that specific conditions are true for the current module.
create‑pact‑guardDefine a predicate function with the specified name that captures the results of the pact-id function for a defpact transaction.
create‑principalCreate a principal account that unambiguously identifies a specified guard predicate function.
create‑user‑guardDefine a custom guard to evaluate and enforce.
is‑principalDetermine whether a string conforms to the principal format without proving its validity.
keyset‑ref‑guardCreate a guard for the keyset registered as keyset-ref in the database.
typeof‑principalReturn the protocol type of the specified principal value.
validate‑principalValidate that a principal identifies a specified guard.