@openzeppelin/miden-multisig-client 0.18.0 → 0.18.2

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.
Files changed (104) hide show
  1. package/README.md +176 -23
  2. package/dist/client.d.ts +41 -2
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +79 -2
  5. package/dist/client.js.map +1 -1
  6. package/dist/index.d.ts +7 -4
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +7 -4
  9. package/dist/index.js.map +1 -1
  10. package/dist/lookupAuth.d.ts.map +1 -1
  11. package/dist/lookupAuth.js +2 -20
  12. package/dist/lookupAuth.js.map +1 -1
  13. package/dist/multisig/authArgErrors.d.ts +27 -1
  14. package/dist/multisig/authArgErrors.d.ts.map +1 -1
  15. package/dist/multisig/authArgErrors.js +33 -0
  16. package/dist/multisig/authArgErrors.js.map +1 -1
  17. package/dist/multisig.d.ts +77 -11
  18. package/dist/multisig.d.ts.map +1 -1
  19. package/dist/multisig.js +247 -181
  20. package/dist/multisig.js.map +1 -1
  21. package/dist/proposal/metadata.d.ts.map +1 -1
  22. package/dist/proposal/metadata.js +2 -0
  23. package/dist/proposal/metadata.js.map +1 -1
  24. package/dist/recovery/transportDrain.d.ts +38 -30
  25. package/dist/recovery/transportDrain.d.ts.map +1 -1
  26. package/dist/recovery/transportDrain.js +113 -113
  27. package/dist/recovery/transportDrain.js.map +1 -1
  28. package/dist/session/grant.d.ts +40 -0
  29. package/dist/session/grant.d.ts.map +1 -0
  30. package/dist/session/grant.js +125 -0
  31. package/dist/session/grant.js.map +1 -0
  32. package/dist/session/key.d.ts +103 -0
  33. package/dist/session/key.d.ts.map +1 -0
  34. package/dist/session/key.js +160 -0
  35. package/dist/session/key.js.map +1 -0
  36. package/dist/session/manager.d.ts +76 -0
  37. package/dist/session/manager.d.ts.map +1 -0
  38. package/dist/session/manager.js +187 -0
  39. package/dist/session/manager.js.map +1 -0
  40. package/dist/signers/ecdsa.d.ts +5 -1
  41. package/dist/signers/ecdsa.d.ts.map +1 -1
  42. package/dist/signers/ecdsa.js +9 -0
  43. package/dist/signers/ecdsa.js.map +1 -1
  44. package/dist/signers/falcon.d.ts +5 -1
  45. package/dist/signers/falcon.d.ts.map +1 -1
  46. package/dist/signers/falcon.js +9 -0
  47. package/dist/signers/falcon.js.map +1 -1
  48. package/dist/signers/ledger.d.ts +9 -1
  49. package/dist/signers/ledger.d.ts.map +1 -1
  50. package/dist/signers/ledger.js +13 -1
  51. package/dist/signers/ledger.js.map +1 -1
  52. package/dist/signers/miden-wallet.d.ts +13 -1
  53. package/dist/signers/miden-wallet.d.ts.map +1 -1
  54. package/dist/signers/miden-wallet.js +25 -0
  55. package/dist/signers/miden-wallet.js.map +1 -1
  56. package/dist/signers/para.d.ts +5 -1
  57. package/dist/signers/para.d.ts.map +1 -1
  58. package/dist/signers/para.js +9 -0
  59. package/dist/signers/para.js.map +1 -1
  60. package/dist/transaction/authArgs.d.ts +2 -2
  61. package/dist/transaction/authArgs.js +2 -2
  62. package/dist/transaction/options.d.ts +2 -2
  63. package/dist/transaction/summary.d.ts +17 -61
  64. package/dist/transaction/summary.d.ts.map +1 -1
  65. package/dist/transaction/summary.js +49 -95
  66. package/dist/transaction/summary.js.map +1 -1
  67. package/dist/transaction.d.ts +1 -1
  68. package/dist/transaction.d.ts.map +1 -1
  69. package/dist/transaction.js +1 -1
  70. package/dist/transaction.js.map +1 -1
  71. package/dist/types/proposal.d.ts +11 -5
  72. package/dist/types/proposal.d.ts.map +1 -1
  73. package/dist/types/proposal.js.map +1 -1
  74. package/dist/utils/eip712.d.ts +26 -69
  75. package/dist/utils/eip712.d.ts.map +1 -1
  76. package/dist/utils/eip712.js +101 -8
  77. package/dist/utils/eip712.js.map +1 -1
  78. package/dist/utils/felt.d.ts +7 -1
  79. package/dist/utils/felt.d.ts.map +1 -1
  80. package/dist/utils/felt.js +18 -1
  81. package/dist/utils/felt.js.map +1 -1
  82. package/package.json +4 -4
  83. package/src/client.ts +97 -2
  84. package/src/index.ts +29 -8
  85. package/src/lookupAuth.ts +3 -22
  86. package/src/multisig/authArgErrors.ts +42 -1
  87. package/src/multisig.ts +318 -207
  88. package/src/proposal/metadata.ts +2 -0
  89. package/src/recovery/transportDrain.ts +118 -124
  90. package/src/session/grant.ts +143 -0
  91. package/src/session/key.ts +215 -0
  92. package/src/session/manager.ts +273 -0
  93. package/src/signers/ecdsa.ts +12 -1
  94. package/src/signers/falcon.ts +12 -1
  95. package/src/signers/ledger.ts +19 -2
  96. package/src/signers/miden-wallet.ts +29 -1
  97. package/src/signers/para.ts +12 -1
  98. package/src/transaction/authArgs.ts +2 -2
  99. package/src/transaction/options.ts +2 -2
  100. package/src/transaction/summary.ts +62 -110
  101. package/src/transaction.ts +1 -6
  102. package/src/types/proposal.ts +11 -5
  103. package/src/utils/eip712.ts +130 -10
  104. package/src/utils/felt.ts +19 -1
package/README.md CHANGED
@@ -17,7 +17,7 @@ Miden multisig accounts store their authentication logic on-chain, but **their s
17
17
  ## Installation
18
18
 
19
19
  ```bash
20
- npm install @openzeppelin/miden-multisig-client@0.18.0 @miden-sdk/miden-sdk@0.17.0
20
+ npm install @openzeppelin/miden-multisig-client@0.18.2 @miden-sdk/miden-sdk@0.17.3
21
21
  ```
22
22
 
23
23
  Miden 0.17 requires a new client database: a store created under 0.16 does not
@@ -94,6 +94,59 @@ symptoms and recovery are in
94
94
  [TROUBLESHOOTING.md](https://github.com/OpenZeppelin/guardian/blob/main/docs/TROUBLESHOOTING.md#account-data-wasnt-found-or-incomplete-storage-map-in-a-browser).
95
95
  Node.js has no worker and is unaffected.
96
96
 
97
+ ### Cedar
98
+
99
+ `@miden-sdk/miden-sdk` 0.17.3 has no Cedar preset and no `'cedar'` shorthand,
100
+ so a Cedar client names its endpoints explicitly:
101
+
102
+ ```typescript
103
+ const midenClient = await MidenClient.create({
104
+ rpcUrl: 'https://rpc.cedar.miden.io',
105
+ proverUrl: 'https://tx-prover.cedar.miden.io',
106
+ noteTransportUrl: 'https://transport.cedar.miden.io',
107
+ autoSync: true,
108
+ useWorker: false,
109
+ });
110
+
111
+ const client = new MultisigClient(midenClient, {
112
+ guardianEndpoint: 'https://your-guardian-host',
113
+ midenRpcEndpoint: 'https://rpc.cedar.miden.io',
114
+ });
115
+ ```
116
+
117
+ Cedar addresses use the `mm` prefix, today the same as mainnet's. In Rust,
118
+ `MidenCedar::endpoint()` selects the Cedar prover and note transport automatically.
119
+
120
+ ### Mainnet
121
+
122
+ `@miden-sdk/miden-sdk` 0.17.3 has no `createMainnet()` preset and no
123
+ `'mainnet'` shorthand for `rpcUrl`, `proverUrl`, or `noteTransportUrl` either,
124
+ so a mainnet client names its endpoints the same way:
125
+
126
+ ```typescript
127
+ const midenClient = await MidenClient.create({
128
+ rpcUrl: 'https://rpc.mainnet.miden.io',
129
+ proverUrl: 'https://tx-prover.mainnet.miden.io',
130
+ noteTransportUrl: 'https://transport.mainnet.miden.io',
131
+ autoSync: true,
132
+ useWorker: false,
133
+ });
134
+
135
+ const client = new MultisigClient(midenClient, {
136
+ guardianEndpoint: 'https://your-guardian-host',
137
+ midenRpcEndpoint: 'https://rpc.mainnet.miden.io',
138
+ prover: {
139
+ retry: { maxAttempts: 4 },
140
+ },
141
+ });
142
+ ```
143
+
144
+ `createTestnet` and `createDevnet` set exactly these three endpoints plus
145
+ `autoSync`, so the explicit Cedar and mainnet forms are equivalent. Without
146
+ `noteTransportUrl`, private notes cannot be relayed between cosigners. Leave
147
+ `prover.url` unset so the SDK keeps the Cedar or mainnet prover injected into
148
+ the `MidenClient`; a `url` there overrides it.
149
+
97
150
  For an ECDSA cosigner using an EIP-1193 wallet (including Ledger), call
98
151
  `Eip712Signer.connect(provider)` once to select the Ethereum address and
99
152
  recover its secp256k1 public key from a dedicated key-discovery signature.
@@ -184,12 +237,20 @@ The full cross-SDK reference, including the Rust equivalents, is
184
237
 
185
238
  ### Get GUARDIAN Public Key
186
239
 
187
- Before creating a multisig, get the GUARDIAN server's public key commitment:
240
+ Before creating a multisig, get the GUARDIAN server's ACK commitment for the
241
+ account's signature scheme:
188
242
 
189
243
  ```typescript
190
- const guardianCommitment = await client.guardianClient.getPubkey();
244
+ const { commitment: guardianCommitment } = await client.guardianClient.getPubkey(signer.scheme);
191
245
  ```
192
246
 
247
+ `getPubkey` returns `{ commitment, pubkey }` for one signature scheme and
248
+ defaults to Falcon when no scheme is passed, including on a Guardian that only
249
+ admits ECDSA accounts (`GUARDIAN_ALLOWED_ACCOUNT_SCHEMES=ecdsa`): both ACK keys
250
+ stay loaded for existing accounts. Always pass the scheme of the account you
251
+ are creating, usually `signer.scheme`. A Falcon commitment in an ECDSA account
252
+ is refused at registration with an authorization error, not a scheme mismatch.
253
+
193
254
  ### Create a Multisig Account
194
255
 
195
256
  ```typescript
@@ -214,6 +275,67 @@ After creating the account, register it on the GUARDIAN server:
214
275
  await multisig.registerOnGuardian();
215
276
  ```
216
277
 
278
+ ### Sign Requests With a Session
279
+
280
+ Every Guardian request is otherwise signed by the wallet, which on a hardware
281
+ wallet means a prompt per request. When the Guardian supports sessions, the
282
+ wallet signs one grant and a non-extractable WebCrypto P-256 key, the delegated
283
+ signer, signs reads and proposal requests until the session ends:
284
+
285
+ ```typescript
286
+ import {
287
+ IndexedDbSessionKeyStore,
288
+ describeSessionGrant,
289
+ } from '@openzeppelin/miden-multisig-client';
290
+
291
+ const store = new IndexedDbSessionKeyStore(); // optional: survive reloads
292
+ // 'expired', 'revoked' or 'rejected': requests are wallet-signed again, so
293
+ // offer a new session. 'logout': the app ended it itself.
294
+ const onEnded = (reason) => console.info('Guardian session ended:', reason);
295
+ const session =
296
+ (await client.resumeSession(signer, store, { onEnded })) ??
297
+ (await client.startSession(signer, {
298
+ store,
299
+ onEnded,
300
+ // Required for raw wallets, which only show a hash.
301
+ confirm: (grant) => showToUser(describeSessionGrant(grant)),
302
+ }));
303
+
304
+ // ...sync, list proposals and create proposals without wallet prompts.
305
+ // Approving a proposal still asks the wallet to sign the transaction.
306
+
307
+ await client.endSession(store); // this session only
308
+ await client.revokeAllSessions(signer, store); // every session of the signer, wallet-signed
309
+ ```
310
+
311
+ The grant covers every account the signer cosigns on this Guardian, now or
312
+ later, until it expires. It names the website that asked for it
313
+ (`location.origin` by default). The page writes that field, so it is
314
+ unverified: the trustworthy signal is the wallet's own indicator of the
315
+ requesting site, and Guardian does not check it against requests. Ledger and
316
+ other EIP-712 wallets sign the grant as readable typed data (`GuardianSession`:
317
+ signer, session key, website, issued/expires, scope, Guardian key, network).
318
+ Without registered display metadata, Ledger devices need "Verbose EIP-712"
319
+ enabled. Raw (Falcon, raw ECDSA) wallets show only a hash, so `startSession`
320
+ requires `confirm` for them; that shows the fields on an honest page but is
321
+ no protection against a phishing page, which shows what it wants.
322
+ Transaction approvals, account registration, delta pushes, candidate abandons
323
+ and account lookup still use the wallet; the server rejects session
324
+ credentials there with `wallet_signature_required`.
325
+
326
+ The session ends when it expires, when it is logged out or revoked, or when
327
+ Guardian no longer accepts it (for example after a Guardian restart without
328
+ persistent sessions, or a Guardian key rotation). Requests then go back to the
329
+ wallet, the stored key is forgotten, and `onEnded` is called once with the
330
+ reason. Removing the signer from an account ends its delegated access to that
331
+ account (`authorization_failed`, the session keeps working for the others);
332
+ adding it back restores any unexpired grant.
333
+
334
+ Page logout is not revocation: a script that stole the key keeps it, so use
335
+ `revokeAllSessions` when in doubt, and run it again 10 minutes later.
336
+ Revoke-all ends the sessions already registered with Guardian, and a page that
337
+ got a grant signed can register it for up to about 10 minutes afterwards.
338
+
217
339
  ### Load an Existing Multisig
218
340
 
219
341
  The configuration is automatically detected from the account's on-chain storage:
@@ -310,8 +432,10 @@ createSwitchGuardianProposal(endpoint, pubkey, { nonce }?)
310
432
  createCustomProposal(requestBytes, label, { nonce }?)
311
433
  ```
312
434
 
313
- All methods accept `nonce` (identifies the proposal; defaults to
314
- `Date.now()`). `newThreshold` defaults to the current threshold on add and to
435
+ All methods accept `nonce` (identifies the proposal; defaults to the store
436
+ account's nonce plus one, the nonce the executed transaction will have, as the
437
+ Rust SDK labels proposals; through 0.18.0 the default was `Date.now()`).
438
+ `newThreshold` defaults to the current threshold on add and to
315
439
  the min of the current threshold and the remaining signer count on remove.
316
440
  The option shapes are exported as `CreateProposalOptions`,
317
441
  `CreateSignerProposalOptions`, and `CreateP2idProposalOptions`.
@@ -367,7 +491,12 @@ for (const p of proposals) {
367
491
  ### Recover From a Dead Transaction (Abandon)
368
492
 
369
493
  If an approved transaction died client-side after guardian approval, the
370
- candidate keeps the account locked on GUARDIAN. Record an abandon intent
494
+ candidate keeps the account locked on GUARDIAN: proposals and deltas answer
495
+ `conflict_pending_delta` while the account's candidate queue (one candidate
496
+ by default) is full, when they build on the state that candidate already
497
+ claimed, or when their nonce does not extend the queue (a proposal's must be
498
+ the newest queued candidate's plus one), and any candidate queued behind it
499
+ can never land. Record an abandon intent
371
500
  and poll for the resolution:
372
501
 
373
502
  ```typescript
@@ -456,8 +585,10 @@ sync height, so `syncProposals`, `signProposal`, `executeProposal`,
456
585
  client first. Foreign accounts, the fee faucet among them, load at the tip, so
457
586
  a proposal stays verifiable however long it waits for signatures, even after
458
587
  the node has pruned the bound block's account state (devnet keeps about 50
459
- blocks). The proposal's `chainAnchor` still names the bound block, and
460
- 0.18.0-rc.1 clients still re-execute at it.
588
+ blocks). The proposal's `boundBlockNum` records the bound block. The SDK reads
589
+ that block from the signed summary when it creates a proposal and when it
590
+ verifies one, and refuses a proposal whose `boundBlockNum` disagrees
591
+ (`BoundBlockMismatchError`), as the Rust SDK does.
461
592
 
462
593
  `createTransactionProposalRequest(proposalId)` returns the final, fully
463
594
  signed request for an integration that proves and submits with its own
@@ -476,6 +607,18 @@ if (proposal.status === 'ready') {
476
607
  }
477
608
  ```
478
609
 
610
+ GUARDIAN pins every proposal to the account state its transaction must execute
611
+ on. Execution (and `createTransactionProposalRequest` and
612
+ `prepareCustomExecution`) refuses a proposal pinned to a state other than the one
613
+ this client holds: sync with `syncState()` and retry, or create a new proposal if
614
+ the account has moved past that state. A `switch_guardian` proposal is checked
615
+ the same way when the pre-switch GUARDIAN serves it. When that GUARDIAN never
616
+ received it (made offline), is unreachable, or answers with an error, the switch
617
+ executes without the check (logging a warning in the last two cases), so a
618
+ GUARDIAN the account is rotating away from cannot block the rotation. After
619
+ the switch the delta is pushed back to it best-effort, naming the state the
620
+ switch executed on, as the Rust SDK does.
621
+
479
622
  ### Export Proposal for Offline Signing
480
623
 
481
624
  ```typescript
@@ -541,7 +684,7 @@ exported/imported through the normal flow, but the SDK cannot build its on-chain
541
684
  transaction — the integration owns that recipe and submits it itself.
542
685
 
543
686
  ```typescript
544
- import { buildP2idTransactionRequest, chainAnchorBlockNum } from '@openzeppelin/miden-multisig-client';
687
+ import { buildP2idTransactionRequest } from '@openzeppelin/miden-multisig-client';
545
688
 
546
689
  // Producer: build a transaction and propose it under a custom label.
547
690
  // The options object accepts `noteType` (`NoteType.Public` (default) or
@@ -570,7 +713,8 @@ const advice = await multisig.prepareCustomExecution(proposal.id, request.serial
570
713
  // The browser TransactionRequest is immutable, so rebuild from the same recipe
571
714
  // (inputs + salt + bound block) with the advice, then submit. `submitTransaction`
572
715
  // executes at the chain tip: the rebuilt request declares the block it binds.
573
- const boundBlockNum = chainAnchorBlockNum(proposal.metadata.chainAnchor);
716
+ // `prepareCustomExecution` has checked `boundBlockNum` against the signed summary.
717
+ const boundBlockNum = proposal.metadata.boundBlockNum;
574
718
  const { request: finalRequest } = await buildP2idTransactionRequest(
575
719
  midenClient, senderId, recipientId, faucetId, amount,
576
720
  { salt, boundBlockNum, signatureAdviceMap: advice },
@@ -594,23 +738,32 @@ integration asks for one through `approvalExpirationDelta`, which the
594
738
  `create*Proposal` methods forward from their options.
595
739
 
596
740
  The integration keeps its own recipe (build inputs + salt) and reads the bound
597
- block from the proposal's chain anchor, so it can reproduce the exact
598
- transaction at execute time — the SDK does not store the serialized request.
741
+ block from `proposal.metadata.boundBlockNum`, so it can reproduce the exact
742
+ transaction at execute time - the SDK does not store the serialized request.
743
+ Verification and `prepareCustomExecution` refuse a custom proposal whose
744
+ `boundBlockNum` disagrees with its signed summary, as for every other type. A
745
+ proposal a 0.18.0 client made has none; `summaryBoundBlockNum` reads its block
746
+ from the summary.
599
747
  The binding check guarantees the rebuilt transaction matches the commitment the
600
- cosigners signed. A request built at one sync height and anchored at another is
601
- refused by `executeForSummary` with `SummaryAnchorMismatchError`; rebuild and
602
- retry.
748
+ cosigners signed. The request may bind any block up to the client's sync
749
+ height: `createCustomProposal` syncs up to that block when the client is behind
750
+ it and derives the summary at the chain tip.
603
751
 
604
752
  The summary binds the salt itself, so the value the cosigners signed over is
605
- readable back out of it:
753
+ readable back out of it, as is the block it binds:
606
754
 
607
755
  ```typescript
608
- import { summarySalt, summaryApprovalExpirationBlockNum } from '@openzeppelin/miden-multisig-client';
756
+ import {
757
+ summaryApprovalExpirationBlockNum,
758
+ summaryBoundBlockNum,
759
+ summarySalt,
760
+ } from '@openzeppelin/miden-multisig-client';
609
761
  import { TransactionSummary } from '@miden-sdk/miden-sdk';
610
762
 
611
763
  const summary = TransactionSummary.deserialize(bytes);
612
764
  const salt = summarySalt(summary);
613
765
  const expiresAt = summaryApprovalExpirationBlockNum(summary); // undefined: never
766
+ const boundBlockNum = summaryBoundBlockNum(summary);
614
767
  ```
615
768
 
616
769
  The SDK's own verification path compares `summarySalt(summary)` with the
@@ -699,10 +852,11 @@ local store) becomes a `RecoveryStepProblem` entry instead of aborting the
699
852
  flow, and `retryable: true` means rerunning the flow — which is idempotent —
700
853
  can plausibly recover more. In brief:
701
854
 
702
- - **Transport drain** — rescans the full private-note transport backlog for
703
- every tracked tag, regardless of the stored cursor (and without ever
704
- regressing it). Bounded by the transport service's retention: a
705
- best-effort rescan, **not** a backup.
855
+ - **Transport drain** — fetches the private-note transport backlog for
856
+ every tracked tag until a fetch moves no tag's cursor. A recovered account's
857
+ tag has no transport cursor yet, so its whole retained backlog is fetched.
858
+ Bounded by the transport service's retention: a best-effort rescan,
859
+ **not** a backup.
706
860
  - **Proposal import** — rebuilds importable notes from the bytes v2
707
861
  consume-notes proposals embed (validated against the proposals' declared
708
862
  note ids) plus node-fetched inclusion proofs, so it works for private
@@ -795,8 +949,7 @@ discriminator.
795
949
  trip and are imported into the local store as committed (with one
796
950
  `syncState` if the store is behind the note's block). Verification
797
951
  therefore reads and writes the local store and contacts the node.
798
- `createConsumeNotesProposal` does the same before the summary and its
799
- chain anchor are captured, and refuses a note that is not yet
952
+ `createConsumeNotesProposal` does the same before the summary is derived, and refuses a note that is not yet
800
953
  committed on chain.
801
954
 
802
955
  `createConsumeNotesProposal` always emits v2 starting with this
package/dist/client.d.ts CHANGED
@@ -9,6 +9,8 @@ import { GuardianHttpClient } from '@openzeppelin/guardian-client';
9
9
  import type { StateObject } from '@openzeppelin/guardian-client';
10
10
  import { Multisig } from './multisig.js';
11
11
  import type { MultisigConfig, Signer } from './types.js';
12
+ import type { GuardianSession, SessionKeyStore } from './session/key.js';
13
+ import { type StartSessionOptions } from './session/manager.js';
12
14
  import { type ProverConfig } from './prover/config.js';
13
15
  import { type RpcConfig } from './rpc/config.js';
14
16
  /**
@@ -67,8 +69,8 @@ export interface RecoveredAccount {
67
69
  * },
68
70
  * });
69
71
  *
70
- * // Get GUARDIAN pubkey for config
71
- * const guardianCommitment = await client.guardianClient.getPubkey();
72
+ * // Get GUARDIAN's ACK commitment for the account's signature scheme
73
+ * const { commitment: guardianCommitment } = await client.guardianClient.getPubkey(signer.scheme);
72
74
  *
73
75
  * // Create multisig
74
76
  * const config = { threshold: 2, signerCommitments: [...], guardianCommitment };
@@ -81,6 +83,7 @@ export declare class MultisigClient {
81
83
  private readonly proverConfig;
82
84
  private readonly rpcConfig;
83
85
  private _guardianClient;
86
+ private guardianSession;
84
87
  constructor(midenClient: MidenClient, config: MultisigClientConfig);
85
88
  /**
86
89
  * Change the GUARDIAN endpoint.
@@ -92,6 +95,42 @@ export declare class MultisigClient {
92
95
  * Access the internal GUARDIAN client.
93
96
  */
94
97
  get guardianClient(): GuardianHttpClient;
98
+ /**
99
+ * Start a Guardian session: `signer` signs one grant, then a non-extractable
100
+ * browser key (the delegated signer) signs this client's session-eligible
101
+ * Guardian requests (state and delta reads, proposal list/get/create/sign)
102
+ * until the session ends. Account configuration, lookup, delta pushes,
103
+ * candidate abandons and transaction approvals keep using `signer`. Pass
104
+ * `options.store` to survive page reloads via `resumeSession`, and
105
+ * `options.onEnded` to learn when requests fall back to the wallet.
106
+ *
107
+ * A session this client already holds is logged out once the new one is
108
+ * registered. A Guardian endpoint change (`setGuardianEndpoint`) drops the
109
+ * session.
110
+ */
111
+ startSession(signer: Signer, options?: StartSessionOptions): Promise<GuardianSession>;
112
+ /**
113
+ * Reuse a session key stored by `startSession` without a wallet prompt.
114
+ * Returns `null` when there is none or it is about to expire.
115
+ */
116
+ resumeSession(signer: Signer, store: SessionKeyStore, options?: Pick<StartSessionOptions, 'onEnded'>): Promise<GuardianSession | null>;
117
+ /**
118
+ * Revoke the current session, fall back to wallet signatures, and forget its
119
+ * stored key. Returns whether Guardian still had the session active. On
120
+ * error the session stays in use.
121
+ */
122
+ endSession(store?: SessionKeyStore): Promise<boolean>;
123
+ /**
124
+ * Revoke every session of `signer` on the Guardian with a wallet signature,
125
+ * including sessions started in other tabs or devices; stop using the
126
+ * current one and forget its stored key. Use it when a session key may be
127
+ * compromised, and run it again 10 minutes later: it ends only sessions
128
+ * already registered, and a page can register a grant it got signed for up
129
+ * to about 10 minutes. Returns how many sessions Guardian revoked.
130
+ */
131
+ revokeAllSessions(signer: Signer, store?: SessionKeyStore): Promise<number>;
132
+ /** Forgets the session this client holds once Guardian stops using it. */
133
+ private trackSessionEnd;
95
134
  /**
96
135
  * Recover the set of accounts a given signer authorizes by querying
97
136
  * Guardian's `/state/lookup` endpoint and fetching state for each match.
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,WA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M,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAoBvE;;;;;;OAMG;IACG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IA+ChE;;;;;;;;;;;;;;;OAeG;YACW,oBAAoB;CAuEnC"}
package/dist/client.js CHANGED
@@ -12,6 +12,7 @@ import { AccountInspector, assertCompleteDetectedConfig } from './inspector.js';
12
12
  import { requireConfigValue, requireMidenRpcEndpoint } from './config.js';
13
13
  import { isSafeToAdoptGuardianState, readOnChainCommitment } from './state/adopt.js';
14
14
  import { normalizeHexWord } from './utils/encoding.js';
15
+ import { endGuardianSession, resumeGuardianSession, revokeAllGuardianSessions, startGuardianSession, } from './session/manager.js';
15
16
  import { resolveProverConfig, } from './prover/config.js';
16
17
  import { resolveRpcConfig, } from './rpc/config.js';
17
18
  async function bindSignerAccountKey(signer, midenClient, accountId) {
@@ -48,8 +49,8 @@ async function bindSignerAccountKey(signer, midenClient, accountId) {
48
49
  * },
49
50
  * });
50
51
  *
51
- * // Get GUARDIAN pubkey for config
52
- * const guardianCommitment = await client.guardianClient.getPubkey();
52
+ * // Get GUARDIAN's ACK commitment for the account's signature scheme
53
+ * const { commitment: guardianCommitment } = await client.guardianClient.getPubkey(signer.scheme);
53
54
  *
54
55
  * // Create multisig
55
56
  * const config = { threshold: 2, signerCommitments: [...], guardianCommitment };
@@ -62,6 +63,7 @@ export class MultisigClient {
62
63
  proverConfig;
63
64
  rpcConfig;
64
65
  _guardianClient;
66
+ guardianSession = null;
65
67
  constructor(midenClient, config) {
66
68
  this.midenClient = midenClient;
67
69
  this.midenRpcEndpoint = requireMidenRpcEndpoint(config?.midenRpcEndpoint);
@@ -76,6 +78,7 @@ export class MultisigClient {
76
78
  */
77
79
  setGuardianEndpoint(endpoint) {
78
80
  this._guardianClient = new GuardianHttpClient(requireConfigValue('guardianEndpoint', endpoint));
81
+ this.guardianSession = null;
79
82
  }
80
83
  /**
81
84
  * Access the internal GUARDIAN client.
@@ -83,6 +86,80 @@ export class MultisigClient {
83
86
  get guardianClient() {
84
87
  return this._guardianClient;
85
88
  }
89
+ /**
90
+ * Start a Guardian session: `signer` signs one grant, then a non-extractable
91
+ * browser key (the delegated signer) signs this client's session-eligible
92
+ * Guardian requests (state and delta reads, proposal list/get/create/sign)
93
+ * until the session ends. Account configuration, lookup, delta pushes,
94
+ * candidate abandons and transaction approvals keep using `signer`. Pass
95
+ * `options.store` to survive page reloads via `resumeSession`, and
96
+ * `options.onEnded` to learn when requests fall back to the wallet.
97
+ *
98
+ * A session this client already holds is logged out once the new one is
99
+ * registered. A Guardian endpoint change (`setGuardianEndpoint`) drops the
100
+ * session.
101
+ */
102
+ async startSession(signer, options = {}) {
103
+ const previous = this.guardianSession;
104
+ const session = await startGuardianSession(this._guardianClient, signer, {
105
+ ...options,
106
+ onEnded: this.trackSessionEnd(options.onEnded),
107
+ });
108
+ this.guardianSession = session;
109
+ if (previous) {
110
+ await endGuardianSession(this._guardianClient, previous, options.store).catch(() => false);
111
+ }
112
+ return session;
113
+ }
114
+ /**
115
+ * Reuse a session key stored by `startSession` without a wallet prompt.
116
+ * Returns `null` when there is none or it is about to expire.
117
+ */
118
+ async resumeSession(signer, store, options = {}) {
119
+ const session = await resumeGuardianSession(this._guardianClient, signer, store, {
120
+ onEnded: this.trackSessionEnd(options.onEnded),
121
+ });
122
+ if (session) {
123
+ this.guardianSession = session;
124
+ }
125
+ return session;
126
+ }
127
+ /**
128
+ * Revoke the current session, fall back to wallet signatures, and forget its
129
+ * stored key. Returns whether Guardian still had the session active. On
130
+ * error the session stays in use.
131
+ */
132
+ async endSession(store) {
133
+ const session = this.guardianSession;
134
+ if (!session) {
135
+ return false;
136
+ }
137
+ const revoked = await endGuardianSession(this._guardianClient, session, store);
138
+ if (this.guardianSession === session) {
139
+ this.guardianSession = null;
140
+ }
141
+ return revoked;
142
+ }
143
+ /**
144
+ * Revoke every session of `signer` on the Guardian with a wallet signature,
145
+ * including sessions started in other tabs or devices; stop using the
146
+ * current one and forget its stored key. Use it when a session key may be
147
+ * compromised, and run it again 10 minutes later: it ends only sessions
148
+ * already registered, and a page can register a grant it got signed for up
149
+ * to about 10 minutes. Returns how many sessions Guardian revoked.
150
+ */
151
+ async revokeAllSessions(signer, store) {
152
+ return revokeAllGuardianSessions(this._guardianClient, signer, store);
153
+ }
154
+ /** Forgets the session this client holds once Guardian stops using it. */
155
+ trackSessionEnd(onEnded) {
156
+ return (reason, session) => {
157
+ if (this.guardianSession === session) {
158
+ this.guardianSession = null;
159
+ }
160
+ onEnded?.(reason, session);
161
+ };
162
+ }
86
163
  /**
87
164
  * Recover the set of accounts a given signer authorizes by querying
88
165
  * Guardian's `/state/lookup` endpoint and fetching state for each match.
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAoB,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE1E,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,mBAAmB,GAGpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,GAGjB,MAAM,iBAAiB,CAAC;AAMzB,KAAK,UAAU,oBAAoB,CACjC,MAAc,EACd,WAAwB,EACxB,SAAiB;IAEjB,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cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;aAC/C,CAAC,CAAC;YACH,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACtF,OAAO,eAAe,CAAC;QACzB,CAAC;QAED,MAAM,eAAe,GAAG,gBAAgB,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QAC/E,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QACrF,2EAA2E;QAC3E,yEAAyE;QACzE,IAAI,eAAe,KAAK,kBAAkB,EAAE,CAAC;YAC3C,OAAO,YAAY,CAAC;QACtB,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,0BAA0B,CAAC;YAC7C,SAAS;YACT,eAAe;YACf,YAAY;YACZ,cAAc,EAAE,GAAG,EAAE,CACnB,qBAAqB,CAAC,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC;SAC7F,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,YAAY,CAAC;QACtB,CAAC;QAED,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtF,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -31,8 +31,8 @@
31
31
  * },
32
32
  * });
33
33
  *
34
- * // Get GUARDIAN pubkey for config
35
- * const guardianCommitment = await client.guardianClient.getPubkey();
34
+ * // Get GUARDIAN's ACK commitment for the account's signature scheme
35
+ * const { commitment: guardianCommitment } = await client.guardianClient.getPubkey(signer.scheme);
36
36
  *
37
37
  * // Create multisig account
38
38
  * const config = { threshold: 2, signerCommitments: [signer.commitment, ...], guardianCommitment };
@@ -48,9 +48,12 @@ export type { TransportRecoveryReport, TransportRecoveryStatus, } from './recove
48
48
  export type { ProverConfig, ProverRetryPolicy } from './prover/config.js';
49
49
  export type { RpcConfig, RpcRetryPolicy } from './rpc/config.js';
50
50
  export { lookupAuthDigest } from './lookupAuth.js';
51
+ export { SESSION_GRANT_SCOPE, describeSessionGrant, sessionGrantDigest, sessionLogoutDigest, sessionRevokeAllDigest, } from './session/grant.js';
52
+ export { GuardianSession, IndexedDbSessionKeyStore, type GuardianSessionOptions, WebCryptoSessionKey, type SessionKeyStore, type StoredSessionKey, } from './session/key.js';
53
+ export { GuardianSessionsUnsupportedError, SessionGrantDeclinedError, endGuardianSession, resumeGuardianSession, revokeAllGuardianSessions, startGuardianSession, type StartSessionOptions, } from './session/manager.js';
51
54
  export { Multisig, type AccountState, type SyncStateResult, type CreateProposalOptions, type CreateSignerProposalOptions, type CreateP2idProposalOptions, } from './multisig.js';
52
55
  export { AccountInspector, type DetectedMultisigConfig, type VaultBalance } from './inspector.js';
53
- export { ChainBehindBoundBlockError, chainAnchorFromBase64, chainAnchorToBase64, chainAnchorBlockNum, executeForSummary, executeForSummaryAt, executeForSummaryAtTip, summaryApprovalExpirationBlockNum, summarySalt, SummaryAnchorMismatchError, buildUpdateSignersTransactionRequest, buildUpdateProcedureThresholdTransactionRequest, buildUpdateGuardianTransactionRequest, buildConsumeNotesTransactionRequest, buildConsumeNotesTransactionRequestFromNotes, buildP2idTransactionRequest, requestBoundBlockNum, requestSaltHex, MAX_APPROVAL_EXPIRATION_DELTA, parseP2idNoteType, p2idNoteTypeToMetadata, type P2idTransactionOptions, type P2ideHeightOptions, } from './transaction.js';
56
+ export { ChainBehindBoundBlockError, executeForSummaryAtTip, summaryApprovalExpirationBlockNum, summaryBoundBlockNum, summarySalt, buildUpdateSignersTransactionRequest, buildUpdateProcedureThresholdTransactionRequest, buildUpdateGuardianTransactionRequest, buildConsumeNotesTransactionRequest, buildConsumeNotesTransactionRequestFromNotes, buildP2idTransactionRequest, requestBoundBlockNum, requestSaltHex, MAX_APPROVAL_EXPIRATION_DELTA, parseP2idNoteType, p2idNoteTypeToMetadata, type P2idTransactionOptions, type P2ideHeightOptions, } from './transaction.js';
54
57
  export { computeCommitmentFromTxSummary } from './multisig/helpers.js';
55
58
  export type { MultisigRequestOptions, SignatureOptions, } from './transaction/options.js';
56
59
  export { GuardianHttpClient, GuardianHttpError } from '@openzeppelin/guardian-client';
@@ -71,7 +74,7 @@ export { createMultisigAccount, validateMultisigConfig, buildMultisigStorageSlot
71
74
  export { CONSUME_NOTES_METADATA_VERSION_V2, MAX_CONSUME_NOTES_METADATA_BYTES, isConsumeNotesV1, isConsumeNotesV2, isProposalActionable, type ProposalVerification, isP2idNoteVisibility, type P2idNoteVisibility, MAX_P2IDE_BLOCK_HEIGHT, parseP2ideHeight, } from './types/proposal.js';
72
75
  export { LEGACY_CONSUME_NOTES_ENABLED, } from './multisig/config.js';
73
76
  export { type ConsumeNotesErrorCode, NoteBindingMismatchError, UnsupportedMetadataVersionError, ConsumeNotesMetadataOversizeError, LegacyConsumeNotesNoteMissingError, ConsumeNoteNotAuthenticatedError, } from './multisig/consumeNotesErrors.js';
74
- export { type AuthArgErrorCode, BoundBlockNotDeclaredError, MultisigAuthArgsMissingError, ProposalSaltMalformedError, } from './multisig/authArgErrors.js';
77
+ export { type AuthArgErrorCode, BoundBlockMismatchError, BoundBlockNotDeclaredError, MultisigAuthArgsMissingError, ProposalSaltMalformedError, TransactionSummaryLayoutError, } from './multisig/authArgErrors.js';
75
78
  export { noteToBase64, noteFromBase64, } from './utils/encoding.js';
76
79
  export { PROCEDURE_ROOTS, getProcedureRoot, isProcedureName, getProcedureNames, type ProcedureName, } from './procedures.js';
77
80
  export type { MultisigAccountState, MultisigConfig, CreateAccountResult, ProcedureThreshold, Proposal, ProposalStatus, ProposalSignatureEntry, ProposalMetadata, ProposalType, ExportedProposal, ExportedTransactionProposal, SignTransactionProposalParams, TransactionProposal, TransactionProposalSignature, TransactionProposalStatus, TransactionType, ConsumableNote, NoteAsset, FalconSignature, Signer, SignatureScheme, AuthConfig, DeltaObject, DeltaStatus, StateObject, CosignerSignature, ConfigureRequest, ConfigureResponse, DeltaProposalRequest, DeltaProposalResponse, ProposalsResponse, PubkeyResponse, SignProposalRequest, } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,QAAQ,EACR,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,GAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAClG,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,iCAAiC,EACjC,WAAW,EACX,0BAA0B,EAC1B,oCAAoC,EACpC,+CAA+C,EAC/C,qCAAqC,EACrC,mCAAmC,EACnC,4CAA4C,EAC5C,2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mB,EACnB,kBAAkB,EAGlB,QAAQ,EACR,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,2BAA2B,EAC3B,6BAA6B,EAC7B,mBAAmB,EACnB,4BAA4B,EAC5B,yBAAyB,EAGzB,eAAe,EAGf,cAAc,EACd,SAAS,EAGT,eAAe,EACf,MAAM,EACN,eAAe,EAGf,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,iBAAiB,EAGjB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -31,8 +31,8 @@
31
31
  * },
32
32
  * });
33
33
  *
34
- * // Get GUARDIAN pubkey for config
35
- * const guardianCommitment = await client.guardianClient.getPubkey();
34
+ * // Get GUARDIAN's ACK commitment for the account's signature scheme
35
+ * const { commitment: guardianCommitment } = await client.guardianClient.getPubkey(signer.scheme);
36
36
  *
37
37
  * // Create multisig account
38
38
  * const config = { threshold: 2, signerCommitments: [signer.commitment, ...], guardianCommitment };
@@ -45,9 +45,12 @@
45
45
  */
46
46
  export { MultisigClient, } from './client.js';
47
47
  export { lookupAuthDigest } from './lookupAuth.js';
48
+ export { SESSION_GRANT_SCOPE, describeSessionGrant, sessionGrantDigest, sessionLogoutDigest, sessionRevokeAllDigest, } from './session/grant.js';
49
+ export { GuardianSession, IndexedDbSessionKeyStore, WebCryptoSessionKey, } from './session/key.js';
50
+ export { GuardianSessionsUnsupportedError, SessionGrantDeclinedError, endGuardianSession, resumeGuardianSession, revokeAllGuardianSessions, startGuardianSession, } from './session/manager.js';
48
51
  export { Multisig, } from './multisig.js';
49
52
  export { AccountInspector } from './inspector.js';
50
- export { ChainBehindBoundBlockError, chainAnchorFromBase64, chainAnchorToBase64, chainAnchorBlockNum, executeForSummary, executeForSummaryAt, executeForSummaryAtTip, summaryApprovalExpirationBlockNum, summarySalt, SummaryAnchorMismatchError, buildUpdateSignersTransactionRequest, buildUpdateProcedureThresholdTransactionRequest, buildUpdateGuardianTransactionRequest, buildConsumeNotesTransactionRequest, buildConsumeNotesTransactionRequestFromNotes, buildP2idTransactionRequest, requestBoundBlockNum, requestSaltHex, MAX_APPROVAL_EXPIRATION_DELTA, parseP2idNoteType, p2idNoteTypeToMetadata, } from './transaction.js';
53
+ export { ChainBehindBoundBlockError, executeForSummaryAtTip, summaryApprovalExpirationBlockNum, summaryBoundBlockNum, summarySalt, buildUpdateSignersTransactionRequest, buildUpdateProcedureThresholdTransactionRequest, buildUpdateGuardianTransactionRequest, buildConsumeNotesTransactionRequest, buildConsumeNotesTransactionRequestFromNotes, buildP2idTransactionRequest, requestBoundBlockNum, requestSaltHex, MAX_APPROVAL_EXPIRATION_DELTA, parseP2idNoteType, p2idNoteTypeToMetadata, } from './transaction.js';
51
54
  // Commitment derivation for hand-rolled export/import flows (issue #433):
52
55
  // the proposal id is the tx summary's commitment, recomputed from the
53
56
  // serialized summary exactly as import verification does. Returns normalized
@@ -67,7 +70,7 @@ export { createMultisigAccount, validateMultisigConfig, buildMultisigStorageSlot
67
70
  export { CONSUME_NOTES_METADATA_VERSION_V2, MAX_CONSUME_NOTES_METADATA_BYTES, isConsumeNotesV1, isConsumeNotesV2, isProposalActionable, isP2idNoteVisibility, MAX_P2IDE_BLOCK_HEIGHT, parseP2ideHeight, } from './types/proposal.js';
68
71
  export { LEGACY_CONSUME_NOTES_ENABLED, } from './multisig/config.js';
69
72
  export { NoteBindingMismatchError, UnsupportedMetadataVersionError, ConsumeNotesMetadataOversizeError, LegacyConsumeNotesNoteMissingError, ConsumeNoteNotAuthenticatedError, } from './multisig/consumeNotesErrors.js';
70
- export { BoundBlockNotDeclaredError, MultisigAuthArgsMissingError, ProposalSaltMalformedError, } from './multisig/authArgErrors.js';
73
+ export { BoundBlockMismatchError, BoundBlockNotDeclaredError, MultisigAuthArgsMissingError, ProposalSaltMalformedError, TransactionSummaryLayoutError, } from './multisig/authArgErrors.js';
71
74
  export { noteToBase64, noteFromBase64, } from './utils/encoding.js';
72
75
  export { PROCEDURE_ROOTS, getProcedureRoot, isProcedureName, getProcedureNames, } from './procedures.js';
73
76
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EACL,cAAc,GAGf,MAAM,aAAa,CAAC;AAOrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,QAAQ,GAMT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAkD,MAAM,gBAAgB,CAAC;AAClG,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,iCAAiC,EACjC,WAAW,EACX,0BAA0B,EAC1B,oCAAoC,EACpC,+CAA+C,EAC/C,qCAAqC,EACrC,mCAAmC,EACnC,4CAA4C,EAC5C,2BAA2B,EAC3B,oBAAoB,EACpB,cAAc,EACd,6BAA6B,EAC7B,iBAAiB,EACjB,sBAAsB,GAGvB,MAAM,kBAAkB,CAAC;AAC1B,0EAA0E;AAC1E,sEAAsE;AACtE,6EAA6E;AAC7E,6EAA6E;AAC7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAMvE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEtF,yEAAyE;AACzE,iEAAiE;AACjE,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,+BAA+B,CAAC;AAevC,yEAAyE;AACzE,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,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AAkB,CAAC;AAC/C,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,iCAAiC,EACjC,gCAAgC,EAChC,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EAEpB,oBAAoB,EAEpB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,wBAAwB,EACxB,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,gCAAgC,GACjC,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAEL,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,YAAY,EACZ,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,iBAAiB,GAElB,MAAM,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"lookupAuth.d.ts","sourceRoot":"","sources":["../src/lookupAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,IAAI,EAAE,MAAM,sBAAsB,CAAC;AA4CrE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAmB7F;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,IAAI,IAAI,CAE3D"}
1
+ {"version":3,"file":"lookupAuth.d.ts","sourceRoot":"","sources":["../src/lookupAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAyB/D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAmB7F;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,IAAI,IAAI,CAE3D"}