@metamask-previews/json-rpc-engine 11.0.0-preview-373786801 → 11.0.0-preview-4fa35a45a
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/README.md +8 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -94,11 +94,11 @@ the `context` will be copied over._
|
|
|
94
94
|
#### Converting a V2 engine
|
|
95
95
|
|
|
96
96
|
```ts
|
|
97
|
-
import { JsonRpcEngine } from '@metamask/json-rpc-engine';
|
|
98
97
|
import {
|
|
99
98
|
asLegacyMiddleware,
|
|
100
99
|
JsonRpcEngineV2,
|
|
101
100
|
} from '@metamask/json-rpc-engine/v2';
|
|
101
|
+
import { JsonRpcEngine } from '@metamask/json-rpc-engine';
|
|
102
102
|
|
|
103
103
|
const legacyEngine = new JsonRpcEngine();
|
|
104
104
|
|
|
@@ -114,11 +114,11 @@ legacyEngine.push(asLegacyMiddleware(v2Engine));
|
|
|
114
114
|
#### Converting V2 middleware
|
|
115
115
|
|
|
116
116
|
```ts
|
|
117
|
-
import { JsonRpcEngine } from '@metamask/json-rpc-engine';
|
|
118
117
|
import {
|
|
119
118
|
asLegacyMiddleware,
|
|
120
119
|
type JsonRpcMiddleware,
|
|
121
120
|
} from '@metamask/json-rpc-engine/v2';
|
|
121
|
+
import { JsonRpcEngine } from '@metamask/json-rpc-engine';
|
|
122
122
|
|
|
123
123
|
// Convert a single V2 middleware
|
|
124
124
|
const middleware1: JsonRpcMiddleware<JsonRpcRequest> = ({ request }) => {
|
|
@@ -711,11 +711,15 @@ middleware pipelines:
|
|
|
711
711
|
|
|
712
712
|
```ts
|
|
713
713
|
const requestEngine = JsonRpcEngineV2.create({
|
|
714
|
-
middleware: [
|
|
714
|
+
middleware: [
|
|
715
|
+
/* Request-only middleware */
|
|
716
|
+
],
|
|
715
717
|
});
|
|
716
718
|
|
|
717
719
|
const notificationEngine = JsonRpcEngineV2.create({
|
|
718
|
-
middleware: [
|
|
720
|
+
middleware: [
|
|
721
|
+
/* Notification-only middleware */
|
|
722
|
+
],
|
|
719
723
|
});
|
|
720
724
|
|
|
721
725
|
const orchestratorEngine = JsonRpcEngineV2.create({
|