@metamask-previews/assets-controller 0.0.0-preview-f5ec6061
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 +20 -0
- package/README.md +15 -0
- package/dist/AssetsController.cjs +89 -0
- package/dist/AssetsController.cjs.map +1 -0
- package/dist/AssetsController.d.cts +108 -0
- package/dist/AssetsController.d.cts.map +1 -0
- package/dist/AssetsController.d.mts +108 -0
- package/dist/AssetsController.d.mts.map +1 -0
- package/dist/AssetsController.mjs +84 -0
- package/dist/AssetsController.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 +72 -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 ([#7587](https://github.com/MetaMask/core/pull/7587))
|
|
13
|
+
|
|
14
|
+
[Unreleased]: https://github.com/MetaMask/core/
|
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# `@metamask/assets-controller`
|
|
2
|
+
|
|
3
|
+
Tracks assets balances/prices and handles token detection across all digital assets.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
`yarn add @metamask/assets-controller`
|
|
8
|
+
|
|
9
|
+
or
|
|
10
|
+
|
|
11
|
+
`npm install @metamask/assets-controller`
|
|
12
|
+
|
|
13
|
+
## Contributing
|
|
14
|
+
|
|
15
|
+
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,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssetsController = exports.getDefaultAssetsControllerState = exports.controllerName = void 0;
|
|
4
|
+
const base_controller_1 = require("@metamask/base-controller");
|
|
5
|
+
/**
|
|
6
|
+
* The name of the {@link AssetsController}, 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 = 'AssetsController';
|
|
11
|
+
/**
|
|
12
|
+
* The metadata for each property in {@link AssetsControllerState}.
|
|
13
|
+
*/
|
|
14
|
+
const assetsControllerMetadata = {};
|
|
15
|
+
/**
|
|
16
|
+
* Constructs the default {@link AssetsController} 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 AssetsController} state.
|
|
22
|
+
*/
|
|
23
|
+
function getDefaultAssetsControllerState() {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
exports.getDefaultAssetsControllerState = getDefaultAssetsControllerState;
|
|
27
|
+
/**
|
|
28
|
+
* `AssetsController` manages asset tracking for accounts.
|
|
29
|
+
*
|
|
30
|
+
* This controller is a placeholder for future consolidation of asset tracking
|
|
31
|
+
* functionality including account balances, token balances, and asset detection.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
*
|
|
35
|
+
* ``` ts
|
|
36
|
+
* import { Messenger } from '@metamask/messenger';
|
|
37
|
+
* import type {
|
|
38
|
+
* AssetsControllerActions,
|
|
39
|
+
* AssetsControllerEvents,
|
|
40
|
+
* } from '@metamask/assets-controller';
|
|
41
|
+
* import { AssetsController } from '@metamask/assets-controller';
|
|
42
|
+
*
|
|
43
|
+
* const rootMessenger = new Messenger<
|
|
44
|
+
* 'Root',
|
|
45
|
+
* AssetsControllerActions,
|
|
46
|
+
* AssetsControllerEvents
|
|
47
|
+
* >({ namespace: 'Root' });
|
|
48
|
+
* const assetsControllerMessenger = new Messenger<
|
|
49
|
+
* 'AssetsController',
|
|
50
|
+
* AssetsControllerActions,
|
|
51
|
+
* AssetsControllerEvents,
|
|
52
|
+
* typeof rootMessenger,
|
|
53
|
+
* >({
|
|
54
|
+
* namespace: 'AssetsController',
|
|
55
|
+
* parent: rootMessenger,
|
|
56
|
+
* });
|
|
57
|
+
* // Instantiate the controller to register its actions on the messenger
|
|
58
|
+
* new AssetsController({
|
|
59
|
+
* messenger: assetsControllerMessenger,
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* const assetsControllerState = await rootMessenger.call(
|
|
63
|
+
* 'AssetsController:getState',
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
class AssetsController extends base_controller_1.BaseController {
|
|
68
|
+
/**
|
|
69
|
+
* Constructs a new {@link AssetsController}.
|
|
70
|
+
*
|
|
71
|
+
* @param args - The arguments to this controller.
|
|
72
|
+
* @param args.messenger - The messenger suited for this controller.
|
|
73
|
+
* @param args.state - The desired state with which to initialize this
|
|
74
|
+
* controller. Missing properties will be filled in with defaults.
|
|
75
|
+
*/
|
|
76
|
+
constructor({ messenger, state, }) {
|
|
77
|
+
super({
|
|
78
|
+
messenger,
|
|
79
|
+
metadata: assetsControllerMetadata,
|
|
80
|
+
name: exports.controllerName,
|
|
81
|
+
state: {
|
|
82
|
+
...getDefaultAssetsControllerState(),
|
|
83
|
+
...state,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.AssetsController = AssetsController;
|
|
89
|
+
//# sourceMappingURL=AssetsController.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssetsController.cjs","sourceRoot":"","sources":["../src/AssetsController.ts"],"names":[],"mappings":";;;AAKA,+DAA2D;AAG3D;;;;GAIG;AACU,QAAA,cAAc,GAAG,kBAAkB,CAAC;AAgBjD;;GAEG;AACH,MAAM,wBAAwB,GAC5B,EAAiD,CAAC;AAEpD;;;;;;;GAOG;AACH,SAAgB,+BAA+B;IAC7C,OAAO,EAAE,CAAC;AACZ,CAAC;AAFD,0EAEC;AAiDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAa,gBAAiB,SAAQ,gCAIrC;IACC;;;;;;;OAOG;IACH,YAAY,EACV,SAAS,EACT,KAAK,GAIN;QACC,KAAK,CAAC;YACJ,SAAS;YACT,QAAQ,EAAE,wBAAwB;YAClC,IAAI,EAAE,sBAAc;YACpB,KAAK,EAAE;gBACL,GAAG,+BAA+B,EAAE;gBACpC,GAAG,KAAK;aACT;SACF,CAAC,CAAC;IACL,CAAC;CACF;AA9BD,4CA8BC","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 AssetsController}, 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 = 'AssetsController';\n\n// TODO: Implement AssetsController - the goal is to split and consolidate the old one\n// This controller will consolidate asset tracking functionality including:\n// - Account balance tracking\n// - Token balance tracking\n// - Asset detection\n\n/**\n * Describes the shape of the state object for {@link AssetsController}.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type AssetsControllerState = {\n // Empty state - to be implemented\n};\n\n/**\n * The metadata for each property in {@link AssetsControllerState}.\n */\nconst assetsControllerMetadata =\n {} satisfies StateMetadata<AssetsControllerState>;\n\n/**\n * Constructs the default {@link AssetsController} 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 AssetsController} state.\n */\nexport function getDefaultAssetsControllerState(): AssetsControllerState {\n return {};\n}\n\n/**\n * Retrieves the state of the {@link AssetsController}.\n */\nexport type AssetsControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n AssetsControllerState\n>;\n\n/**\n * Actions that {@link AssetsControllerMessenger} exposes to other consumers.\n */\nexport type AssetsControllerActions = AssetsControllerGetStateAction;\n\n/**\n * Actions from other messengers that {@link AssetsControllerMessenger} calls.\n */\ntype AllowedActions = never;\n\n/**\n * Published when the state of {@link AssetsController} changes.\n */\nexport type AssetsControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n AssetsControllerState\n>;\n\n/**\n * Events that {@link AssetsControllerMessenger} exposes to other consumers.\n */\nexport type AssetsControllerEvents = AssetsControllerStateChangeEvent;\n\n/**\n * Events from other messengers that {@link AssetsControllerMessenger} subscribes\n * to.\n */\ntype AllowedEvents = never;\n\n/**\n * The messenger restricted to actions and events accessed by\n * {@link AssetsController}.\n */\nexport type AssetsControllerMessenger = Messenger<\n typeof controllerName,\n AssetsControllerActions | AllowedActions,\n AssetsControllerEvents | AllowedEvents\n>;\n\n/**\n * `AssetsController` manages asset tracking for accounts.\n *\n * This controller is a placeholder for future consolidation of asset tracking\n * functionality including account balances, token balances, and asset detection.\n *\n * @example\n *\n * ``` ts\n * import { Messenger } from '@metamask/messenger';\n * import type {\n * AssetsControllerActions,\n * AssetsControllerEvents,\n * } from '@metamask/assets-controller';\n * import { AssetsController } from '@metamask/assets-controller';\n *\n * const rootMessenger = new Messenger<\n * 'Root',\n * AssetsControllerActions,\n * AssetsControllerEvents\n * >({ namespace: 'Root' });\n * const assetsControllerMessenger = new Messenger<\n * 'AssetsController',\n * AssetsControllerActions,\n * AssetsControllerEvents,\n * typeof rootMessenger,\n * >({\n * namespace: 'AssetsController',\n * parent: rootMessenger,\n * });\n * // Instantiate the controller to register its actions on the messenger\n * new AssetsController({\n * messenger: assetsControllerMessenger,\n * });\n *\n * const assetsControllerState = await rootMessenger.call(\n * 'AssetsController:getState',\n * );\n * ```\n */\nexport class AssetsController extends BaseController<\n typeof controllerName,\n AssetsControllerState,\n AssetsControllerMessenger\n> {\n /**\n * Constructs a new {@link AssetsController}.\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: AssetsControllerMessenger;\n state?: Partial<AssetsControllerState>;\n }) {\n super({\n messenger,\n metadata: assetsControllerMetadata,\n name: controllerName,\n state: {\n ...getDefaultAssetsControllerState(),\n ...state,\n },\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,108 @@
|
|
|
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 AssetsController}, 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 = "AssetsController";
|
|
10
|
+
/**
|
|
11
|
+
* Describes the shape of the state object for {@link AssetsController}.
|
|
12
|
+
*/
|
|
13
|
+
export type AssetsControllerState = {};
|
|
14
|
+
/**
|
|
15
|
+
* Constructs the default {@link AssetsController} 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 AssetsController} state.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getDefaultAssetsControllerState(): AssetsControllerState;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves the state of the {@link AssetsController}.
|
|
25
|
+
*/
|
|
26
|
+
export type AssetsControllerGetStateAction = ControllerGetStateAction<typeof controllerName, AssetsControllerState>;
|
|
27
|
+
/**
|
|
28
|
+
* Actions that {@link AssetsControllerMessenger} exposes to other consumers.
|
|
29
|
+
*/
|
|
30
|
+
export type AssetsControllerActions = AssetsControllerGetStateAction;
|
|
31
|
+
/**
|
|
32
|
+
* Actions from other messengers that {@link AssetsControllerMessenger} calls.
|
|
33
|
+
*/
|
|
34
|
+
type AllowedActions = never;
|
|
35
|
+
/**
|
|
36
|
+
* Published when the state of {@link AssetsController} changes.
|
|
37
|
+
*/
|
|
38
|
+
export type AssetsControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, AssetsControllerState>;
|
|
39
|
+
/**
|
|
40
|
+
* Events that {@link AssetsControllerMessenger} exposes to other consumers.
|
|
41
|
+
*/
|
|
42
|
+
export type AssetsControllerEvents = AssetsControllerStateChangeEvent;
|
|
43
|
+
/**
|
|
44
|
+
* Events from other messengers that {@link AssetsControllerMessenger} subscribes
|
|
45
|
+
* to.
|
|
46
|
+
*/
|
|
47
|
+
type AllowedEvents = never;
|
|
48
|
+
/**
|
|
49
|
+
* The messenger restricted to actions and events accessed by
|
|
50
|
+
* {@link AssetsController}.
|
|
51
|
+
*/
|
|
52
|
+
export type AssetsControllerMessenger = Messenger<typeof controllerName, AssetsControllerActions | AllowedActions, AssetsControllerEvents | AllowedEvents>;
|
|
53
|
+
/**
|
|
54
|
+
* `AssetsController` manages asset tracking for accounts.
|
|
55
|
+
*
|
|
56
|
+
* This controller is a placeholder for future consolidation of asset tracking
|
|
57
|
+
* functionality including account balances, token balances, and asset detection.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
*
|
|
61
|
+
* ``` ts
|
|
62
|
+
* import { Messenger } from '@metamask/messenger';
|
|
63
|
+
* import type {
|
|
64
|
+
* AssetsControllerActions,
|
|
65
|
+
* AssetsControllerEvents,
|
|
66
|
+
* } from '@metamask/assets-controller';
|
|
67
|
+
* import { AssetsController } from '@metamask/assets-controller';
|
|
68
|
+
*
|
|
69
|
+
* const rootMessenger = new Messenger<
|
|
70
|
+
* 'Root',
|
|
71
|
+
* AssetsControllerActions,
|
|
72
|
+
* AssetsControllerEvents
|
|
73
|
+
* >({ namespace: 'Root' });
|
|
74
|
+
* const assetsControllerMessenger = new Messenger<
|
|
75
|
+
* 'AssetsController',
|
|
76
|
+
* AssetsControllerActions,
|
|
77
|
+
* AssetsControllerEvents,
|
|
78
|
+
* typeof rootMessenger,
|
|
79
|
+
* >({
|
|
80
|
+
* namespace: 'AssetsController',
|
|
81
|
+
* parent: rootMessenger,
|
|
82
|
+
* });
|
|
83
|
+
* // Instantiate the controller to register its actions on the messenger
|
|
84
|
+
* new AssetsController({
|
|
85
|
+
* messenger: assetsControllerMessenger,
|
|
86
|
+
* });
|
|
87
|
+
*
|
|
88
|
+
* const assetsControllerState = await rootMessenger.call(
|
|
89
|
+
* 'AssetsController:getState',
|
|
90
|
+
* );
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare class AssetsController extends BaseController<typeof controllerName, AssetsControllerState, AssetsControllerMessenger> {
|
|
94
|
+
/**
|
|
95
|
+
* Constructs a new {@link AssetsController}.
|
|
96
|
+
*
|
|
97
|
+
* @param args - The arguments to this controller.
|
|
98
|
+
* @param args.messenger - The messenger suited for this controller.
|
|
99
|
+
* @param args.state - The desired state with which to initialize this
|
|
100
|
+
* controller. Missing properties will be filled in with defaults.
|
|
101
|
+
*/
|
|
102
|
+
constructor({ messenger, state, }: {
|
|
103
|
+
messenger: AssetsControllerMessenger;
|
|
104
|
+
state?: Partial<AssetsControllerState>;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
export {};
|
|
108
|
+
//# sourceMappingURL=AssetsController.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssetsController.d.cts","sourceRoot":"","sources":["../src/AssetsController.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,qBAAqB,CAAC;AAQjD;;GAEG;AAEH,MAAM,MAAM,qBAAqB,GAAG,EAEnC,CAAC;AAQF;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,IAAI,qBAAqB,CAEvE;AAED;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,wBAAwB,CACnE,OAAO,cAAc,EACrB,qBAAqB,CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAErE;;GAEG;AACH,KAAK,cAAc,GAAG,KAAK,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG,0BAA0B,CACvE,OAAO,cAAc,EACrB,qBAAqB,CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,gCAAgC,CAAC;AAEtE;;;GAGG;AACH,KAAK,aAAa,GAAG,KAAK,CAAC;AAE3B;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,SAAS,CAC/C,OAAO,cAAc,EACrB,uBAAuB,GAAG,cAAc,EACxC,sBAAsB,GAAG,aAAa,CACvC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,qBAAa,gBAAiB,SAAQ,cAAc,CAClD,OAAO,cAAc,EACrB,qBAAqB,EACrB,yBAAyB,CAC1B;IACC;;;;;;;OAOG;gBACS,EACV,SAAS,EACT,KAAK,GACN,EAAE;QACD,SAAS,EAAE,yBAAyB,CAAC;QACrC,KAAK,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;KACxC;CAWF"}
|
|
@@ -0,0 +1,108 @@
|
|
|
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 AssetsController}, 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 = "AssetsController";
|
|
10
|
+
/**
|
|
11
|
+
* Describes the shape of the state object for {@link AssetsController}.
|
|
12
|
+
*/
|
|
13
|
+
export type AssetsControllerState = {};
|
|
14
|
+
/**
|
|
15
|
+
* Constructs the default {@link AssetsController} 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 AssetsController} state.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getDefaultAssetsControllerState(): AssetsControllerState;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves the state of the {@link AssetsController}.
|
|
25
|
+
*/
|
|
26
|
+
export type AssetsControllerGetStateAction = ControllerGetStateAction<typeof controllerName, AssetsControllerState>;
|
|
27
|
+
/**
|
|
28
|
+
* Actions that {@link AssetsControllerMessenger} exposes to other consumers.
|
|
29
|
+
*/
|
|
30
|
+
export type AssetsControllerActions = AssetsControllerGetStateAction;
|
|
31
|
+
/**
|
|
32
|
+
* Actions from other messengers that {@link AssetsControllerMessenger} calls.
|
|
33
|
+
*/
|
|
34
|
+
type AllowedActions = never;
|
|
35
|
+
/**
|
|
36
|
+
* Published when the state of {@link AssetsController} changes.
|
|
37
|
+
*/
|
|
38
|
+
export type AssetsControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, AssetsControllerState>;
|
|
39
|
+
/**
|
|
40
|
+
* Events that {@link AssetsControllerMessenger} exposes to other consumers.
|
|
41
|
+
*/
|
|
42
|
+
export type AssetsControllerEvents = AssetsControllerStateChangeEvent;
|
|
43
|
+
/**
|
|
44
|
+
* Events from other messengers that {@link AssetsControllerMessenger} subscribes
|
|
45
|
+
* to.
|
|
46
|
+
*/
|
|
47
|
+
type AllowedEvents = never;
|
|
48
|
+
/**
|
|
49
|
+
* The messenger restricted to actions and events accessed by
|
|
50
|
+
* {@link AssetsController}.
|
|
51
|
+
*/
|
|
52
|
+
export type AssetsControllerMessenger = Messenger<typeof controllerName, AssetsControllerActions | AllowedActions, AssetsControllerEvents | AllowedEvents>;
|
|
53
|
+
/**
|
|
54
|
+
* `AssetsController` manages asset tracking for accounts.
|
|
55
|
+
*
|
|
56
|
+
* This controller is a placeholder for future consolidation of asset tracking
|
|
57
|
+
* functionality including account balances, token balances, and asset detection.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
*
|
|
61
|
+
* ``` ts
|
|
62
|
+
* import { Messenger } from '@metamask/messenger';
|
|
63
|
+
* import type {
|
|
64
|
+
* AssetsControllerActions,
|
|
65
|
+
* AssetsControllerEvents,
|
|
66
|
+
* } from '@metamask/assets-controller';
|
|
67
|
+
* import { AssetsController } from '@metamask/assets-controller';
|
|
68
|
+
*
|
|
69
|
+
* const rootMessenger = new Messenger<
|
|
70
|
+
* 'Root',
|
|
71
|
+
* AssetsControllerActions,
|
|
72
|
+
* AssetsControllerEvents
|
|
73
|
+
* >({ namespace: 'Root' });
|
|
74
|
+
* const assetsControllerMessenger = new Messenger<
|
|
75
|
+
* 'AssetsController',
|
|
76
|
+
* AssetsControllerActions,
|
|
77
|
+
* AssetsControllerEvents,
|
|
78
|
+
* typeof rootMessenger,
|
|
79
|
+
* >({
|
|
80
|
+
* namespace: 'AssetsController',
|
|
81
|
+
* parent: rootMessenger,
|
|
82
|
+
* });
|
|
83
|
+
* // Instantiate the controller to register its actions on the messenger
|
|
84
|
+
* new AssetsController({
|
|
85
|
+
* messenger: assetsControllerMessenger,
|
|
86
|
+
* });
|
|
87
|
+
*
|
|
88
|
+
* const assetsControllerState = await rootMessenger.call(
|
|
89
|
+
* 'AssetsController:getState',
|
|
90
|
+
* );
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare class AssetsController extends BaseController<typeof controllerName, AssetsControllerState, AssetsControllerMessenger> {
|
|
94
|
+
/**
|
|
95
|
+
* Constructs a new {@link AssetsController}.
|
|
96
|
+
*
|
|
97
|
+
* @param args - The arguments to this controller.
|
|
98
|
+
* @param args.messenger - The messenger suited for this controller.
|
|
99
|
+
* @param args.state - The desired state with which to initialize this
|
|
100
|
+
* controller. Missing properties will be filled in with defaults.
|
|
101
|
+
*/
|
|
102
|
+
constructor({ messenger, state, }: {
|
|
103
|
+
messenger: AssetsControllerMessenger;
|
|
104
|
+
state?: Partial<AssetsControllerState>;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
export {};
|
|
108
|
+
//# sourceMappingURL=AssetsController.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssetsController.d.mts","sourceRoot":"","sources":["../src/AssetsController.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,qBAAqB,CAAC;AAQjD;;GAEG;AAEH,MAAM,MAAM,qBAAqB,GAAG,EAEnC,CAAC;AAQF;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,IAAI,qBAAqB,CAEvE;AAED;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,wBAAwB,CACnE,OAAO,cAAc,EACrB,qBAAqB,CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAErE;;GAEG;AACH,KAAK,cAAc,GAAG,KAAK,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG,0BAA0B,CACvE,OAAO,cAAc,EACrB,qBAAqB,CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,gCAAgC,CAAC;AAEtE;;;GAGG;AACH,KAAK,aAAa,GAAG,KAAK,CAAC;AAE3B;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,SAAS,CAC/C,OAAO,cAAc,EACrB,uBAAuB,GAAG,cAAc,EACxC,sBAAsB,GAAG,aAAa,CACvC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,qBAAa,gBAAiB,SAAQ,cAAc,CAClD,OAAO,cAAc,EACrB,qBAAqB,EACrB,yBAAyB,CAC1B;IACC;;;;;;;OAOG;gBACS,EACV,SAAS,EACT,KAAK,GACN,EAAE;QACD,SAAS,EAAE,yBAAyB,CAAC;QACrC,KAAK,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;KACxC;CAWF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { BaseController } from "@metamask/base-controller";
|
|
2
|
+
/**
|
|
3
|
+
* The name of the {@link AssetsController}, 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 = 'AssetsController';
|
|
8
|
+
/**
|
|
9
|
+
* The metadata for each property in {@link AssetsControllerState}.
|
|
10
|
+
*/
|
|
11
|
+
const assetsControllerMetadata = {};
|
|
12
|
+
/**
|
|
13
|
+
* Constructs the default {@link AssetsController} 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 AssetsController} state.
|
|
19
|
+
*/
|
|
20
|
+
export function getDefaultAssetsControllerState() {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* `AssetsController` manages asset tracking for accounts.
|
|
25
|
+
*
|
|
26
|
+
* This controller is a placeholder for future consolidation of asset tracking
|
|
27
|
+
* functionality including account balances, token balances, and asset detection.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
*
|
|
31
|
+
* ``` ts
|
|
32
|
+
* import { Messenger } from '@metamask/messenger';
|
|
33
|
+
* import type {
|
|
34
|
+
* AssetsControllerActions,
|
|
35
|
+
* AssetsControllerEvents,
|
|
36
|
+
* } from '@metamask/assets-controller';
|
|
37
|
+
* import { AssetsController } from '@metamask/assets-controller';
|
|
38
|
+
*
|
|
39
|
+
* const rootMessenger = new Messenger<
|
|
40
|
+
* 'Root',
|
|
41
|
+
* AssetsControllerActions,
|
|
42
|
+
* AssetsControllerEvents
|
|
43
|
+
* >({ namespace: 'Root' });
|
|
44
|
+
* const assetsControllerMessenger = new Messenger<
|
|
45
|
+
* 'AssetsController',
|
|
46
|
+
* AssetsControllerActions,
|
|
47
|
+
* AssetsControllerEvents,
|
|
48
|
+
* typeof rootMessenger,
|
|
49
|
+
* >({
|
|
50
|
+
* namespace: 'AssetsController',
|
|
51
|
+
* parent: rootMessenger,
|
|
52
|
+
* });
|
|
53
|
+
* // Instantiate the controller to register its actions on the messenger
|
|
54
|
+
* new AssetsController({
|
|
55
|
+
* messenger: assetsControllerMessenger,
|
|
56
|
+
* });
|
|
57
|
+
*
|
|
58
|
+
* const assetsControllerState = await rootMessenger.call(
|
|
59
|
+
* 'AssetsController:getState',
|
|
60
|
+
* );
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export class AssetsController extends BaseController {
|
|
64
|
+
/**
|
|
65
|
+
* Constructs a new {@link AssetsController}.
|
|
66
|
+
*
|
|
67
|
+
* @param args - The arguments to this controller.
|
|
68
|
+
* @param args.messenger - The messenger suited for this controller.
|
|
69
|
+
* @param args.state - The desired state with which to initialize this
|
|
70
|
+
* controller. Missing properties will be filled in with defaults.
|
|
71
|
+
*/
|
|
72
|
+
constructor({ messenger, state, }) {
|
|
73
|
+
super({
|
|
74
|
+
messenger,
|
|
75
|
+
metadata: assetsControllerMetadata,
|
|
76
|
+
name: controllerName,
|
|
77
|
+
state: {
|
|
78
|
+
...getDefaultAssetsControllerState(),
|
|
79
|
+
...state,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=AssetsController.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssetsController.mjs","sourceRoot":"","sources":["../src/AssetsController.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAG3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAgBjD;;GAEG;AACH,MAAM,wBAAwB,GAC5B,EAAiD,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,UAAU,+BAA+B;IAC7C,OAAO,EAAE,CAAC;AACZ,CAAC;AAiDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,OAAO,gBAAiB,SAAQ,cAIrC;IACC;;;;;;;OAOG;IACH,YAAY,EACV,SAAS,EACT,KAAK,GAIN;QACC,KAAK,CAAC;YACJ,SAAS;YACT,QAAQ,EAAE,wBAAwB;YAClC,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE;gBACL,GAAG,+BAA+B,EAAE;gBACpC,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 AssetsController}, 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 = 'AssetsController';\n\n// TODO: Implement AssetsController - the goal is to split and consolidate the old one\n// This controller will consolidate asset tracking functionality including:\n// - Account balance tracking\n// - Token balance tracking\n// - Asset detection\n\n/**\n * Describes the shape of the state object for {@link AssetsController}.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type AssetsControllerState = {\n // Empty state - to be implemented\n};\n\n/**\n * The metadata for each property in {@link AssetsControllerState}.\n */\nconst assetsControllerMetadata =\n {} satisfies StateMetadata<AssetsControllerState>;\n\n/**\n * Constructs the default {@link AssetsController} 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 AssetsController} state.\n */\nexport function getDefaultAssetsControllerState(): AssetsControllerState {\n return {};\n}\n\n/**\n * Retrieves the state of the {@link AssetsController}.\n */\nexport type AssetsControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n AssetsControllerState\n>;\n\n/**\n * Actions that {@link AssetsControllerMessenger} exposes to other consumers.\n */\nexport type AssetsControllerActions = AssetsControllerGetStateAction;\n\n/**\n * Actions from other messengers that {@link AssetsControllerMessenger} calls.\n */\ntype AllowedActions = never;\n\n/**\n * Published when the state of {@link AssetsController} changes.\n */\nexport type AssetsControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n AssetsControllerState\n>;\n\n/**\n * Events that {@link AssetsControllerMessenger} exposes to other consumers.\n */\nexport type AssetsControllerEvents = AssetsControllerStateChangeEvent;\n\n/**\n * Events from other messengers that {@link AssetsControllerMessenger} subscribes\n * to.\n */\ntype AllowedEvents = never;\n\n/**\n * The messenger restricted to actions and events accessed by\n * {@link AssetsController}.\n */\nexport type AssetsControllerMessenger = Messenger<\n typeof controllerName,\n AssetsControllerActions | AllowedActions,\n AssetsControllerEvents | AllowedEvents\n>;\n\n/**\n * `AssetsController` manages asset tracking for accounts.\n *\n * This controller is a placeholder for future consolidation of asset tracking\n * functionality including account balances, token balances, and asset detection.\n *\n * @example\n *\n * ``` ts\n * import { Messenger } from '@metamask/messenger';\n * import type {\n * AssetsControllerActions,\n * AssetsControllerEvents,\n * } from '@metamask/assets-controller';\n * import { AssetsController } from '@metamask/assets-controller';\n *\n * const rootMessenger = new Messenger<\n * 'Root',\n * AssetsControllerActions,\n * AssetsControllerEvents\n * >({ namespace: 'Root' });\n * const assetsControllerMessenger = new Messenger<\n * 'AssetsController',\n * AssetsControllerActions,\n * AssetsControllerEvents,\n * typeof rootMessenger,\n * >({\n * namespace: 'AssetsController',\n * parent: rootMessenger,\n * });\n * // Instantiate the controller to register its actions on the messenger\n * new AssetsController({\n * messenger: assetsControllerMessenger,\n * });\n *\n * const assetsControllerState = await rootMessenger.call(\n * 'AssetsController:getState',\n * );\n * ```\n */\nexport class AssetsController extends BaseController<\n typeof controllerName,\n AssetsControllerState,\n AssetsControllerMessenger\n> {\n /**\n * Constructs a new {@link AssetsController}.\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: AssetsControllerMessenger;\n state?: Partial<AssetsControllerState>;\n }) {\n super({\n messenger,\n metadata: assetsControllerMetadata,\n name: controllerName,\n state: {\n ...getDefaultAssetsControllerState(),\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.getDefaultAssetsControllerState = exports.AssetsController = void 0;
|
|
4
|
+
var AssetsController_1 = require("./AssetsController.cjs");
|
|
5
|
+
Object.defineProperty(exports, "AssetsController", { enumerable: true, get: function () { return AssetsController_1.AssetsController; } });
|
|
6
|
+
Object.defineProperty(exports, "getDefaultAssetsControllerState", { enumerable: true, get: function () { return AssetsController_1.getDefaultAssetsControllerState; } });
|
|
7
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAQA,2DAG4B;AAF1B,oHAAA,gBAAgB,OAAA;AAChB,mIAAA,+BAA+B,OAAA","sourcesContent":["export type {\n AssetsControllerState,\n AssetsControllerGetStateAction,\n AssetsControllerActions,\n AssetsControllerStateChangeEvent,\n AssetsControllerEvents,\n AssetsControllerMessenger,\n} from './AssetsController';\nexport {\n AssetsController,\n getDefaultAssetsControllerState,\n} from './AssetsController';\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { AssetsControllerState, AssetsControllerGetStateAction, AssetsControllerActions, AssetsControllerStateChangeEvent, AssetsControllerEvents, AssetsControllerMessenger, } from "./AssetsController.cjs";
|
|
2
|
+
export { AssetsController, getDefaultAssetsControllerState, } from "./AssetsController.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,qBAAqB,EACrB,8BAA8B,EAC9B,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,EACtB,yBAAyB,GAC1B,+BAA2B;AAC5B,OAAO,EACL,gBAAgB,EAChB,+BAA+B,GAChC,+BAA2B"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { AssetsControllerState, AssetsControllerGetStateAction, AssetsControllerActions, AssetsControllerStateChangeEvent, AssetsControllerEvents, AssetsControllerMessenger, } from "./AssetsController.mjs";
|
|
2
|
+
export { AssetsController, getDefaultAssetsControllerState, } from "./AssetsController.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,qBAAqB,EACrB,8BAA8B,EAC9B,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,EACtB,yBAAyB,GAC1B,+BAA2B;AAC5B,OAAO,EACL,gBAAgB,EAChB,+BAA+B,GAChC,+BAA2B"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,gBAAgB,EAChB,+BAA+B,EAChC,+BAA2B","sourcesContent":["export type {\n AssetsControllerState,\n AssetsControllerGetStateAction,\n AssetsControllerActions,\n AssetsControllerStateChangeEvent,\n AssetsControllerEvents,\n AssetsControllerMessenger,\n} from './AssetsController';\nexport {\n AssetsController,\n getDefaultAssetsControllerState,\n} from './AssetsController';\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@metamask-previews/assets-controller",
|
|
3
|
+
"version": "0.0.0-preview-f5ec6061",
|
|
4
|
+
"description": "Tracks assets balances/prices and handles token detection across all digital assets",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"MetaMask",
|
|
7
|
+
"Ethereum"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://github.com/MetaMask/core/tree/main/packages/assets-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/assets-controller",
|
|
42
|
+
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/assets-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/messenger": "^0.3.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@metamask/auto-changelog": "^3.4.4",
|
|
56
|
+
"@ts-bridge/cli": "^0.6.4",
|
|
57
|
+
"@types/jest": "^27.4.1",
|
|
58
|
+
"deepmerge": "^4.2.2",
|
|
59
|
+
"jest": "^27.5.1",
|
|
60
|
+
"ts-jest": "^27.1.4",
|
|
61
|
+
"typedoc": "^0.24.8",
|
|
62
|
+
"typedoc-plugin-missing-exports": "^2.0.0",
|
|
63
|
+
"typescript": "~5.3.3"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": "^18.18 || >=20"
|
|
67
|
+
},
|
|
68
|
+
"publishConfig": {
|
|
69
|
+
"access": "public",
|
|
70
|
+
"registry": "https://registry.npmjs.org/"
|
|
71
|
+
}
|
|
72
|
+
}
|