Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support for Solana Devnet ([#31702](https://github.com/MetaMask/metamask-extension/pull/31702))
- [Beta] Create Solana account automatically on wallet creation or SRP import [#32038](https://github.com/MetaMask/metamask-extension/pull/32038)
- Support for Solana on Firefox ([#32104](https://github.com/MetaMask/metamask-extension/pull/32104))
- Update CAIP-294 wallet announcement event to include `targets` property and new `caip-348` target object ([#32070](https://github.com/MetaMask/metamask-extension/pull/32070))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we link the providers PR here too?

- Replace `caip-x` with `caip-348` in Multichain API over externally_connectable ([#32070](https://github.com/MetaMask/metamask-extension/pull/32070))

### Fixed
- Fix NFT removal on different networks ([#32102](https://github.com/MetaMask/metamask-extension/pull/32102))
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/metamask-controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2645,7 +2645,7 @@ describe('MetaMaskController', () => {
await new Promise((resolve) => {
streamTest.write(
{
type: 'caip-x',
type: 'caip-348',
data: {
method: 'wallet_invokeMethod',
params: {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
"@metamask/message-manager": "^12.0.1",
"@metamask/message-signing-snap": "^1.1.1",
"@metamask/metamask-eth-abis": "^3.1.1",
"@metamask/multichain-api-client": "^0.2.0",
"@metamask/multichain-api-client": "^0.3.0",
"@metamask/multichain-api-middleware": "^0.1.1",
"@metamask/multichain-network-controller": "^0.4.0",
"@metamask/multichain-transactions-controller": "^0.9.0",
Expand All @@ -311,7 +311,7 @@
"@metamask/ppom-validator": "0.36.0",
"@metamask/preinstalled-example-snap": "^0.3.0",
"@metamask/profile-sync-controller": "^12.0.0",
"@metamask/providers": "^21.0.0",
"@metamask/providers": "^22.0.0",
"@metamask/rate-limit-controller": "^6.0.3",
"@metamask/remote-feature-flag-controller": "^1.6.0",
"@metamask/rpc-errors": "^7.0.0",
Expand Down Expand Up @@ -450,7 +450,7 @@
"@metamask/preferences-controller": "^17.0.0",
"@metamask/test-bundler": "^1.0.0",
"@metamask/test-dapp": "9.3.0",
"@metamask/test-dapp-multichain": "^0.9.0",
"@metamask/test-dapp-multichain": "^0.10.0",
"@octokit/core": "^3.6.0",
"@open-rpc/meta-schema": "^1.14.6",
"@open-rpc/mock-server": "^1.7.5",
Expand Down
8 changes: 4 additions & 4 deletions shared/modules/caip-stream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ class MockStream extends Duplex {

describe('CAIP Stream', () => {
describe('createCaipStream', () => {
it('pipes and unwraps a caip-x message from source stream to the substream', async () => {
it('pipes and unwraps a caip-348 message from source stream to the substream', async () => {
const sourceStream = new PassThrough({ objectMode: true });
const sourceStreamChunks = readFromStream(sourceStream);

const providerStream = createCaipStream(sourceStream);
const providerStreamChunks = readFromStream(providerStream);

await writeToStream(sourceStream, {
type: 'caip-x',
type: 'caip-348',
data: { foo: 'bar' },
});

expect(sourceStreamChunks).toStrictEqual([
{ type: 'caip-x', data: { foo: 'bar' } },
{ type: 'caip-348', data: { foo: 'bar' } },
]);
expect(providerStreamChunks).toStrictEqual([{ foo: 'bar' }]);
});
Expand All @@ -74,7 +74,7 @@ describe('CAIP Stream', () => {
// Note that it's not possible to verify the output side of the internal SplitStream
// instantiated inside createCaipStream as only the substream is actually exported
expect(sourceStream.chunks).toStrictEqual([
{ type: 'caip-x', data: { foo: 'bar' } },
{ type: 'caip-348', data: { foo: 'bar' } },
]);
});

Expand Down
4 changes: 2 additions & 2 deletions shared/modules/caip-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Substream extends Duplex {
callback: (error?: Error | null) => void,
) {
this.parent.push({
type: 'caip-x',
type: 'caip-348',
data: value,
});
callback();
Expand All @@ -45,7 +45,7 @@ export class CaipStream extends Duplex {
_encoding: BufferEncoding,
callback: (error?: Error | null) => void,
) {
if (isObject(value) && value.type === 'caip-x') {
if (isObject(value) && value.type === 'caip-348') {
this.substream.push(value.data);
}
callback();
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/api-specs/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const createCaip27DriverTransport = (
type: string;
data: JsonRpcResponse<Json>;
}) => {
if (type !== 'caip-x') {
if (type !== 'caip-348') {
return;
}
if (data?.id !== g) {
Expand All @@ -134,7 +134,7 @@ export const createCaip27DriverTransport = (

extensionPort.onMessage.addListener(listener);
const msg = {
type: 'caip-x',
type: 'caip-348',
data: {
jsonrpc: '2.0',
method: 'wallet_invokeMethod',
Expand Down Expand Up @@ -203,7 +203,7 @@ export const createMultichainDriverTransport = (
type: string;
data: JsonRpcResponse<Json>;
}) => {
if (type !== 'caip-x') {
if (type !== 'caip-348') {
return;
}
if (data?.id !== g) {
Expand All @@ -218,7 +218,7 @@ export const createMultichainDriverTransport = (

extensionPort.onMessage.addListener(listener);
const msg = {
type: 'caip-x',
type: 'caip-348',
data: {
jsonrpc: '2.0',
method: m,
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/flask/multichain-api/testHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export const sendMultichainApiRequest = ({
const data = ${JSON.stringify(requestWithNewId)};
const result = new Promise((resolve) => {
port.onMessage.addListener((msg) => {
if (msg.type !== 'caip-x') {
if (msg.type !== 'caip-348') {
return;
}
if (msg.data?.id !== ${id}) {
Expand All @@ -221,7 +221,7 @@ export const sendMultichainApiRequest = ({
resolve(msg.data);
})
})
port.postMessage({ type: 'caip-x', data });
port.postMessage({ type: 'caip-348', data });
return result;`;
}

Expand Down
49 changes: 35 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5777,10 +5777,10 @@ __metadata:
languageName: node
linkType: hard

"@metamask/multichain-api-client@npm:^0.2.0":
version: 0.2.0
resolution: "@metamask/multichain-api-client@npm:0.2.0"
checksum: 10/39509819e8304e5adee96d242c4fe73f39fe92f07102faf373c902fded2617bd023ea7423e84dcea47980c752d5233742d05ca45ff040db664ea883db128cc7c
"@metamask/multichain-api-client@npm:^0.3.0":
version: 0.3.0
resolution: "@metamask/multichain-api-client@npm:0.3.0"
checksum: 10/3a82a36dbdad88f16464e7655d77a5562d636a387b93d69438421c1fd25f4767eb28ed4c423647b6b06fb0c85cf7dcbe7e4bca474cddd022c78652d631de23fe
languageName: node
linkType: hard

Expand Down Expand Up @@ -6175,6 +6175,27 @@ __metadata:
languageName: node
linkType: hard

"@metamask/providers@npm:^22.0.0":
version: 22.0.0
resolution: "@metamask/providers@npm:22.0.0"
dependencies:
"@metamask/json-rpc-engine": "npm:^10.0.2"
"@metamask/json-rpc-middleware-stream": "npm:^8.0.6"
"@metamask/object-multiplex": "npm:^2.0.0"
"@metamask/rpc-errors": "npm:^7.0.2"
"@metamask/safe-event-emitter": "npm:^3.1.1"
"@metamask/utils": "npm:^11.0.1"
detect-browser: "npm:^5.2.0"
extension-port-stream: "npm:^4.1.0"
fast-deep-equal: "npm:^3.1.3"
is-stream: "npm:^2.0.0"
readable-stream: "npm:^3.6.2"
peerDependencies:
webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0
checksum: 10/b9bd381e5669e07ecee0a98f8748993fed4e02bc855e2ad342db9b9bb8b2d453a01c0e4c9f1e2c7b80929c5ce15d7aafa88c0a6a78651737efdb16f707a84017
languageName: node
linkType: hard

"@metamask/rate-limit-controller@npm:^6.0.3":
version: 6.0.3
resolution: "@metamask/rate-limit-controller@npm:6.0.3"
Expand Down Expand Up @@ -6519,10 +6540,10 @@ __metadata:
languageName: node
linkType: hard

"@metamask/test-dapp-multichain@npm:^0.9.0":
version: 0.9.0
resolution: "@metamask/test-dapp-multichain@npm:0.9.0"
checksum: 10/6d317402bc59165559fad9b1e681ea1437858158f102cced86b7c52da115c7a991e7012906f6bad06f7f55ffa36a30ffe4651b29375d769989eba5611540f530
"@metamask/test-dapp-multichain@npm:^0.10.0":
version: 0.10.0
resolution: "@metamask/test-dapp-multichain@npm:0.10.0"
checksum: 10/9840f9dbbfe289de159dc9d950aea923a4154980e5e31fd68a67bc21437f23c35d85ce8a4fc36e7f51234353a5d2ec83af04e56ad95ded93f624ee63050e55bb
languageName: node
linkType: hard

Expand Down Expand Up @@ -15696,9 +15717,9 @@ __metadata:
linkType: hard

"caniuse-lite@npm:^1.0.30001109, caniuse-lite@npm:^1.0.30001599, caniuse-lite@npm:^1.0.30001669":
version: 1.0.30001669
resolution: "caniuse-lite@npm:1.0.30001669"
checksum: 10/cd0b481bb997703cb7651e55666b4aa4e7b4ecf9784796e2393179a15e55c71a6abc6ff865c922bbd3bbfa4a4bf0530d8da13989b97ff8c7850c8a5bd4e00491
version: 1.0.30001707
resolution: "caniuse-lite@npm:1.0.30001707"
checksum: 10/5c5f9aad651f4d957cc59c8b4ac22bb7ac3a1c86c26ee7d5c59b00062bdc1c421980513179da1f5e20cade2da8d7f3c41d482ce7d4a8d9f411e4a827fe092d29
languageName: node
linkType: hard

Expand Down Expand Up @@ -27630,7 +27651,7 @@ __metadata:
"@metamask/message-manager": "npm:^12.0.1"
"@metamask/message-signing-snap": "npm:^1.1.1"
"@metamask/metamask-eth-abis": "npm:^3.1.1"
"@metamask/multichain-api-client": "npm:^0.2.0"
"@metamask/multichain-api-client": "npm:^0.3.0"
"@metamask/multichain-api-middleware": "npm:^0.1.1"
"@metamask/multichain-network-controller": "npm:^0.4.0"
"@metamask/multichain-transactions-controller": "npm:^0.9.0"
Expand All @@ -27649,7 +27670,7 @@ __metadata:
"@metamask/preferences-controller": "npm:^17.0.0"
"@metamask/preinstalled-example-snap": "npm:^0.3.0"
"@metamask/profile-sync-controller": "npm:^12.0.0"
"@metamask/providers": "npm:^21.0.0"
"@metamask/providers": "npm:^22.0.0"
"@metamask/rate-limit-controller": "npm:^6.0.3"
"@metamask/remote-feature-flag-controller": "npm:^1.6.0"
"@metamask/rpc-errors": "npm:^7.0.0"
Expand All @@ -27667,7 +27688,7 @@ __metadata:
"@metamask/solana-wallet-standard": "npm:^0.1.1"
"@metamask/test-bundler": "npm:^1.0.0"
"@metamask/test-dapp": "npm:9.3.0"
"@metamask/test-dapp-multichain": "npm:^0.9.0"
"@metamask/test-dapp-multichain": "npm:^0.10.0"
"@metamask/transaction-controller": "npm:^54.1.0"
"@metamask/user-operation-controller": "npm:^31.0.0"
"@metamask/utils": "npm:^11.1.0"
Expand Down
Loading