@dynamic-labs-wallet/browser-wallet-client 1.1.22 → 1.1.23
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/index.cjs
CHANGED
|
@@ -2275,7 +2275,7 @@ const limitKeys = [
|
|
|
2275
2275
|
const assertMatches = (matches, message)=>{
|
|
2276
2276
|
if (!matches) throw new Error(message);
|
|
2277
2277
|
};
|
|
2278
|
-
const assertPreparedSigningIntentMatchesRequest = ({ intent, request, preparedPayload
|
|
2278
|
+
const assertPreparedSigningIntentMatchesRequest = ({ intent, request, preparedPayload })=>{
|
|
2279
2279
|
const sameAddress = request.chainName === 'EVM' ? intent.accountAddress.toLowerCase() === request.accountAddress.toLowerCase() : intent.accountAddress === request.accountAddress;
|
|
2280
2280
|
assertMatches(Object.values(core.WaasChainEnum).includes(request.chainName) && intent.actionType === 'waasSigningQuorumApprove' && Boolean(intent.intentId) && Number.isFinite(Date.parse(intent.createdAt)) && sameAddress && intent.businessAccountId === request.businessAccountId && intent.initiatorUserId === request.initiatorUserId && intent.completeBy === request.completeBy && intent.operation.chainName === request.chainName && intent.operation.kind === request.kind, 'Prepared signing intent does not match request');
|
|
2281
2281
|
if (intent.operation.kind === 'transaction') {
|
|
@@ -2283,15 +2283,15 @@ const assertPreparedSigningIntentMatchesRequest = ({ intent, request, preparedPa
|
|
|
2283
2283
|
throw new Error('Unsupported transaction signing intent');
|
|
2284
2284
|
}
|
|
2285
2285
|
const { operation, limits } = intent;
|
|
2286
|
-
if (!limits
|
|
2286
|
+
if (!limits) throw new Error('Prepared transaction signing intent is malformed');
|
|
2287
2287
|
assertMatches(operation.from === intent.accountAddress.toLowerCase(), 'Transaction signer does not match request');
|
|
2288
2288
|
assertMatches(!request.chainId || operation.chainId === request.chainId, 'Transaction chain does not match request');
|
|
2289
2289
|
assertMatches(!request.refreshLimits || limitKeys.every((key)=>{
|
|
2290
2290
|
var _request_refreshLimits;
|
|
2291
2291
|
return limits[key] === ((_request_refreshLimits = request.refreshLimits) == null ? void 0 : _request_refreshLimits[key]);
|
|
2292
2292
|
}), 'Transaction signing limits do not match request');
|
|
2293
|
-
|
|
2294
|
-
|
|
2293
|
+
// Wallet-service parses the transaction it signs and rejects any mismatch with
|
|
2294
|
+
// the approved operation, so the transaction fields are not re-derived here.
|
|
2295
2295
|
return;
|
|
2296
2296
|
}
|
|
2297
2297
|
const { operation } = intent;
|
package/index.esm.js
CHANGED
|
@@ -2274,7 +2274,7 @@ const limitKeys = [
|
|
|
2274
2274
|
const assertMatches = (matches, message)=>{
|
|
2275
2275
|
if (!matches) throw new Error(message);
|
|
2276
2276
|
};
|
|
2277
|
-
const assertPreparedSigningIntentMatchesRequest = ({ intent, request, preparedPayload
|
|
2277
|
+
const assertPreparedSigningIntentMatchesRequest = ({ intent, request, preparedPayload })=>{
|
|
2278
2278
|
const sameAddress = request.chainName === 'EVM' ? intent.accountAddress.toLowerCase() === request.accountAddress.toLowerCase() : intent.accountAddress === request.accountAddress;
|
|
2279
2279
|
assertMatches(Object.values(WaasChainEnum).includes(request.chainName) && intent.actionType === 'waasSigningQuorumApprove' && Boolean(intent.intentId) && Number.isFinite(Date.parse(intent.createdAt)) && sameAddress && intent.businessAccountId === request.businessAccountId && intent.initiatorUserId === request.initiatorUserId && intent.completeBy === request.completeBy && intent.operation.chainName === request.chainName && intent.operation.kind === request.kind, 'Prepared signing intent does not match request');
|
|
2280
2280
|
if (intent.operation.kind === 'transaction') {
|
|
@@ -2282,15 +2282,15 @@ const assertPreparedSigningIntentMatchesRequest = ({ intent, request, preparedPa
|
|
|
2282
2282
|
throw new Error('Unsupported transaction signing intent');
|
|
2283
2283
|
}
|
|
2284
2284
|
const { operation, limits } = intent;
|
|
2285
|
-
if (!limits
|
|
2285
|
+
if (!limits) throw new Error('Prepared transaction signing intent is malformed');
|
|
2286
2286
|
assertMatches(operation.from === intent.accountAddress.toLowerCase(), 'Transaction signer does not match request');
|
|
2287
2287
|
assertMatches(!request.chainId || operation.chainId === request.chainId, 'Transaction chain does not match request');
|
|
2288
2288
|
assertMatches(!request.refreshLimits || limitKeys.every((key)=>{
|
|
2289
2289
|
var _request_refreshLimits;
|
|
2290
2290
|
return limits[key] === ((_request_refreshLimits = request.refreshLimits) == null ? void 0 : _request_refreshLimits[key]);
|
|
2291
2291
|
}), 'Transaction signing limits do not match request');
|
|
2292
|
-
|
|
2293
|
-
|
|
2292
|
+
// Wallet-service parses the transaction it signs and rejects any mismatch with
|
|
2293
|
+
// the approved operation, so the transaction fields are not re-derived here.
|
|
2294
2294
|
return;
|
|
2295
2295
|
}
|
|
2296
2296
|
const { operation } = intent;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser-wallet-client",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.23",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/core": "1.1.
|
|
7
|
+
"@dynamic-labs-wallet/core": "1.1.23",
|
|
8
8
|
"@dynamic-labs/logger": "^5.0.0",
|
|
9
9
|
"@dynamic-labs/message-transport": "^5.0.0"
|
|
10
10
|
},
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare const assertPreparedSigningIntentMatchesRequest: ({ intent, request, preparedPayload,
|
|
1
|
+
import { type PrepareSigningIntentRequest, type SigningIntent } from '@dynamic-labs-wallet/core';
|
|
2
|
+
export declare const assertPreparedSigningIntentMatchesRequest: ({ intent, request, preparedPayload, }: {
|
|
3
3
|
intent: SigningIntent;
|
|
4
4
|
request: PrepareSigningIntentRequest;
|
|
5
5
|
preparedPayload?: string;
|
|
6
|
-
preparedTransaction?: PreparedTransactionSigningIntent;
|
|
7
6
|
}) => void;
|
|
8
7
|
//# sourceMappingURL=assertPreparedSigningIntentMatchesRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertPreparedSigningIntentMatchesRequest.d.ts","sourceRoot":"","sources":["../../packages/src/assertPreparedSigningIntentMatchesRequest.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"assertPreparedSigningIntentMatchesRequest.d.ts","sourceRoot":"","sources":["../../packages/src/assertPreparedSigningIntentMatchesRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,2BAA2B,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAQhH,eAAO,MAAM,yCAAyC,0CAInD;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,2BAA2B,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,KAAG,IAsEH,CAAC"}
|