@openzeppelin/miden-multisig-client 0.17.0 → 0.18.0-rc.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.
- package/README.md +171 -46
- package/dist/account/builder.d.ts +4 -4
- package/dist/account/builder.d.ts.map +1 -1
- package/dist/account/builder.js +17 -7
- package/dist/account/builder.js.map +1 -1
- package/dist/account/layout.d.ts +5 -5
- package/dist/account/layout.d.ts.map +1 -1
- package/dist/account/layout.js +5 -5
- package/dist/account/layout.js.map +1 -1
- package/dist/client.d.ts +18 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +79 -6
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/multisig/authArgErrors.d.ts +28 -31
- package/dist/multisig/authArgErrors.d.ts.map +1 -1
- package/dist/multisig/authArgErrors.js +42 -46
- package/dist/multisig/authArgErrors.js.map +1 -1
- package/dist/multisig/consumeNotesErrors.d.ts +13 -1
- package/dist/multisig/consumeNotesErrors.d.ts.map +1 -1
- package/dist/multisig/consumeNotesErrors.js +17 -0
- package/dist/multisig/consumeNotesErrors.js.map +1 -1
- package/dist/multisig/signing.d.ts +1 -1
- package/dist/multisig/signing.d.ts.map +1 -1
- package/dist/multisig/signing.js +8 -3
- package/dist/multisig/signing.js.map +1 -1
- package/dist/multisig.d.ts +145 -18
- package/dist/multisig.d.ts.map +1 -1
- package/dist/multisig.js +493 -162
- package/dist/multisig.js.map +1 -1
- package/dist/procedures.d.ts +7 -7
- package/dist/procedures.js +7 -7
- package/dist/proposal/factory.d.ts.map +1 -1
- package/dist/proposal/factory.js +7 -0
- package/dist/proposal/factory.js.map +1 -1
- 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/raw-client.d.ts +1 -0
- package/dist/raw-client.d.ts.map +1 -1
- package/dist/raw-client.js +10 -2
- package/dist/raw-client.js.map +1 -1
- package/dist/recovery/publicNoteBackfill.js +1 -1
- package/dist/recovery/publicNoteBackfill.js.map +1 -1
- package/dist/retry/classify.d.ts +3 -0
- package/dist/retry/classify.d.ts.map +1 -1
- package/dist/retry/classify.js +2 -2
- package/dist/retry/classify.js.map +1 -1
- package/dist/signer.d.ts +1 -0
- package/dist/signer.d.ts.map +1 -1
- package/dist/signer.js +1 -0
- package/dist/signer.js.map +1 -1
- package/dist/signers/index.d.ts +1 -0
- package/dist/signers/index.d.ts.map +1 -1
- package/dist/signers/index.js +1 -0
- package/dist/signers/index.js.map +1 -1
- package/dist/signers/ledger.d.ts +25 -0
- package/dist/signers/ledger.d.ts.map +1 -0
- package/dist/signers/ledger.js +96 -0
- package/dist/signers/ledger.js.map +1 -0
- package/dist/state/adopt.d.ts +45 -0
- package/dist/state/adopt.d.ts.map +1 -0
- package/dist/state/adopt.js +101 -0
- package/dist/state/adopt.js.map +1 -0
- package/dist/transaction/authArgs.d.ts +57 -0
- package/dist/transaction/authArgs.d.ts.map +1 -0
- package/dist/transaction/authArgs.js +108 -0
- package/dist/transaction/authArgs.js.map +1 -0
- package/dist/transaction/consumeNotes.d.ts +9 -5
- package/dist/transaction/consumeNotes.d.ts.map +1 -1
- package/dist/transaction/consumeNotes.js +8 -23
- package/dist/transaction/consumeNotes.js.map +1 -1
- package/dist/transaction/noteAuthentication.d.ts +39 -0
- package/dist/transaction/noteAuthentication.d.ts.map +1 -0
- package/dist/transaction/noteAuthentication.js +94 -0
- package/dist/transaction/noteAuthentication.js.map +1 -0
- package/dist/transaction/options.d.ts +25 -0
- package/dist/transaction/options.d.ts.map +1 -1
- package/dist/transaction/p2id.d.ts +3 -2
- package/dist/transaction/p2id.d.ts.map +1 -1
- package/dist/transaction/p2id.js +36 -27
- package/dist/transaction/p2id.js.map +1 -1
- package/dist/transaction/summary.d.ts +126 -22
- package/dist/transaction/summary.d.ts.map +1 -1
- package/dist/transaction/summary.js +164 -22
- package/dist/transaction/summary.js.map +1 -1
- package/dist/transaction/updateGuardian.d.ts +3 -3
- package/dist/transaction/updateGuardian.d.ts.map +1 -1
- package/dist/transaction/updateGuardian.js +5 -16
- package/dist/transaction/updateGuardian.js.map +1 -1
- package/dist/transaction/updateProcedureThreshold.d.ts +3 -3
- package/dist/transaction/updateProcedureThreshold.d.ts.map +1 -1
- package/dist/transaction/updateProcedureThreshold.js +6 -16
- package/dist/transaction/updateProcedureThreshold.js.map +1 -1
- package/dist/transaction/updateSigners.d.ts +3 -3
- package/dist/transaction/updateSigners.d.ts.map +1 -1
- package/dist/transaction/updateSigners.js +9 -16
- package/dist/transaction/updateSigners.js.map +1 -1
- package/dist/transaction.d.ts +3 -2
- package/dist/transaction.d.ts.map +1 -1
- package/dist/transaction.js +3 -2
- package/dist/transaction.js.map +1 -1
- package/dist/types/proposal.d.ts +37 -5
- package/dist/types/proposal.d.ts.map +1 -1
- package/dist/types/proposal.js +8 -0
- package/dist/types/proposal.js.map +1 -1
- package/dist/utils/eip712.d.ts +80 -0
- package/dist/utils/eip712.d.ts.map +1 -0
- package/dist/utils/eip712.js +49 -0
- package/dist/utils/eip712.js.map +1 -0
- package/dist/utils/signature.d.ts +4 -0
- package/dist/utils/signature.d.ts.map +1 -1
- package/dist/utils/signature.js +49 -1
- package/dist/utils/signature.js.map +1 -1
- package/package.json +11 -6
- package/src/account/builder.ts +18 -7
- package/src/account/layout.ts +5 -5
- package/src/client.ts +94 -6
- package/src/index.ts +24 -3
- package/src/multisig/authArgErrors.ts +47 -53
- package/src/multisig/consumeNotesErrors.ts +20 -1
- package/src/multisig/signing.ts +8 -2
- package/src/multisig.ts +614 -205
- package/src/procedures.ts +7 -7
- package/src/proposal/factory.ts +7 -0
- package/src/prover/workflow.ts +7 -10
- package/src/raw-client.ts +11 -7
- package/src/recovery/publicNoteBackfill.ts +1 -1
- package/src/retry/classify.ts +3 -3
- package/src/signer.ts +1 -0
- package/src/signers/index.ts +1 -0
- package/src/signers/ledger.ts +122 -0
- package/src/state/adopt.ts +132 -0
- package/src/transaction/authArgs.ts +142 -0
- package/src/transaction/consumeNotes.ts +23 -30
- package/src/transaction/noteAuthentication.ts +136 -0
- package/src/transaction/options.ts +27 -0
- package/src/transaction/p2id.ts +45 -34
- package/src/transaction/summary.ts +239 -30
- package/src/transaction/updateGuardian.ts +8 -22
- package/src/transaction/updateProcedureThreshold.ts +8 -20
- package/src/transaction/updateSigners.ts +11 -22
- package/src/transaction.ts +18 -1
- package/src/types/proposal.ts +36 -5
- package/src/utils/eip712.ts +57 -0
- package/src/utils/signature.ts +57 -0
- package/src/prover/test-node.d.ts +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumeNotes.d.ts","sourceRoot":"","sources":["../../src/transaction/consumeNotes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,IAAI,EACJ,kBAAkB,EAClB,aAAa,EACb,IAAI,EACL,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"consumeNotes.d.ts","sourceRoot":"","sources":["../../src/transaction/consumeNotes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,IAAI,EACJ,kBAAkB,EAClB,aAAa,EACb,IAAI,EACL,MAAM,sBAAsB,CAAC;AAK9B,OAAO,KAAK,EAAE,iCAAiC,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE9F;;;GAGG;AACH,wBAAgB,4CAA4C,CAC1D,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,EAAE,iCAAiC,GACzC,OAAO,CAAC;IAAE,OAAO,EAAE,kBAAkB,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC;AACxD,wBAAgB,4CAA4C,CAC1D,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC;IAAE,OAAO,EAAE,kBAAkB,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC;AAyBxD;;;GAGG;AACH,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,iCAAiC,GACzC,OAAO,CAAC;IAAE,OAAO,EAAE,kBAAkB,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC;AACxD,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC;IAAE,OAAO,EAAE,kBAAkB,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { NoteAndArgs, NoteAndArgsArray
|
|
1
|
+
import { NoteAndArgs, NoteAndArgsArray } from '@miden-sdk/miden-sdk';
|
|
2
2
|
import { LegacyConsumeNotesNoteMissingError } from '../multisig/consumeNotesErrors.js';
|
|
3
3
|
import { getRawMidenClient } from '../raw-client.js';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Build a consume-notes request from loaded `Note` objects (no local-store
|
|
8
|
-
* read). v2 verification path for issue #229.
|
|
9
|
-
*/
|
|
10
|
-
export function buildConsumeNotesTransactionRequestFromNotes(notes, options = {}) {
|
|
4
|
+
import { buildMultisigRequest, multisigRequestBuilder } from './authArgs.js';
|
|
5
|
+
export async function buildConsumeNotesTransactionRequestFromNotes(client, notes, options) {
|
|
11
6
|
if (notes.length === 0) {
|
|
12
7
|
throw new Error('At least one note is required');
|
|
13
8
|
}
|
|
@@ -15,24 +10,14 @@ export function buildConsumeNotesTransactionRequestFromNotes(notes, options = {}
|
|
|
15
10
|
for (const note of notes) {
|
|
16
11
|
noteAndArgsArray.push(new NoteAndArgs(note, null));
|
|
17
12
|
}
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
let txBuilder = new TransactionRequestBuilder();
|
|
21
|
-
txBuilder = txBuilder.withInputNotes(noteAndArgsArray);
|
|
22
|
-
txBuilder = txBuilder.withFeeConversionSalt(authSaltForBuilder);
|
|
23
|
-
// Borrows rather than consumes: the glue passes `__wbg_ptr` without taking it,
|
|
24
|
-
// so the handle stays ours to release once the builder has read it.
|
|
25
|
-
authSaltForBuilder.free?.();
|
|
13
|
+
const { builder, saltHex } = await multisigRequestBuilder(client, options);
|
|
14
|
+
let txBuilder = builder.withInputNotes(noteAndArgsArray);
|
|
26
15
|
if (options.signatureAdviceMap) {
|
|
27
16
|
txBuilder = txBuilder.extendAdviceMap(options.signatureAdviceMap);
|
|
28
17
|
}
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
request: txBuilder.build(),
|
|
32
|
-
salt: authSaltForReturn,
|
|
33
|
-
};
|
|
18
|
+
return buildMultisigRequest(txBuilder, saltHex, options.accountId);
|
|
34
19
|
}
|
|
35
|
-
export async function buildConsumeNotesTransactionRequest(client, noteIds, options
|
|
20
|
+
export async function buildConsumeNotesTransactionRequest(client, noteIds, options) {
|
|
36
21
|
if (noteIds.length === 0) {
|
|
37
22
|
throw new Error('At least one note ID is required');
|
|
38
23
|
}
|
|
@@ -45,6 +30,6 @@ export async function buildConsumeNotesTransactionRequest(client, noteIds, optio
|
|
|
45
30
|
}
|
|
46
31
|
notes.push(inputNoteRecord.toNote());
|
|
47
32
|
}
|
|
48
|
-
return buildConsumeNotesTransactionRequestFromNotes(notes, options);
|
|
33
|
+
return buildConsumeNotesTransactionRequestFromNotes(rawClient, notes, options);
|
|
49
34
|
}
|
|
50
35
|
//# sourceMappingURL=consumeNotes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumeNotes.js","sourceRoot":"","sources":["../../src/transaction/consumeNotes.ts"],"names":[],"mappings":"AAOA,OAA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AC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC5E,MAAM,KAAK,GAAW,EAAE,CAAC;IACzB,KAAK,MAAM,SAAS,IAAI,OAAO,EAAE,CAAC;QAChC,MAAM,eAAe,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAChE,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,kCAAkC,CAAC,SAAS,CAAC,CAAC;QAC1D,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,4CAA4C,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical consumption mode for `consume_notes` proposals: authenticated.
|
|
3
|
+
*
|
|
4
|
+
* miden-client decides per input note, at execution time and from the local
|
|
5
|
+
* store alone, whether it is consumed as *authenticated* (the store holds
|
|
6
|
+
* its inclusion proof) or *unauthenticated* (anything else). The two modes
|
|
7
|
+
* commit differently into the transaction summary,
|
|
8
|
+
* `hash(nullifier || note_id_or_ZERO)`, so the proposer and every verifier
|
|
9
|
+
* must be in the same mode or the summary commitment, and with it the
|
|
10
|
+
* proposal id, differs. That was issue #409's live shape: a cosigner whose
|
|
11
|
+
* fresh store had never seen the notes failed with "metadata does not match
|
|
12
|
+
* tx_summary". Proposal creation and every rebuild call
|
|
13
|
+
* {@link ensureNotesAuthenticated} first, so the executed transaction is the
|
|
14
|
+
* one the cosigners signed regardless of what each store held before.
|
|
15
|
+
*/
|
|
16
|
+
import { type Note } from '@miden-sdk/miden-sdk';
|
|
17
|
+
import type { RawClientSource } from '../raw-client.js';
|
|
18
|
+
import { type RpcConfig } from '../rpc/config.js';
|
|
19
|
+
export interface EnsureNotesAuthenticatedOptions {
|
|
20
|
+
/** Miden node RPC endpoint the inclusion proofs are fetched from. */
|
|
21
|
+
midenRpcEndpoint: string;
|
|
22
|
+
/** Retry policy for the proof fetch; defaults to the SDK's RPC defaults. */
|
|
23
|
+
rpc?: RpcConfig;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Makes every note in `notes` an authenticated input note in the client's
|
|
27
|
+
* local store: present, with its on-chain inclusion proof and block header.
|
|
28
|
+
*
|
|
29
|
+
* Notes already authenticated locally are left alone. For the rest the
|
|
30
|
+
* inclusion proofs come from the node in one round trip (the node serves
|
|
31
|
+
* proofs for private notes too) and each note is imported as committed,
|
|
32
|
+
* which also upgrades a proof-less record the store already tracked.
|
|
33
|
+
*
|
|
34
|
+
* @throws {ConsumeNoteNotAuthenticatedError} when a note is not committed on
|
|
35
|
+
* chain yet, the node does not serve its proof, the import fails, or the
|
|
36
|
+
* record still lacks authentication after a sync.
|
|
37
|
+
*/
|
|
38
|
+
export declare function ensureNotesAuthenticated(midenClient: RawClientSource, notes: readonly Note[], options: EnsureNotesAuthenticatedOptions): Promise<void>;
|
|
39
|
+
//# sourceMappingURL=noteAuthentication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noteAuthentication.d.ts","sourceRoot":"","sources":["../../src/transaction/noteAuthentication.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAY,KAAK,IAAI,EAAsC,MAAM,sBAAsB,CAAC;AAG/F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIpE,MAAM,WAAW,+BAA+B;IAC9C,qEAAqE;IACrE,gBAAgB,EAAE,MAAM,CAAC;IACzB,4EAA4E;IAC5E,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,eAAe,EAC5B,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,IAAI,CAAC,CA+Df"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical consumption mode for `consume_notes` proposals: authenticated.
|
|
3
|
+
*
|
|
4
|
+
* miden-client decides per input note, at execution time and from the local
|
|
5
|
+
* store alone, whether it is consumed as *authenticated* (the store holds
|
|
6
|
+
* its inclusion proof) or *unauthenticated* (anything else). The two modes
|
|
7
|
+
* commit differently into the transaction summary,
|
|
8
|
+
* `hash(nullifier || note_id_or_ZERO)`, so the proposer and every verifier
|
|
9
|
+
* must be in the same mode or the summary commitment, and with it the
|
|
10
|
+
* proposal id, differs. That was issue #409's live shape: a cosigner whose
|
|
11
|
+
* fresh store had never seen the notes failed with "metadata does not match
|
|
12
|
+
* tx_summary". Proposal creation and every rebuild call
|
|
13
|
+
* {@link ensureNotesAuthenticated} first, so the executed transaction is the
|
|
14
|
+
* one the cosigners signed regardless of what each store held before.
|
|
15
|
+
*/
|
|
16
|
+
import { Endpoint, RpcClient } from '@miden-sdk/miden-sdk';
|
|
17
|
+
import { ConsumeNoteNotAuthenticatedError } from '../multisig/consumeNotesErrors.js';
|
|
18
|
+
import { getRawMidenClient } from '../raw-client.js';
|
|
19
|
+
import { importNoteWithProof } from '../recovery/proposalNoteImport.js';
|
|
20
|
+
import { resolveRpcConfig } from '../rpc/config.js';
|
|
21
|
+
import { retryRpcRead } from '../rpc/retry.js';
|
|
22
|
+
import { normalizeHexWord } from '../utils/encoding.js';
|
|
23
|
+
/**
|
|
24
|
+
* Makes every note in `notes` an authenticated input note in the client's
|
|
25
|
+
* local store: present, with its on-chain inclusion proof and block header.
|
|
26
|
+
*
|
|
27
|
+
* Notes already authenticated locally are left alone. For the rest the
|
|
28
|
+
* inclusion proofs come from the node in one round trip (the node serves
|
|
29
|
+
* proofs for private notes too) and each note is imported as committed,
|
|
30
|
+
* which also upgrades a proof-less record the store already tracked.
|
|
31
|
+
*
|
|
32
|
+
* @throws {ConsumeNoteNotAuthenticatedError} when a note is not committed on
|
|
33
|
+
* chain yet, the node does not serve its proof, the import fails, or the
|
|
34
|
+
* record still lacks authentication after a sync.
|
|
35
|
+
*/
|
|
36
|
+
export async function ensureNotesAuthenticated(midenClient, notes, options) {
|
|
37
|
+
const webClient = await getRawMidenClient(midenClient, options.midenRpcEndpoint);
|
|
38
|
+
const pending = await unauthenticatedNotes(webClient, notes);
|
|
39
|
+
if (pending.length === 0) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const proofs = new Map();
|
|
43
|
+
try {
|
|
44
|
+
const rpcClient = new RpcClient(new Endpoint(options.midenRpcEndpoint));
|
|
45
|
+
const fetched = await retryRpcRead(() => rpcClient.getNotesById(pending.map((note) => note.id())), resolveRpcConfig(options.rpc));
|
|
46
|
+
for (const entry of fetched) {
|
|
47
|
+
proofs.set(normalizeHexWord(entry.noteId.toString()), entry.inclusionProof);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
throw new ConsumeNoteNotAuthenticatedError(noteIdHex(pending[0]), `failed to fetch inclusion proofs from the node: ${errorDetail(error)}`);
|
|
52
|
+
}
|
|
53
|
+
for (const note of pending) {
|
|
54
|
+
const idHex = noteIdHex(note);
|
|
55
|
+
const proof = proofs.get(idHex);
|
|
56
|
+
if (!proof) {
|
|
57
|
+
throw new ConsumeNoteNotAuthenticatedError(idHex, 'the node has no inclusion proof for it (not committed on chain yet)');
|
|
58
|
+
}
|
|
59
|
+
const { outcome, wasImported } = await importNoteWithProof(webClient, 'proposal', idHex, note, proof);
|
|
60
|
+
if (!wasImported) {
|
|
61
|
+
throw new ConsumeNoteNotAuthenticatedError(idHex, `failed to import it with its inclusion proof: ${outcome.reason ?? 'unknown error'}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// The import authenticates a note committed at or below the client's sync
|
|
65
|
+
// height; a newer one lands unverified until a sync fetches its block
|
|
66
|
+
// header. A cosigner that just loaded the account is typically behind the
|
|
67
|
+
// note's block, so sync once and re-check before failing.
|
|
68
|
+
if ((await unauthenticatedNotes(webClient, notes)).length > 0) {
|
|
69
|
+
await webClient.syncState();
|
|
70
|
+
}
|
|
71
|
+
const still = await unauthenticatedNotes(webClient, notes);
|
|
72
|
+
if (still.length > 0) {
|
|
73
|
+
throw new ConsumeNoteNotAuthenticatedError(noteIdHex(still[0]), 'its inclusion proof was imported but the local store could not verify it ' +
|
|
74
|
+
'against the chain even after a sync');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** The subset of `notes` whose local record is missing or carries no proof. */
|
|
78
|
+
async function unauthenticatedNotes(webClient, notes) {
|
|
79
|
+
const pending = [];
|
|
80
|
+
for (const note of notes) {
|
|
81
|
+
const record = await webClient.getInputNote(noteIdHex(note));
|
|
82
|
+
if (!record || !record.isAuthenticated()) {
|
|
83
|
+
pending.push(note);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return pending;
|
|
87
|
+
}
|
|
88
|
+
function noteIdHex(note) {
|
|
89
|
+
return normalizeHexWord(note.id().toString());
|
|
90
|
+
}
|
|
91
|
+
function errorDetail(error) {
|
|
92
|
+
return error instanceof Error ? error.message : String(error);
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=noteAuthentication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noteAuthentication.js","sourceRoot":"","sources":["../../src/transaction/noteAuthentication.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAsC,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE/F,OAAO,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AAErF,OAAO,EAAE,iBAAiB,EA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KAAsB;IAEtB,MAAM,OAAO,GAAW,EAAE,CAAC;IAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,CAAC;YACzC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,SAAS,CAAC,IAAU;IAC3B,OAAO,gBAAgB,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -5,8 +5,33 @@ export interface SignatureOptions {
|
|
|
5
5
|
signatureAdviceMap?: AdviceMap;
|
|
6
6
|
signatureScheme?: SignatureScheme;
|
|
7
7
|
midenRpcEndpoint?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The block the transaction summary binds. Omitted, the store's sync height,
|
|
10
|
+
* which is right for the party creating a proposal. A cosigner or executor
|
|
11
|
+
* rebuilding a proposal pins it to the proposal's anchor block, or the rebuilt
|
|
12
|
+
* summary can never match the signed one.
|
|
13
|
+
*/
|
|
14
|
+
boundBlockNum?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Blocks after the bound block at which the approvers' signatures stop
|
|
17
|
+
* authorizing the transaction, so it must be included by then. Bound by the
|
|
18
|
+
* summary, so a rebuild must pass the same value. At most 65535 blocks, the
|
|
19
|
+
* furthest a transaction can expire after its reference block; omitted, the
|
|
20
|
+
* approval never expires, which is the upstream default.
|
|
21
|
+
*/
|
|
22
|
+
approvalExpirationDelta?: number;
|
|
8
23
|
}
|
|
9
24
|
export interface MidenClientSignatureOptions extends SignatureOptions {
|
|
10
25
|
midenRpcEndpoint: string;
|
|
11
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Options for a request a multisig account executes. The account decides the
|
|
29
|
+
* auth args the request has to carry, so every multisig builder needs it.
|
|
30
|
+
*/
|
|
31
|
+
export interface MultisigRequestOptions extends SignatureOptions {
|
|
32
|
+
accountId: string;
|
|
33
|
+
}
|
|
34
|
+
export interface MidenClientMultisigRequestOptions extends MultisigRequestOptions {
|
|
35
|
+
midenRpcEndpoint: string;
|
|
36
|
+
}
|
|
12
37
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/transaction/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/transaction/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iCAAkC,SAAQ,sBAAsB;IAC/E,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TransactionRequest, Word } from '@miden-sdk/miden-sdk';
|
|
2
2
|
import { Note, NoteType } from '@miden-sdk/miden-sdk';
|
|
3
|
+
import type { RawClientSource } from '../raw-client.js';
|
|
3
4
|
import type { SignatureOptions } from './options.js';
|
|
4
5
|
import type { P2idNoteVisibility } from '../types/proposal.js';
|
|
5
6
|
/**
|
|
@@ -37,8 +38,8 @@ export declare function deriveP2idSerialNumber(salt: Word): Word;
|
|
|
37
38
|
* callback flag is encoded in the faucet account ID.
|
|
38
39
|
*/
|
|
39
40
|
export declare function buildP2idNoteFromMetadata(senderId: string, recipientId: string, faucetId: string, amount: bigint, noteType: NoteType, saltHex: string, heights?: P2ideHeightOptions): Note;
|
|
40
|
-
export declare function buildP2idTransactionRequest(senderId: string, recipientId: string, faucetId: string, amount: bigint, options?: P2idTransactionOptions): {
|
|
41
|
+
export declare function buildP2idTransactionRequest(client: RawClientSource, senderId: string, recipientId: string, faucetId: string, amount: bigint, options?: P2idTransactionOptions): Promise<{
|
|
41
42
|
request: TransactionRequest;
|
|
42
43
|
salt: Word;
|
|
43
|
-
}
|
|
44
|
+
}>;
|
|
44
45
|
//# sourceMappingURL=p2id.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p2id.d.ts","sourceRoot":"","sources":["../../src/transaction/p2id.ts"],"names":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AAO,GAAE,kBAAuB,GAC/B,IAAI,CASN;AAED,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC;IAAE,OAAO,EAAE,kBAAkB,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAuBtD"}
|
package/dist/transaction/p2id.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AccountId, Felt, FeltArray, FungibleAsset, MidenArrays, Note, NoteAssets, NoteMetadata, NoteRecipient, NoteScript, NoteStorage, NoteTag, NoteType, Poseidon2,
|
|
2
|
-
import {
|
|
1
|
+
import { AccountId, Felt, FeltArray, FungibleAsset, MidenArrays, Note, NoteAssets, NoteMetadata, NoteRecipient, NoteScript, NoteStorage, NoteTag, NoteType, Poseidon2, Word as WordType, } from '@miden-sdk/miden-sdk';
|
|
2
|
+
import { buildMultisigRequest, multisigRequestBuilder } from './authArgs.js';
|
|
3
3
|
import { normalizeHexWord } from '../utils/encoding.js';
|
|
4
4
|
import { parseP2ideHeight } from '../types/proposal.js';
|
|
5
5
|
/**
|
|
@@ -33,22 +33,39 @@ export function deriveP2idSerialNumber(salt) {
|
|
|
33
33
|
...zeroWord.toFelts(),
|
|
34
34
|
]));
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* P2ID storage since protocol 0.17 rc.5: target account, then a two-felt salt.
|
|
38
|
+
* Zero salt is the upstream default. A secret salt hides the target from
|
|
39
|
+
* guesses against the storage commitment; this builder keeps the note
|
|
40
|
+
* deterministic in the proposal salt, which already derives the serial number.
|
|
41
|
+
*/
|
|
42
|
+
function p2idStorage(recipient) {
|
|
43
|
+
return [recipient.suffix(), recipient.prefix(), new Felt(0n), new Felt(0n)];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* P2IDE storage: reclaimer (the sender), target, then reclaim and timelock
|
|
47
|
+
* heights. Zero encodes an unset height. The script requires all six items.
|
|
48
|
+
*/
|
|
49
|
+
function p2ideStorage(sender, recipient, reclaimHeight, timelockHeight) {
|
|
50
|
+
return [
|
|
51
|
+
sender.suffix(),
|
|
52
|
+
sender.prefix(),
|
|
53
|
+
recipient.suffix(),
|
|
54
|
+
recipient.prefix(),
|
|
55
|
+
new Felt(BigInt(reclaimHeight)),
|
|
56
|
+
new Felt(BigInt(timelockHeight)),
|
|
57
|
+
];
|
|
58
|
+
}
|
|
36
59
|
function buildP2idNote(sender, recipient, noteAssets, noteType, saltHex, heights = {}) {
|
|
37
60
|
const salt = WordType.fromHex(normalizeHexWord(saltHex));
|
|
38
61
|
const serialNum = deriveP2idSerialNumber(salt);
|
|
39
62
|
const reclaimHeight = parseP2ideHeight('reclaimHeight', heights.reclaimHeight);
|
|
40
63
|
const timelockHeight = parseP2ideHeight('timelockHeight', heights.timelockHeight);
|
|
41
64
|
const isP2ide = reclaimHeight !== undefined || timelockHeight !== undefined;
|
|
42
|
-
// P2IDE storage layout (miden-standards `P2ideNoteStorage`): the P2ID
|
|
43
|
-
// storage plus reclaim/timelock heights as felts, 0 encoding "unset".
|
|
44
65
|
const noteScript = isP2ide ? NoteScript.p2ide() : NoteScript.p2id();
|
|
45
|
-
const storageFelts =
|
|
46
|
-
recipient
|
|
47
|
-
recipient
|
|
48
|
-
];
|
|
49
|
-
if (isP2ide) {
|
|
50
|
-
storageFelts.push(new Felt(BigInt(reclaimHeight ?? 0)), new Felt(BigInt(timelockHeight ?? 0)));
|
|
51
|
-
}
|
|
66
|
+
const storageFelts = isP2ide
|
|
67
|
+
? p2ideStorage(sender, recipient, reclaimHeight ?? 0, timelockHeight ?? 0)
|
|
68
|
+
: p2idStorage(recipient);
|
|
52
69
|
const noteStorage = new NoteStorage(new FeltArray(storageFelts));
|
|
53
70
|
const noteRecipient = new NoteRecipient(serialNum, noteScript, noteStorage);
|
|
54
71
|
const noteTag = NoteTag.withAccountTarget(recipient);
|
|
@@ -69,24 +86,16 @@ export function buildP2idNoteFromMetadata(senderId, recipientId, faucetId, amoun
|
|
|
69
86
|
const noteAssets = new NoteAssets([asset]);
|
|
70
87
|
return buildP2idNote(sender, recipient, noteAssets, noteType, saltHex, heights);
|
|
71
88
|
}
|
|
72
|
-
export function buildP2idTransactionRequest(senderId, recipientId, faucetId, amount, options = {}) {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
txBuilder =
|
|
79
|
-
txBuilder = txBuilder.withFeeConversionSalt(authSaltForBuilder);
|
|
80
|
-
// Borrows rather than consumes: the glue passes `__wbg_ptr` without taking it,
|
|
81
|
-
// so the handle stays ours to release once the builder has read it.
|
|
82
|
-
authSaltForBuilder.free?.();
|
|
89
|
+
export async function buildP2idTransactionRequest(client, senderId, recipientId, faucetId, amount, options = {}) {
|
|
90
|
+
const { builder, saltHex } = await multisigRequestBuilder(client, {
|
|
91
|
+
...options,
|
|
92
|
+
accountId: senderId,
|
|
93
|
+
});
|
|
94
|
+
const note = buildP2idNoteFromMetadata(senderId, recipientId, faucetId, amount, options.noteType ?? NoteType.Public, saltHex, { reclaimHeight: options.reclaimHeight, timelockHeight: options.timelockHeight });
|
|
95
|
+
let txBuilder = builder.withOwnOutputNotes(new MidenArrays.NoteArray([note]));
|
|
83
96
|
if (options.signatureAdviceMap) {
|
|
84
97
|
txBuilder = txBuilder.extendAdviceMap(options.signatureAdviceMap);
|
|
85
98
|
}
|
|
86
|
-
|
|
87
|
-
return {
|
|
88
|
-
request: txBuilder.build(),
|
|
89
|
-
salt: authSaltForReturn,
|
|
90
|
-
};
|
|
99
|
+
return buildMultisigRequest(txBuilder, saltHex, senderId);
|
|
91
100
|
}
|
|
92
101
|
//# sourceMappingURL=p2id.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p2id.js","sourceRoot":"","sources":["../../src/transaction/p2id.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,SAAS,EACT,aAAa,EACb,WAAW,EACX,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,OAAO,EACP,QAAQ,EACR,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"p2id.js","sourceRoot":"","sources":["../../src/transaction/p2id.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,SAAS,EACT,aAAa,EACb,WAAW,EACX,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,OAAO,EACP,QAAQ,EACR,SAAS,EACT,IAAI,IAAI,QAAQ,GACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAmBxD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAyB;IACzD,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC,MAAM,CAAC;QACzB,KAAK,SAAS;YACZ,OAAO,QAAQ,CAAC,OAAO,CAAC;QAC1B;YACE,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,mCAAmC,CAAC,CAAC;IAChG,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAA8B;IACnE,OAAO,QAAQ,KAAK,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAU;IAC/C,MAAM,QAAQ,GAAG,QAAQ,CAAC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AC,CAAC,CAAC;IAE3C,OAAO,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,MAAuB,EACvB,QAAgB,EAChB,WAAmB,EACnB,QAAgB,EAChB,MAAc,EACd,UAAkC,EAAE;IAEpC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,sBAAsB,CAAC,MAAM,EAAE;QAChE,GAAG,OAAO;QACV,SAAS,EAAE,QAAQ;KACpB,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,yBAAyB,CACpC,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,MAAM,EACN,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,EACnC,OAAO,EACP,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CACjF,CAAC;IAEF,IAAI,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE9E,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAC/B,SAAS,GAAG,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,oBAAoB,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -1,12 +1,51 @@
|
|
|
1
1
|
import type { MidenClient, TransactionRequest, TransactionSummary, WasmWebClient } from '@miden-sdk/miden-sdk';
|
|
2
2
|
import { ChainAnchor, Word } from '@miden-sdk/miden-sdk';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
|
|
4
|
+
* The summary binds the block the request's auth args name, and the anchor
|
|
5
|
+
* the store's sync height at capture. A sync landing between the build and the
|
|
6
|
+
* capture leaves them one block apart, and every cosigner's anchor check would
|
|
7
|
+
* then fail on a proposal nothing else is wrong with. Caught here, before the
|
|
8
|
+
* proposal is pushed, so the proposer rebuilds instead.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SummaryAnchorMismatchError extends Error {
|
|
11
|
+
readonly retryable = true;
|
|
12
|
+
constructor(details: {
|
|
13
|
+
anchorCommitmentHex: string;
|
|
14
|
+
summaryBlockCommitmentHex: string;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The Miden client synced and its node still has not produced the block a
|
|
19
|
+
* proposal binds, so the proposal cannot execute at this client's tip yet.
|
|
20
|
+
* Worth retrying once the node catches up.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ChainBehindBoundBlockError extends Error {
|
|
23
|
+
readonly retryable = true;
|
|
24
|
+
readonly syncHeight: number;
|
|
25
|
+
readonly boundBlockNum: number;
|
|
26
|
+
constructor(details: {
|
|
27
|
+
syncHeight: number;
|
|
28
|
+
boundBlockNum: number;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Whether a failed re-execution came from chain state this client can catch up
|
|
33
|
+
* with rather than from the proposal itself: a node that has not reached the
|
|
34
|
+
* bound block yet, or account state the node pruned because this client had
|
|
35
|
+
* not synced recently. Either clears on a later attempt, which syncs first.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isStaleChainError(error: unknown): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Derives the summary awaiting authorization for a proposal the caller is
|
|
40
|
+
* creating now, and captures a `ChainAnchor` at the current sync height to ship
|
|
41
|
+
* with it.
|
|
42
|
+
*
|
|
43
|
+
* The summary is derived at the chain tip, like every other execution of a
|
|
44
|
+
* multisig proposal (see {@link executeForSummaryAtTip}). The anchor still
|
|
45
|
+
* travels in the proposal: it names the block the request's auth args bind,
|
|
46
|
+
* which is how a rebuild learns that block, and 0.18.0-rc.1 clients re-execute
|
|
47
|
+
* at it. A proposer builds at the sync height the anchor is captured at, and
|
|
48
|
+
* the check below is what makes that hold.
|
|
10
49
|
*/
|
|
11
50
|
export declare function executeForSummary(client: MidenClient, accountId: string, txRequest: TransactionRequest, midenRpcEndpoint: string): Promise<{
|
|
12
51
|
summary: TransactionSummary;
|
|
@@ -16,11 +55,68 @@ export declare function executeForSummary(client: WasmWebClient, accountId: stri
|
|
|
16
55
|
summary: TransactionSummary;
|
|
17
56
|
anchor: ChainAnchor;
|
|
18
57
|
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Executes a multisig request at the chain tip to obtain the summary awaiting
|
|
60
|
+
* authorization. This is how cosigners and the executor reproduce a proposal's
|
|
61
|
+
* summary, whatever block they have synced to.
|
|
62
|
+
*
|
|
63
|
+
* Since protocol 0.17 a multisig summary binds the block its auth args name
|
|
64
|
+
* (the bound block), not the block the transaction executes against, so it
|
|
65
|
+
* reproduces at any later tip once the bound block is in the transaction's
|
|
66
|
+
* partial blockchain. The request declares it through `withBlockNumbers`, and
|
|
67
|
+
* foreign accounts, the fee faucet among them, load at the tip. Re-executing at
|
|
68
|
+
* the proposal's anchor instead loads them at the bound block, which a node
|
|
69
|
+
* prunes about 50 blocks later (issue #462).
|
|
70
|
+
*
|
|
71
|
+
* The client has to have synced to at least the bound block. When it has not,
|
|
72
|
+
* this syncs once before executing.
|
|
73
|
+
*
|
|
74
|
+
* @throws BoundBlockNotDeclaredError when the request binds a block in its
|
|
75
|
+
* multisig auth args without declaring it.
|
|
76
|
+
*/
|
|
77
|
+
export declare function executeForSummaryAtTip(client: MidenClient, accountId: string, txRequest: TransactionRequest, midenRpcEndpoint: string): Promise<TransactionSummary>;
|
|
78
|
+
export declare function executeForSummaryAtTip(client: WasmWebClient, accountId: string, txRequest: TransactionRequest, midenRpcEndpoint?: string): Promise<TransactionSummary>;
|
|
79
|
+
/**
|
|
80
|
+
* Gets `client` ready to execute `request` at the chain tip: checks the
|
|
81
|
+
* request declares the block its multisig auth args bind, and syncs to that
|
|
82
|
+
* block (see {@link syncToBoundBlock}).
|
|
83
|
+
*
|
|
84
|
+
* @throws BoundBlockNotDeclaredError when the request binds a block in its
|
|
85
|
+
* multisig auth args without declaring it.
|
|
86
|
+
*/
|
|
87
|
+
export declare function prepareTipExecution(client: WasmWebClient, request: TransactionRequest, syncState?: () => Promise<unknown>): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* The block `request`'s multisig auth args bind, after checking the request
|
|
90
|
+
* declares it. `undefined` for a request without multisig auth args, which
|
|
91
|
+
* has no bound block to declare.
|
|
92
|
+
*
|
|
93
|
+
* @throws BoundBlockNotDeclaredError when the block is bound but not declared.
|
|
94
|
+
*/
|
|
95
|
+
export declare function requireDeclaredBoundBlock(request: TransactionRequest): number | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Syncs `client` once when its sync height is below `blockNum`, the block a
|
|
98
|
+
* proposal binds. Execution at a tip below it fails with "requested block N is
|
|
99
|
+
* after transaction reference block M", and a store that has never synced (a
|
|
100
|
+
* cosigner that has only just loaded the account) holds no header to rebuild
|
|
101
|
+
* the request from. `syncState` lets a caller wrap the sync in its own retry
|
|
102
|
+
* policy.
|
|
103
|
+
*
|
|
104
|
+
* This does not make a store that is already past the bound block current. An
|
|
105
|
+
* execution loads foreign accounts, the fee faucet among them, at the store's
|
|
106
|
+
* sync height, which a node prunes about 50 blocks later, so the multisig
|
|
107
|
+
* entry points that re-execute a proposal sync the chain first.
|
|
108
|
+
*
|
|
109
|
+
* @throws ChainBehindBoundBlockError when the node has not reached the block.
|
|
110
|
+
*/
|
|
111
|
+
export declare function syncToBoundBlock(client: WasmWebClient, blockNum: number, syncState?: () => Promise<unknown>): Promise<void>;
|
|
19
112
|
/**
|
|
20
113
|
* Executes a transaction at the given `ChainAnchor`'s reference block to
|
|
21
|
-
* obtain the summary awaiting authorization
|
|
22
|
-
*
|
|
23
|
-
*
|
|
114
|
+
* obtain the summary awaiting authorization.
|
|
115
|
+
*
|
|
116
|
+
* For a summary that binds the reference block, such as a single-signature
|
|
117
|
+
* one. A multisig proposal's summary binds its bound block instead and is
|
|
118
|
+
* reproduced with {@link executeForSummaryAtTip}: re-executing it at an anchor
|
|
119
|
+
* fails once the node prunes the anchor block's account state.
|
|
24
120
|
*/
|
|
25
121
|
export declare function executeForSummaryAt(client: MidenClient, accountId: string, txRequest: TransactionRequest, anchor: ChainAnchor, midenRpcEndpoint: string): Promise<TransactionSummary>;
|
|
26
122
|
export declare function executeForSummaryAt(client: WasmWebClient, accountId: string, txRequest: TransactionRequest, anchor: ChainAnchor, midenRpcEndpoint?: string): Promise<TransactionSummary>;
|
|
@@ -32,22 +128,30 @@ export declare function chainAnchorToBase64(anchor: ChainAnchor): string;
|
|
|
32
128
|
* Deserializes a `ChainAnchor` from its base64 wire form. `ChainAnchor`
|
|
33
129
|
* deserialization validates the header/chain consistency internally, so a
|
|
34
130
|
* decoded anchor only needs its block commitment checked against the signed
|
|
35
|
-
* transaction summary before it is
|
|
131
|
+
* transaction summary before the block it names is taken as the one the
|
|
132
|
+
* summary binds.
|
|
36
133
|
*/
|
|
37
134
|
export declare function chainAnchorFromBase64(anchorBase64: string): ChainAnchor;
|
|
38
135
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
136
|
+
* The block a proposal's `chainAnchor` names, which is the block its summary
|
|
137
|
+
* binds: a custom producer rebuilds its request at this block. Decodes the
|
|
138
|
+
* anchor for the one number and frees it.
|
|
139
|
+
*/
|
|
140
|
+
export declare function chainAnchorBlockNum(anchorBase64: string): number;
|
|
141
|
+
/**
|
|
142
|
+
* Reads the salt a multisig transaction summary binds.
|
|
45
143
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
144
|
+
* Since protocol 0.17 the multisig auth components bind the salt itself into
|
|
145
|
+
* the summary's user params rather than a commitment derived from it, so the
|
|
146
|
+
* value cosigners signed over is readable again. A proposal still carries the
|
|
147
|
+
* salt in its metadata, because a request has to be rebuilt before any summary
|
|
148
|
+
* exists; this reader is the cross-check that the two agree.
|
|
149
|
+
*/
|
|
150
|
+
export declare function summarySalt(summary: TransactionSummary): Word;
|
|
151
|
+
/**
|
|
152
|
+
* Reads the block at which the approvers' signatures stop authorizing the
|
|
153
|
+
* transaction, or `undefined` for an approval that never expires, which is
|
|
154
|
+
* what this package's builders produce.
|
|
51
155
|
*/
|
|
52
|
-
export declare function
|
|
156
|
+
export declare function summaryApprovalExpirationBlockNum(summary: TransactionSummary): number | undefined;
|
|
53
157
|
//# sourceMappingURL=summary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/transaction/summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAa,WAAW,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/transaction/summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAa,WAAW,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAcpE;;;;;;GAMG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,SAAS,QAAQ;gBAEd,OAAO,EAAE;QAAE,mBAAmB,EAAE,MAAM,CAAC;QAAC,yBAAyB,EAAE,MAAM,CAAA;KAAE;CAQxF;AAED;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,SAAS,QAAQ;IAC1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