@openzeppelin/miden-multisig-client 0.18.0 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +176 -23
- package/dist/client.d.ts +41 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +79 -2
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/lookupAuth.d.ts.map +1 -1
- package/dist/lookupAuth.js +2 -20
- package/dist/lookupAuth.js.map +1 -1
- package/dist/multisig/authArgErrors.d.ts +27 -1
- package/dist/multisig/authArgErrors.d.ts.map +1 -1
- package/dist/multisig/authArgErrors.js +33 -0
- package/dist/multisig/authArgErrors.js.map +1 -1
- package/dist/multisig.d.ts +77 -11
- package/dist/multisig.d.ts.map +1 -1
- package/dist/multisig.js +247 -181
- package/dist/multisig.js.map +1 -1
- package/dist/proposal/metadata.d.ts.map +1 -1
- package/dist/proposal/metadata.js +2 -0
- package/dist/proposal/metadata.js.map +1 -1
- package/dist/recovery/transportDrain.d.ts +38 -30
- package/dist/recovery/transportDrain.d.ts.map +1 -1
- package/dist/recovery/transportDrain.js +113 -113
- package/dist/recovery/transportDrain.js.map +1 -1
- package/dist/session/grant.d.ts +40 -0
- package/dist/session/grant.d.ts.map +1 -0
- package/dist/session/grant.js +125 -0
- package/dist/session/grant.js.map +1 -0
- package/dist/session/key.d.ts +103 -0
- package/dist/session/key.d.ts.map +1 -0
- package/dist/session/key.js +160 -0
- package/dist/session/key.js.map +1 -0
- package/dist/session/manager.d.ts +76 -0
- package/dist/session/manager.d.ts.map +1 -0
- package/dist/session/manager.js +187 -0
- package/dist/session/manager.js.map +1 -0
- package/dist/signers/ecdsa.d.ts +5 -1
- package/dist/signers/ecdsa.d.ts.map +1 -1
- package/dist/signers/ecdsa.js +9 -0
- package/dist/signers/ecdsa.js.map +1 -1
- package/dist/signers/falcon.d.ts +5 -1
- package/dist/signers/falcon.d.ts.map +1 -1
- package/dist/signers/falcon.js +9 -0
- package/dist/signers/falcon.js.map +1 -1
- package/dist/signers/ledger.d.ts +9 -1
- package/dist/signers/ledger.d.ts.map +1 -1
- package/dist/signers/ledger.js +13 -1
- package/dist/signers/ledger.js.map +1 -1
- package/dist/signers/miden-wallet.d.ts +13 -1
- package/dist/signers/miden-wallet.d.ts.map +1 -1
- package/dist/signers/miden-wallet.js +25 -0
- package/dist/signers/miden-wallet.js.map +1 -1
- package/dist/signers/para.d.ts +5 -1
- package/dist/signers/para.d.ts.map +1 -1
- package/dist/signers/para.js +9 -0
- package/dist/signers/para.js.map +1 -1
- package/dist/transaction/authArgs.d.ts +2 -2
- package/dist/transaction/authArgs.js +2 -2
- package/dist/transaction/options.d.ts +2 -2
- package/dist/transaction/summary.d.ts +17 -61
- package/dist/transaction/summary.d.ts.map +1 -1
- package/dist/transaction/summary.js +49 -95
- package/dist/transaction/summary.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 +11 -5
- package/dist/types/proposal.d.ts.map +1 -1
- package/dist/types/proposal.js.map +1 -1
- package/dist/utils/eip712.d.ts +26 -69
- package/dist/utils/eip712.d.ts.map +1 -1
- package/dist/utils/eip712.js +101 -8
- package/dist/utils/eip712.js.map +1 -1
- package/dist/utils/felt.d.ts +7 -1
- package/dist/utils/felt.d.ts.map +1 -1
- package/dist/utils/felt.js +18 -1
- package/dist/utils/felt.js.map +1 -1
- package/package.json +4 -4
- package/src/client.ts +97 -2
- package/src/index.ts +29 -8
- package/src/lookupAuth.ts +3 -22
- package/src/multisig/authArgErrors.ts +42 -1
- package/src/multisig.ts +318 -207
- package/src/proposal/metadata.ts +2 -0
- package/src/recovery/transportDrain.ts +118 -124
- package/src/session/grant.ts +143 -0
- package/src/session/key.ts +215 -0
- package/src/session/manager.ts +273 -0
- package/src/signers/ecdsa.ts +12 -1
- package/src/signers/falcon.ts +12 -1
- package/src/signers/ledger.ts +19 -2
- package/src/signers/miden-wallet.ts +29 -1
- package/src/signers/para.ts +12 -1
- package/src/transaction/authArgs.ts +2 -2
- package/src/transaction/options.ts +2 -2
- package/src/transaction/summary.ts +62 -110
- package/src/transaction.ts +1 -6
- package/src/types/proposal.ts +11 -5
- package/src/utils/eip712.ts +130 -10
- package/src/utils/felt.ts +19 -1
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
export type AuthArgErrorCode =
|
|
7
7
|
| 'proposal_salt_malformed'
|
|
8
8
|
| 'multisig_auth_args_missing'
|
|
9
|
-
| 'bound_block_not_declared'
|
|
9
|
+
| 'bound_block_not_declared'
|
|
10
|
+
| 'transaction_summary_layout_unsupported'
|
|
11
|
+
| 'bound_block_mismatch';
|
|
10
12
|
|
|
11
13
|
/** How much of an untrusted value an error message will quote. */
|
|
12
14
|
const MAX_QUOTED_CHARS = 80;
|
|
@@ -130,3 +132,42 @@ export class BoundBlockNotDeclaredError extends Error {
|
|
|
130
132
|
this.boundBlockNum = boundBlockNum;
|
|
131
133
|
}
|
|
132
134
|
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* A serialized transaction summary does not have the layout this client reads
|
|
138
|
+
* its bound block from: the version 1 encoding of protocol 0.17. Raised instead
|
|
139
|
+
* of reading a number from the wrong offset, so a protocol upgrade that moves
|
|
140
|
+
* the field fails loudly.
|
|
141
|
+
*/
|
|
142
|
+
export class TransactionSummaryLayoutError extends Error {
|
|
143
|
+
readonly code: AuthArgErrorCode = 'transaction_summary_layout_unsupported';
|
|
144
|
+
|
|
145
|
+
constructor(reason: string) {
|
|
146
|
+
super(`The transaction summary does not have the layout this client reads: ${reason}`);
|
|
147
|
+
this.name = 'TransactionSummaryLayoutError';
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* A proposal's `boundBlockNum` names a block other than the one its signed
|
|
153
|
+
* summary binds. The value is served unsigned, so one that disagrees is refused
|
|
154
|
+
* by name for every proposal type, as the Rust SDK does.
|
|
155
|
+
*/
|
|
156
|
+
export class BoundBlockMismatchError extends Error {
|
|
157
|
+
readonly code: AuthArgErrorCode = 'bound_block_mismatch';
|
|
158
|
+
readonly proposalId: string;
|
|
159
|
+
readonly declaredBoundBlockNum: number;
|
|
160
|
+
readonly boundBlockNum: number;
|
|
161
|
+
|
|
162
|
+
constructor(details: { proposalId: string; declaredBoundBlockNum: number; boundBlockNum: number }) {
|
|
163
|
+
super(
|
|
164
|
+
`Proposal ${quoteUntrusted(details.proposalId)} declares boundBlockNum ` +
|
|
165
|
+
`${details.declaredBoundBlockNum}, but its signed transaction summary binds block ` +
|
|
166
|
+
`${details.boundBlockNum}`,
|
|
167
|
+
);
|
|
168
|
+
this.name = 'BoundBlockMismatchError';
|
|
169
|
+
this.proposalId = details.proposalId;
|
|
170
|
+
this.declaredBoundBlockNum = details.declaredBoundBlockNum;
|
|
171
|
+
this.boundBlockNum = details.boundBlockNum;
|
|
172
|
+
}
|
|
173
|
+
}
|