@metamask-previews/perps-controller 0.0.0-preview-903db2da
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/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/README.md +23 -0
- package/dist/PerpsController.cjs +88 -0
- package/dist/PerpsController.cjs.map +1 -0
- package/dist/PerpsController.d.cts +107 -0
- package/dist/PerpsController.d.cts.map +1 -0
- package/dist/PerpsController.d.mts +107 -0
- package/dist/PerpsController.d.mts.map +1 -0
- package/dist/PerpsController.mjs +83 -0
- package/dist/PerpsController.mjs.map +1 -0
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +74 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Initial release ([#7654](https://github.com/MetaMask/core/pull/7654))
|
|
13
|
+
|
|
14
|
+
[Unreleased]: https://github.com/MetaMask/core/
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MetaMask
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# `@metamask/perps-controller`
|
|
2
|
+
|
|
3
|
+
Controller for perpetual trading functionality in MetaMask.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
`yarn add @metamask/perps-controller`
|
|
8
|
+
|
|
9
|
+
or
|
|
10
|
+
|
|
11
|
+
`npm install @metamask/perps-controller`
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { PerpsController } from '@metamask/perps-controller';
|
|
17
|
+
|
|
18
|
+
// Full usage documentation coming in future releases
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Contributing
|
|
22
|
+
|
|
23
|
+
This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/core#readme).
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PerpsController = exports.getDefaultPerpsControllerState = exports.controllerName = void 0;
|
|
4
|
+
const base_controller_1 = require("@metamask/base-controller");
|
|
5
|
+
/**
|
|
6
|
+
* The name of the {@link PerpsController}, used to namespace the
|
|
7
|
+
* controller's actions and events and to namespace the controller's state data
|
|
8
|
+
* when composed with other controllers.
|
|
9
|
+
*/
|
|
10
|
+
exports.controllerName = 'PerpsController';
|
|
11
|
+
/**
|
|
12
|
+
* The metadata for each property in {@link PerpsControllerState}.
|
|
13
|
+
*/
|
|
14
|
+
const perpsControllerMetadata = {};
|
|
15
|
+
/**
|
|
16
|
+
* Constructs the default {@link PerpsController} state. This allows
|
|
17
|
+
* consumers to provide a partial state object when initializing the controller
|
|
18
|
+
* and also helps in constructing complete state objects for this controller in
|
|
19
|
+
* tests.
|
|
20
|
+
*
|
|
21
|
+
* @returns The default {@link PerpsController} state.
|
|
22
|
+
*/
|
|
23
|
+
function getDefaultPerpsControllerState() {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
exports.getDefaultPerpsControllerState = getDefaultPerpsControllerState;
|
|
27
|
+
/**
|
|
28
|
+
* `PerpsController` manages perpetual trading functionality in MetaMask.
|
|
29
|
+
*
|
|
30
|
+
* This controller provides platform-agnostic perps trading capabilities.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
*
|
|
34
|
+
* ``` ts
|
|
35
|
+
* import { Messenger } from '@metamask/messenger';
|
|
36
|
+
* import type {
|
|
37
|
+
* PerpsControllerActions,
|
|
38
|
+
* PerpsControllerEvents,
|
|
39
|
+
* } from '@metamask/perps-controller';
|
|
40
|
+
* import { PerpsController } from '@metamask/perps-controller';
|
|
41
|
+
*
|
|
42
|
+
* const rootMessenger = new Messenger<
|
|
43
|
+
* 'Root',
|
|
44
|
+
* PerpsControllerActions,
|
|
45
|
+
* PerpsControllerEvents
|
|
46
|
+
* >({ namespace: 'Root' });
|
|
47
|
+
* const perpsControllerMessenger = new Messenger<
|
|
48
|
+
* 'PerpsController',
|
|
49
|
+
* PerpsControllerActions,
|
|
50
|
+
* PerpsControllerEvents,
|
|
51
|
+
* typeof rootMessenger,
|
|
52
|
+
* >({
|
|
53
|
+
* namespace: 'PerpsController',
|
|
54
|
+
* parent: rootMessenger,
|
|
55
|
+
* });
|
|
56
|
+
* // Instantiate the controller to register its actions on the messenger
|
|
57
|
+
* new PerpsController({
|
|
58
|
+
* messenger: perpsControllerMessenger,
|
|
59
|
+
* });
|
|
60
|
+
*
|
|
61
|
+
* const perpsControllerState = await rootMessenger.call(
|
|
62
|
+
* 'PerpsController:getState',
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
class PerpsController extends base_controller_1.BaseController {
|
|
67
|
+
/**
|
|
68
|
+
* Constructs a new {@link PerpsController}.
|
|
69
|
+
*
|
|
70
|
+
* @param args - The arguments to this controller.
|
|
71
|
+
* @param args.messenger - The messenger suited for this controller.
|
|
72
|
+
* @param args.state - The desired state with which to initialize this
|
|
73
|
+
* controller. Missing properties will be filled in with defaults.
|
|
74
|
+
*/
|
|
75
|
+
constructor({ messenger, state, }) {
|
|
76
|
+
super({
|
|
77
|
+
messenger,
|
|
78
|
+
metadata: perpsControllerMetadata,
|
|
79
|
+
name: exports.controllerName,
|
|
80
|
+
state: {
|
|
81
|
+
...getDefaultPerpsControllerState(),
|
|
82
|
+
...state,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.PerpsController = PerpsController;
|
|
88
|
+
//# sourceMappingURL=PerpsController.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PerpsController.cjs","sourceRoot":"","sources":["../src/PerpsController.ts"],"names":[],"mappings":";;;AAKA,+DAA2D;AAG3D;;;;GAIG;AACU,QAAA,cAAc,GAAG,iBAAiB,CAAC;AAUhD;;GAEG;AACH,MAAM,uBAAuB,GAC3B,EAAgD,CAAC;AAEnD;;;;;;;GAOG;AACH,SAAgB,8BAA8B;IAC5C,OAAO,EAAE,CAAC;AACZ,CAAC;AAFD,wEAEC;AAiDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAa,eAAgB,SAAQ,gCAIpC;IACC;;;;;;;OAOG;IACH,YAAY,EACV,SAAS,EACT,KAAK,GAIN;QACC,KAAK,CAAC;YACJ,SAAS;YACT,QAAQ,EAAE,uBAAuB;YACjC,IAAI,EAAE,sBAAc;YACpB,KAAK,EAAE;gBACL,GAAG,8BAA8B,EAAE;gBACnC,GAAG,KAAK;aACT;SACF,CAAC,CAAC;IACL,CAAC;CACF;AA9BD,0CA8BC","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n StateMetadata,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { Messenger } from '@metamask/messenger';\n\n/**\n * The name of the {@link PerpsController}, used to namespace the\n * controller's actions and events and to namespace the controller's state data\n * when composed with other controllers.\n */\nexport const controllerName = 'PerpsController';\n\n/**\n * Describes the shape of the state object for {@link PerpsController}.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type PerpsControllerState = {\n // Empty state - to be implemented in future PRs\n};\n\n/**\n * The metadata for each property in {@link PerpsControllerState}.\n */\nconst perpsControllerMetadata =\n {} satisfies StateMetadata<PerpsControllerState>;\n\n/**\n * Constructs the default {@link PerpsController} state. This allows\n * consumers to provide a partial state object when initializing the controller\n * and also helps in constructing complete state objects for this controller in\n * tests.\n *\n * @returns The default {@link PerpsController} state.\n */\nexport function getDefaultPerpsControllerState(): PerpsControllerState {\n return {};\n}\n\n/**\n * Retrieves the state of the {@link PerpsController}.\n */\nexport type PerpsControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n PerpsControllerState\n>;\n\n/**\n * Actions that {@link PerpsControllerMessenger} exposes to other consumers.\n */\nexport type PerpsControllerActions = PerpsControllerGetStateAction;\n\n/**\n * Actions from other messengers that {@link PerpsControllerMessenger} calls.\n */\ntype AllowedActions = never;\n\n/**\n * Published when the state of {@link PerpsController} changes.\n */\nexport type PerpsControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n PerpsControllerState\n>;\n\n/**\n * Events that {@link PerpsControllerMessenger} exposes to other consumers.\n */\nexport type PerpsControllerEvents = PerpsControllerStateChangeEvent;\n\n/**\n * Events from other messengers that {@link PerpsControllerMessenger} subscribes\n * to.\n */\ntype AllowedEvents = never;\n\n/**\n * The messenger restricted to actions and events accessed by\n * {@link PerpsController}.\n */\nexport type PerpsControllerMessenger = Messenger<\n typeof controllerName,\n PerpsControllerActions | AllowedActions,\n PerpsControllerEvents | AllowedEvents\n>;\n\n/**\n * `PerpsController` manages perpetual trading functionality in MetaMask.\n *\n * This controller provides platform-agnostic perps trading capabilities.\n *\n * @example\n *\n * ``` ts\n * import { Messenger } from '@metamask/messenger';\n * import type {\n * PerpsControllerActions,\n * PerpsControllerEvents,\n * } from '@metamask/perps-controller';\n * import { PerpsController } from '@metamask/perps-controller';\n *\n * const rootMessenger = new Messenger<\n * 'Root',\n * PerpsControllerActions,\n * PerpsControllerEvents\n * >({ namespace: 'Root' });\n * const perpsControllerMessenger = new Messenger<\n * 'PerpsController',\n * PerpsControllerActions,\n * PerpsControllerEvents,\n * typeof rootMessenger,\n * >({\n * namespace: 'PerpsController',\n * parent: rootMessenger,\n * });\n * // Instantiate the controller to register its actions on the messenger\n * new PerpsController({\n * messenger: perpsControllerMessenger,\n * });\n *\n * const perpsControllerState = await rootMessenger.call(\n * 'PerpsController:getState',\n * );\n * ```\n */\nexport class PerpsController extends BaseController<\n typeof controllerName,\n PerpsControllerState,\n PerpsControllerMessenger\n> {\n /**\n * Constructs a new {@link PerpsController}.\n *\n * @param args - The arguments to this controller.\n * @param args.messenger - The messenger suited for this controller.\n * @param args.state - The desired state with which to initialize this\n * controller. Missing properties will be filled in with defaults.\n */\n constructor({\n messenger,\n state,\n }: {\n messenger: PerpsControllerMessenger;\n state?: Partial<PerpsControllerState>;\n }) {\n super({\n messenger,\n metadata: perpsControllerMetadata,\n name: controllerName,\n state: {\n ...getDefaultPerpsControllerState(),\n ...state,\n },\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";
|
|
2
|
+
import { BaseController } from "@metamask/base-controller";
|
|
3
|
+
import type { Messenger } from "@metamask/messenger";
|
|
4
|
+
/**
|
|
5
|
+
* The name of the {@link PerpsController}, used to namespace the
|
|
6
|
+
* controller's actions and events and to namespace the controller's state data
|
|
7
|
+
* when composed with other controllers.
|
|
8
|
+
*/
|
|
9
|
+
export declare const controllerName = "PerpsController";
|
|
10
|
+
/**
|
|
11
|
+
* Describes the shape of the state object for {@link PerpsController}.
|
|
12
|
+
*/
|
|
13
|
+
export type PerpsControllerState = {};
|
|
14
|
+
/**
|
|
15
|
+
* Constructs the default {@link PerpsController} state. This allows
|
|
16
|
+
* consumers to provide a partial state object when initializing the controller
|
|
17
|
+
* and also helps in constructing complete state objects for this controller in
|
|
18
|
+
* tests.
|
|
19
|
+
*
|
|
20
|
+
* @returns The default {@link PerpsController} state.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getDefaultPerpsControllerState(): PerpsControllerState;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves the state of the {@link PerpsController}.
|
|
25
|
+
*/
|
|
26
|
+
export type PerpsControllerGetStateAction = ControllerGetStateAction<typeof controllerName, PerpsControllerState>;
|
|
27
|
+
/**
|
|
28
|
+
* Actions that {@link PerpsControllerMessenger} exposes to other consumers.
|
|
29
|
+
*/
|
|
30
|
+
export type PerpsControllerActions = PerpsControllerGetStateAction;
|
|
31
|
+
/**
|
|
32
|
+
* Actions from other messengers that {@link PerpsControllerMessenger} calls.
|
|
33
|
+
*/
|
|
34
|
+
type AllowedActions = never;
|
|
35
|
+
/**
|
|
36
|
+
* Published when the state of {@link PerpsController} changes.
|
|
37
|
+
*/
|
|
38
|
+
export type PerpsControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, PerpsControllerState>;
|
|
39
|
+
/**
|
|
40
|
+
* Events that {@link PerpsControllerMessenger} exposes to other consumers.
|
|
41
|
+
*/
|
|
42
|
+
export type PerpsControllerEvents = PerpsControllerStateChangeEvent;
|
|
43
|
+
/**
|
|
44
|
+
* Events from other messengers that {@link PerpsControllerMessenger} subscribes
|
|
45
|
+
* to.
|
|
46
|
+
*/
|
|
47
|
+
type AllowedEvents = never;
|
|
48
|
+
/**
|
|
49
|
+
* The messenger restricted to actions and events accessed by
|
|
50
|
+
* {@link PerpsController}.
|
|
51
|
+
*/
|
|
52
|
+
export type PerpsControllerMessenger = Messenger<typeof controllerName, PerpsControllerActions | AllowedActions, PerpsControllerEvents | AllowedEvents>;
|
|
53
|
+
/**
|
|
54
|
+
* `PerpsController` manages perpetual trading functionality in MetaMask.
|
|
55
|
+
*
|
|
56
|
+
* This controller provides platform-agnostic perps trading capabilities.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
*
|
|
60
|
+
* ``` ts
|
|
61
|
+
* import { Messenger } from '@metamask/messenger';
|
|
62
|
+
* import type {
|
|
63
|
+
* PerpsControllerActions,
|
|
64
|
+
* PerpsControllerEvents,
|
|
65
|
+
* } from '@metamask/perps-controller';
|
|
66
|
+
* import { PerpsController } from '@metamask/perps-controller';
|
|
67
|
+
*
|
|
68
|
+
* const rootMessenger = new Messenger<
|
|
69
|
+
* 'Root',
|
|
70
|
+
* PerpsControllerActions,
|
|
71
|
+
* PerpsControllerEvents
|
|
72
|
+
* >({ namespace: 'Root' });
|
|
73
|
+
* const perpsControllerMessenger = new Messenger<
|
|
74
|
+
* 'PerpsController',
|
|
75
|
+
* PerpsControllerActions,
|
|
76
|
+
* PerpsControllerEvents,
|
|
77
|
+
* typeof rootMessenger,
|
|
78
|
+
* >({
|
|
79
|
+
* namespace: 'PerpsController',
|
|
80
|
+
* parent: rootMessenger,
|
|
81
|
+
* });
|
|
82
|
+
* // Instantiate the controller to register its actions on the messenger
|
|
83
|
+
* new PerpsController({
|
|
84
|
+
* messenger: perpsControllerMessenger,
|
|
85
|
+
* });
|
|
86
|
+
*
|
|
87
|
+
* const perpsControllerState = await rootMessenger.call(
|
|
88
|
+
* 'PerpsController:getState',
|
|
89
|
+
* );
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare class PerpsController extends BaseController<typeof controllerName, PerpsControllerState, PerpsControllerMessenger> {
|
|
93
|
+
/**
|
|
94
|
+
* Constructs a new {@link PerpsController}.
|
|
95
|
+
*
|
|
96
|
+
* @param args - The arguments to this controller.
|
|
97
|
+
* @param args.messenger - The messenger suited for this controller.
|
|
98
|
+
* @param args.state - The desired state with which to initialize this
|
|
99
|
+
* controller. Missing properties will be filled in with defaults.
|
|
100
|
+
*/
|
|
101
|
+
constructor({ messenger, state, }: {
|
|
102
|
+
messenger: PerpsControllerMessenger;
|
|
103
|
+
state?: Partial<PerpsControllerState>;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export {};
|
|
107
|
+
//# sourceMappingURL=PerpsController.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PerpsController.d.cts","sourceRoot":"","sources":["../src/PerpsController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AAErD;;;;GAIG;AACH,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD;;GAEG;AAEH,MAAM,MAAM,oBAAoB,GAAG,EAElC,CAAC;AAQF;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,IAAI,oBAAoB,CAErE;AAED;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,CAClE,OAAO,cAAc,EACrB,oBAAoB,CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,6BAA6B,CAAC;AAEnE;;GAEG;AACH,KAAK,cAAc,GAAG,KAAK,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,0BAA0B,CACtE,OAAO,cAAc,EACrB,oBAAoB,CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,+BAA+B,CAAC;AAEpE;;;GAGG;AACH,KAAK,aAAa,GAAG,KAAK,CAAC;AAE3B;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAC9C,OAAO,cAAc,EACrB,sBAAsB,GAAG,cAAc,EACvC,qBAAqB,GAAG,aAAa,CACtC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAAa,eAAgB,SAAQ,cAAc,CACjD,OAAO,cAAc,EACrB,oBAAoB,EACpB,wBAAwB,CACzB;IACC;;;;;;;OAOG;gBACS,EACV,SAAS,EACT,KAAK,GACN,EAAE;QACD,SAAS,EAAE,wBAAwB,CAAC;QACpC,KAAK,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;KACvC;CAWF"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";
|
|
2
|
+
import { BaseController } from "@metamask/base-controller";
|
|
3
|
+
import type { Messenger } from "@metamask/messenger";
|
|
4
|
+
/**
|
|
5
|
+
* The name of the {@link PerpsController}, used to namespace the
|
|
6
|
+
* controller's actions and events and to namespace the controller's state data
|
|
7
|
+
* when composed with other controllers.
|
|
8
|
+
*/
|
|
9
|
+
export declare const controllerName = "PerpsController";
|
|
10
|
+
/**
|
|
11
|
+
* Describes the shape of the state object for {@link PerpsController}.
|
|
12
|
+
*/
|
|
13
|
+
export type PerpsControllerState = {};
|
|
14
|
+
/**
|
|
15
|
+
* Constructs the default {@link PerpsController} state. This allows
|
|
16
|
+
* consumers to provide a partial state object when initializing the controller
|
|
17
|
+
* and also helps in constructing complete state objects for this controller in
|
|
18
|
+
* tests.
|
|
19
|
+
*
|
|
20
|
+
* @returns The default {@link PerpsController} state.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getDefaultPerpsControllerState(): PerpsControllerState;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves the state of the {@link PerpsController}.
|
|
25
|
+
*/
|
|
26
|
+
export type PerpsControllerGetStateAction = ControllerGetStateAction<typeof controllerName, PerpsControllerState>;
|
|
27
|
+
/**
|
|
28
|
+
* Actions that {@link PerpsControllerMessenger} exposes to other consumers.
|
|
29
|
+
*/
|
|
30
|
+
export type PerpsControllerActions = PerpsControllerGetStateAction;
|
|
31
|
+
/**
|
|
32
|
+
* Actions from other messengers that {@link PerpsControllerMessenger} calls.
|
|
33
|
+
*/
|
|
34
|
+
type AllowedActions = never;
|
|
35
|
+
/**
|
|
36
|
+
* Published when the state of {@link PerpsController} changes.
|
|
37
|
+
*/
|
|
38
|
+
export type PerpsControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, PerpsControllerState>;
|
|
39
|
+
/**
|
|
40
|
+
* Events that {@link PerpsControllerMessenger} exposes to other consumers.
|
|
41
|
+
*/
|
|
42
|
+
export type PerpsControllerEvents = PerpsControllerStateChangeEvent;
|
|
43
|
+
/**
|
|
44
|
+
* Events from other messengers that {@link PerpsControllerMessenger} subscribes
|
|
45
|
+
* to.
|
|
46
|
+
*/
|
|
47
|
+
type AllowedEvents = never;
|
|
48
|
+
/**
|
|
49
|
+
* The messenger restricted to actions and events accessed by
|
|
50
|
+
* {@link PerpsController}.
|
|
51
|
+
*/
|
|
52
|
+
export type PerpsControllerMessenger = Messenger<typeof controllerName, PerpsControllerActions | AllowedActions, PerpsControllerEvents | AllowedEvents>;
|
|
53
|
+
/**
|
|
54
|
+
* `PerpsController` manages perpetual trading functionality in MetaMask.
|
|
55
|
+
*
|
|
56
|
+
* This controller provides platform-agnostic perps trading capabilities.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
*
|
|
60
|
+
* ``` ts
|
|
61
|
+
* import { Messenger } from '@metamask/messenger';
|
|
62
|
+
* import type {
|
|
63
|
+
* PerpsControllerActions,
|
|
64
|
+
* PerpsControllerEvents,
|
|
65
|
+
* } from '@metamask/perps-controller';
|
|
66
|
+
* import { PerpsController } from '@metamask/perps-controller';
|
|
67
|
+
*
|
|
68
|
+
* const rootMessenger = new Messenger<
|
|
69
|
+
* 'Root',
|
|
70
|
+
* PerpsControllerActions,
|
|
71
|
+
* PerpsControllerEvents
|
|
72
|
+
* >({ namespace: 'Root' });
|
|
73
|
+
* const perpsControllerMessenger = new Messenger<
|
|
74
|
+
* 'PerpsController',
|
|
75
|
+
* PerpsControllerActions,
|
|
76
|
+
* PerpsControllerEvents,
|
|
77
|
+
* typeof rootMessenger,
|
|
78
|
+
* >({
|
|
79
|
+
* namespace: 'PerpsController',
|
|
80
|
+
* parent: rootMessenger,
|
|
81
|
+
* });
|
|
82
|
+
* // Instantiate the controller to register its actions on the messenger
|
|
83
|
+
* new PerpsController({
|
|
84
|
+
* messenger: perpsControllerMessenger,
|
|
85
|
+
* });
|
|
86
|
+
*
|
|
87
|
+
* const perpsControllerState = await rootMessenger.call(
|
|
88
|
+
* 'PerpsController:getState',
|
|
89
|
+
* );
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare class PerpsController extends BaseController<typeof controllerName, PerpsControllerState, PerpsControllerMessenger> {
|
|
93
|
+
/**
|
|
94
|
+
* Constructs a new {@link PerpsController}.
|
|
95
|
+
*
|
|
96
|
+
* @param args - The arguments to this controller.
|
|
97
|
+
* @param args.messenger - The messenger suited for this controller.
|
|
98
|
+
* @param args.state - The desired state with which to initialize this
|
|
99
|
+
* controller. Missing properties will be filled in with defaults.
|
|
100
|
+
*/
|
|
101
|
+
constructor({ messenger, state, }: {
|
|
102
|
+
messenger: PerpsControllerMessenger;
|
|
103
|
+
state?: Partial<PerpsControllerState>;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export {};
|
|
107
|
+
//# sourceMappingURL=PerpsController.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PerpsController.d.mts","sourceRoot":"","sources":["../src/PerpsController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AAErD;;;;GAIG;AACH,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD;;GAEG;AAEH,MAAM,MAAM,oBAAoB,GAAG,EAElC,CAAC;AAQF;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,IAAI,oBAAoB,CAErE;AAED;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,CAClE,OAAO,cAAc,EACrB,oBAAoB,CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,6BAA6B,CAAC;AAEnE;;GAEG;AACH,KAAK,cAAc,GAAG,KAAK,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,0BAA0B,CACtE,OAAO,cAAc,EACrB,oBAAoB,CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,+BAA+B,CAAC;AAEpE;;;GAGG;AACH,KAAK,aAAa,GAAG,KAAK,CAAC;AAE3B;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAC9C,OAAO,cAAc,EACrB,sBAAsB,GAAG,cAAc,EACvC,qBAAqB,GAAG,aAAa,CACtC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAAa,eAAgB,SAAQ,cAAc,CACjD,OAAO,cAAc,EACrB,oBAAoB,EACpB,wBAAwB,CACzB;IACC;;;;;;;OAOG;gBACS,EACV,SAAS,EACT,KAAK,GACN,EAAE;QACD,SAAS,EAAE,wBAAwB,CAAC;QACpC,KAAK,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;KACvC;CAWF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { BaseController } from "@metamask/base-controller";
|
|
2
|
+
/**
|
|
3
|
+
* The name of the {@link PerpsController}, used to namespace the
|
|
4
|
+
* controller's actions and events and to namespace the controller's state data
|
|
5
|
+
* when composed with other controllers.
|
|
6
|
+
*/
|
|
7
|
+
export const controllerName = 'PerpsController';
|
|
8
|
+
/**
|
|
9
|
+
* The metadata for each property in {@link PerpsControllerState}.
|
|
10
|
+
*/
|
|
11
|
+
const perpsControllerMetadata = {};
|
|
12
|
+
/**
|
|
13
|
+
* Constructs the default {@link PerpsController} state. This allows
|
|
14
|
+
* consumers to provide a partial state object when initializing the controller
|
|
15
|
+
* and also helps in constructing complete state objects for this controller in
|
|
16
|
+
* tests.
|
|
17
|
+
*
|
|
18
|
+
* @returns The default {@link PerpsController} state.
|
|
19
|
+
*/
|
|
20
|
+
export function getDefaultPerpsControllerState() {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* `PerpsController` manages perpetual trading functionality in MetaMask.
|
|
25
|
+
*
|
|
26
|
+
* This controller provides platform-agnostic perps trading capabilities.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
*
|
|
30
|
+
* ``` ts
|
|
31
|
+
* import { Messenger } from '@metamask/messenger';
|
|
32
|
+
* import type {
|
|
33
|
+
* PerpsControllerActions,
|
|
34
|
+
* PerpsControllerEvents,
|
|
35
|
+
* } from '@metamask/perps-controller';
|
|
36
|
+
* import { PerpsController } from '@metamask/perps-controller';
|
|
37
|
+
*
|
|
38
|
+
* const rootMessenger = new Messenger<
|
|
39
|
+
* 'Root',
|
|
40
|
+
* PerpsControllerActions,
|
|
41
|
+
* PerpsControllerEvents
|
|
42
|
+
* >({ namespace: 'Root' });
|
|
43
|
+
* const perpsControllerMessenger = new Messenger<
|
|
44
|
+
* 'PerpsController',
|
|
45
|
+
* PerpsControllerActions,
|
|
46
|
+
* PerpsControllerEvents,
|
|
47
|
+
* typeof rootMessenger,
|
|
48
|
+
* >({
|
|
49
|
+
* namespace: 'PerpsController',
|
|
50
|
+
* parent: rootMessenger,
|
|
51
|
+
* });
|
|
52
|
+
* // Instantiate the controller to register its actions on the messenger
|
|
53
|
+
* new PerpsController({
|
|
54
|
+
* messenger: perpsControllerMessenger,
|
|
55
|
+
* });
|
|
56
|
+
*
|
|
57
|
+
* const perpsControllerState = await rootMessenger.call(
|
|
58
|
+
* 'PerpsController:getState',
|
|
59
|
+
* );
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export class PerpsController extends BaseController {
|
|
63
|
+
/**
|
|
64
|
+
* Constructs a new {@link PerpsController}.
|
|
65
|
+
*
|
|
66
|
+
* @param args - The arguments to this controller.
|
|
67
|
+
* @param args.messenger - The messenger suited for this controller.
|
|
68
|
+
* @param args.state - The desired state with which to initialize this
|
|
69
|
+
* controller. Missing properties will be filled in with defaults.
|
|
70
|
+
*/
|
|
71
|
+
constructor({ messenger, state, }) {
|
|
72
|
+
super({
|
|
73
|
+
messenger,
|
|
74
|
+
metadata: perpsControllerMetadata,
|
|
75
|
+
name: controllerName,
|
|
76
|
+
state: {
|
|
77
|
+
...getDefaultPerpsControllerState(),
|
|
78
|
+
...state,
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=PerpsController.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PerpsController.mjs","sourceRoot":"","sources":["../src/PerpsController.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAG3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAUhD;;GAEG;AACH,MAAM,uBAAuB,GAC3B,EAAgD,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,UAAU,8BAA8B;IAC5C,OAAO,EAAE,CAAC;AACZ,CAAC;AAiDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,OAAO,eAAgB,SAAQ,cAIpC;IACC;;;;;;;OAOG;IACH,YAAY,EACV,SAAS,EACT,KAAK,GAIN;QACC,KAAK,CAAC;YACJ,SAAS;YACT,QAAQ,EAAE,uBAAuB;YACjC,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE;gBACL,GAAG,8BAA8B,EAAE;gBACnC,GAAG,KAAK;aACT;SACF,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n StateMetadata,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { Messenger } from '@metamask/messenger';\n\n/**\n * The name of the {@link PerpsController}, used to namespace the\n * controller's actions and events and to namespace the controller's state data\n * when composed with other controllers.\n */\nexport const controllerName = 'PerpsController';\n\n/**\n * Describes the shape of the state object for {@link PerpsController}.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type PerpsControllerState = {\n // Empty state - to be implemented in future PRs\n};\n\n/**\n * The metadata for each property in {@link PerpsControllerState}.\n */\nconst perpsControllerMetadata =\n {} satisfies StateMetadata<PerpsControllerState>;\n\n/**\n * Constructs the default {@link PerpsController} state. This allows\n * consumers to provide a partial state object when initializing the controller\n * and also helps in constructing complete state objects for this controller in\n * tests.\n *\n * @returns The default {@link PerpsController} state.\n */\nexport function getDefaultPerpsControllerState(): PerpsControllerState {\n return {};\n}\n\n/**\n * Retrieves the state of the {@link PerpsController}.\n */\nexport type PerpsControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n PerpsControllerState\n>;\n\n/**\n * Actions that {@link PerpsControllerMessenger} exposes to other consumers.\n */\nexport type PerpsControllerActions = PerpsControllerGetStateAction;\n\n/**\n * Actions from other messengers that {@link PerpsControllerMessenger} calls.\n */\ntype AllowedActions = never;\n\n/**\n * Published when the state of {@link PerpsController} changes.\n */\nexport type PerpsControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n PerpsControllerState\n>;\n\n/**\n * Events that {@link PerpsControllerMessenger} exposes to other consumers.\n */\nexport type PerpsControllerEvents = PerpsControllerStateChangeEvent;\n\n/**\n * Events from other messengers that {@link PerpsControllerMessenger} subscribes\n * to.\n */\ntype AllowedEvents = never;\n\n/**\n * The messenger restricted to actions and events accessed by\n * {@link PerpsController}.\n */\nexport type PerpsControllerMessenger = Messenger<\n typeof controllerName,\n PerpsControllerActions | AllowedActions,\n PerpsControllerEvents | AllowedEvents\n>;\n\n/**\n * `PerpsController` manages perpetual trading functionality in MetaMask.\n *\n * This controller provides platform-agnostic perps trading capabilities.\n *\n * @example\n *\n * ``` ts\n * import { Messenger } from '@metamask/messenger';\n * import type {\n * PerpsControllerActions,\n * PerpsControllerEvents,\n * } from '@metamask/perps-controller';\n * import { PerpsController } from '@metamask/perps-controller';\n *\n * const rootMessenger = new Messenger<\n * 'Root',\n * PerpsControllerActions,\n * PerpsControllerEvents\n * >({ namespace: 'Root' });\n * const perpsControllerMessenger = new Messenger<\n * 'PerpsController',\n * PerpsControllerActions,\n * PerpsControllerEvents,\n * typeof rootMessenger,\n * >({\n * namespace: 'PerpsController',\n * parent: rootMessenger,\n * });\n * // Instantiate the controller to register its actions on the messenger\n * new PerpsController({\n * messenger: perpsControllerMessenger,\n * });\n *\n * const perpsControllerState = await rootMessenger.call(\n * 'PerpsController:getState',\n * );\n * ```\n */\nexport class PerpsController extends BaseController<\n typeof controllerName,\n PerpsControllerState,\n PerpsControllerMessenger\n> {\n /**\n * Constructs a new {@link PerpsController}.\n *\n * @param args - The arguments to this controller.\n * @param args.messenger - The messenger suited for this controller.\n * @param args.state - The desired state with which to initialize this\n * controller. Missing properties will be filled in with defaults.\n */\n constructor({\n messenger,\n state,\n }: {\n messenger: PerpsControllerMessenger;\n state?: Partial<PerpsControllerState>;\n }) {\n super({\n messenger,\n metadata: perpsControllerMetadata,\n name: controllerName,\n state: {\n ...getDefaultPerpsControllerState(),\n ...state,\n },\n });\n }\n}\n"]}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDefaultPerpsControllerState = exports.PerpsController = void 0;
|
|
4
|
+
var PerpsController_1 = require("./PerpsController.cjs");
|
|
5
|
+
Object.defineProperty(exports, "PerpsController", { enumerable: true, get: function () { return PerpsController_1.PerpsController; } });
|
|
6
|
+
Object.defineProperty(exports, "getDefaultPerpsControllerState", { enumerable: true, get: function () { return PerpsController_1.getDefaultPerpsControllerState; } });
|
|
7
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAQA,yDAG2B;AAFzB,kHAAA,eAAe,OAAA;AACf,iIAAA,8BAA8B,OAAA","sourcesContent":["export type {\n PerpsControllerState,\n PerpsControllerGetStateAction,\n PerpsControllerActions,\n PerpsControllerStateChangeEvent,\n PerpsControllerEvents,\n PerpsControllerMessenger,\n} from './PerpsController';\nexport {\n PerpsController,\n getDefaultPerpsControllerState,\n} from './PerpsController';\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { PerpsControllerState, PerpsControllerGetStateAction, PerpsControllerActions, PerpsControllerStateChangeEvent, PerpsControllerEvents, PerpsControllerMessenger, } from "./PerpsController.cjs";
|
|
2
|
+
export { PerpsController, getDefaultPerpsControllerState, } from "./PerpsController.cjs";
|
|
3
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,6BAA6B,EAC7B,sBAAsB,EACtB,+BAA+B,EAC/B,qBAAqB,EACrB,wBAAwB,GACzB,8BAA0B;AAC3B,OAAO,EACL,eAAe,EACf,8BAA8B,GAC/B,8BAA0B"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { PerpsControllerState, PerpsControllerGetStateAction, PerpsControllerActions, PerpsControllerStateChangeEvent, PerpsControllerEvents, PerpsControllerMessenger, } from "./PerpsController.mjs";
|
|
2
|
+
export { PerpsController, getDefaultPerpsControllerState, } from "./PerpsController.mjs";
|
|
3
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,6BAA6B,EAC7B,sBAAsB,EACtB,+BAA+B,EAC/B,qBAAqB,EACrB,wBAAwB,GACzB,8BAA0B;AAC3B,OAAO,EACL,eAAe,EACf,8BAA8B,GAC/B,8BAA0B"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,eAAe,EACf,8BAA8B,EAC/B,8BAA0B","sourcesContent":["export type {\n PerpsControllerState,\n PerpsControllerGetStateAction,\n PerpsControllerActions,\n PerpsControllerStateChangeEvent,\n PerpsControllerEvents,\n PerpsControllerMessenger,\n} from './PerpsController';\nexport {\n PerpsController,\n getDefaultPerpsControllerState,\n} from './PerpsController';\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@metamask-previews/perps-controller",
|
|
3
|
+
"version": "0.0.0-preview-903db2da",
|
|
4
|
+
"description": "Controller for perpetual trading functionality in MetaMask",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"MetaMask",
|
|
7
|
+
"Ethereum"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://github.com/MetaMask/core/tree/main/packages/perps-controller#readme",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/MetaMask/core/issues"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/MetaMask/core.git"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/index.d.mts",
|
|
23
|
+
"default": "./dist/index.mjs"
|
|
24
|
+
},
|
|
25
|
+
"require": {
|
|
26
|
+
"types": "./dist/index.d.cts",
|
|
27
|
+
"default": "./dist/index.cjs"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
"main": "./dist/index.cjs",
|
|
33
|
+
"types": "./dist/index.d.cts",
|
|
34
|
+
"files": [
|
|
35
|
+
"dist/"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "ts-bridge --project tsconfig.build.json --verbose --clean --no-references",
|
|
39
|
+
"build:all": "ts-bridge --project tsconfig.build.json --verbose --clean",
|
|
40
|
+
"build:docs": "typedoc",
|
|
41
|
+
"changelog:update": "../../scripts/update-changelog.sh @metamask/perps-controller",
|
|
42
|
+
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/perps-controller",
|
|
43
|
+
"publish:preview": "yarn npm publish --tag preview",
|
|
44
|
+
"since-latest-release": "../../scripts/since-latest-release.sh",
|
|
45
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
|
|
46
|
+
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
|
|
47
|
+
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
|
|
48
|
+
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@metamask/base-controller": "^9.0.0",
|
|
52
|
+
"@metamask/controller-utils": "^11.18.0",
|
|
53
|
+
"@metamask/messenger": "^0.3.0",
|
|
54
|
+
"@metamask/utils": "^11.9.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@metamask/auto-changelog": "^3.4.4",
|
|
58
|
+
"@ts-bridge/cli": "^0.6.4",
|
|
59
|
+
"@types/jest": "^27.4.1",
|
|
60
|
+
"deepmerge": "^4.2.2",
|
|
61
|
+
"jest": "^27.5.1",
|
|
62
|
+
"ts-jest": "^27.1.4",
|
|
63
|
+
"typedoc": "^0.24.8",
|
|
64
|
+
"typedoc-plugin-missing-exports": "^2.0.0",
|
|
65
|
+
"typescript": "~5.3.3"
|
|
66
|
+
},
|
|
67
|
+
"engines": {
|
|
68
|
+
"node": "^18.18 || >=20"
|
|
69
|
+
},
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"access": "public",
|
|
72
|
+
"registry": "https://registry.npmjs.org/"
|
|
73
|
+
}
|
|
74
|
+
}
|