Skip to content

Commit c1ab3a7

Browse files
authored
Merge branch 'main' into release/577.0.0
2 parents f72c323 + 7f6cdfa commit c1ab3a7

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

packages/multichain-api-middleware/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- `wallet_invokeMethod` requests no longer fail with unauthorized error if the `isMultichainOrigin` property is false on the requesting origin's CAIP-25 Permission.
13+
1014
## [1.1.0]
1115

1216
### Changed

packages/multichain-api-middleware/src/handlers/wallet-invokeMethod.test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,6 @@ describe('wallet_invokeMethod', () => {
165165
expect(end).toHaveBeenCalledWith(providerErrors.unauthorized());
166166
});
167167

168-
it('throws an unauthorized error when the CAIP-25 endowment permission was not granted from the multichain flow', async () => {
169-
const request = createMockedRequest();
170-
const { handler, getCaveatForOrigin, end } = createMockedHandler();
171-
getCaveatForOrigin.mockReturnValue({
172-
value: {
173-
isMultichainOrigin: false,
174-
},
175-
});
176-
await handler(request);
177-
expect(end).toHaveBeenCalledWith(providerErrors.unauthorized());
178-
});
179-
180168
it('throws an unauthorized error if the requested scope is not authorized', async () => {
181169
const request = createMockedRequest();
182170
const { handler, end } = createMockedHandler();

packages/multichain-api-middleware/src/handlers/wallet-invokeMethod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async function walletInvokeMethodHandler(
8080
} catch {
8181
// noop
8282
}
83-
if (!caveat?.value?.isMultichainOrigin) {
83+
if (!caveat) {
8484
return end(providerErrors.unauthorized());
8585
}
8686

0 commit comments

Comments
 (0)