@stellar-registry/perch-contracts 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @stellar-registry/perch-contracts
2
2
 
3
3
  TypeScript clients for the perch stack contracts, generated by `stellar
4
- contract bindings typescript` from the exact wasm a deployment manifest names,
5
- plus the manifests themselves.
4
+ contract bindings typescript`, plus deployment manifests. Modules generated
5
+ from unreleased builds are explicitly marked undeployed (see below).
6
6
 
7
7
  ```sh
8
8
  npm install @stellar-registry/perch-contracts
@@ -10,13 +10,14 @@ npm install @stellar-registry/perch-contracts
10
10
 
11
11
  | Module | Contract |
12
12
  | --- | --- |
13
- | `account` | `perch-account`: `apply_doc`, `execute`, `applied_doc`, `infra`, upgrades, `cancel_recovery`, and the consumer views `revision`, `configuration`, `document`, `capabilities` |
13
+ | `account` | `perch-account`: `apply_doc`, `apply_grant`, `execute`, `applied_doc`, `infra`, upgrades, `cancel_recovery`, the consumer views `revision`, `configuration`, `document`, `capabilities`, and the grant views |
14
14
  | `factory` | `perch-account-factory`: `create`, `create_passkey`, `address_of`, `passkey_address` |
15
15
  | `recovery` | `perch-recovery`: attempts, guardian and ZK evidence, change approvals, statements |
16
16
  | `pool` | `perch-zk-pool`: trees, leaves, roots, enrollments |
17
17
  | `adapter` | `perch-zk-adapter`: `verify`, `circuit_id`, `tree_depth` |
18
18
  | `webauthnVerifier` | `perch-webauthn-verifier` |
19
- | `docCompiler` | `perch-doc-compiler`: `compile_doc`, `derive_target`, `limits`, `capabilities` |
19
+ | `docCompiler` | `perch-doc-compiler`: `compile_doc`, `derive_target`, `limits`, `grant_limits`, `capabilities` |
20
+ | `legacyAccount`, `legacyDocCompiler` | the deployed `perch-account` and `perch-doc-compiler` specs (snapshot 1; see below) |
20
21
 
21
22
  ```ts
22
23
  import { factory, addressOf, testnet } from '@stellar-registry/perch-contracts';
@@ -37,12 +38,30 @@ from; `npm test` fails if it, or `testnet`, drifts from
37
38
  after a deployment. A module regenerated from a stack built from source
38
39
  (`scripts/bindings-contracts.sh --undeployed <stack> <module>...`), for a
39
40
  contract change not deployed yet, exports `DEPLOYED = false` and is exempt
40
- from that check until the next deployment regenerates it. `PERCH_LIVE=1 npm test` also calls the deployed
41
- contracts through the bindings.
41
+ from that check until the next deployment regenerates it.
42
+ `PERCH_LIVE=1 npm test` also calls the deployed contracts through the
43
+ bindings.
42
44
 
43
45
  A recovery completion (`apply_doc` through the zero-signer recovery rule)
44
46
  must be simulated with its recovery-rule authorization entry already in the
45
47
  transaction. Recording-mode simulation never runs `__check_auth`, so the
46
- controller's `enforce` never marks the call as the completion and
48
+ controller's `rcv_complete` never marks the call as the completion and
47
49
  `rcv_sync` refuses it as a change during the authorized window. See
48
50
  [`docs/deploy/README.md`](../../docs/deploy/README.md#simulating-a-recovery-completion).
51
+
52
+ The `account` and `docCompiler` bindings, from the build that stores rules
53
+ compactly (snapshot 3), are marked undeployed. `legacyAccount` /
54
+ `legacyDocCompiler` (also the `/legacy-account` and `/legacy-doc-compiler`
55
+ package exports) retain the recorded deployed spec. Read `capabilities()`
56
+ before `configuration()`: snapshot 1 uses the legacy account spec, and
57
+ snapshots 2 and 3 the current one, whose `configuration()` is the same in
58
+ both. The stored-rule views (`rule_set`, `grant_rule_set`, with
59
+ `rule_signers` and `grant_signers`) decode only snapshot 3's tuples. Select
60
+ a compiler binding matching that account's pinned compiler, and refuse
61
+ unknown snapshot versions.
62
+
63
+ The Stellar SDK decodes struct fields by position. The current spec cannot
64
+ safely decode old rule maps, and the account itself no longer reads them.
65
+ `perch-js`'s `readSnapshot` supports every snapshot's `configuration()`
66
+ through a matching `AccountReader`; it cannot repair a result already
67
+ misdecoded by the SDK.