@metamask-previews/json-rpc-engine 11.0.0-preview-6c5c11696 → 11.0.0-preview-c5fdaa9c8
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 +4 -8
- 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';
|
|
97
98
|
import {
|
|
98
99
|
asLegacyMiddleware,
|
|
99
100
|
JsonRpcEngineV2,
|
|
100
101
|
} 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';
|
|
117
118
|
import {
|
|
118
119
|
asLegacyMiddleware,
|
|
119
120
|
type JsonRpcMiddleware,
|
|
120
121
|
} 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,15 +711,11 @@ middleware pipelines:
|
|
|
711
711
|
|
|
712
712
|
```ts
|
|
713
713
|
const requestEngine = JsonRpcEngineV2.create({
|
|
714
|
-
middleware: [
|
|
715
|
-
/* Request-only middleware */
|
|
716
|
-
],
|
|
714
|
+
middleware: [/* Request-only middleware */],
|
|
717
715
|
});
|
|
718
716
|
|
|
719
717
|
const notificationEngine = JsonRpcEngineV2.create({
|
|
720
|
-
middleware: [
|
|
721
|
-
/* Notification-only middleware */
|
|
722
|
-
],
|
|
718
|
+
middleware: [/* Notification-only middleware */],
|
|
723
719
|
});
|
|
724
720
|
|
|
725
721
|
const orchestratorEngine = JsonRpcEngineV2.create({
|