@openzeppelin/miden-multisig-client 0.18.0-rc.1 → 0.18.0-rc.3
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 +71 -17
- package/dist/account/builder.d.ts +3 -4
- package/dist/account/builder.d.ts.map +1 -1
- package/dist/account/builder.js +6 -13
- package/dist/account/builder.js.map +1 -1
- package/dist/client.d.ts +11 -4
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +8 -3
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +14 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/multisig/authArgErrors.d.ts +15 -1
- package/dist/multisig/authArgErrors.d.ts.map +1 -1
- package/dist/multisig/authArgErrors.js +20 -0
- package/dist/multisig/authArgErrors.js.map +1 -1
- package/dist/multisig.d.ts +76 -25
- package/dist/multisig.d.ts.map +1 -1
- package/dist/multisig.js +196 -156
- package/dist/multisig.js.map +1 -1
- package/dist/procedures.d.ts +5 -5
- package/dist/procedures.js +5 -5
- package/dist/prover/workflow.d.ts +7 -3
- package/dist/prover/workflow.d.ts.map +1 -1
- package/dist/prover/workflow.js +7 -5
- package/dist/prover/workflow.js.map +1 -1
- package/dist/recovery/proposalNoteImport.d.ts +5 -6
- package/dist/recovery/proposalNoteImport.d.ts.map +1 -1
- package/dist/recovery/proposalNoteImport.js +12 -13
- package/dist/recovery/proposalNoteImport.js.map +1 -1
- package/dist/recovery/publicNoteBackfill.d.ts +2 -3
- package/dist/recovery/publicNoteBackfill.d.ts.map +1 -1
- package/dist/recovery/publicNoteBackfill.js +4 -5
- package/dist/recovery/publicNoteBackfill.js.map +1 -1
- package/dist/transaction/authArgs.d.ts +2 -3
- package/dist/transaction/authArgs.d.ts.map +1 -1
- package/dist/transaction/authArgs.js +7 -14
- package/dist/transaction/authArgs.js.map +1 -1
- package/dist/transaction/consumeNotes.d.ts +4 -12
- package/dist/transaction/consumeNotes.d.ts.map +1 -1
- package/dist/transaction/consumeNotes.js +10 -4
- package/dist/transaction/consumeNotes.js.map +1 -1
- package/dist/transaction/noteAuthentication.d.ts +2 -3
- package/dist/transaction/noteAuthentication.d.ts.map +1 -1
- package/dist/transaction/noteAuthentication.js +11 -11
- package/dist/transaction/noteAuthentication.js.map +1 -1
- package/dist/transaction/options.d.ts +0 -7
- package/dist/transaction/options.d.ts.map +1 -1
- package/dist/transaction/p2id.d.ts +2 -3
- package/dist/transaction/p2id.d.ts.map +1 -1
- package/dist/transaction/p2id.js.map +1 -1
- package/dist/transaction/summary.d.ts +94 -22
- package/dist/transaction/summary.d.ts.map +1 -1
- package/dist/transaction/summary.js +146 -12
- package/dist/transaction/summary.js.map +1 -1
- package/dist/transaction/updateGuardian.d.ts +3 -7
- package/dist/transaction/updateGuardian.d.ts.map +1 -1
- package/dist/transaction/updateGuardian.js +3 -4
- package/dist/transaction/updateGuardian.js.map +1 -1
- package/dist/transaction/updateProcedureThreshold.d.ts +3 -8
- package/dist/transaction/updateProcedureThreshold.d.ts.map +1 -1
- package/dist/transaction/updateProcedureThreshold.js +3 -4
- package/dist/transaction/updateProcedureThreshold.js.map +1 -1
- package/dist/transaction/updateSigners.d.ts +3 -8
- package/dist/transaction/updateSigners.d.ts.map +1 -1
- package/dist/transaction/updateSigners.js +3 -4
- package/dist/transaction/updateSigners.js.map +1 -1
- package/dist/transaction.d.ts +1 -1
- package/dist/transaction.d.ts.map +1 -1
- package/dist/transaction.js +1 -1
- package/dist/transaction.js.map +1 -1
- package/dist/types/proposal.d.ts +9 -8
- package/dist/types/proposal.d.ts.map +1 -1
- package/dist/types/proposal.js.map +1 -1
- package/package.json +4 -4
- package/src/account/builder.ts +6 -13
- package/src/client.ts +13 -10
- package/src/config.ts +14 -0
- package/src/index.ts +5 -3
- package/src/multisig/authArgErrors.ts +28 -1
- package/src/multisig.ts +238 -194
- package/src/procedures.ts +5 -5
- package/src/prover/workflow.ts +7 -10
- package/src/recovery/proposalNoteImport.ts +13 -15
- package/src/recovery/publicNoteBackfill.ts +6 -6
- package/src/transaction/authArgs.ts +15 -21
- package/src/transaction/consumeNotes.ts +6 -34
- package/src/transaction/noteAuthentication.ts +18 -13
- package/src/transaction/options.ts +0 -9
- package/src/transaction/p2id.ts +2 -3
- package/src/transaction/summary.ts +160 -57
- package/src/transaction/updateGuardian.ts +5 -23
- package/src/transaction/updateProcedureThreshold.ts +5 -25
- package/src/transaction/updateSigners.ts +5 -22
- package/src/transaction.ts +6 -0
- package/src/types/proposal.ts +9 -8
- package/dist/raw-client.d.ts +0 -14
- package/dist/raw-client.d.ts.map +0 -1
- package/dist/raw-client.js +0 -60
- package/dist/raw-client.js.map +0 -1
- package/src/raw-client.ts +0 -89
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-rc.
|
|
20
|
+
npm install @openzeppelin/miden-multisig-client@0.18.0-rc.3 @miden-sdk/miden-sdk@0.17.0-rc.5
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Miden 0.17 requires a new client database: a store created under 0.16 does
|
|
@@ -53,7 +53,7 @@ breaking changes per line, and what each upgrade does to stored data:
|
|
|
53
53
|
import { MultisigClient, FalconSigner } from '@openzeppelin/miden-multisig-client';
|
|
54
54
|
import { AuthSecretKey, MidenClient } from '@miden-sdk/miden-sdk';
|
|
55
55
|
|
|
56
|
-
const midenClient = await MidenClient.createDevnet();
|
|
56
|
+
const midenClient = await MidenClient.createDevnet({ useWorker: false });
|
|
57
57
|
|
|
58
58
|
// Create a signer from your secret key
|
|
59
59
|
const secretKey = AuthSecretKey.rpoFalconWithRNG(undefined);
|
|
@@ -75,6 +75,25 @@ const client = new MultisigClient(midenClient, {
|
|
|
75
75
|
});
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
The SDK does all of its local work (account reads and writes, note imports and
|
|
79
|
+
exports, chain syncs, proposal previews) through the `MidenClient` you pass in,
|
|
80
|
+
and never opens a second client on that client's store. Pass the client your
|
|
81
|
+
application executes transactions with: miden-client keeps account state in
|
|
82
|
+
memory per client, so two live clients writing one store can leave either of
|
|
83
|
+
them persisting a storage root computed from state it never saw.
|
|
84
|
+
`midenRpcEndpoint` serves only the SDK's direct node reads (on-chain
|
|
85
|
+
commitments and note inclusion proofs).
|
|
86
|
+
|
|
87
|
+
In a browser, create that client with `useWorker: false`, which runs its WASM
|
|
88
|
+
work on the page's main thread. In the default worker mode, transactions
|
|
89
|
+
execute and apply in a Web Worker that never sees the account state this SDK
|
|
90
|
+
writes with `accounts.insert`, so a device's local copy of the account breaks
|
|
91
|
+
after `MultisigClient.load` or a `syncState()` import
|
|
92
|
+
([0xMiden/web-sdk#441](https://github.com/0xMiden/web-sdk/issues/441)). The
|
|
93
|
+
symptoms and recovery are in
|
|
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
|
+
Node.js has no worker and is unaffected.
|
|
96
|
+
|
|
78
97
|
For an ECDSA cosigner using an EIP-1193 wallet (including Ledger), call
|
|
79
98
|
`Eip712Signer.connect(provider)` once to select the Ethereum address and
|
|
80
99
|
recover its secp256k1 public key from a dedicated key-discovery signature.
|
|
@@ -145,6 +164,7 @@ explicitly.
|
|
|
145
164
|
const midenClient = await MidenClient.create({
|
|
146
165
|
rpcUrl: 'https://my-node.internal:57291',
|
|
147
166
|
noteTransportUrl: 'https://my-transport.internal',
|
|
167
|
+
useWorker: false,
|
|
148
168
|
});
|
|
149
169
|
|
|
150
170
|
const client = new MultisigClient(midenClient, {
|
|
@@ -251,6 +271,28 @@ console.log('Commitment:', state.commitment);
|
|
|
251
271
|
console.log('Created:', state.createdAt);
|
|
252
272
|
```
|
|
253
273
|
|
|
274
|
+
### Sync Account State
|
|
275
|
+
|
|
276
|
+
`syncState()` reconciles the local store with GUARDIAN. It first asks GUARDIAN
|
|
277
|
+
for the nonce and commitment of its canonical state (`getCanonicalNonce`) and
|
|
278
|
+
skips the full state fetch when that nonce is not above the local account's
|
|
279
|
+
(at a matching commitment when equal). The result says which side stood:
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
const synced = await multisig.syncState();
|
|
283
|
+
if (synced.source === 'guardian') {
|
|
284
|
+
console.log('Imported GUARDIAN state at', synced.state.commitment);
|
|
285
|
+
} else {
|
|
286
|
+
console.log(`Local nonce ${synced.localNonce} is current (GUARDIAN at ${synced.guardianNonce})`);
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Either way `multisig.account` and the cached config reflect the authoritative
|
|
291
|
+
account afterwards. Call `fetchState()` when you need GUARDIAN's state copy
|
|
292
|
+
regardless. The pre-check needs a GUARDIAN server that serves `GET /state/nonce`
|
|
293
|
+
(issue #191); against an older server `syncState()` fails rather than falling back
|
|
294
|
+
to the full fetch, so deploy the server first.
|
|
295
|
+
|
|
254
296
|
### Creating Proposals
|
|
255
297
|
|
|
256
298
|
Every `create*Proposal` method takes its required arguments followed by a
|
|
@@ -275,7 +317,7 @@ The option shapes are exported as `CreateProposalOptions`,
|
|
|
275
317
|
`CreateSignerProposalOptions`, and `CreateP2idProposalOptions`.
|
|
276
318
|
|
|
277
319
|
All methods also accept `approvalExpirationDelta` (1 to 65535): the number of blocks after
|
|
278
|
-
the proposal
|
|
320
|
+
the block the proposal binds by which the transaction must be included. Past
|
|
279
321
|
that block the approvers' signatures no longer authorize it, the SDK refuses to
|
|
280
322
|
execute it, and the node rejects it as expired. The summary binds the value, so
|
|
281
323
|
the executing party cannot change it. Omitted, the approval never expires,
|
|
@@ -385,8 +427,7 @@ others; only the check itself writes `verified`, and a freshly parsed or
|
|
|
385
427
|
imported proposal is `unchecked`. `retryable: true` means the
|
|
386
428
|
re-execution hit a transient node error and the proposal may verify on
|
|
387
429
|
the next sync; `retryable: false` means it cannot be reproduced (tampered
|
|
388
|
-
metadata,
|
|
389
|
-
re-proposed. Verification is deliberately not part of `status`: a fully
|
|
430
|
+
metadata, for example) and has to be re-proposed. Verification is deliberately not part of `status`: a fully
|
|
390
431
|
signed proposal can be dead, so `'ready'` keeps meaning "threshold met"
|
|
391
432
|
and `isProposalActionable(proposal)` answers "verified and ready".
|
|
392
433
|
`signProposal` and `executeProposal` re-verify the one proposal they act
|
|
@@ -406,12 +447,23 @@ for (const p of await multisig.syncProposals()) {
|
|
|
406
447
|
}
|
|
407
448
|
```
|
|
408
449
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
450
|
+
Verification and execution run at the chain tip. Since Miden 0.17 a
|
|
451
|
+
multisig summary binds the block its auth args name (the bound block), and
|
|
452
|
+
every request the SDK builds declares that block (`withBlockNumbers`), so the
|
|
453
|
+
summary reproduces at any later tip. An execution runs at the Miden client's
|
|
454
|
+
sync height, so `syncProposals`, `signProposal`, `executeProposal`,
|
|
455
|
+
`createTransactionProposalRequest` and the custom and offline paths sync the
|
|
456
|
+
client first. Foreign accounts, the fee faucet among them, load at the tip, so
|
|
457
|
+
a proposal stays verifiable however long it waits for signatures, even after
|
|
458
|
+
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.
|
|
461
|
+
|
|
462
|
+
`createTransactionProposalRequest(proposalId)` returns the final, fully
|
|
463
|
+
signed request for an integration that proves and submits with its own
|
|
464
|
+
pipeline. Execute it at the chain tip, without an anchor, on a client that has
|
|
465
|
+
synced recently: this call syncs first, and an execution loads the fee faucet
|
|
466
|
+
at the client's sync height, which a node serves for only about 50 blocks.
|
|
415
467
|
|
|
416
468
|
### Execute a Proposal
|
|
417
469
|
|
|
@@ -504,7 +556,7 @@ import { buildP2idTransactionRequest, chainAnchorBlockNum } from '@openzeppelin/
|
|
|
504
556
|
// The builder takes the Miden client because the executing account decides
|
|
505
557
|
// the auth args the request has to carry (see below).
|
|
506
558
|
const { request, salt } = await buildP2idTransactionRequest(
|
|
507
|
-
midenClient, senderId, recipientId, faucetId, amount,
|
|
559
|
+
midenClient, senderId, recipientId, faucetId, amount,
|
|
508
560
|
);
|
|
509
561
|
const proposal = await multisig.createCustomProposal(request.serialize(), 'b2agg');
|
|
510
562
|
|
|
@@ -517,12 +569,11 @@ const advice = await multisig.prepareCustomExecution(proposal.id, request.serial
|
|
|
517
569
|
|
|
518
570
|
// The browser TransactionRequest is immutable, so rebuild from the same recipe
|
|
519
571
|
// (inputs + salt + bound block) with the advice, then submit. `submitTransaction`
|
|
520
|
-
//
|
|
521
|
-
// since the collected signatures only authorize the summary produced there.
|
|
572
|
+
// executes at the chain tip: the rebuilt request declares the block it binds.
|
|
522
573
|
const boundBlockNum = chainAnchorBlockNum(proposal.metadata.chainAnchor);
|
|
523
574
|
const { request: finalRequest } = await buildP2idTransactionRequest(
|
|
524
575
|
midenClient, senderId, recipientId, faucetId, amount,
|
|
525
|
-
{ salt, boundBlockNum, signatureAdviceMap: advice
|
|
576
|
+
{ salt, boundBlockNum, signatureAdviceMap: advice },
|
|
526
577
|
);
|
|
527
578
|
await multisig.submitTransaction(proposal.id, finalRequest);
|
|
528
579
|
```
|
|
@@ -531,8 +582,11 @@ Since Miden 0.17 a multisig auth procedure reads three words out of the
|
|
|
531
582
|
transaction's auth arg: the block the summary binds together with the approval
|
|
532
583
|
expiration, the salt, and the fee conversion info. The exported builders get
|
|
533
584
|
them from `client.feeAwareTransactionRequestBuilder(account, { feeConversionSalt,
|
|
534
|
-
boundBlockNum })`, which sets the commitment as the request's auth arg
|
|
535
|
-
the preimage in its advice map
|
|
585
|
+
boundBlockNum })`, which sets the commitment as the request's auth arg, puts
|
|
586
|
+
the preimage in its advice map, and declares the bound block with
|
|
587
|
+
`withBlockNumbers` so the request executes at the chain tip. A request whose
|
|
588
|
+
auth args bind a block it does not declare is refused with
|
|
589
|
+
`BoundBlockNotDeclaredError`. An integration that assembles a request itself
|
|
536
590
|
must start from that builder for a multisig account, and must not call
|
|
537
591
|
`withFeeConversionSalt` or `withAuthArg` on it: the two setters clear each other
|
|
538
592
|
and either one discards the auth args. The approval never expires unless the
|
|
@@ -3,17 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This module provides functionality to create multisig accounts.
|
|
5
5
|
*/
|
|
6
|
-
import { type
|
|
6
|
+
import { type MidenClient } from "@miden-sdk/miden-sdk";
|
|
7
7
|
import type { MultisigConfig, CreateAccountResult } from "../types.js";
|
|
8
8
|
/**
|
|
9
9
|
* Creates a multisig account with GUARDIAN authentication.
|
|
10
10
|
*
|
|
11
|
-
* @param client - Initialized MidenClient
|
|
11
|
+
* @param client - Initialized MidenClient
|
|
12
12
|
* @param config - Multisig configuration
|
|
13
|
-
* @param midenRpcEndpoint - RPC endpoint for the client's network
|
|
14
13
|
* @returns The created account and seed
|
|
15
14
|
*/
|
|
16
|
-
export declare function createMultisigAccount(client:
|
|
15
|
+
export declare function createMultisigAccount(client: MidenClient, config: MultisigConfig): Promise<CreateAccountResult>;
|
|
17
16
|
/**
|
|
18
17
|
* Validates a multisig configuration.
|
|
19
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/account/builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/account/builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAQL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAgEvE;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,mBAAmB,CAAC,CAiC9B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAgFnE"}
|
package/dist/account/builder.js
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { AccountBuilder, AccountStorageMode, AuthGuardedMultisigConfig, ProcedureThreshold, Word, createAuthGuardedMultisig, } from "@miden-sdk/miden-sdk";
|
|
7
7
|
import { getProcedureRoot } from "../procedures.js";
|
|
8
|
-
import { isPublicMidenClient } from "../raw-client.js";
|
|
9
8
|
import { MAX_SIGNERS } from "./layout.js";
|
|
10
9
|
import { normalizeSignerCommitment } from "../utils/signature.js";
|
|
11
10
|
/**
|
|
@@ -46,12 +45,11 @@ function buildGuardedMultisigComponent(config) {
|
|
|
46
45
|
/**
|
|
47
46
|
* Creates a multisig account with GUARDIAN authentication.
|
|
48
47
|
*
|
|
49
|
-
* @param client - Initialized MidenClient
|
|
48
|
+
* @param client - Initialized MidenClient
|
|
50
49
|
* @param config - Multisig configuration
|
|
51
|
-
* @param midenRpcEndpoint - RPC endpoint for the client's network
|
|
52
50
|
* @returns The created account and seed
|
|
53
51
|
*/
|
|
54
|
-
export async function createMultisigAccount(client, config
|
|
52
|
+
export async function createMultisigAccount(client, config) {
|
|
55
53
|
validateMultisigConfig(config);
|
|
56
54
|
const authComponent = buildGuardedMultisigComponent(config);
|
|
57
55
|
let seed = config.seed;
|
|
@@ -69,15 +67,10 @@ export async function createMultisigAccount(client, config, midenRpcEndpoint) {
|
|
|
69
67
|
.withAuthComponent(authComponent)
|
|
70
68
|
.withBasicWalletComponent();
|
|
71
69
|
const result = accountBuilder.buildWithoutSchemaCommitment();
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
await client.newAccount(result.account, false);
|
|
80
|
-
}
|
|
70
|
+
await client.accounts.insert({
|
|
71
|
+
account: result.account,
|
|
72
|
+
overwrite: false,
|
|
73
|
+
});
|
|
81
74
|
return {
|
|
82
75
|
account: result.account,
|
|
83
76
|
seed,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/account/builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,cAAc,EAEd,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,IAAI,EACJ,yBAAyB,GAE1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/account/builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,cAAc,EAEd,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,IAAI,EACJ,yBAAyB,GAE1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE;;;;;;;;GAQG;AACH,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAW,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,SAAS,6BAA6B,CACpC,MAAsB;IAEtB,MAAM,SAAS,GAAG,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAC5D,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC,CACpD,CAAC;IACF,MAAM,QAAQ,GAAG,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AAK,CAAC,sCAAsC,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;YACxE,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;QACzB,CAAC;QAED,wEAAwE;QACxE,0EAA0E;QAC1E,mEAAmE;QACnE,wEAAwE;QACxE,0EAA0E;QAC1E,yEAAyE;QACzE,2EAA2E;QAC3E,MAAM,cAAc,GAAG,MAAM,CAAC,mBAAmB,CAAC,IAAI,CACpD,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,KAAK,4BAA4B,CACtD,EAAE,SAAS,CAAC;QACb,MAAM,eAAe,GAAG,cAAc,IAAI,MAAM,CAAC,SAAS,CAAC;QAE3D,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,mBAAmB,EAAE,CAAC;YAC5C,IAAI,EAAE,CAAC,SAAS,GAAG,eAAe,EAAE,CAAC;gBACnC,MAAM,IAAI,KAAK,CACb,oCAAoC,EAAE,CAAC,SAAS,KAAK,EAAE,CAAC,SAAS,gBAAgB;oBAC/E,gBAAgB,eAAe,mDAAmD;oBAClF,oFAAoF;oBACpF,wBAAwB,EAAE,CAAC,SAAS,yBAAyB,CAChE,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/client.d.ts
CHANGED
|
@@ -18,9 +18,11 @@ export interface MultisigClientConfig {
|
|
|
18
18
|
/** GUARDIAN server endpoint. Required — there is no default. */
|
|
19
19
|
guardianEndpoint: string;
|
|
20
20
|
/**
|
|
21
|
-
* Miden node RPC endpoint
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* Miden node RPC endpoint the SDK reads directly: on-chain commitments for
|
|
22
|
+
* state verification, and note inclusion proofs for consume-notes proposals
|
|
23
|
+
* and note recovery. Everything else, execution included, goes through the
|
|
24
|
+
* injected `MidenClient`. Required — must point at the same network as the
|
|
25
|
+
* injected `MidenClient`; there is no default.
|
|
24
26
|
*/
|
|
25
27
|
midenRpcEndpoint: string;
|
|
26
28
|
/** Multisig-owned remote prover override and proof retry policy. */
|
|
@@ -40,13 +42,18 @@ export interface RecoveredAccount {
|
|
|
40
42
|
/**
|
|
41
43
|
* Client for creating and loading multisig accounts.
|
|
42
44
|
*
|
|
45
|
+
* In a browser, create the injected `MidenClient` with `useWorker: false` until
|
|
46
|
+
* https://github.com/0xMiden/web-sdk/issues/441 is fixed: a worker-mode client
|
|
47
|
+
* applies transactions in a Web Worker that never sees the account state this
|
|
48
|
+
* SDK writes.
|
|
49
|
+
*
|
|
43
50
|
* @example
|
|
44
51
|
* ```typescript
|
|
45
52
|
* import { MultisigClient, FalconSigner } from '@openzeppelin/miden-multisig-client';
|
|
46
53
|
* import { MidenClient, AuthSecretKey } from '@miden-sdk/miden-sdk';
|
|
47
54
|
*
|
|
48
55
|
* // Initialize
|
|
49
|
-
* const midenClient = await MidenClient.createDevnet();
|
|
56
|
+
* const midenClient = await MidenClient.createDevnet({ useWorker: false });
|
|
50
57
|
* const secretKey = AuthSecretKey.rpoFalconWithRNG(seed);
|
|
51
58
|
* const signer = new FalconSigner(secretKey);
|
|
52
59
|
*
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGzD,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,SAAS,EAEf,MAA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qB;gBAEhC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,oBAAoB;IAUlE;;;;OAIG;IACH,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAM3C;;OAEG;IACH,IAAI,cAAc,IAAI,kBAAkB,CAEvC;IAED;;;;;;;;;OASG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAe/D;;;;;;OAMG;IACG,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,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
|
@@ -9,7 +9,7 @@ import { GuardianHttpClient } from '@openzeppelin/guardian-client';
|
|
|
9
9
|
import { Multisig } from './multisig.js';
|
|
10
10
|
import { createMultisigAccount } from './account/index.js';
|
|
11
11
|
import { AccountInspector, assertCompleteDetectedConfig } from './inspector.js';
|
|
12
|
-
import { requireConfigValue, requireMidenRpcEndpoint } from './
|
|
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
15
|
import { resolveProverConfig, } from './prover/config.js';
|
|
@@ -23,13 +23,18 @@ async function bindSignerAccountKey(signer, midenClient, accountId) {
|
|
|
23
23
|
/**
|
|
24
24
|
* Client for creating and loading multisig accounts.
|
|
25
25
|
*
|
|
26
|
+
* In a browser, create the injected `MidenClient` with `useWorker: false` until
|
|
27
|
+
* https://github.com/0xMiden/web-sdk/issues/441 is fixed: a worker-mode client
|
|
28
|
+
* applies transactions in a Web Worker that never sees the account state this
|
|
29
|
+
* SDK writes.
|
|
30
|
+
*
|
|
26
31
|
* @example
|
|
27
32
|
* ```typescript
|
|
28
33
|
* import { MultisigClient, FalconSigner } from '@openzeppelin/miden-multisig-client';
|
|
29
34
|
* import { MidenClient, AuthSecretKey } from '@miden-sdk/miden-sdk';
|
|
30
35
|
*
|
|
31
36
|
* // Initialize
|
|
32
|
-
* const midenClient = await MidenClient.createDevnet();
|
|
37
|
+
* const midenClient = await MidenClient.createDevnet({ useWorker: false });
|
|
33
38
|
* const secretKey = AuthSecretKey.rpoFalconWithRNG(seed);
|
|
34
39
|
* const signer = new FalconSigner(secretKey);
|
|
35
40
|
*
|
|
@@ -107,7 +112,7 @@ export class MultisigClient {
|
|
|
107
112
|
*/
|
|
108
113
|
async create(config, signer) {
|
|
109
114
|
this._guardianClient.setSigner(signer);
|
|
110
|
-
const { account } = await createMultisigAccount(this.midenClient, config
|
|
115
|
+
const { account } = await createMultisigAccount(this.midenClient, config);
|
|
111
116
|
const accountId = account.id().toString();
|
|
112
117
|
await bindSignerAccountKey(signer, this.midenClient, accountId);
|
|
113
118
|
return new Multisig(account, config, this._guardianClient, signer, this.midenClient, undefined, this.midenRpcEndpoint, this.proverConfig, this.rpcConfig);
|
package/dist/client.js.map
CHANGED
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","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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/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CASzE;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjE"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function requireConfigValue(field, value) {
|
|
2
|
+
if (typeof value !== 'string') {
|
|
3
|
+
throw new Error(`missing required configuration: ${field}`);
|
|
4
|
+
}
|
|
5
|
+
const normalizedValue = value.trim();
|
|
6
|
+
if (normalizedValue === '') {
|
|
7
|
+
throw new Error(`missing required configuration: ${field}`);
|
|
8
|
+
}
|
|
9
|
+
return normalizedValue;
|
|
10
|
+
}
|
|
11
|
+
export function requireMidenRpcEndpoint(endpoint) {
|
|
12
|
+
return requireConfigValue('midenRpcEndpoint', endpoint);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,KAAa,EAAE,KAAe;IAC/D,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,mCAAmC,KAAK,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACrC,IAAI,eAAe,KAAK,EAAE,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,mCAAmC,KAAK,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,QAAiB;IACvD,OAAO,kBAAkB,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;AAC1D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* } from '@openzeppelin/miden-multisig-client';
|
|
12
12
|
* import { MidenClient, AuthSecretKey } from '@miden-sdk/miden-sdk';
|
|
13
13
|
*
|
|
14
|
-
* const midenClient = await MidenClient.createDevnet();
|
|
14
|
+
* const midenClient = await MidenClient.createDevnet({ useWorker: false });
|
|
15
15
|
* const secretKey = AuthSecretKey.rpoFalconWithRNG(undefined);
|
|
16
16
|
*
|
|
17
17
|
* // Store in miden-sdk's keystore
|
|
@@ -48,11 +48,11 @@ 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 { Multisig, type AccountState, type CreateProposalOptions, type CreateSignerProposalOptions, type CreateP2idProposalOptions, } from './multisig.js';
|
|
51
|
+
export { Multisig, type AccountState, type SyncStateResult, type CreateProposalOptions, type CreateSignerProposalOptions, type CreateP2idProposalOptions, } from './multisig.js';
|
|
52
52
|
export { AccountInspector, type DetectedMultisigConfig, type VaultBalance } from './inspector.js';
|
|
53
|
-
export { chainAnchorFromBase64, chainAnchorToBase64, chainAnchorBlockNum, executeForSummary, executeForSummaryAt, summaryApprovalExpirationBlockNum, summarySalt, SummaryAnchorMismatchError, buildUpdateSignersTransactionRequest, buildUpdateProcedureThresholdTransactionRequest, buildUpdateGuardianTransactionRequest, buildConsumeNotesTransactionRequest, buildConsumeNotesTransactionRequestFromNotes, buildP2idTransactionRequest, requestBoundBlockNum, requestSaltHex, MAX_APPROVAL_EXPIRATION_DELTA, parseP2idNoteType, p2idNoteTypeToMetadata, type P2idTransactionOptions, type P2ideHeightOptions, } from './transaction.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';
|
|
54
54
|
export { computeCommitmentFromTxSummary } from './multisig/helpers.js';
|
|
55
|
-
export type {
|
|
55
|
+
export type { MultisigRequestOptions, SignatureOptions, } from './transaction/options.js';
|
|
56
56
|
export { GuardianHttpClient, GuardianHttpError } from '@openzeppelin/guardian-client';
|
|
57
57
|
export type { GuardianErrorMeta } from '@openzeppelin/guardian-client';
|
|
58
58
|
export { GUARDIAN_ERROR_CODES, isGuardianErrorCode, normalizeGuardianErrorCode, } from '@openzeppelin/guardian-client';
|
|
@@ -71,7 +71,7 @@ export { createMultisigAccount, validateMultisigConfig, buildMultisigStorageSlot
|
|
|
71
71
|
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
72
|
export { LEGACY_CONSUME_NOTES_ENABLED, } from './multisig/config.js';
|
|
73
73
|
export { type ConsumeNotesErrorCode, NoteBindingMismatchError, UnsupportedMetadataVersionError, ConsumeNotesMetadataOversizeError, LegacyConsumeNotesNoteMissingError, ConsumeNoteNotAuthenticatedError, } from './multisig/consumeNotesErrors.js';
|
|
74
|
-
export { type AuthArgErrorCode, MultisigAuthArgsMissingError, ProposalSaltMalformedError, } from './multisig/authArgErrors.js';
|
|
74
|
+
export { type AuthArgErrorCode, BoundBlockNotDeclaredError, MultisigAuthArgsMissingError, ProposalSaltMalformedError, } from './multisig/authArgErrors.js';
|
|
75
75
|
export { noteToBase64, noteFromBase64, } from './utils/encoding.js';
|
|
76
76
|
export { PROCEDURE_ROOTS, getProcedureRoot, isProcedureName, getProcedureNames, type ProcedureName, } from './procedures.js';
|
|
77
77
|
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';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"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MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,qBAAqB,EAC1B,wBAAwB,EACxB,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,gCAAgC,GACjC,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,KAAK,gBAAgB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,YAAY,EACZ,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,KAAK,aAAa,GACnB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAEV,oBAAoB,EACpB,cAAc,EACd,mBAAmB,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
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* } from '@openzeppelin/miden-multisig-client';
|
|
12
12
|
* import { MidenClient, AuthSecretKey } from '@miden-sdk/miden-sdk';
|
|
13
13
|
*
|
|
14
|
-
* const midenClient = await MidenClient.createDevnet();
|
|
14
|
+
* const midenClient = await MidenClient.createDevnet({ useWorker: false });
|
|
15
15
|
* const secretKey = AuthSecretKey.rpoFalconWithRNG(undefined);
|
|
16
16
|
*
|
|
17
17
|
* // Store in miden-sdk's keystore
|
|
@@ -47,7 +47,7 @@ export { MultisigClient, } from './client.js';
|
|
|
47
47
|
export { lookupAuthDigest } from './lookupAuth.js';
|
|
48
48
|
export { Multisig, } from './multisig.js';
|
|
49
49
|
export { AccountInspector } from './inspector.js';
|
|
50
|
-
export { chainAnchorFromBase64, chainAnchorToBase64, chainAnchorBlockNum, executeForSummary, executeForSummaryAt, summaryApprovalExpirationBlockNum, summarySalt, SummaryAnchorMismatchError, buildUpdateSignersTransactionRequest, buildUpdateProcedureThresholdTransactionRequest, buildUpdateGuardianTransactionRequest, buildConsumeNotesTransactionRequest, buildConsumeNotesTransactionRequestFromNotes, buildP2idTransactionRequest, requestBoundBlockNum, requestSaltHex, MAX_APPROVAL_EXPIRATION_DELTA, parseP2idNoteType, p2idNoteTypeToMetadata, } from './transaction.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';
|
|
51
51
|
// Commitment derivation for hand-rolled export/import flows (issue #433):
|
|
52
52
|
// the proposal id is the tx summary's commitment, recomputed from the
|
|
53
53
|
// serialized summary exactly as import verification does. Returns normalized
|
|
@@ -67,7 +67,7 @@ export { createMultisigAccount, validateMultisigConfig, buildMultisigStorageSlot
|
|
|
67
67
|
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
68
|
export { LEGACY_CONSUME_NOTES_ENABLED, } from './multisig/config.js';
|
|
69
69
|
export { NoteBindingMismatchError, UnsupportedMetadataVersionError, ConsumeNotesMetadataOversizeError, LegacyConsumeNotesNoteMissingError, ConsumeNoteNotAuthenticatedError, } from './multisig/consumeNotesErrors.js';
|
|
70
|
-
export { MultisigAuthArgsMissingError, ProposalSaltMalformedError, } from './multisig/authArgErrors.js';
|
|
70
|
+
export { BoundBlockNotDeclaredError, MultisigAuthArgsMissingError, ProposalSaltMalformedError, } from './multisig/authArgErrors.js';
|
|
71
71
|
export { noteToBase64, noteFromBase64, } from './utils/encoding.js';
|
|
72
72
|
export { PROCEDURE_ROOTS, getProcedureRoot, isProcedureName, getProcedureNames, } from './procedures.js';
|
|
73
73
|
//# 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,
|
|
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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AAM,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,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,GAC3B,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,5 +1,5 @@
|
|
|
1
1
|
/** Stable error identifiers for auth-arg recovery failures. */
|
|
2
|
-
export type AuthArgErrorCode = 'proposal_salt_malformed' | 'multisig_auth_args_missing';
|
|
2
|
+
export type AuthArgErrorCode = 'proposal_salt_malformed' | 'multisig_auth_args_missing' | 'bound_block_not_declared';
|
|
3
3
|
/**
|
|
4
4
|
* A proposal's recorded salt is not a readable 32-byte word, so no rebuild can
|
|
5
5
|
* use it.
|
|
@@ -39,4 +39,18 @@ export declare class MultisigAuthArgsMissingError extends Error {
|
|
|
39
39
|
readonly accountId: string;
|
|
40
40
|
constructor(accountId: string);
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* A multisig request does not list the block its auth args bind among the
|
|
44
|
+
* blocks it declares through `withBlockNumbers`. A proposal executes at the
|
|
45
|
+
* chain tip, where the auth procedure can read the bound block only from the
|
|
46
|
+
* transaction's partial blockchain, so such a request fails in the VM with
|
|
47
|
+
* `failed to lookup value in Merkle store` once the chain moves past that
|
|
48
|
+
* block. `feeAwareTransactionRequestBuilder` declares it; a request whose auth
|
|
49
|
+
* args are attached by hand has to call `withBlockNumbers([boundBlockNum])`.
|
|
50
|
+
*/
|
|
51
|
+
export declare class BoundBlockNotDeclaredError extends Error {
|
|
52
|
+
readonly code: AuthArgErrorCode;
|
|
53
|
+
readonly boundBlockNum: number;
|
|
54
|
+
constructor(boundBlockNum: number);
|
|
55
|
+
}
|
|
42
56
|
//# sourceMappingURL=authArgErrors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authArgErrors.d.ts","sourceRoot":"","sources":["../../src/multisig/authArgErrors.ts"],"names":[],"mappings":"AAIA,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"authArgErrors.d.ts","sourceRoot":"","sources":["../../src/multisig/authArgErrors.ts"],"names":[],"mappings":"AAIA,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,GACxB,yBAAyB,GACzB,4BAA4B,GAC5B,0BAA0B,CAAC;AA0C/B;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAA6B;IAC5D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;gBAEd,OAAO,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAc/F;AAED;;;;;;;GAOG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAgC;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,SAAS,EAAE,MAAM;CAS9B;AAED;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAA8B;IAC7D,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;gBAEnB,aAAa,EAAE,MAAM;CASlC"}
|
|
@@ -88,4 +88,24 @@ export class MultisigAuthArgsMissingError extends Error {
|
|
|
88
88
|
this.accountId = accountId;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* A multisig request does not list the block its auth args bind among the
|
|
93
|
+
* blocks it declares through `withBlockNumbers`. A proposal executes at the
|
|
94
|
+
* chain tip, where the auth procedure can read the bound block only from the
|
|
95
|
+
* transaction's partial blockchain, so such a request fails in the VM with
|
|
96
|
+
* `failed to lookup value in Merkle store` once the chain moves past that
|
|
97
|
+
* block. `feeAwareTransactionRequestBuilder` declares it; a request whose auth
|
|
98
|
+
* args are attached by hand has to call `withBlockNumbers([boundBlockNum])`.
|
|
99
|
+
*/
|
|
100
|
+
export class BoundBlockNotDeclaredError extends Error {
|
|
101
|
+
code = 'bound_block_not_declared';
|
|
102
|
+
boundBlockNum;
|
|
103
|
+
constructor(boundBlockNum) {
|
|
104
|
+
super(`The transaction request binds block ${boundBlockNum} in its multisig auth args but does ` +
|
|
105
|
+
'not declare it, so it cannot execute at a later chain tip. Build it with ' +
|
|
106
|
+
`feeAwareTransactionRequestBuilder or add withBlockNumbers([${boundBlockNum}])`);
|
|
107
|
+
this.name = 'BoundBlockNotDeclaredError';
|
|
108
|
+
this.boundBlockNum = boundBlockNum;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
91
111
|
//# sourceMappingURL=authArgErrors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authArgErrors.js","sourceRoot":"","sources":["../../src/multisig/authArgErrors.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,2FAA2F;AAC3F,4EAA4E;
|
|
1
|
+
{"version":3,"file":"authArgErrors.js","sourceRoot":"","sources":["../../src/multisig/authArgErrors.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,2FAA2F;AAC3F,4EAA4E;AAQ5E,kEAAkE;AAClE,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,cAAc,CAAC,KAAc;IACpC,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