diff --git a/docs/en/pact-functions.md b/docs/en/pact-functions.md index 0658420c9..a5e9b1a11 100644 --- a/docs/en/pact-functions.md +++ b/docs/en/pact-functions.md @@ -622,16 +622,6 @@ Create table TABLE. Top level only: this function will fail if used in module code. -### describe-keyset {#describe-keyset} - -*keyset* `string` *→* `object:*` - - -Get metadata for KEYSET. - -Top level only: this function will fail if used in module code. - - ### describe-module {#describe-module} *module* `string` *→* `object:*` @@ -1356,598 +1346,25 @@ Define keyset as NAME with KEYSET, or if unspecified, read NAME from message pay Top level only: this function will fail if used in module code. -### enforce-keyset {#enforce-keyset} - -*guard* `guard` *→* `bool` - -*keysetname* `string` *→* `bool` - - -Execute GUARD, or defined keyset KEYSETNAME, to enforce desired predicate logic. -```lisp -(enforce-keyset 'admin-keyset) -(enforce-keyset row-guard) -``` - - -### keys-2 {#keys-2} - -*count* `integer` *matched* `integer` *→* `bool` - - -Keyset predicate function to match at least 2 keys in keyset. -```lisp -pact> (keys-2 3 1) -false -``` - - -### keys-all {#keys-all} - -*count* `integer` *matched* `integer` *→* `bool` - - -Keyset predicate function to match all keys in keyset. -```lisp -pact> (keys-all 3 3) -true -``` - - -### keys-any {#keys-any} - -*count* `integer` *matched* `integer` *→* `bool` - - -Keyset predicate function to match any (at least 1) key in keyset. -```lisp -pact> (keys-any 10 1) -true -``` - - -### read-keyset {#read-keyset} - -*key* `string` *→* `keyset` - - -Read KEY from message data body as keyset ({ "keys": KEYLIST, "pred": PREDFUN }). PREDFUN should resolve to a keys predicate. -```lisp -(read-keyset "admin-keyset") -``` - -## Capabilities {#Capabilities} - -### compose-capability {#compose-capability} - -*capability* ` -> bool` *→* `bool` - - -Specifies and requests grant of CAPABILITY which is an application of a 'defcap' production, only valid within a (distinct) 'defcap' body, as a way to compose CAPABILITY with the outer capability such that the scope of the containing 'with-capability' call will "import" this capability. Thus, a call to '(with-capability (OUTER-CAP) OUTER-BODY)', where the OUTER-CAP defcap calls '(compose-capability (INNER-CAP))', will result in INNER-CAP being granted in the scope of OUTER-BODY. -```lisp -(compose-capability (TRANSFER src dest)) -``` - - -### create-module-guard {#create-module-guard} - -*name* `string` *→* `guard` - - -Defines a guard by NAME that enforces the current module admin predicate. - - -### create-pact-guard {#create-pact-guard} - -*name* `string` *→* `guard` - - -Defines a guard predicate by NAME that captures the results of 'pact-id'. At enforcement time, the success condition is that at that time 'pact-id' must return the same value. In effect this ensures that the guard will only succeed within the multi-transaction identified by the pact id. - - -### create-user-guard {#create-user-guard} - -*closure* ` -> bool` *→* `guard` - - -Defines a custom guard CLOSURE whose arguments are strictly evaluated at definition time, to be supplied to indicated function at enforcement time. - - -### enforce-guard {#enforce-guard} - -*guard* `guard` *→* `bool` - -*keysetname* `string` *→* `bool` - - -Execute GUARD, or defined keyset KEYSETNAME, to enforce desired predicate logic. -```lisp -(enforce-guard 'admin-keyset) -(enforce-guard row-guard) -``` - - -### install-capability {#install-capability} - -*capability* ` -> bool` *→* `string` - - -Specifies, and provisions install of, a _managed_ CAPABILITY, defined in a 'defcap' in which a '@managed' tag designates a single parameter to be managed by a specified function. After install, CAPABILITY must still be brought into scope using 'with-capability', at which time the 'manager function' is invoked to validate the request. The manager function is of type 'managed:
requested:
->
', where '
' indicates the type of the managed parameter, such that for '(defcap FOO (bar:string baz:integer) @managed baz FOO-mgr ...)', the manager function would be '(defun FOO-mgr:integer (managed:integer requested:integer) ...)'. Any capability matching the 'static' (non-managed) parameters will cause this function to be invoked with the current managed value and that of the requested capability. The function should perform whatever logic, presumably linear, to validate the request, and return the new managed value representing the 'balance' of the request. NOTE that signatures scoped to a managed capability cause the capability to be automatically provisioned for install similarly to one installed with this function.
-```lisp
-(install-capability (PAY "alice" "bob" 10.0))
-```
-
-
-### keyset-ref-guard {#keyset-ref-guard}
-
-*keyset-ref* `string` *→* `guard`
-
-
-Creates a guard for the keyset registered as KEYSET-REF with 'define-keyset'. Concrete keysets are themselves guard types; this function is specifically to store references alongside other guards in the database, etc.
-
-
-### require-capability {#require-capability}
-
-*capability* ` -> bool` *→* `bool`
-
-
-Specifies and tests for existing grant of CAPABILITY, failing if not found in environment.
-```lisp
-(require-capability (TRANSFER src dest))
-```
-
-
-### with-capability {#with-capability}
-
-*capability* ` -> bool` *body* `[*]` *→* ``
-
-
-Specifies and requests grant of _acquired_ CAPABILITY which is an application of a 'defcap' production. Given the unique token specified by this application, ensure that the token is granted in the environment during execution of BODY. 'with-capability' can only be called in the same module that declares the corresponding 'defcap', otherwise module-admin rights are required. If token is not present, the CAPABILITY is evaluated, with successful completion resulting in the installation/granting of the token, which will then be revoked upon completion of BODY. Nested 'with-capability' calls for the same token will detect the presence of the token, and will not re-apply CAPABILITY, but simply execute BODY. 'with-capability' cannot be called from within an evaluating defcap. Acquire of a managed capability results in emission of the equivalent event.
-```lisp
-(with-capability (UPDATE-USERS id) (update users id { salary: new-salary }))
-```
-
-## SPV {#SPV}
-
-### verify-spv {#verify-spv}
-
-*type* `string` *payload* `object: