Skip to content

Commit

Permalink
deps: json-rpc-engine@^6.1.0 -> @metamask/json-rpc-engine@^7.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Mar 6, 2024
1 parent 7bd77d6 commit c2c9351
Show file tree
Hide file tree
Showing 23 changed files with 223 additions and 249 deletions.
5 changes: 4 additions & 1 deletion app/scripts/lib/createMetamaskMiddleware.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { createScaffoldMiddleware, mergeMiddleware } from 'json-rpc-engine';
import {
createScaffoldMiddleware,
mergeMiddleware,
} from '@metamask/json-rpc-engine';
import { createWalletMiddleware } from '@metamask/eth-json-rpc-middleware';
import {
createPendingNonceMiddleware,
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/lib/middleware/pending.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createAsyncMiddleware } from 'json-rpc-engine';
import { createAsyncMiddleware } from '@metamask/json-rpc-engine';
import { formatTxMetaForRpcResult } from '../util';

export function createPendingNonceMiddleware({ getPendingNonce }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default requestEthereumAccounts;

/**
*
* @param {import('json-rpc-engine').JsonRpcRequest<unknown>} _req - The JSON-RPC request object.
* @param {import('json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {import('@metamask/json-rpc-engine').JsonRpcRequest<unknown>} _req - The JSON-RPC request object.
* @param {import('@metamask/json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {Function} _next - The json-rpc-engine 'next' callback.
* @param {Function} end - The json-rpc-engine 'end' callback.
* @param {EthAccountsOptions} options - The RPC method hooks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export default getProviderState;
*/

/**
* @param {import('json-rpc-engine').JsonRpcRequest<[]>} req - The JSON-RPC request object.
* @param {import('json-rpc-engine').JsonRpcResponse<ProviderStateHandlerResult>} res - The JSON-RPC response object.
* @param {import('@metamask/json-rpc-engine').JsonRpcRequest<[]>} req - The JSON-RPC request object.
* @param {import('@metamask/json-rpc-engine').JsonRpcResponse<ProviderStateHandlerResult>} res - The JSON-RPC response object.
* @param {Function} _next - The json-rpc-engine 'next' callback.
* @param {Function} end - The json-rpc-engine 'end' callback.
* @param {ProviderStateHandlerOptions} options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default mmiAuthenticate;
*/

/**
* @param {import('json-rpc-engine').JsonRpcRequest<WatchAssetParam>} req - The JSON-RPC request object.
* @param {import('json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {import('@metamask/json-rpc-engine').JsonRpcRequest<WatchAssetParam>} req - The JSON-RPC request object.
* @param {import('@metamask/json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {Function} _next - The json-rpc-engine 'next' callback.
* @param {Function} end - The json-rpc-engine 'end' callback.
* @param {WatchAssetOptions} options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default mmiAuthenticate;
*/

/**
* @param {import('json-rpc-engine').JsonRpcRequest<MmiCheckIfTokenIsPresentParam>} req - The JSON-RPC request object.
* @param {import('json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {import('@metamask/json-rpc-engine').JsonRpcRequest<MmiCheckIfTokenIsPresentParam>} req - The JSON-RPC request object.
* @param {import('@metamask/json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {Function} _next - The json-rpc-engine 'next' callback.
* @param {Function} end - The json-rpc-engine 'end' callback.
* @param options0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export default mmiOpenAddHardwareWallet;
*/

/**
* @param {import('json-rpc-engine').JsonRpcRequest} req - The JSON-RPC request object.
* @param {import('json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {import('@metamask/json-rpc-engine').JsonRpcRequest} req - The JSON-RPC request object.
* @param {import('@metamask/json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {Function} _next - The json-rpc-engine 'next' callback.
* @param {Function} end - The json-rpc-engine 'end' callback.
* @param {WatchAssetOptions} options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export default mmiPortfolio;
*/

/**
* @param {import('json-rpc-engine').JsonRpcRequest<MmiPortfolioParam>} req - The JSON-RPC request object.
* @param {import('json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {import('@metamask/json-rpc-engine').JsonRpcRequest<MmiPortfolioParam>} req - The JSON-RPC request object.
* @param {import('@metamask/json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {Function} _next - The json-rpc-engine 'next' callback.
* @param {Function} end - The json-rpc-engine 'end' callback.
* @param {WatchAssetOptions} options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default mmiSetAccountAndNetwork;
*/

/**
* @param {import('json-rpc-engine').JsonRpcRequest<MmiSetAccountAndNetworkParam>} req - The JSON-RPC request object.
* @param {import('json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {import('@metamask/json-rpc-engine').JsonRpcRequest<MmiSetAccountAndNetworkParam>} req - The JSON-RPC request object.
* @param {import('@metamask/json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {Function} _next - The json-rpc-engine 'next' callback.
* @param {Function} end - The json-rpc-engine 'end' callback.
* @param {WatchAssetOptions} options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export default mmiSupported;
*/

/**
* @param {import('json-rpc-engine').JsonRpcRequest<WatchAssetParam>} _req - The JSON-RPC request object.
* @param {import('json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {import('@metamask/json-rpc-engine').JsonRpcRequest<WatchAssetParam>} _req - The JSON-RPC request object.
* @param {import('@metamask/json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {Function} _next - The json-rpc-engine 'next' callback.
* @param {Function} end - The json-rpc-engine 'end' callback.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default logWeb3ShimUsage;
*/

/**
* @param {import('json-rpc-engine').JsonRpcRequest<unknown>} req - The JSON-RPC request object.
* @param {import('json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {import('@metamask/json-rpc-engine').JsonRpcRequest<unknown>} req - The JSON-RPC request object.
* @param {import('@metamask/json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {Function} _next - The json-rpc-engine 'next' callback.
* @param {Function} end - The json-rpc-engine 'end' callback.
* @param {LogWeb3ShimUsageOptions} options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ const locks = new Set();

/**
*
* @param {import('json-rpc-engine').JsonRpcRequest<unknown>} _req - The JSON-RPC request object.
* @param {import('json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {import('@metamask/json-rpc-engine').JsonRpcRequest<unknown>} _req - The JSON-RPC request object.
* @param {import('@metamask/json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {Function} _next - The json-rpc-engine 'next' callback.
* @param {Function} end - The json-rpc-engine 'end' callback.
* @param {RequestEthereumAccountsOptions} options - The RPC method hooks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default sendMetadata;
*/

/**
* @param {import('json-rpc-engine').JsonRpcRequest<unknown>} req - The JSON-RPC request object.
* @param {import('json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {import('@metamask/json-rpc-engine').JsonRpcRequest<unknown>} req - The JSON-RPC request object.
* @param {import('@metamask/json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {Function} _next - The json-rpc-engine 'next' callback.
* @param {Function} end - The json-rpc-engine 'end' callback.
* @param {SendMetadataOptions} options
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/lib/rpc-method-middleware/handlers/watch-asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default watchAsset;
*/

/**
* @param {import('json-rpc-engine').JsonRpcRequest<WatchAssetParam>} req - The JSON-RPC request object.
* @param {import('json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {import('@metamask/json-rpc-engine').JsonRpcRequest<WatchAssetParam>} req - The JSON-RPC request object.
* @param {import('@metamask/json-rpc-engine').JsonRpcResponse<true>} res - The JSON-RPC response object.
* @param {Function} _next - The json-rpc-engine 'next' callback.
* @param {Function} end - The json-rpc-engine 'end' callback.
* @param {WatchAssetOptions} options
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import {
TokensController,
CodefiTokenPricesServiceV2,
} from '@metamask/assets-controllers';
import { JsonRpcEngine } from '@metamask/json-rpc-engine';
import { ObservableStore } from '@metamask/obs-store';
import { storeAsStream } from '@metamask/obs-store/dist/asStream';
import { JsonRpcEngine } from 'json-rpc-engine';
import { createEngineStream } from 'json-rpc-middleware-stream';
import { providerAsMiddleware } from '@metamask/eth-json-rpc-middleware';
import {
Expand Down
70 changes: 35 additions & 35 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -929,8 +929,8 @@
},
"packages": {
"@metamask/eth-json-rpc-middleware>safe-stable-stringify": true,
"@metamask/json-rpc-engine": true,
"@metamask/message-manager>@metamask/eth-sig-util": true,
"@metamask/providers>@metamask/json-rpc-engine": true,
"@metamask/rpc-errors": true,
"@metamask/utils": true,
"pify": true,
Expand Down Expand Up @@ -1389,6 +1389,21 @@
"jest-canvas-mock>moo-color>color-name": true
}
},
"@metamask/json-rpc-engine": {
"packages": {
"@metamask/json-rpc-engine>@metamask/safe-event-emitter": true,
"@metamask/rpc-errors": true,
"@metamask/utils": true
}
},
"@metamask/json-rpc-engine>@metamask/safe-event-emitter": {
"globals": {
"setTimeout": true
},
"packages": {
"webpack>events": true
}
},
"@metamask/keyring-api": {
"packages": {
"@metamask/keyring-api>uuid": true,
Expand Down Expand Up @@ -1559,10 +1574,10 @@
"@metamask/eth-json-rpc-middleware": true,
"@metamask/eth-query": true,
"@metamask/eth-token-tracker>eth-block-tracker": true,
"@metamask/json-rpc-engine": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura": true,
"@metamask/network-controller>@metamask/eth-json-rpc-provider": true,
"@metamask/network-controller>@metamask/swappable-obj-proxy": true,
"@metamask/providers>@metamask/json-rpc-engine": true,
"@metamask/rpc-errors": true,
"@metamask/utils": true,
"browserify>assert": true,
Expand All @@ -1574,17 +1589,17 @@
"setTimeout": true
},
"packages": {
"@metamask/json-rpc-engine": true,
"@metamask/network-controller>@metamask/eth-json-rpc-provider": true,
"@metamask/providers>@metamask/json-rpc-engine": true,
"@metamask/rpc-errors": true,
"@metamask/utils": true,
"node-fetch": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-provider": {
"packages": {
"@metamask/network-controller>@metamask/eth-json-rpc-provider>@metamask/safe-event-emitter": true,
"@metamask/providers>@metamask/json-rpc-engine": true
"@metamask/json-rpc-engine": true,
"@metamask/network-controller>@metamask/eth-json-rpc-provider>@metamask/safe-event-emitter": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-provider>@metamask/safe-event-emitter": {
Expand Down Expand Up @@ -1622,8 +1637,8 @@
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/json-rpc-engine": true,
"@metamask/permission-controller>nanoid": true,
"@metamask/providers>@metamask/json-rpc-engine": true,
"@metamask/rpc-errors": true,
"@metamask/utils": true,
"deep-freeze-strict": true,
Expand Down Expand Up @@ -1696,26 +1711,11 @@
"ethereumjs-util>ethereum-cryptography>hash.js": true
}
},
"@metamask/providers>@metamask/json-rpc-engine": {
"packages": {
"@metamask/providers>@metamask/json-rpc-engine>@metamask/safe-event-emitter": true,
"@metamask/rpc-errors": true,
"@metamask/utils": true
}
},
"@metamask/providers>@metamask/json-rpc-engine>@metamask/safe-event-emitter": {
"globals": {
"setTimeout": true
},
"packages": {
"webpack>events": true
}
},
"@metamask/queued-request-controller": {
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/providers>@metamask/json-rpc-engine": true,
"@metamask/json-rpc-engine": true,
"@metamask/rpc-errors": true,
"@metamask/selected-network-controller": true
}
Expand Down Expand Up @@ -2033,7 +2033,7 @@
"@metamask/controller-utils": true,
"@metamask/eth-query": true,
"@metamask/gas-fee-controller": true,
"@metamask/providers>@metamask/rpc-errors": true,
"@metamask/rpc-errors": true,
"@metamask/transaction-controller": true,
"@metamask/user-operation-controller>@metamask/polling-controller": true,
"@metamask/utils": true,
Expand Down Expand Up @@ -2897,7 +2897,7 @@
"@metamask/safe-event-emitter": true,
"eth-json-rpc-filters>async-mutex": true,
"eth-json-rpc-filters>eth-query": true,
"json-rpc-engine": true,
"eth-json-rpc-filters>json-rpc-engine": true,
"pify": true
}
},
Expand All @@ -2916,6 +2916,17 @@
"watchify>xtend": true
}
},
"eth-json-rpc-filters>json-rpc-engine": {
"packages": {
"@metamask/safe-event-emitter": true,
"eth-json-rpc-filters>json-rpc-engine>eth-rpc-errors": true
}
},
"eth-json-rpc-filters>json-rpc-engine>eth-rpc-errors": {
"packages": {
"@metamask/rpc-errors>fast-safe-stringify": true
}
},
"eth-keyring-controller>@metamask/browser-passworder": {
"globals": {
"crypto": true
Expand Down Expand Up @@ -3430,17 +3441,6 @@
"string.prototype.matchall>has-symbols": true
}
},
"json-rpc-engine": {
"packages": {
"@metamask/safe-event-emitter": true,
"json-rpc-engine>eth-rpc-errors": true
}
},
"json-rpc-engine>eth-rpc-errors": {
"packages": {
"@metamask/rpc-errors>fast-safe-stringify": true
}
},
"json-rpc-middleware-stream": {
"globals": {
"console.warn": true,
Expand Down
Loading

0 comments on commit c2c9351

Please sign in to comment.