@stellar-registry/perch-contracts 0.1.2 → 0.2.1
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 +26 -7
- package/dist/account.d.ts +840 -358
- package/dist/account.js +333 -71
- package/dist/adapter.d.ts +2 -525
- package/dist/adapter.js +1 -197
- package/dist/deployment.d.ts +26 -1
- package/dist/deployment.js +2 -1
- package/dist/deployments.js +68 -45
- package/dist/doc-compiler.d.ts +188 -132
- package/dist/doc-compiler.js +31 -20
- package/dist/factory.d.ts +3 -2
- package/dist/factory.js +2 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -0
- package/dist/legacy-account.d.ts +723 -0
- package/dist/legacy-account.js +181 -0
- package/dist/legacy-doc-compiler.d.ts +600 -0
- package/dist/legacy-doc-compiler.js +126 -0
- package/dist/pool.d.ts +1 -861
- package/dist/pool.js +2 -270
- package/dist/recovery.d.ts +76 -118
- package/dist/recovery.js +16 -19
- package/dist/webauthn-verifier.d.ts +1 -1
- package/dist/webauthn-verifier.js +1 -1
- package/package.json +10 -2
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
|
|
5
|
-
|
|
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`,
|
|
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.
|
|
41
|
-
contracts through the
|
|
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 `
|
|
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.
|