Skip to content
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

CAIP Multichain package #4784

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bc56104
Initial package
jiexi Oct 10, 2024
a4b52ad
Fix caip25Permission
jiexi Oct 10, 2024
86ab58a
scopes
jiexi Oct 10, 2024
186d4b3
Fix middlewares
jiexi Oct 10, 2024
6a93d1d
Fix adapters except permission middleware
jiexi Oct 10, 2024
231bcaa
Rename handlers js to ts
jiexi Oct 10, 2024
4e52fc0
permission middleware test js ts rename
jiexi Oct 10, 2024
151eaac
fix: typescript + linting (#4788)
shanejonas Oct 11, 2024
85a723e
Added exports for multichain package (#4789)
shanejonas Oct 11, 2024
a0bb278
Add requires
jiexi Oct 11, 2024
1cd8ef2
add permittedChains adapter to exports
jiexi Oct 11, 2024
c636def
kill scope index barrel
jiexi Oct 11, 2024
a6aa7c1
barrel
jiexi Oct 14, 2024
42134f7
Merge branch 'main' into caip-multichain
jiexi Oct 14, 2024
a13b9c7
remove subjectTypes from CAIP-25 permission
jiexi Oct 14, 2024
81db877
update eth accounts adapter with empty wallet and wallet:eip155 Scope…
jiexi Oct 14, 2024
a3fc263
fix caip25permission spec
jiexi Oct 14, 2024
afe5cb9
upsert empty wallet:eip155 when setting permittedChains
jiexi Oct 14, 2024
9ea78be
lint
jiexi Oct 14, 2024
5650d31
Rename scope.test.ts to types.test.ts
jiexi Oct 14, 2024
df5167e
add networkClientId type to permission-adapter-middleware
jiexi Oct 15, 2024
9446b0b
fix snapshot
jiexi Oct 15, 2024
f65ca24
Merge branch 'main' into caip-multichain
jiexi Oct 15, 2024
941849d
add KnownWalletScopeString enum
jiexi Oct 15, 2024
a250de2
stop upserting wallet scope in setEthAccounts()
jiexi Oct 15, 2024
aa7ba39
lint
jiexi Oct 15, 2024
8415be6
update removeScope mutator to not revoke permission if requiredScope …
jiexi Oct 15, 2024
c7f510e
Fix specificationBuilder jsdoc and typing
jiexi Oct 15, 2024
4afa8f8
Fix caip25permission type
jiexi Oct 15, 2024
597e837
Fix caip25permission type
jiexi Oct 15, 2024
1872188
small dry todo fix
adonesky1 Oct 15, 2024
c5d8005
another small dry
adonesky1 Oct 15, 2024
54f7c49
Added handler wrappers to better integrate with existing middleware (…
shanejonas Oct 15, 2024
ada451d
change subscriptionManager require to import
jiexi Oct 15, 2024
2322e39
lint
jiexi Oct 15, 2024
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
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This repository contains the following packages [^fn1]:
- [`@metamask/keyring-controller`](packages/keyring-controller)
- [`@metamask/logging-controller`](packages/logging-controller)
- [`@metamask/message-manager`](packages/message-manager)
- [`@metamask/multichain`](packages/multichain)
- [`@metamask/name-controller`](packages/name-controller)
- [`@metamask/network-controller`](packages/network-controller)
- [`@metamask/notification-controller`](packages/notification-controller)
Expand Down Expand Up @@ -71,6 +72,7 @@ linkStyle default opacity:0.5
keyring_controller(["@metamask/keyring-controller"]);
logging_controller(["@metamask/logging-controller"]);
message_manager(["@metamask/message-manager"]);
multichain(["@metamask/multichain"]);
name_controller(["@metamask/name-controller"]);
network_controller(["@metamask/network-controller"]);
notification_controller(["@metamask/notification-controller"]);
Expand All @@ -93,14 +95,15 @@ linkStyle default opacity:0.5
address_book_controller --> controller_utils;
announcement_controller --> base_controller;
approval_controller --> base_controller;
assets_controllers --> accounts_controller;
assets_controllers --> approval_controller;
assets_controllers --> base_controller;
assets_controllers --> controller_utils;
assets_controllers --> polling_controller;
assets_controllers --> accounts_controller;
assets_controllers --> approval_controller;
assets_controllers --> keyring_controller;
assets_controllers --> network_controller;
assets_controllers --> polling_controller;
assets_controllers --> preferences_controller;
base_controller --> json_rpc_engine;
chain_controller --> base_controller;
composable_controller --> base_controller;
composable_controller --> json_rpc_engine;
Expand All @@ -110,8 +113,8 @@ linkStyle default opacity:0.5
eth_json_rpc_provider --> json_rpc_engine;
gas_fee_controller --> base_controller;
gas_fee_controller --> controller_utils;
gas_fee_controller --> network_controller;
gas_fee_controller --> polling_controller;
gas_fee_controller --> network_controller;
json_rpc_middleware_stream --> json_rpc_engine;
keyring_controller --> base_controller;
keyring_controller --> message_manager;
Expand Down Expand Up @@ -145,6 +148,9 @@ linkStyle default opacity:0.5
preferences_controller --> controller_utils;
preferences_controller --> keyring_controller;
profile_sync_controller --> base_controller;
profile_sync_controller --> keyring_controller;
profile_sync_controller --> accounts_controller;
profile_sync_controller --> network_controller;
queued_request_controller --> base_controller;
queued_request_controller --> controller_utils;
queued_request_controller --> json_rpc_engine;
Expand All @@ -155,26 +161,26 @@ linkStyle default opacity:0.5
selected_network_controller --> json_rpc_engine;
selected_network_controller --> network_controller;
selected_network_controller --> permission_controller;
signature_controller --> approval_controller;
signature_controller --> base_controller;
signature_controller --> controller_utils;
signature_controller --> message_manager;
signature_controller --> approval_controller;
signature_controller --> keyring_controller;
signature_controller --> logging_controller;
signature_controller --> message_manager;
transaction_controller --> accounts_controller;
transaction_controller --> approval_controller;
transaction_controller --> base_controller;
transaction_controller --> controller_utils;
transaction_controller --> accounts_controller;
transaction_controller --> approval_controller;
transaction_controller --> eth_json_rpc_provider;
transaction_controller --> gas_fee_controller;
transaction_controller --> network_controller;
transaction_controller --> eth_json_rpc_provider;
user_operation_controller --> approval_controller;
user_operation_controller --> base_controller;
user_operation_controller --> controller_utils;
user_operation_controller --> polling_controller;
user_operation_controller --> approval_controller;
user_operation_controller --> gas_fee_controller;
user_operation_controller --> keyring_controller;
user_operation_controller --> network_controller;
user_operation_controller --> polling_controller;
user_operation_controller --> transaction_controller;
```

Expand Down
10 changes: 10 additions & 0 deletions packages/multichain/CHANGELOG.md
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/
20 changes: 20 additions & 0 deletions packages/multichain/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
MIT License

Copyright (c) 2024 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
15 changes: 15 additions & 0 deletions packages/multichain/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# `@metamask/multichain`

Provides types, helpers, adapters, and wrappers for facilitating CAIP Multichain sessions

## Installation

`yarn add @metamask/multichain`

or

`npm install @metamask/multichain`

## 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/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: 83.05,
functions: 87.37,
lines: 86.73,
statements: 87.17,
},
},
});
Loading
Loading