Skip to content

Commit

Permalink
fix: @metamask/providers@16, @metamask/json-rpc-middleware-stream@8 (#…
Browse files Browse the repository at this point in the history
…12085)

## **Description**
- Upgrade `@metamask/providers` from `^13.1.0` to `^16.1.0`
- Upgrade from `json-rpc-middleware-stream@^4.2.3` to
`@metamask/json-rpc-middleware-stream@^8.0.2`

Removes usage of depecated `[email protected]`,
`extension-port-stream`


## **Related issues**

### Blocking
- #11952

## **Manual testing steps**

## **Screenshots/Recordings**

### **Before**

### **After**

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: sethkfman <[email protected]>
  • Loading branch information
legobeat and sethkfman authored Nov 6, 2024
1 parent 1f885dd commit 753e2ea
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 38 deletions.
2 changes: 1 addition & 1 deletion app/core/BackgroundBridge/BackgroundBridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import Engine from '../Engine';
import { createSanitizationMiddleware } from '../SanitizationMiddleware';
import Logger from '../../util/Logger';
import AppConstants from '../AppConstants';
import { createEngineStream } from 'json-rpc-middleware-stream';
import RemotePort from './RemotePort';
import WalletConnectPort from './WalletConnectPort';
import Port from './Port';
Expand All @@ -29,6 +28,7 @@ import { SubjectType } from '@metamask/permission-controller';
const createFilterMiddleware = require('@metamask/eth-json-rpc-filters');
const createSubscriptionManager = require('@metamask/eth-json-rpc-filters/subscriptionManager');
const { providerAsMiddleware } = require('@metamask/eth-json-rpc-middleware');
import { createEngineStream } from '@metamask/json-rpc-middleware-stream';
const pump = require('pump');
// eslint-disable-next-line import/no-nodejs-modules
const EventEmitter = require('events').EventEmitter;
Expand Down
2 changes: 1 addition & 1 deletion app/core/Snaps/SnapBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
createEventEmitterProxy,
} from '@metamask/swappable-obj-proxy';
import { JsonRpcEngine } from 'json-rpc-engine';
import { createEngineStream } from 'json-rpc-middleware-stream';
import { createEngineStream } from '@metamask/json-rpc-middleware-stream';
import { NetworksChainId } from '@metamask/controller-utils';

import Engine from '../Engine';
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
"@metamask/ethjs-query": "^0.7.1",
"@metamask/ethjs-unit": "^0.3.0",
"@metamask/gas-fee-controller": "^18.0.0",
"@metamask/json-rpc-middleware-stream": "^8.0.2",
"@metamask/key-tree": "^9.0.0",
"@metamask/keyring-api": "^8.1.0",
"@metamask/keyring-controller": "^17.2.1",
Expand Down Expand Up @@ -252,7 +253,6 @@
"humanize-duration": "^3.27.2",
"is-url": "^1.2.4",
"json-rpc-engine": "^6.1.0",
"json-rpc-middleware-stream": "^4.2.3",
"lodash": "^4.17.21",
"lottie-ios": "3.4.1",
"lottie-react-native": "5.1.5",
Expand Down Expand Up @@ -370,7 +370,7 @@
"@metamask/eslint-plugin-design-tokens": "^1.0.0",
"@metamask/mobile-provider": "^3.0.0",
"@metamask/object-multiplex": "^1.1.0",
"@metamask/providers": "^13.1.0",
"@metamask/providers": "^16.1.0",
"@metamask/test-dapp": "^8.9.0",
"@octokit/rest": "^21.0.0",
"@open-rpc/mock-server": "^1.7.5",
Expand Down
35 changes: 1 addition & 34 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5243,24 +5243,7 @@
loglevel "^1.8.1"
siwe "^2.3.2"

"@metamask/providers@^13.1.0":
version "13.1.0"
resolved "https://registry.yarnpkg.com/@metamask/providers/-/providers-13.1.0.tgz#c5aef8e7073e097e6693cffc5f463b0632e1f1fd"
integrity sha512-/2Ti81CwZ/9LLpAm9Law+7z1PYbR3EiNXNKCbkppOfxxR1MbC2ps8/GFTjk7UHEMhAVG4k9ziGW8mMsutNVxmA==
dependencies:
"@metamask/json-rpc-engine" "^7.1.1"
"@metamask/object-multiplex" "^1.1.0"
"@metamask/rpc-errors" "^6.0.0"
"@metamask/safe-event-emitter" "^3.0.0"
"@metamask/utils" "^8.1.0"
detect-browser "^5.2.0"
extension-port-stream "^2.1.1"
fast-deep-equal "^3.1.3"
is-stream "^2.0.0"
json-rpc-middleware-stream "^4.2.1"
webextension-polyfill "^0.10.0"

"@metamask/providers@^16.0.0":
"@metamask/providers@^16.0.0", "@metamask/providers@^16.1.0":
version "16.1.0"
resolved "https://registry.yarnpkg.com/@metamask/providers/-/providers-16.1.0.tgz#7da593d17c541580fa3beab8d9d8a9b9ce19ea07"
integrity sha512-znVCvux30+3SaUwcUGaSf+pUckzT5ukPRpcBmy+muBLC0yaWnBcvDqGfcsw6CBIenUdFrVoAFa8B6jsuCY/a+g==
Expand Down Expand Up @@ -17523,13 +17506,6 @@ extend@~3.0.2:
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==

extension-port-stream@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/extension-port-stream/-/extension-port-stream-2.1.1.tgz#ec11f2a5ed95655d8c40805d7cb0c39939ee9ef4"
integrity sha512-qknp5o5rj2J9CRKfVB8KJr+uXQlrojNZzdESUPhKYLXf97TPcGf6qWWKmpsNNtUyOdzFhab1ON0jzouNxHHvow==
dependencies:
webextension-polyfill ">=0.10.0 <1.0"

extension-port-stream@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/extension-port-stream/-/extension-port-stream-3.0.0.tgz#00a7185fe2322708a36ed24843c81bd754925fef"
Expand Down Expand Up @@ -20919,15 +20895,6 @@ json-rpc-engine@^6.1.0:
"@metamask/safe-event-emitter" "^2.0.0"
eth-rpc-errors "^4.0.2"

json-rpc-middleware-stream@^4.2.1, json-rpc-middleware-stream@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/json-rpc-middleware-stream/-/json-rpc-middleware-stream-4.2.3.tgz#08340846ffaa2a60287930773546eb4b7f7dbba2"
integrity sha512-4iFb0yffm5vo3eFKDbQgke9o17XBcLQ2c3sONrXSbcOLzP8LTojqo8hRGVgtJShhm5q4ZDSNq039fAx9o65E1w==
dependencies:
"@metamask/safe-event-emitter" "^3.0.0"
json-rpc-engine "^6.1.0"
readable-stream "^2.3.3"

json-rpc-random-id@^1.0.0, json-rpc-random-id@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz#ba49d96aded1444dbb8da3d203748acbbcdec8c8"
Expand Down

0 comments on commit 753e2ea

Please sign in to comment.