@metamask-previews/eth-snap-keyring 22.1.0-bc99865 → 22.1.0-de887b2

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 CHANGED
@@ -7,12 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ### Added
11
-
12
- - Add `SnapKeyringV1Adapter` to adapt Snap v2 keyrings to legacy v1 keyring operations ([#557](https://github.com/MetaMask/accounts/pull/557))
13
- - This adapter mostly exposes EVM signing operations through `EthKeyringV1Adapter`.
14
- - This adapter also implements `removeAccount` the way it was implemented by the legacy Snap keyring (compatible with the `KeyringController` account removal flow).
15
-
16
10
  ### Changed
17
11
 
18
12
  - Normalize `KeyringAccount`'s address with `:accountCreated` and `setAccounts` ([#556](https://github.com/MetaMask/accounts/pull/556))
package/dist/index.cjs CHANGED
@@ -17,6 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./options.cjs"), exports);
18
18
  __exportStar(require("./types.cjs"), exports);
19
19
  __exportStar(require("./SnapKeyring.cjs"), exports);
20
- __exportStar(require("./v2/SnapKeyringV1Adapter.cjs"), exports);
21
20
  __exportStar(require("./SnapKeyringV1.cjs"), exports);
22
21
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,8CAAwB;AACxB,oDAA8B;AAC9B,gEAA0C;AAC1C,sDAAgC","sourcesContent":["export * from './options';\nexport * from './types';\nexport * from './SnapKeyring';\nexport * from './v2/SnapKeyringV1Adapter';\nexport * from './SnapKeyringV1';\nexport type * from './SnapKeyringMessenger';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,8CAAwB;AACxB,oDAA8B;AAC9B,sDAAgC","sourcesContent":["export * from './options';\nexport * from './types';\nexport * from './SnapKeyring';\nexport * from './SnapKeyringV1';\nexport type * from './SnapKeyringMessenger';\n"]}
package/dist/index.d.cts CHANGED
@@ -1,7 +1,6 @@
1
1
  export * from "./options.cjs";
2
2
  export * from "./types.cjs";
3
3
  export * from "./SnapKeyring.cjs";
4
- export * from "./v2/SnapKeyringV1Adapter.cjs";
5
4
  export * from "./SnapKeyringV1.cjs";
6
5
  export type * from "./SnapKeyringMessenger.cjs";
7
6
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,4BAAwB;AACxB,kCAA8B;AAC9B,8CAA0C;AAC1C,oCAAgC;AAChC,gDAA4C"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,4BAAwB;AACxB,kCAA8B;AAC9B,oCAAgC;AAChC,gDAA4C"}
package/dist/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  export * from "./options.mjs";
2
2
  export * from "./types.mjs";
3
3
  export * from "./SnapKeyring.mjs";
4
- export * from "./v2/SnapKeyringV1Adapter.mjs";
5
4
  export * from "./SnapKeyringV1.mjs";
6
5
  export type * from "./SnapKeyringMessenger.mjs";
7
6
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,4BAAwB;AACxB,kCAA8B;AAC9B,8CAA0C;AAC1C,oCAAgC;AAChC,gDAA4C"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,4BAAwB;AACxB,kCAA8B;AAC9B,oCAAgC;AAChC,gDAA4C"}
package/dist/index.mjs CHANGED
@@ -1,6 +1,5 @@
1
1
  export * from "./options.mjs";
2
2
  export * from "./types.mjs";
3
3
  export * from "./SnapKeyring.mjs";
4
- export * from "./v2/SnapKeyringV1Adapter.mjs";
5
4
  export * from "./SnapKeyringV1.mjs";
6
5
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,4BAAwB;AACxB,kCAA8B;AAC9B,8CAA0C;AAC1C,oCAAgC","sourcesContent":["export * from './options';\nexport * from './types';\nexport * from './SnapKeyring';\nexport * from './v2/SnapKeyringV1Adapter';\nexport * from './SnapKeyringV1';\nexport type * from './SnapKeyringMessenger';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,4BAAwB;AACxB,kCAA8B;AAC9B,oCAAgC","sourcesContent":["export * from './options';\nexport * from './types';\nexport * from './SnapKeyring';\nexport * from './SnapKeyringV1';\nexport type * from './SnapKeyringMessenger';\n"]}
package/dist/v2/index.cjs CHANGED
@@ -15,5 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./SnapKeyring.cjs"), exports);
18
- __exportStar(require("./SnapKeyringV1Adapter.cjs"), exports);
19
18
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAA8B;AAC9B,6DAAuC","sourcesContent":["export * from './SnapKeyring';\nexport * from './SnapKeyringV1Adapter';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAA8B","sourcesContent":["export * from './SnapKeyring';\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from "./SnapKeyring.cjs";
2
- export * from "./SnapKeyringV1Adapter.cjs";
3
2
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,2CAAuC"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAAA,kCAA8B"}
@@ -1,3 +1,2 @@
1
1
  export * from "./SnapKeyring.mjs";
2
- export * from "./SnapKeyringV1Adapter.mjs";
3
2
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,2CAAuC"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAAA,kCAA8B"}
package/dist/v2/index.mjs CHANGED
@@ -1,3 +1,2 @@
1
1
  export * from "./SnapKeyring.mjs";
2
- export * from "./SnapKeyringV1Adapter.mjs";
3
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,2CAAuC","sourcesContent":["export * from './SnapKeyring';\nexport * from './SnapKeyringV1Adapter';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAAA,kCAA8B","sourcesContent":["export * from './SnapKeyring';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/eth-snap-keyring",
3
- "version": "22.1.0-bc99865",
3
+ "version": "22.1.0-de887b2",
4
4
  "description": "Snaps keyring bridge",
5
5
  "keywords": [
6
6
  "keyring",
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SnapKeyringV1Adapter = void 0;
4
- const v2_1 = require("@metamask/keyring-sdk/v2");
5
- /**
6
- * Adapts a v2 Snap keyring to the legacy v1 keyring API.
7
- */
8
- class SnapKeyringV1Adapter extends v2_1.EthKeyringV1Adapter {
9
- /**
10
- * Remove an account matching the given address.
11
- *
12
- * @param address - Address of the account to remove.
13
- */
14
- async removeAccount(address) {
15
- const account = this.inner.lookupByAddress(address);
16
- if (!account) {
17
- throw new Error(`Account '${address}' not found`);
18
- }
19
- await this.inner.deleteAccount(account.id);
20
- }
21
- }
22
- exports.SnapKeyringV1Adapter = SnapKeyringV1Adapter;
23
- //# sourceMappingURL=SnapKeyringV1Adapter.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SnapKeyringV1Adapter.cjs","sourceRoot":"","sources":["../../src/v2/SnapKeyringV1Adapter.ts"],"names":[],"mappings":";;;AAAA,iDAA+D;AAI/D;;GAEG;AACH,MAAa,oBAAqB,SAAQ,wBAAgC;IACxE;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,OAAe;QACjC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAEpD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,aAAa,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF;AAfD,oDAeC","sourcesContent":["import { EthKeyringV1Adapter } from '@metamask/keyring-sdk/v2';\n\nimport type { SnapKeyring } from './SnapKeyring';\n\n/**\n * Adapts a v2 Snap keyring to the legacy v1 keyring API.\n */\nexport class SnapKeyringV1Adapter extends EthKeyringV1Adapter<SnapKeyring> {\n /**\n * Remove an account matching the given address.\n *\n * @param address - Address of the account to remove.\n */\n async removeAccount(address: string): Promise<void> {\n const account = this.inner.lookupByAddress(address);\n\n if (!account) {\n throw new Error(`Account '${address}' not found`);\n }\n\n await this.inner.deleteAccount(account.id);\n }\n}\n"]}
@@ -1,14 +0,0 @@
1
- import { EthKeyringV1Adapter } from "@metamask/keyring-sdk/v2";
2
- import type { SnapKeyring } from "./SnapKeyring.cjs";
3
- /**
4
- * Adapts a v2 Snap keyring to the legacy v1 keyring API.
5
- */
6
- export declare class SnapKeyringV1Adapter extends EthKeyringV1Adapter<SnapKeyring> {
7
- /**
8
- * Remove an account matching the given address.
9
- *
10
- * @param address - Address of the account to remove.
11
- */
12
- removeAccount(address: string): Promise<void>;
13
- }
14
- //# sourceMappingURL=SnapKeyringV1Adapter.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SnapKeyringV1Adapter.d.cts","sourceRoot":"","sources":["../../src/v2/SnapKeyringV1Adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iCAAiC;AAE/D,OAAO,KAAK,EAAE,WAAW,EAAE,0BAAsB;AAEjD;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,mBAAmB,CAAC,WAAW,CAAC;IACxE;;;;OAIG;IACG,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CASpD"}
@@ -1,14 +0,0 @@
1
- import { EthKeyringV1Adapter } from "@metamask/keyring-sdk/v2";
2
- import type { SnapKeyring } from "./SnapKeyring.mjs";
3
- /**
4
- * Adapts a v2 Snap keyring to the legacy v1 keyring API.
5
- */
6
- export declare class SnapKeyringV1Adapter extends EthKeyringV1Adapter<SnapKeyring> {
7
- /**
8
- * Remove an account matching the given address.
9
- *
10
- * @param address - Address of the account to remove.
11
- */
12
- removeAccount(address: string): Promise<void>;
13
- }
14
- //# sourceMappingURL=SnapKeyringV1Adapter.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SnapKeyringV1Adapter.d.mts","sourceRoot":"","sources":["../../src/v2/SnapKeyringV1Adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iCAAiC;AAE/D,OAAO,KAAK,EAAE,WAAW,EAAE,0BAAsB;AAEjD;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,mBAAmB,CAAC,WAAW,CAAC;IACxE;;;;OAIG;IACG,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CASpD"}
@@ -1,19 +0,0 @@
1
- import { EthKeyringV1Adapter } from "@metamask/keyring-sdk/v2";
2
- /**
3
- * Adapts a v2 Snap keyring to the legacy v1 keyring API.
4
- */
5
- export class SnapKeyringV1Adapter extends EthKeyringV1Adapter {
6
- /**
7
- * Remove an account matching the given address.
8
- *
9
- * @param address - Address of the account to remove.
10
- */
11
- async removeAccount(address) {
12
- const account = this.inner.lookupByAddress(address);
13
- if (!account) {
14
- throw new Error(`Account '${address}' not found`);
15
- }
16
- await this.inner.deleteAccount(account.id);
17
- }
18
- }
19
- //# sourceMappingURL=SnapKeyringV1Adapter.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SnapKeyringV1Adapter.mjs","sourceRoot":"","sources":["../../src/v2/SnapKeyringV1Adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iCAAiC;AAI/D;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,mBAAgC;IACxE;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,OAAe;QACjC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAEpD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,aAAa,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import { EthKeyringV1Adapter } from '@metamask/keyring-sdk/v2';\n\nimport type { SnapKeyring } from './SnapKeyring';\n\n/**\n * Adapts a v2 Snap keyring to the legacy v1 keyring API.\n */\nexport class SnapKeyringV1Adapter extends EthKeyringV1Adapter<SnapKeyring> {\n /**\n * Remove an account matching the given address.\n *\n * @param address - Address of the account to remove.\n */\n async removeAccount(address: string): Promise<void> {\n const account = this.inner.lookupByAddress(address);\n\n if (!account) {\n throw new Error(`Account '${address}' not found`);\n }\n\n await this.inner.deleteAccount(account.id);\n }\n}\n"]}