Skip to content

feat: add multichain-account-service (readonly) #6141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d0db324
feat: add multichain-account-controller implementation
ccharly Jul 3, 2025
23e91ae
refactor: remove write operations + use new keyring account options
ccharly Jul 17, 2025
4588bad
refactor: remove unused test code
ccharly Jul 17, 2025
7c23474
chore: update README
ccharly Jul 17, 2025
8e81e6a
chore: update CODEOWNERS
ccharly Jul 17, 2025
ed8e17c
chore: fix deps
ccharly Jul 17, 2025
c99dd89
Merge branch 'main' into feat/multichain-accounts-controller-readonly
ccharly Jul 18, 2025
0c7ec8a
chore: remove use of preview builds
ccharly Jul 18, 2025
e29e344
chore: bump eth-snap-keyring (was missing)
ccharly Jul 18, 2025
1edf2eb
chore: update CODEOWNERS
ccharly Jul 18, 2025
51f4404
chore: restore previous resolution
ccharly Jul 18, 2025
d9d8f5d
chore: update teams.json
ccharly Jul 18, 2025
4c9532d
chore: typo
ccharly Jul 18, 2025
de60d19
chore: add more comment
ccharly Jul 18, 2025
d452337
chore: add missing jsdocs
ccharly Jul 18, 2025
0891e58
feat: handle keyring state change for new entropy sources
ccharly Jul 18, 2025
7e3c5a8
fix: fix jsdocs
ccharly Jul 18, 2025
349826f
test: fix error messages
ccharly Jul 18, 2025
ed97c85
build: update tsconfig
ccharly Jul 18, 2025
5efb545
chore: lint
ccharly Jul 18, 2025
9c0c6b6
chore: rename MultichainAccountController -> MultichainAccountService
ccharly Jul 18, 2025
f2c8ca5
chore: cosmetic
ccharly Jul 18, 2025
b26e629
chore: cosmetic
ccharly Jul 18, 2025
d6dd7f0
test: remove unneeded `beforeEach`
ccharly Jul 18, 2025
6a1d472
chore: export events + actions
ccharly Jul 18, 2025
18a6358
test: remove accounts.test.ts
ccharly Jul 18, 2025
7399ee3
refactor: use event selector
ccharly Jul 18, 2025
90a98a3
chore: update changelog
ccharly Jul 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
/.github/ @MetaMask/core-platform

## Accounts Team
/packages/accounts-controller @MetaMask/accounts-engineers
/packages/accounts-controller @MetaMask/accounts-engineers
/packages/multichain-transactions-controller @MetaMask/accounts-engineers
/packages/account-tree-controller @MetaMask/accounts-engineers
/packages/multichain-account-service @MetaMask/accounts-engineers
/packages/account-tree-controller @MetaMask/accounts-engineers

## Assets Team
/packages/assets-controllers @MetaMask/metamask-assets
Expand Down Expand Up @@ -118,6 +119,8 @@
/packages/logging-controller/CHANGELOG.md @MetaMask/confirmations @MetaMask/core-platform
/packages/message-manager/package.json @MetaMask/confirmations @MetaMask/core-platform
/packages/message-manager/CHANGELOG.md @MetaMask/confirmations @MetaMask/core-platform
/packages/multichain-account-service/package.json @MetaMask/accounts-engineers @MetaMask/core-platform
/packages/multichain-account-service/CHANGELOG.md @MetaMask/accounts-engineers @MetaMask/core-platform
/packages/multichain-api-middleware/package.json @MetaMask/wallet-api-platform-engineers @MetaMask/core-platform
/packages/multichain-api-middleware/CHANGELOG.md @MetaMask/wallet-api-platform-engineers @MetaMask/core-platform
/packages/name-controller/package.json @MetaMask/confirmations @MetaMask/core-platform
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Each package in this repository has its own README where you can find installati
- [`@metamask/logging-controller`](packages/logging-controller)
- [`@metamask/message-manager`](packages/message-manager)
- [`@metamask/messenger`](packages/messenger)
- [`@metamask/multichain-account-service`](packages/multichain-account-service)
- [`@metamask/multichain-api-middleware`](packages/multichain-api-middleware)
- [`@metamask/multichain-network-controller`](packages/multichain-network-controller)
- [`@metamask/multichain-transactions-controller`](packages/multichain-transactions-controller)
Expand Down Expand Up @@ -106,6 +107,7 @@ linkStyle default opacity:0.5
logging_controller(["@metamask/logging-controller"]);
message_manager(["@metamask/message-manager"]);
messenger(["@metamask/messenger"]);
multichain_account_service(["@metamask/multichain-account-service"]);
multichain_api_middleware(["@metamask/multichain-api-middleware"]);
multichain_network_controller(["@metamask/multichain-network-controller"]);
multichain_transactions_controller(["@metamask/multichain-transactions-controller"]);
Expand Down Expand Up @@ -201,6 +203,9 @@ linkStyle default opacity:0.5
logging_controller --> controller_utils;
message_manager --> base_controller;
message_manager --> controller_utils;
multichain_account_service --> base_controller;
multichain_account_service --> accounts_controller;
multichain_account_service --> keyring_controller;
multichain_api_middleware --> chain_agnostic_permission;
multichain_api_middleware --> controller_utils;
multichain_api_middleware --> json_rpc_engine;
Expand Down
15 changes: 15 additions & 0 deletions packages/multichain-account-service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Add `MultichainAccountService` ([#6141](https://github.com/MetaMask/core/pull/6141))
- This service manages multichain accounts/wallets.

[Unreleased]: https://github.com/MetaMask/core/
20 changes: 20 additions & 0 deletions packages/multichain-account-service/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
MIT License

Copyright (c) 2025 MetaMask

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17 changes: 17 additions & 0 deletions packages/multichain-account-service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# `@metamask/multichain-account-service`

Multichain account service.

This service provides operations and functionalities around multichain accounts and wallets.

## Installation

`yarn add @metamask/multichain-account-service`

or

`npm install @metamask/multichain-account-service`

## Contributing

This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/core#readme).
26 changes: 26 additions & 0 deletions packages/multichain-account-service/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/

const merge = require('deepmerge');
const path = require('path');

const baseConfig = require('../../jest.config.packages');

const displayName = path.basename(__dirname);

module.exports = merge(baseConfig, {
// The display name when running multiple projects
displayName,

// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
});
89 changes: 89 additions & 0 deletions packages/multichain-account-service/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"name": "@metamask/multichain-account-service",
"version": "0.0.0",
"description": "Service to manage multichain accounts",
"keywords": [
"MetaMask",
"Ethereum"
],
"homepage": "https://github.com/MetaMask/core/tree/main/packages/multichain-account-service#readme",
"bugs": {
"url": "https://github.com/MetaMask/core/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/MetaMask/core.git"
},
"license": "MIT",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"types": "./dist/index.d.cts",
"files": [
"dist/"
],
"scripts": {
"build": "ts-bridge --project tsconfig.build.json --verbose --clean --no-references",
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/multichain-account-service",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/multichain-account-service",
"publish:preview": "yarn npm publish --tag preview",
"since-latest-release": "../../scripts/since-latest-release.sh",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"dependencies": {
"@metamask/account-api": "^0.2.0",
"@metamask/base-controller": "^8.0.1",
"@metamask/keyring-api": "^19.0.0",
"@metamask/keyring-internal-api": "^7.0.0",
"@metamask/keyring-snap-client": "^6.0.0",
"@metamask/snaps-sdk": "^9.0.0",
"@metamask/snaps-utils": "^11.0.0",
"@metamask/superstruct": "^3.1.0"
},
"devDependencies": {
"@metamask/accounts-controller": "^31.0.0",
"@metamask/auto-changelog": "^3.4.4",
"@metamask/eth-snap-keyring": "^14.0.0",
"@metamask/keyring-controller": "^22.1.0",
"@metamask/providers": "^22.1.0",
"@metamask/snaps-controllers": "^14.0.1",
"@types/jest": "^27.4.1",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.2.2",
"webextension-polyfill": "^0.12.0"
},
"peerDependencies": {
"@metamask/accounts-controller": "^31.0.0",
"@metamask/keyring-controller": "^22.0.0",
"@metamask/providers": "^22.0.0",
"@metamask/snaps-controllers": "^14.0.0",
"webextension-polyfill": "^0.10.0 || ^0.11.0 || ^0.12.0"
},
"engines": {
"node": "^18.18 || >=20"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
Loading
Loading