-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
d0db324
feat: add multichain-account-controller implementation
ccharly 23e91ae
refactor: remove write operations + use new keyring account options
ccharly 4588bad
refactor: remove unused test code
ccharly 7c23474
chore: update README
ccharly 8e81e6a
chore: update CODEOWNERS
ccharly ed8e17c
chore: fix deps
ccharly c99dd89
Merge branch 'main' into feat/multichain-accounts-controller-readonly
ccharly 0c7ec8a
chore: remove use of preview builds
ccharly e29e344
chore: bump eth-snap-keyring (was missing)
ccharly 1edf2eb
chore: update CODEOWNERS
ccharly 51f4404
chore: restore previous resolution
ccharly d9d8f5d
chore: update teams.json
ccharly 4c9532d
chore: typo
ccharly de60d19
chore: add more comment
ccharly d452337
chore: add missing jsdocs
ccharly 0891e58
feat: handle keyring state change for new entropy sources
ccharly 7e3c5a8
fix: fix jsdocs
ccharly 349826f
test: fix error messages
ccharly ed97c85
build: update tsconfig
ccharly 5efb545
chore: lint
ccharly 9c0c6b6
chore: rename MultichainAccountController -> MultichainAccountService
ccharly f2c8ca5
chore: cosmetic
ccharly b26e629
chore: cosmetic
ccharly d6dd7f0
test: remove unneeded `beforeEach`
ccharly 6a1d472
chore: export events + actions
ccharly 18a6358
test: remove accounts.test.ts
ccharly 7399ee3
refactor: use event selector
ccharly 90a98a3
chore: update changelog
ccharly 742486e
Merge branch 'main' into feat/multichain-accounts-controller-readonly
ccharly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 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] | ||
|
||
[Unreleased]: https://github.com/MetaMask/core/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# `@metamask/multichain-account-controller` | ||
|
||
Multichain account stateless controller. | ||
|
||
This controller provides operations and functionalities around multichain accounts and wallets. | ||
|
||
## Installation | ||
|
||
`yarn add @metamask/multichain-account-controller` | ||
|
||
or | ||
|
||
`npm install @metamask/multichain-account-controller` | ||
|
||
## Contributing | ||
|
||
This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/core#readme). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}, | ||
}, | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"name": "@metamask/multichain-account-controller", | ||
"version": "0.0.0", | ||
"description": "Controller to manage multichain accounts", | ||
"keywords": [ | ||
"MetaMask", | ||
"Ethereum" | ||
], | ||
"homepage": "https://github.com/MetaMask/core/tree/main/packages/multichain-account-controller#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-controller", | ||
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/multichain-account-controller", | ||
"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.1.0", | ||
"@metamask/base-controller": "^8.0.1", | ||
"@metamask/keyring-api": "^18.0.0", | ||
"@metamask/keyring-internal-api": "^6.2.0", | ||
"@metamask/keyring-snap-client": "^5.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": "^13.0.0", | ||
"@metamask/keyring-controller": "^22.1.0", | ||
"@metamask/providers": "^22.1.0", | ||
"@metamask/snaps-controllers": "^14.0.1", | ||
"@types/jest": "^27.4.1", | ||
"@types/uuid": "^8.3.0", | ||
"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", | ||
"uuid": "^8.3.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/" | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.