Skip to content

Commit 3fa49bd

Browse files
dependabot[bot]Mrtenzmetamaskbot
authored
chore(deps): bump @metamask/providers from 18.3.1 to 20.0.0 (#3057)
Bumps [@metamask/providers](https://github.com/MetaMask/providers) from 18.3.1 to 20.0.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/MetaMask/providers/releases"><code>@​metamask/providers</code>'s releases</a>.</em></p> <blockquote> <h2>20.0.0</h2> <h3>Changed</h3> <ul> <li><strong>BREAKING</strong>: An <code>isConnected</code> boolean property is now expected in the result of <code>metamask_getProviderState</code> and <code>metamask_chainChanged</code> events (<a href="https://redirect.github.com/MetaMask/providers/pull/404">#404</a>)</li> <li><strong>BREAKING</strong>: A <code>networkVersion</code> value of <code>loading</code> received by the <code>chainChanged</code> event handler is now interpreted to be null. In this case, the <code>networkChanged</code> event emits a null value as well. (<a href="https://redirect.github.com/MetaMask/providers/pull/404">#404</a>)</li> <li><strong>BREAKING</strong>: The disconnect event is now tied to the new <code>isConnected</code> property instead of the <code>networkVersion</code> property. (<a href="https://redirect.github.com/MetaMask/providers/pull/404">#404</a>)</li> <li>A change in the <code>isUnlocked</code> boolean property of the <code>metamask_getProviderState</code> and <code>metamask_accountsChanged</code> events (from what is in state) no longer causes the <code>accountsChanged</code> event to be emitted (<a href="https://redirect.github.com/MetaMask/providers/pull/405">#405</a>)</li> <li><code>MetaMaskInpageProvider.isUnlocked()</code> will always return true until the inpage to contentscript stream ends and the provider enters a permanently disconnected state (<a href="https://redirect.github.com/MetaMask/providers/pull/405">#405</a>)</li> </ul> <h2>19.0.0</h2> <h3>Changed</h3> <ul> <li><strong>BREAKING</strong>: <code>StreamProvider</code> no longer accepts a <code>jsonRpcStreamName</code> parameter (<a href="https://redirect.github.com/MetaMask/providers/pull/400">#400</a>) <ul> <li>Previously, this parameter was used internally to create an ObjectMultiplex stream and substream for JSON-RPC communication</li> <li>Now, the consumer is responsible for creating and managing the stream multiplexing if needed</li> <li>The provider will use the provided stream connection directly without any multiplexing</li> </ul> </li> <li><strong>BREAKING</strong>: <code>MetaMaskInpageProvider</code> no longer accepts a <code>jsonRpcStreamName</code> parameter (<a href="https://redirect.github.com/MetaMask/providers/pull/400">#400</a>) <ul> <li>This change is inherited from StreamProvider, as MetaMaskInpageProvider extends StreamProvider</li> <li>Stream multiplexing should be handled before provider instantiation</li> </ul> </li> <li><code>initializeInpageProvider</code> now handles stream multiplexing internally (<a href="https://redirect.github.com/MetaMask/providers/pull/400">#400</a>) <ul> <li>Creates an ObjectMultiplex instance and substream using the provided <code>jsonRpcStreamName</code></li> <li>This maintains backwards compatibility for consumers using <code>initializeInpageProvider</code></li> </ul> </li> <li><code>createExternalExtensionProvider</code> now handles stream multiplexing internally (<a href="https://redirect.github.com/MetaMask/providers/pull/400">#400</a>) <ul> <li>Creates an ObjectMultiplex instance and substream for JSON-RPC communication</li> <li>This maintains backwards compatibility for consumers using <code>createExternalExtensionProvider</code></li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/MetaMask/providers/blob/main/CHANGELOG.md"><code>@​metamask/providers</code>'s changelog</a>.</em></p> <blockquote> <h2>[20.0.0]</h2> <h3>Changed</h3> <ul> <li><strong>BREAKING</strong>: An <code>isConnected</code> boolean property is now expected in the result of <code>metamask_getProviderState</code> and <code>metamask_chainChanged</code> events (<a href="https://redirect.github.com/MetaMask/providers/pull/404">#404</a>)</li> <li><strong>BREAKING</strong>: A <code>networkVersion</code> value of <code>loading</code> received by the <code>chainChanged</code> event handler is now interpreted to be null. In this case, the <code>networkChanged</code> event emits a null value as well. (<a href="https://redirect.github.com/MetaMask/providers/pull/404">#404</a>)</li> <li><strong>BREAKING</strong>: The disconnect event is now tied to the new <code>isConnected</code> property instead of the <code>networkVersion</code> property. (<a href="https://redirect.github.com/MetaMask/providers/pull/404">#404</a>)</li> <li>A change in the <code>isUnlocked</code> boolean property of the <code>metamask_getProviderState</code> and <code>metamask_accountsChanged</code> events (from what is in state) no longer causes the <code>accountsChanged</code> event to be emitted (<a href="https://redirect.github.com/MetaMask/providers/pull/405">#405</a>)</li> <li><code>MetaMaskInpageProvider.isUnlocked()</code> will always return true until the inpage to contentscript stream ends and the provider enters a permanently disconnected state (<a href="https://redirect.github.com/MetaMask/providers/pull/405">#405</a>)</li> </ul> <h2>[19.0.0]</h2> <h3>Changed</h3> <ul> <li><strong>BREAKING</strong>: <code>StreamProvider</code> no longer accepts a <code>jsonRpcStreamName</code> parameter (<a href="https://redirect.github.com/MetaMask/providers/pull/400">#400</a>) <ul> <li>Previously, this parameter was used internally to create an ObjectMultiplex stream and substream for JSON-RPC communication</li> <li>Now, the consumer is responsible for creating and managing the stream multiplexing if needed</li> <li>The provider will use the provided stream connection directly without any multiplexing</li> </ul> </li> <li><strong>BREAKING</strong>: <code>MetaMaskInpageProvider</code> no longer accepts a <code>jsonRpcStreamName</code> parameter (<a href="https://redirect.github.com/MetaMask/providers/pull/400">#400</a>) <ul> <li>This change is inherited from StreamProvider, as MetaMaskInpageProvider extends StreamProvider</li> <li>Stream multiplexing should be handled before provider instantiation</li> </ul> </li> <li><code>initializeInpageProvider</code> now handles stream multiplexing internally (<a href="https://redirect.github.com/MetaMask/providers/pull/400">#400</a>) <ul> <li>Creates an ObjectMultiplex instance and substream using the provided <code>jsonRpcStreamName</code></li> <li>This maintains backwards compatibility for consumers using <code>initializeInpageProvider</code></li> </ul> </li> <li><code>createExternalExtensionProvider</code> now handles stream multiplexing internally (<a href="https://redirect.github.com/MetaMask/providers/pull/400">#400</a>) <ul> <li>Creates an ObjectMultiplex instance and substream for JSON-RPC communication</li> <li>This maintains backwards compatibility for consumers using <code>createExternalExtensionProvider</code></li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/MetaMask/providers/commit/e19bdf5d86b5f245f28a7ef2a1e36bee8841443b"><code>e19bdf5</code></a> 20.0.0 (<a href="https://redirect.github.com/MetaMask/providers/issues/407">#407</a>)</li> <li><a href="https://github.com/MetaMask/providers/commit/bda8d7288425cfa6a460935a6fbf4e2d35bdf335"><code>bda8d72</code></a> fix: eth_accounts / accountsChanged behavior when wallet is locked (<a href="https://redirect.github.com/MetaMask/providers/issues/405">#405</a>)</li> <li><a href="https://github.com/MetaMask/providers/commit/d919ab6bf356ff0a7d4eb1a1997e3372858a2f6c"><code>d919ab6</code></a> feat: allow <code>networkVersion</code> to be set to <code>null</code>. fire connection events base...</li> <li><a href="https://github.com/MetaMask/providers/commit/11acfb0ee733743a3264313bcba4be2c34e9f62d"><code>11acfb0</code></a> 19.0.0 (<a href="https://redirect.github.com/MetaMask/providers/issues/402">#402</a>)</li> <li><a href="https://github.com/MetaMask/providers/commit/df85bdf35130182ecf2ecc71cca4213cca0df2e2"><code>df85bdf</code></a> refactor(StreamProvider): remove unnecessary stream multiplexing (<a href="https://redirect.github.com/MetaMask/providers/issues/400">#400</a>)</li> <li>See full diff in <a href="https://github.com/MetaMask/providers/compare/v18.3.1...v20.0.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@metamask/providers&package-manager=npm_and_yarn&previous-version=18.3.1&new-version=20.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Maarten Zuidhoorn <[email protected]> Co-authored-by: MetaMask Bot <[email protected]>
1 parent cc5cc01 commit 3fa49bd

File tree

11 files changed

+28
-22
lines changed

11 files changed

+28
-22
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"branches": 81.08,
3-
"functions": 89.54,
4-
"lines": 90.92,
5-
"statements": 89.95
2+
"branches": 80.53,
3+
"functions": 88.96,
4+
"lines": 90.69,
5+
"statements": 89.74
66
}

packages/snaps-execution-environments/lavamoat/browserify/iframe/policy.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
},
4444
"packages": {
4545
"@metamask/json-rpc-engine": true,
46-
"@metamask/object-multiplex": true,
4746
"@metamask/providers>@metamask/json-rpc-middleware-stream": true,
4847
"@metamask/providers>@metamask/safe-event-emitter": true,
4948
"@metamask/providers>is-stream": true,

packages/snaps-execution-environments/lavamoat/browserify/node-process/policy.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
},
5151
"packages": {
5252
"@metamask/json-rpc-engine": true,
53-
"@metamask/object-multiplex": true,
5453
"@metamask/providers>@metamask/json-rpc-middleware-stream": true,
5554
"@metamask/providers>@metamask/safe-event-emitter": true,
5655
"@metamask/providers>is-stream": true,

packages/snaps-execution-environments/lavamoat/browserify/node-thread/policy.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
},
5151
"packages": {
5252
"@metamask/json-rpc-engine": true,
53-
"@metamask/object-multiplex": true,
5453
"@metamask/providers>@metamask/json-rpc-middleware-stream": true,
5554
"@metamask/providers>@metamask/safe-event-emitter": true,
5655
"@metamask/providers>is-stream": true,

packages/snaps-execution-environments/lavamoat/browserify/worker-executor/policy.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
},
4444
"packages": {
4545
"@metamask/json-rpc-engine": true,
46-
"@metamask/object-multiplex": true,
4746
"@metamask/providers>@metamask/json-rpc-middleware-stream": true,
4847
"@metamask/providers>@metamask/safe-event-emitter": true,
4948
"@metamask/providers>is-stream": true,

packages/snaps-execution-environments/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"@metamask/json-rpc-engine": "^10.0.2",
6868
"@metamask/object-multiplex": "^2.1.0",
6969
"@metamask/post-message-stream": "^9.0.0",
70-
"@metamask/providers": "^18.3.1",
70+
"@metamask/providers": "^20.0.0",
7171
"@metamask/rpc-errors": "^7.0.2",
7272
"@metamask/snaps-sdk": "workspace:^",
7373
"@metamask/snaps-utils": "workspace:^",

packages/snaps-execution-environments/src/common/BaseSnapExecutor.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// eslint-disable-next-line @typescript-eslint/triple-slash-reference, spaced-comment
22
/// <reference path="../../../../node_modules/ses/types.d.ts" />
33
import { createIdRemapMiddleware } from '@metamask/json-rpc-engine';
4+
import ObjectMultiplex from '@metamask/object-multiplex';
45
import type { RequestArguments, StreamProvider } from '@metamask/providers';
56
import { errorCodes, rpcErrors, serializeError } from '@metamask/rpc-errors';
67
import type { SnapsEthereumProvider, SnapsProvider } from '@metamask/snaps-sdk';
@@ -33,6 +34,7 @@ import {
3334
JsonRpcIdStruct,
3435
} from '@metamask/utils';
3536
import type { Duplex } from 'readable-stream';
37+
import { pipeline } from 'readable-stream';
3638

3739
import { log } from '../logging';
3840
import type { CommandMethodsMapping } from './commands';
@@ -369,11 +371,20 @@ export class BaseSnapExecutor {
369371
});
370372
};
371373

372-
const provider = new SnapProvider(this.rpcStream, {
373-
jsonRpcStreamName: 'metamask-provider',
374-
rpcMiddleware: [createIdRemapMiddleware()],
374+
const multiplex = new ObjectMultiplex();
375+
pipeline(this.rpcStream, multiplex, this.rpcStream, (error) => {
376+
if (error) {
377+
logError(`Provider stream failure.`, error);
378+
}
375379
});
376380

381+
const provider = new SnapProvider(
382+
multiplex.createStream('metamask-provider'),
383+
{
384+
rpcMiddleware: [createIdRemapMiddleware()],
385+
},
386+
);
387+
377388
provider.initializeSync();
378389

379390
const snap = this.createSnapGlobal(provider);

packages/snaps-execution-environments/src/common/test-utils/endowments.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export function getMockedStreamProvider(): SnapsEthereumProvider {
4444
const rpcStream = mux.createStream(SNAP_STREAM_NAMES.JSON_RPC);
4545

4646
const provider = new StreamProvider(rpcStream, {
47-
jsonRpcStreamName: 'metamask-provider',
4847
rpcMiddleware: [createIdRemapMiddleware()],
4948
logger: SILENT_LOGGER,
5049
});

packages/snaps-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
},
9393
"dependencies": {
9494
"@metamask/key-tree": "^10.0.2",
95-
"@metamask/providers": "^18.3.1",
95+
"@metamask/providers": "^20.0.0",
9696
"@metamask/rpc-errors": "^7.0.2",
9797
"@metamask/superstruct": "^3.1.0",
9898
"@metamask/utils": "^11.1.0"

packages/test-snaps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"@metamask/eslint-config-jest": "^12.1.0",
8585
"@metamask/eslint-config-nodejs": "^12.1.0",
8686
"@metamask/eslint-config-typescript": "^12.1.0",
87-
"@metamask/providers": "^18.3.1",
87+
"@metamask/providers": "^20.0.0",
8888
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
8989
"@swc/core": "1.3.78",
9090
"@swc/jest": "^0.2.26",

0 commit comments

Comments
 (0)