@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MidenClient, TransactionRequest, TransactionSummary
|
|
1
|
+
import type { MidenClient, TransactionRequest, TransactionSummary } from '@miden-sdk/miden-sdk';
|
|
2
2
|
import { ChainAnchor, Word } from '@miden-sdk/miden-sdk';
|
|
3
3
|
/**
|
|
4
4
|
* The summary binds the block the request's auth args name, and the anchor
|
|
@@ -15,34 +15,105 @@ export declare class SummaryAnchorMismatchError extends Error {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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.
|
|
24
42
|
*
|
|
25
|
-
* The
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
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.
|
|
29
49
|
*/
|
|
30
|
-
export declare function executeForSummary(client: MidenClient, accountId: string, txRequest: TransactionRequest
|
|
31
|
-
summary: TransactionSummary;
|
|
32
|
-
anchor: ChainAnchor;
|
|
33
|
-
}>;
|
|
34
|
-
export declare function executeForSummary(client: WasmWebClient, accountId: string, txRequest: TransactionRequest, midenRpcEndpoint?: string): Promise<{
|
|
50
|
+
export declare function executeForSummary(client: MidenClient, accountId: string, txRequest: TransactionRequest): Promise<{
|
|
35
51
|
summary: TransactionSummary;
|
|
36
52
|
anchor: ChainAnchor;
|
|
37
53
|
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Executes a multisig request at the chain tip to obtain the summary awaiting
|
|
56
|
+
* authorization. This is how cosigners and the executor reproduce a proposal's
|
|
57
|
+
* summary, whatever block they have synced to.
|
|
58
|
+
*
|
|
59
|
+
* Since protocol 0.17 a multisig summary binds the block its auth args name
|
|
60
|
+
* (the bound block), not the block the transaction executes against, so it
|
|
61
|
+
* reproduces at any later tip once the bound block is in the transaction's
|
|
62
|
+
* partial blockchain. The request declares it through `withBlockNumbers`, and
|
|
63
|
+
* foreign accounts, the fee faucet among them, load at the tip. Re-executing at
|
|
64
|
+
* the proposal's anchor instead loads them at the bound block, which a node
|
|
65
|
+
* prunes about 50 blocks later (issue #462).
|
|
66
|
+
*
|
|
67
|
+
* The client has to have synced to at least the bound block. When it has not,
|
|
68
|
+
* this syncs once before executing.
|
|
69
|
+
*
|
|
70
|
+
* @throws BoundBlockNotDeclaredError when the request binds a block in its
|
|
71
|
+
* multisig auth args without declaring it.
|
|
72
|
+
*/
|
|
73
|
+
export declare function executeForSummaryAtTip(client: MidenClient, accountId: string, txRequest: TransactionRequest): Promise<TransactionSummary>;
|
|
74
|
+
/**
|
|
75
|
+
* Gets `client` ready to execute `request` at the chain tip: checks the
|
|
76
|
+
* request declares the block its multisig auth args bind, and syncs to that
|
|
77
|
+
* block (see {@link syncToBoundBlock}).
|
|
78
|
+
*
|
|
79
|
+
* @throws BoundBlockNotDeclaredError when the request binds a block in its
|
|
80
|
+
* multisig auth args without declaring it.
|
|
81
|
+
*/
|
|
82
|
+
export declare function prepareTipExecution(client: MidenClient, request: TransactionRequest, syncChain?: () => Promise<unknown>): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* The block `request`'s multisig auth args bind, after checking the request
|
|
85
|
+
* declares it. `undefined` for a request without multisig auth args, which
|
|
86
|
+
* has no bound block to declare.
|
|
87
|
+
*
|
|
88
|
+
* @throws BoundBlockNotDeclaredError when the block is bound but not declared.
|
|
89
|
+
*/
|
|
90
|
+
export declare function requireDeclaredBoundBlock(request: TransactionRequest): number | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Syncs `client` once when its sync height is below `blockNum`, the block a
|
|
93
|
+
* proposal binds. Execution at a tip below it fails with "requested block N is
|
|
94
|
+
* after transaction reference block M", and a store that has never synced (a
|
|
95
|
+
* cosigner that has only just loaded the account) holds no header to rebuild
|
|
96
|
+
* the request from. The sync is a chain sync; `syncChain` lets a caller wrap
|
|
97
|
+
* it in its own retry policy.
|
|
98
|
+
*
|
|
99
|
+
* This does not make a store that is already past the bound block current. An
|
|
100
|
+
* execution loads foreign accounts, the fee faucet among them, at the store's
|
|
101
|
+
* sync height, which a node prunes about 50 blocks later, so the multisig
|
|
102
|
+
* entry points that re-execute a proposal sync the chain first.
|
|
103
|
+
*
|
|
104
|
+
* @throws ChainBehindBoundBlockError when the node has not reached the block.
|
|
105
|
+
*/
|
|
106
|
+
export declare function syncToBoundBlock(client: MidenClient, blockNum: number, syncChain?: () => Promise<unknown>): Promise<void>;
|
|
38
107
|
/**
|
|
39
108
|
* Executes a transaction at the given `ChainAnchor`'s reference block to
|
|
40
|
-
* obtain the summary awaiting authorization
|
|
41
|
-
*
|
|
42
|
-
*
|
|
109
|
+
* obtain the summary awaiting authorization.
|
|
110
|
+
*
|
|
111
|
+
* For a summary that binds the reference block, such as a single-signature
|
|
112
|
+
* one. A multisig proposal's summary binds its bound block instead and is
|
|
113
|
+
* reproduced with {@link executeForSummaryAtTip}: re-executing it at an anchor
|
|
114
|
+
* fails once the node prunes the anchor block's account state.
|
|
43
115
|
*/
|
|
44
|
-
export declare function executeForSummaryAt(client: MidenClient, accountId: string, txRequest: TransactionRequest, anchor: ChainAnchor
|
|
45
|
-
export declare function executeForSummaryAt(client: WasmWebClient, accountId: string, txRequest: TransactionRequest, anchor: ChainAnchor, midenRpcEndpoint?: string): Promise<TransactionSummary>;
|
|
116
|
+
export declare function executeForSummaryAt(client: MidenClient, accountId: string, txRequest: TransactionRequest, anchor: ChainAnchor): Promise<TransactionSummary>;
|
|
46
117
|
/**
|
|
47
118
|
* Serializes a `ChainAnchor` to base64 for the proposal wire payload.
|
|
48
119
|
*/
|
|
@@ -51,7 +122,8 @@ export declare function chainAnchorToBase64(anchor: ChainAnchor): string;
|
|
|
51
122
|
* Deserializes a `ChainAnchor` from its base64 wire form. `ChainAnchor`
|
|
52
123
|
* deserialization validates the header/chain consistency internally, so a
|
|
53
124
|
* decoded anchor only needs its block commitment checked against the signed
|
|
54
|
-
* transaction summary before it is
|
|
125
|
+
* transaction summary before the block it names is taken as the one the
|
|
126
|
+
* summary binds.
|
|
55
127
|
*/
|
|
56
128
|
export declare function chainAnchorFromBase64(anchorBase64: string): ChainAnchor;
|
|
57
129
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/transaction/summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/transaction/summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAazD;;;;;;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;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;gBAEnB,OAAO,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE;CASnE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAMzD;AAED;;;;;;;;;;;GAWG;AACH,wB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M,CAOhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAI7D;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAGjG"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ChainAnchor, Word } from '@miden-sdk/miden-sdk';
|
|
2
|
+
import { BoundBlockNotDeclaredError } from '../multisig/authArgErrors.js';
|
|
3
3
|
import { base64ToUint8Array, normalizeHexWord, uint8ArrayToBase64 } from '../utils/encoding.js';
|
|
4
|
+
import { requestBoundBlockNum } from './authArgs.js';
|
|
4
5
|
/**
|
|
5
6
|
* Layout of the six user params a multisig auth component binds into the
|
|
6
7
|
* transaction summary since protocol 0.17: the approval expiration block (or
|
|
@@ -24,13 +25,53 @@ export class SummaryAnchorMismatchError extends Error {
|
|
|
24
25
|
this.name = 'SummaryAnchorMismatchError';
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
/**
|
|
29
|
+
* The Miden client synced and its node still has not produced the block a
|
|
30
|
+
* proposal binds, so the proposal cannot execute at this client's tip yet.
|
|
31
|
+
* Worth retrying once the node catches up.
|
|
32
|
+
*/
|
|
33
|
+
export class ChainBehindBoundBlockError extends Error {
|
|
34
|
+
retryable = true;
|
|
35
|
+
syncHeight;
|
|
36
|
+
boundBlockNum;
|
|
37
|
+
constructor(details) {
|
|
38
|
+
super(`the Miden client synced to block ${details.syncHeight}, below block ` +
|
|
39
|
+
`${details.boundBlockNum} the proposal binds; its node has not reached that block yet`);
|
|
40
|
+
this.name = 'ChainBehindBoundBlockError';
|
|
41
|
+
this.syncHeight = details.syncHeight;
|
|
42
|
+
this.boundBlockNum = details.boundBlockNum;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Whether a failed re-execution came from chain state this client can catch up
|
|
47
|
+
* with rather than from the proposal itself: a node that has not reached the
|
|
48
|
+
* bound block yet, or account state the node pruned because this client had
|
|
49
|
+
* not synced recently. Either clears on a later attempt, which syncs first.
|
|
50
|
+
*/
|
|
51
|
+
export function isStaleChainError(error) {
|
|
52
|
+
if (error instanceof ChainBehindBoundBlockError) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
56
|
+
return message.includes('has been pruned');
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Derives the summary awaiting authorization for a proposal the caller is
|
|
60
|
+
* creating now, and captures a `ChainAnchor` at the current sync height to ship
|
|
61
|
+
* with it.
|
|
62
|
+
*
|
|
63
|
+
* The summary is derived at the chain tip, like every other execution of a
|
|
64
|
+
* multisig proposal (see {@link executeForSummaryAtTip}). The anchor still
|
|
65
|
+
* travels in the proposal: it names the block the request's auth args bind,
|
|
66
|
+
* which is how a rebuild learns that block, and 0.18.0-rc.1 clients re-execute
|
|
67
|
+
* at it. A proposer builds at the sync height the anchor is captured at, and
|
|
68
|
+
* the check below is what makes that hold.
|
|
69
|
+
*/
|
|
70
|
+
export async function executeForSummary(client, accountId, txRequest) {
|
|
71
|
+
const anchor = await client.transactions.captureAnchor(txRequest);
|
|
31
72
|
let summary;
|
|
32
73
|
try {
|
|
33
|
-
summary = await
|
|
74
|
+
summary = await executeForSummaryAtTip(client, accountId, txRequest);
|
|
34
75
|
}
|
|
35
76
|
catch (error) {
|
|
36
77
|
anchor.free();
|
|
@@ -48,10 +89,102 @@ export async function executeForSummary(client, accountId, txRequest, midenRpcEn
|
|
|
48
89
|
}
|
|
49
90
|
return { summary, anchor };
|
|
50
91
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Executes a multisig request at the chain tip to obtain the summary awaiting
|
|
94
|
+
* authorization. This is how cosigners and the executor reproduce a proposal's
|
|
95
|
+
* summary, whatever block they have synced to.
|
|
96
|
+
*
|
|
97
|
+
* Since protocol 0.17 a multisig summary binds the block its auth args name
|
|
98
|
+
* (the bound block), not the block the transaction executes against, so it
|
|
99
|
+
* reproduces at any later tip once the bound block is in the transaction's
|
|
100
|
+
* partial blockchain. The request declares it through `withBlockNumbers`, and
|
|
101
|
+
* foreign accounts, the fee faucet among them, load at the tip. Re-executing at
|
|
102
|
+
* the proposal's anchor instead loads them at the bound block, which a node
|
|
103
|
+
* prunes about 50 blocks later (issue #462).
|
|
104
|
+
*
|
|
105
|
+
* The client has to have synced to at least the bound block. When it has not,
|
|
106
|
+
* this syncs once before executing.
|
|
107
|
+
*
|
|
108
|
+
* @throws BoundBlockNotDeclaredError when the request binds a block in its
|
|
109
|
+
* multisig auth args without declaring it.
|
|
110
|
+
*/
|
|
111
|
+
export async function executeForSummaryAtTip(client, accountId, txRequest) {
|
|
112
|
+
await prepareTipExecution(client, txRequest);
|
|
113
|
+
return client.transactions.preview({
|
|
114
|
+
operation: 'custom',
|
|
115
|
+
account: accountId,
|
|
116
|
+
request: txRequest,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Gets `client` ready to execute `request` at the chain tip: checks the
|
|
121
|
+
* request declares the block its multisig auth args bind, and syncs to that
|
|
122
|
+
* block (see {@link syncToBoundBlock}).
|
|
123
|
+
*
|
|
124
|
+
* @throws BoundBlockNotDeclaredError when the request binds a block in its
|
|
125
|
+
* multisig auth args without declaring it.
|
|
126
|
+
*/
|
|
127
|
+
export async function prepareTipExecution(client, request, syncChain) {
|
|
128
|
+
const boundBlockNum = requireDeclaredBoundBlock(request);
|
|
129
|
+
if (boundBlockNum !== undefined) {
|
|
130
|
+
await syncToBoundBlock(client, boundBlockNum, syncChain);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The block `request`'s multisig auth args bind, after checking the request
|
|
135
|
+
* declares it. `undefined` for a request without multisig auth args, which
|
|
136
|
+
* has no bound block to declare.
|
|
137
|
+
*
|
|
138
|
+
* @throws BoundBlockNotDeclaredError when the block is bound but not declared.
|
|
139
|
+
*/
|
|
140
|
+
export function requireDeclaredBoundBlock(request) {
|
|
141
|
+
const boundBlockNum = requestBoundBlockNum(request);
|
|
142
|
+
if (boundBlockNum !== undefined && !request.blockNumbers().includes(boundBlockNum)) {
|
|
143
|
+
throw new BoundBlockNotDeclaredError(boundBlockNum);
|
|
144
|
+
}
|
|
145
|
+
return boundBlockNum;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Syncs `client` once when its sync height is below `blockNum`, the block a
|
|
149
|
+
* proposal binds. Execution at a tip below it fails with "requested block N is
|
|
150
|
+
* after transaction reference block M", and a store that has never synced (a
|
|
151
|
+
* cosigner that has only just loaded the account) holds no header to rebuild
|
|
152
|
+
* the request from. The sync is a chain sync; `syncChain` lets a caller wrap
|
|
153
|
+
* it in its own retry policy.
|
|
154
|
+
*
|
|
155
|
+
* This does not make a store that is already past the bound block current. An
|
|
156
|
+
* execution loads foreign accounts, the fee faucet among them, at the store's
|
|
157
|
+
* sync height, which a node prunes about 50 blocks later, so the multisig
|
|
158
|
+
* entry points that re-execute a proposal sync the chain first.
|
|
159
|
+
*
|
|
160
|
+
* @throws ChainBehindBoundBlockError when the node has not reached the block.
|
|
161
|
+
*/
|
|
162
|
+
export async function syncToBoundBlock(client, blockNum, syncChain = () => client.syncChain()) {
|
|
163
|
+
if ((await client.getSyncHeight()) >= blockNum) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
await syncChain();
|
|
167
|
+
const syncHeight = await client.getSyncHeight();
|
|
168
|
+
if (syncHeight < blockNum) {
|
|
169
|
+
throw new ChainBehindBoundBlockError({ syncHeight, boundBlockNum: blockNum });
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Executes a transaction at the given `ChainAnchor`'s reference block to
|
|
174
|
+
* obtain the summary awaiting authorization.
|
|
175
|
+
*
|
|
176
|
+
* For a summary that binds the reference block, such as a single-signature
|
|
177
|
+
* one. A multisig proposal's summary binds its bound block instead and is
|
|
178
|
+
* reproduced with {@link executeForSummaryAtTip}: re-executing it at an anchor
|
|
179
|
+
* fails once the node prunes the anchor block's account state.
|
|
180
|
+
*/
|
|
181
|
+
export async function executeForSummaryAt(client, accountId, txRequest, anchor) {
|
|
182
|
+
return client.transactions.preview({
|
|
183
|
+
operation: 'custom',
|
|
184
|
+
account: accountId,
|
|
185
|
+
request: txRequest,
|
|
186
|
+
anchor,
|
|
187
|
+
});
|
|
55
188
|
}
|
|
56
189
|
/**
|
|
57
190
|
* Serializes a `ChainAnchor` to base64 for the proposal wire payload.
|
|
@@ -63,7 +196,8 @@ export function chainAnchorToBase64(anchor) {
|
|
|
63
196
|
* Deserializes a `ChainAnchor` from its base64 wire form. `ChainAnchor`
|
|
64
197
|
* deserialization validates the header/chain consistency internally, so a
|
|
65
198
|
* decoded anchor only needs its block commitment checked against the signed
|
|
66
|
-
* transaction summary before it is
|
|
199
|
+
* transaction summary before the block it names is taken as the one the
|
|
200
|
+
* summary binds.
|
|
67
201
|
*/
|
|
68
202
|
export function chainAnchorFromBase64(anchorBase64) {
|
|
69
203
|
return ChainAnchor.deserialize(base64ToUint8Array(anchorBase64));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.js","sourceRoot":"","sources":["../../src/transaction/summary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"summary.js","sourceRoot":"","sources":["../../src/transaction/summary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,oB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
|
3
|
-
export declare function buildUpdateGuardianTransactionRequest(client: MidenClient, newGuardianPubkey: string, options:
|
|
4
|
-
request: TransactionRequest;
|
|
5
|
-
salt: Word;
|
|
6
|
-
}>;
|
|
7
|
-
export declare function buildUpdateGuardianTransactionRequest(client: WasmWebClient, newGuardianPubkey: string, options: MultisigRequestOptions): Promise<{
|
|
1
|
+
import { type MidenClient, TransactionRequest, Word } from '@miden-sdk/miden-sdk';
|
|
2
|
+
import type { MultisigRequestOptions } from './options.js';
|
|
3
|
+
export declare function buildUpdateGuardianTransactionRequest(client: MidenClient, newGuardianPubkey: string, options: MultisigRequestOptions): Promise<{
|
|
8
4
|
request: TransactionRequest;
|
|
9
5
|
salt: Word;
|
|
10
6
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateGuardian.d.ts","sourceRoot":"","sources":["../../src/transaction/updateGuardian.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,kBAAkB,EAElB,
|
|
1
|
+
{"version":3,"file":"updateGuardian.d.ts","sourceRoot":"","sources":["../../src/transaction/updateGuardian.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,kBAAkB,EAElB,IAAI,EACL,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AA6B3D,wBAAsB,qCAAqC,CACzD,MAAM,EAAE,WAAW,EACnB,iBAAiB,EAAE,MAAM,EACzB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC;IAAE,OAAO,EAAE,kBAAkB,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAYtD"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { compileTxScript } from '../raw-client.js';
|
|
2
1
|
import { normalizeHexWord } from '../utils/encoding.js';
|
|
3
2
|
import { authSchemeId } from '../utils/signature.js';
|
|
4
3
|
import { buildMultisigRequest, multisigRequestBuilder } from './authArgs.js';
|
|
5
|
-
async function buildUpdateGuardianScript(client, newGuardianPubkey, signatureScheme
|
|
4
|
+
async function buildUpdateGuardianScript(client, newGuardianPubkey, signatureScheme) {
|
|
6
5
|
// A word literal preserves the key's element order on the operand stack.
|
|
7
6
|
const keyLiteral = normalizeHexWord(newGuardianPubkey);
|
|
8
7
|
const schemeId = authSchemeId(signatureScheme);
|
|
@@ -19,11 +18,11 @@ pub proc main
|
|
|
19
18
|
dropw
|
|
20
19
|
end
|
|
21
20
|
`;
|
|
22
|
-
return
|
|
21
|
+
return client.compile.txScript({ code: scriptSource });
|
|
23
22
|
}
|
|
24
23
|
export async function buildUpdateGuardianTransactionRequest(client, newGuardianPubkey, options) {
|
|
25
24
|
const signatureScheme = options.signatureScheme ?? 'falcon';
|
|
26
|
-
const script = await buildUpdateGuardianScript(client, newGuardianPubkey, signatureScheme
|
|
25
|
+
const script = await buildUpdateGuardianScript(client, newGuardianPubkey, signatureScheme);
|
|
27
26
|
const { builder, saltHex } = await multisigRequestBuilder(client, options);
|
|
28
27
|
let txBuilder = builder.withCustomScript(script);
|
|
29
28
|
if (options.signatureAdviceMap) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateGuardian.js","sourceRoot":"","sources":["../../src/transaction/updateGuardian.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"updateGuardian.js","sourceRoot":"","sources":["../../src/transaction/updateGuardian.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAI7E,KAAK,UAAU,yBAAyB,CACtC,MAAmB,EACnB,iBAAyB,EACzB,eAAgC;IAEhC,yEAAyE;IACzE,MAAM,UAAU,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC;IAE/C,qFAAqF;IACrF,MAAM,YAAY,GAAG;;;;;WAKZ,UAAU;WACV,QAAQ;;;;;GAKhB,CAAC;IAEF,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qCAAqC,CACzD,MAAmB,EACnB,iBAAyB,EACzB,OAA+B;IAE/B,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,QAAQ,CAAC;IAC5D,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,EAAE,eAAe,CAAC,CAAC;IAE3F,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,sBAAsB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3E,IAAI,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEjD,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,OAAO,CAAC,SAAS,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { type MidenClient, TransactionRequest,
|
|
1
|
+
import { type MidenClient, TransactionRequest, Word } from '@miden-sdk/miden-sdk';
|
|
2
2
|
import { type ProcedureName } from '../procedures.js';
|
|
3
|
-
import type {
|
|
4
|
-
export declare function buildUpdateProcedureThresholdTransactionRequest(client: MidenClient, procedure: ProcedureName, threshold: number, options:
|
|
5
|
-
request: TransactionRequest;
|
|
6
|
-
salt: Word;
|
|
7
|
-
configHash: Word;
|
|
8
|
-
}>;
|
|
9
|
-
export declare function buildUpdateProcedureThresholdTransactionRequest(client: WasmWebClient, procedure: ProcedureName, threshold: number, options: MultisigRequestOptions): Promise<{
|
|
3
|
+
import type { MultisigRequestOptions } from './options.js';
|
|
4
|
+
export declare function buildUpdateProcedureThresholdTransactionRequest(client: MidenClient, procedure: ProcedureName, threshold: number, options: MultisigRequestOptions): Promise<{
|
|
10
5
|
request: TransactionRequest;
|
|
11
6
|
salt: Word;
|
|
12
7
|
configHash: Word;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateProcedureThreshold.d.ts","sourceRoot":"","sources":["../../src/transaction/updateProcedureThreshold.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAEhB,kBAAkB,EAElB,
|
|
1
|
+
{"version":3,"file":"updateProcedureThreshold.d.ts","sourceRoot":"","sources":["../../src/transaction/updateProcedureThreshold.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAEhB,kBAAkB,EAElB,IAAI,EAEL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AA+C3D,wBAAsB,+CAA+C,CACnE,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC;IAAE,OAAO,EAAE,kBAAkB,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,IAAI,CAAA;CAAE,CAAC,CAYxE"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Felt, FeltArray, Poseidon2, Word as WordType, } from '@miden-sdk/miden-sdk';
|
|
2
2
|
import { getProcedureRoot } from '../procedures.js';
|
|
3
|
-
import { compileTxScript } from '../raw-client.js';
|
|
4
3
|
import { normalizeHexWord } from '../utils/encoding.js';
|
|
5
4
|
import { buildMultisigRequest, multisigRequestBuilder } from './authArgs.js';
|
|
6
5
|
function buildProcedureThresholdFelts(procedure, threshold) {
|
|
@@ -21,7 +20,7 @@ function buildProcedureThresholdFelts(procedure, threshold) {
|
|
|
21
20
|
function buildProcedureThresholdConfigHash(procedure, threshold) {
|
|
22
21
|
return Poseidon2.hashElements(new FeltArray(buildProcedureThresholdFelts(procedure, threshold)));
|
|
23
22
|
}
|
|
24
|
-
async function buildUpdateProcedureThresholdScript(client, procedure, threshold
|
|
23
|
+
async function buildUpdateProcedureThresholdScript(client, procedure, threshold) {
|
|
25
24
|
const procedureRoot = normalizeHexWord(getProcedureRoot(procedure));
|
|
26
25
|
const scriptSource = `
|
|
27
26
|
use miden::standards::auth::multisig
|
|
@@ -35,11 +34,11 @@ pub proc main
|
|
|
35
34
|
drop
|
|
36
35
|
end
|
|
37
36
|
`;
|
|
38
|
-
return
|
|
37
|
+
return client.compile.txScript({ code: scriptSource });
|
|
39
38
|
}
|
|
40
39
|
export async function buildUpdateProcedureThresholdTransactionRequest(client, procedure, threshold, options) {
|
|
41
40
|
const configHash = buildProcedureThresholdConfigHash(procedure, threshold);
|
|
42
|
-
const script = await buildUpdateProcedureThresholdScript(client, procedure, threshold
|
|
41
|
+
const script = await buildUpdateProcedureThresholdScript(client, procedure, threshold);
|
|
43
42
|
const { builder, saltHex } = await multisigRequestBuilder(client, options);
|
|
44
43
|
let txBuilder = builder.withCustomScript(script);
|
|
45
44
|
if (options.signatureAdviceMap) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateProcedureThreshold.js","sourceRoot":"","sources":["../../src/transaction/updateProcedureThreshold.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,SAAS,EAET,SAAS,
|
|
1
|
+
{"version":3,"file":"updateProcedureThreshold.js","sourceRoot":"","sources":["../../src/transaction/updateProcedureThreshold.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,SAAS,EAET,SAAS,EAIT,IAAI,IAAI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,SAAS,EAAE,SAAS,CAAC,CAAC;IAE3E,MAAM,MAAM,GAAG,MAAM,mCAAmC,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IACvF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,sBAAsB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3E,IAAI,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEjD,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAC/B,SAAS,GAAG,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,EAAE,GAAG,oBAAoB,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC;AACxF,CAAC"}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { FeltArray, type MidenClient, TransactionRequest,
|
|
2
|
-
import type {
|
|
1
|
+
import { FeltArray, type MidenClient, TransactionRequest, Word } from '@miden-sdk/miden-sdk';
|
|
2
|
+
import type { MultisigRequestOptions } from './options.js';
|
|
3
3
|
import type { SignatureScheme } from '../types.js';
|
|
4
4
|
export declare function buildMultisigConfigAdvice(threshold: number, signerCommitments: string[], signatureScheme: SignatureScheme): {
|
|
5
5
|
configHash: Word;
|
|
6
6
|
payload: FeltArray;
|
|
7
7
|
};
|
|
8
|
-
export declare function buildUpdateSignersTransactionRequest(client: MidenClient, threshold: number, signerCommitments: string[], options:
|
|
9
|
-
request: TransactionRequest;
|
|
10
|
-
salt: Word;
|
|
11
|
-
configHash: Word;
|
|
12
|
-
}>;
|
|
13
|
-
export declare function buildUpdateSignersTransactionRequest(client: WasmWebClient, threshold: number, signerCommitments: string[], options: MultisigRequestOptions): Promise<{
|
|
8
|
+
export declare function buildUpdateSignersTransactionRequest(client: MidenClient, threshold: number, signerCommitments: string[], options: MultisigRequestOptions): Promise<{
|
|
14
9
|
request: TransactionRequest;
|
|
15
10
|
salt: Word;
|
|
16
11
|
configHash: Word;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateSigners.d.ts","sourceRoot":"","sources":["../../src/transaction/updateSigners.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EACT,KAAK,WAAW,EAEhB,kBAAkB,EAElB,
|
|
1
|
+
{"version":3,"file":"updateSigners.d.ts","sourceRoot":"","sources":["../../src/transaction/updateSigners.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EACT,KAAK,WAAW,EAEhB,kBAAkB,EAElB,IAAI,EAEL,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAwBnD,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,MAAM,EAAE,EAC3B,eAAe,EAAE,eAAe,GAC/B;IAAE,UAAU,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,SAAS,CAAA;CAAE,CAW1C;AAeD,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,MAAM,EAAE,EAC3B,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC;IAAE,OAAO,EAAE,kBAAkB,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,IAAI,CAAA;CAAE,CAAC,CAuCxE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AdviceMap, Felt, FeltArray, Poseidon2, Word as WordType, } from '@miden-sdk/miden-sdk';
|
|
2
|
-
import { compileTxScript } from '../raw-client.js';
|
|
3
2
|
import { normalizeHexWord } from '../utils/encoding.js';
|
|
4
3
|
import { authSchemeId } from '../utils/signature.js';
|
|
5
4
|
import { buildMultisigRequest, multisigRequestBuilder } from './authArgs.js';
|
|
@@ -28,7 +27,7 @@ export function buildMultisigConfigAdvice(threshold, signerCommitments, signatur
|
|
|
28
27
|
const payload = new FeltArray(buildMultisigConfigFelts(threshold, signerCommitments, signatureScheme));
|
|
29
28
|
return { configHash, payload };
|
|
30
29
|
}
|
|
31
|
-
async function buildUpdateSignersScript(client
|
|
30
|
+
async function buildUpdateSignersScript(client) {
|
|
32
31
|
const scriptSource = `
|
|
33
32
|
use miden::standards::auth::multisig
|
|
34
33
|
|
|
@@ -37,7 +36,7 @@ pub proc main
|
|
|
37
36
|
call.multisig::update_signers_and_threshold
|
|
38
37
|
end
|
|
39
38
|
`;
|
|
40
|
-
return
|
|
39
|
+
return client.compile.txScript({ code: scriptSource });
|
|
41
40
|
}
|
|
42
41
|
export async function buildUpdateSignersTransactionRequest(client, threshold, signerCommitments, options) {
|
|
43
42
|
const signatureScheme = options.signatureScheme ?? 'falcon';
|
|
@@ -46,7 +45,7 @@ export async function buildUpdateSignersTransactionRequest(client, threshold, si
|
|
|
46
45
|
const { configHash: configHashForReturn } = buildMultisigConfigAdvice(threshold, signerCommitments, signatureScheme);
|
|
47
46
|
const advice = new AdviceMap();
|
|
48
47
|
advice.insert(configHashForAdvice, payload);
|
|
49
|
-
const script = await buildUpdateSignersScript(client
|
|
48
|
+
const script = await buildUpdateSignersScript(client);
|
|
50
49
|
const { builder, saltHex } = await multisigRequestBuilder(client, options);
|
|
51
50
|
let txBuilder = builder
|
|
52
51
|
.withCustomScript(script)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateSigners.js","sourceRoot":"","sources":["../../src/transaction/updateSigners.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,SAAS,EAET,SAAS,
|
|
1
|
+
{"version":3,"file":"updateSigners.js","sourceRoot":"","sources":["../../src/transaction/updateSigners.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,SAAS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BAAsB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3E,IAAI,SAAS,GAAG,OAAO;SACpB,gBAAgB,CAAC,MAAM,CAAC;SACxB,aAAa,CAAC,mBAAmB,CAAC;SAClC,eAAe,CAAC,MAAM,CAAC,CAAC;IAE3B,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAC/B,SAAS,GAAG,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACpE,CAAC;IAED,OAAO;QACL,GAAG,oBAAoB,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC;QAC9D,UAAU,EAAE,mBAAmB;KAChC,CAAC;AACJ,CAAC"}
|
package/dist/transaction.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { MAX_APPROVAL_EXPIRATION_DELTA, buildMultisigRequest, multisigRequestBuilder, requestBoundBlockNum, requestSaltHex, } from './transaction/authArgs.js';
|
|
2
2
|
export { buildConsumeNotesTransactionRequest, buildConsumeNotesTransactionRequestFromNotes, } from './transaction/consumeNotes.js';
|
|
3
|
-
export { chainAnchorBlockNum, chainAnchorFromBase64, chainAnchorToBase64, executeForSummary, executeForSummaryAt, summaryApprovalExpirationBlockNum, summarySalt, SummaryAnchorMismatchError, } from './transaction/summary.js';
|
|
3
|
+
export { ChainBehindBoundBlockError, chainAnchorBlockNum, chainAnchorFromBase64, chainAnchorToBase64, executeForSummary, executeForSummaryAt, executeForSummaryAtTip, prepareTipExecution, isStaleChainError, requireDeclaredBoundBlock, syncToBoundBlock, summaryApprovalExpirationBlockNum, summarySalt, SummaryAnchorMismatchError, } from './transaction/summary.js';
|
|
4
4
|
export { buildP2idNoteFromMetadata, buildP2idTransactionRequest, parseP2idNoteType, p2idNoteTypeToMetadata, type P2idTransactionOptions, type P2ideHeightOptions, } from './transaction/p2id.js';
|
|
5
5
|
export { buildUpdateGuardianTransactionRequest, } from './transaction/updateGuardian.js';
|
|
6
6
|
export { buildUpdateProcedureThresholdTransactionRequest, } from './transaction/updateProcedureThreshold.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,mCAAmC,EACnC,4CAA4C,GAC7C,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iCAAiC,EACjC,WAAW,EACX,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,qCAAqC,GACtC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,+CAA+C,GAChD,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,oCAAoC,GACrC,MAAM,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,mCAAmC,EACnC,4CAA4C,GAC7C,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,iCAAiC,EACjC,WAAW,EACX,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,qCAAqC,GACtC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,+CAA+C,GAChD,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,oCAAoC,GACrC,MAAM,gCAAgC,CAAC"}
|
package/dist/transaction.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { MAX_APPROVAL_EXPIRATION_DELTA, buildMultisigRequest, multisigRequestBuilder, requestBoundBlockNum, requestSaltHex, } from './transaction/authArgs.js';
|
|
2
2
|
export { buildConsumeNotesTransactionRequest, buildConsumeNotesTransactionRequestFromNotes, } from './transaction/consumeNotes.js';
|
|
3
|
-
export { chainAnchorBlockNum, chainAnchorFromBase64, chainAnchorToBase64, executeForSummary, executeForSummaryAt, summaryApprovalExpirationBlockNum, summarySalt, SummaryAnchorMismatchError, } from './transaction/summary.js';
|
|
3
|
+
export { ChainBehindBoundBlockError, chainAnchorBlockNum, chainAnchorFromBase64, chainAnchorToBase64, executeForSummary, executeForSummaryAt, executeForSummaryAtTip, prepareTipExecution, isStaleChainError, requireDeclaredBoundBlock, syncToBoundBlock, summaryApprovalExpirationBlockNum, summarySalt, SummaryAnchorMismatchError, } from './transaction/summary.js';
|
|
4
4
|
export { buildP2idNoteFromMetadata, buildP2idTransactionRequest, parseP2idNoteType, p2idNoteTypeToMetadata, } from './transaction/p2id.js';
|
|
5
5
|
export { buildUpdateGuardianTransactionRequest, } from './transaction/updateGuardian.js';
|
|
6
6
|
export { buildUpdateProcedureThresholdTransactionRequest, } from './transaction/updateProcedureThreshold.js';
|
package/dist/transaction.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,mCAAmC,EACnC,4CAA4C,GAC7C,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iCAAiC,EACjC,WAAW,EACX,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,iBAAiB,EACjB,sBAAsB,GAGvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,qCAAqC,GACtC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,+CAA+C,GAChD,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,oCAAoC,GACrC,MAAM,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,mCAAmC,EACnC,4CAA4C,GAC7C,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,iCAAiC,EACjC,WAAW,EACX,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,iBAAiB,EACjB,sBAAsB,GAGvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,qCAAqC,GACtC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,+CAA+C,GAChD,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,oCAAoC,GACrC,MAAM,gCAAgC,CAAC"}
|