@metamask-previews/keyring-internal-api 10.0.1-d23a1b9 → 10.1.1-7275dbc
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 +19 -1
- package/LICENSE +21 -0
- package/dist/compatibility/keyring-request.cjs.map +1 -1
- package/dist/compatibility/keyring-request.d.cts +1 -1
- package/dist/compatibility/keyring-request.d.cts.map +1 -1
- package/dist/compatibility/keyring-request.d.mts +1 -1
- package/dist/compatibility/keyring-request.d.mts.map +1 -1
- package/dist/compatibility/keyring-request.mjs.map +1 -1
- package/dist/types.cjs +6 -2
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +97 -6
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +97 -6
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +6 -2
- package/dist/types.mjs.map +1 -1
- package/package.json +31 -25
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [10.1.1]
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Bump `@metamask/keyring-api` from `^23.0.0` to `^23.0.1` ([#518](https://github.com/MetaMask/accounts/pull/518))
|
|
15
|
+
|
|
16
|
+
## [10.1.0]
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Add Stellar (XLM) support ([#483](https://github.com/MetaMask/accounts/pull/483))
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Bump `@metamask/keyring-api` from `^22.0.0` to `^23.0.0` ([#515](https://github.com/MetaMask/accounts/pull/515))
|
|
25
|
+
|
|
10
26
|
## [10.0.1]
|
|
11
27
|
|
|
12
28
|
### Changed
|
|
@@ -175,7 +191,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
175
191
|
- This new version fixes a bug with CJS re-exports.
|
|
176
192
|
- Initial release ([#24](https://github.com/MetaMask/accounts/pull/24))
|
|
177
193
|
|
|
178
|
-
[Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@10.
|
|
194
|
+
[Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@10.1.1...HEAD
|
|
195
|
+
[10.1.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@10.1.0...@metamask/keyring-internal-api@10.1.1
|
|
196
|
+
[10.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@10.0.1...@metamask/keyring-internal-api@10.1.0
|
|
179
197
|
[10.0.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@10.0.0...@metamask/keyring-internal-api@10.0.1
|
|
180
198
|
[10.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@9.1.1...@metamask/keyring-internal-api@10.0.0
|
|
181
199
|
[9.1.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@9.1.0...@metamask/keyring-internal-api@9.1.1
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MetaMask
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-request.cjs","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"keyring-request.cjs","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":";;;AAoCA,sEAMC;AAzCD,uDAG+B;AAC/B,uDAA6C;AAG7C;;GAEG;AACU,QAAA,iCAAiC,GAAG,IAAA,kBAAI,EAAC,kCAAoB,EAAE;IAC1E,QAAQ;CACT,CAAC,CAAC;AAMH;;GAEG;AACU,QAAA,kCAAkC,GAAG,mCAAqB,CAAC;AAM3D,QAAA,6BAA6B,GAAG,0CAAkC,CAAC;AAEhF;;;;;GAKG;AACH,SAAgB,6BAA6B,CAC3C,OAAuB;IAEvB,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC;IAEzC,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { KeyringRequest } from '@metamask/keyring-api';\nimport {\n KeyringRequestStruct,\n KeyringResponseStruct,\n} from '@metamask/keyring-api';\nimport { omit } from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\n/**\n * Keyring request without `origin` support.\n */\nexport const KeyringRequestWithoutOriginStruct = omit(KeyringRequestStruct, [\n 'origin',\n]);\n\nexport type KeyringRequestWithoutOrigin = Infer<\n typeof KeyringRequestWithoutOriginStruct\n>;\n\n/**\n * Response to a call to `submitRequest` (v1).\n */\nexport const KeyringResponseWithoutOriginStruct = KeyringResponseStruct;\n\nexport type KeyringResponseWithoutOrigin = Infer<\n typeof KeyringResponseWithoutOriginStruct\n>;\n\nexport const SubmitRequestResponseV1Struct = KeyringResponseWithoutOriginStruct;\n\n/**\n * Converts a keyring request to a keyring request v1.\n *\n * @param request - A keyring request.\n * @returns A keyring request v1.\n */\nexport function toKeyringRequestWithoutOrigin(\n request: KeyringRequest,\n): KeyringRequestWithoutOrigin {\n const { origin, ...requestV1 } = request;\n\n return requestV1;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-request.d.cts","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;
|
|
1
|
+
{"version":3,"file":"keyring-request.d.cts","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAM5D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAEnD;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;cAyBL,CAAC;;;;;aAvBxC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAC7C,OAAO,iCAAiC,CACzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;eAjBV,CAAC;WACxB,CAAA;;;;;QAgByD,CAAC;AAExE,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAC9C,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;eAvBL,CAAC;WACxB,CAAA;;;;;QAsBiE,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,cAAc,GACtB,2BAA2B,CAI7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-request.d.mts","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;
|
|
1
|
+
{"version":3,"file":"keyring-request.d.mts","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAM5D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAEnD;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;cAyBL,CAAC;;;;;aAvBxC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAC7C,OAAO,iCAAiC,CACzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;eAjBV,CAAC;WACxB,CAAA;;;;;QAgByD,CAAC;AAExE,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAC9C,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;eAvBL,CAAC;WACxB,CAAA;;;;;QAsBiE,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,cAAc,GACtB,2BAA2B,CAI7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-request.mjs","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACtB,8BAA8B;AAC/B,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"keyring-request.mjs","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACtB,8BAA8B;AAC/B,OAAO,EAAE,IAAI,EAAE,8BAA8B;AAG7C;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC,oBAAoB,EAAE;IAC1E,QAAQ;CACT,CAAC,CAAC;AAMH;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,qBAAqB,CAAC;AAMxE,MAAM,CAAC,MAAM,6BAA6B,GAAG,kCAAkC,CAAC;AAEhF;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAC3C,OAAuB;IAEvB,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC;IAEzC,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { KeyringRequest } from '@metamask/keyring-api';\nimport {\n KeyringRequestStruct,\n KeyringResponseStruct,\n} from '@metamask/keyring-api';\nimport { omit } from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\n/**\n * Keyring request without `origin` support.\n */\nexport const KeyringRequestWithoutOriginStruct = omit(KeyringRequestStruct, [\n 'origin',\n]);\n\nexport type KeyringRequestWithoutOrigin = Infer<\n typeof KeyringRequestWithoutOriginStruct\n>;\n\n/**\n * Response to a call to `submitRequest` (v1).\n */\nexport const KeyringResponseWithoutOriginStruct = KeyringResponseStruct;\n\nexport type KeyringResponseWithoutOrigin = Infer<\n typeof KeyringResponseWithoutOriginStruct\n>;\n\nexport const SubmitRequestResponseV1Struct = KeyringResponseWithoutOriginStruct;\n\n/**\n * Converts a keyring request to a keyring request v1.\n *\n * @param request - A keyring request.\n * @returns A keyring request v1.\n */\nexport function toKeyringRequestWithoutOrigin(\n request: KeyringRequest,\n): KeyringRequestWithoutOrigin {\n const { origin, ...requestV1 } = request;\n\n return requestV1;\n}\n"]}
|
package/dist/types.cjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// FIXME: eslint is complaning about our account union even if those accounts
|
|
3
3
|
// types should all be different, so we disable this for now:
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */
|
|
5
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.InternalAccountStruct = exports.InternalAccountStructs = exports.InternalTrxEoaAccountStruct = exports.InternalSolDataAccountStruct = exports.InternalBtcP2trAccountStruct = exports.InternalBtcP2wpkhAccountStruct = exports.InternalBtcP2shAccountStruct = exports.InternalBtcP2pkhAccountStruct = exports.InternalEthErc4337AccountStruct = exports.InternalEthEoaAccountStruct = exports.InternalAccountMetadataStruct = void 0;
|
|
5
|
+
exports.InternalAccountStruct = exports.InternalAccountStructs = exports.InternalXlmAccountStruct = exports.InternalTrxEoaAccountStruct = exports.InternalSolDataAccountStruct = exports.InternalBtcP2trAccountStruct = exports.InternalBtcP2wpkhAccountStruct = exports.InternalBtcP2shAccountStruct = exports.InternalBtcP2pkhAccountStruct = exports.InternalEthErc4337AccountStruct = exports.InternalEthEoaAccountStruct = exports.InternalAccountMetadataStruct = void 0;
|
|
7
6
|
const keyring_api_1 = require("@metamask/keyring-api");
|
|
8
7
|
const keyring_utils_1 = require("@metamask/keyring-utils");
|
|
9
8
|
const superstruct_1 = require("@metamask/superstruct");
|
|
@@ -55,6 +54,10 @@ exports.InternalTrxEoaAccountStruct = (0, keyring_utils_1.object)({
|
|
|
55
54
|
...keyring_api_1.TrxEoaAccountStruct.schema,
|
|
56
55
|
...exports.InternalAccountMetadataStruct.schema,
|
|
57
56
|
});
|
|
57
|
+
exports.InternalXlmAccountStruct = (0, keyring_utils_1.object)({
|
|
58
|
+
...keyring_api_1.XlmAccountStruct.schema,
|
|
59
|
+
...exports.InternalAccountMetadataStruct.schema,
|
|
60
|
+
});
|
|
58
61
|
exports.InternalAccountStructs = {
|
|
59
62
|
[`${keyring_api_1.EthAccountType.Eoa}`]: exports.InternalEthEoaAccountStruct,
|
|
60
63
|
[`${keyring_api_1.EthAccountType.Erc4337}`]: exports.InternalEthErc4337AccountStruct,
|
|
@@ -64,6 +67,7 @@ exports.InternalAccountStructs = {
|
|
|
64
67
|
[`${keyring_api_1.BtcAccountType.P2tr}`]: exports.InternalBtcP2trAccountStruct,
|
|
65
68
|
[`${keyring_api_1.SolAccountType.DataAccount}`]: exports.InternalSolDataAccountStruct,
|
|
66
69
|
[`${keyring_api_1.TrxAccountType.Eoa}`]: exports.InternalTrxEoaAccountStruct,
|
|
70
|
+
[`${keyring_api_1.XlmAccountType.Account}`]: exports.InternalXlmAccountStruct,
|
|
67
71
|
};
|
|
68
72
|
exports.InternalAccountStruct = (0, keyring_utils_1.object)({
|
|
69
73
|
...keyring_api_1.KeyringAccountStruct.schema,
|
package/dist/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,6EAA6E;AAC7E,6DAA6D
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,6EAA6E;AAC7E,6DAA6D;;;AAE7D,uDAgB+B;AAC/B,2DAAgE;AAEhE,uDAAgE;AASnD,QAAA,6BAA6B,GAAG,IAAA,sBAAM,EAAC;IAClD,QAAQ,EAAE,IAAA,sBAAM,EAAC;QACf,IAAI,EAAE,IAAA,oBAAM,GAAE;QACd,iBAAiB,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QAC1C,IAAI,EAAE,IAAA,6BAAa,EACjB,IAAA,sBAAM,EAAC;YACL,EAAE,EAAE,IAAA,oBAAM,GAAE;YACZ,OAAO,EAAE,IAAA,qBAAO,GAAE;YAClB,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC,CACH;QACD,YAAY,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QACrC,UAAU,EAAE,IAAA,oBAAM,GAAE;QACpB,OAAO,EAAE,IAAA,sBAAM,EAAC;YACd,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,IA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ACtD,CAAC,GAAG,4BAAc,CAAC,OAAO,EAAE,CAAC,EAAE,uCAA+B;IAC9D,CAAC,GAAG,4BAAc,CAAC,KAAK,EAAE,CAAC,EAAE,qCAA6B;IAC1D,CAAC,GAAG,4BAAc,CAAC,IAAI,EAAE,CAAC,EAAE,oCAA4B;IACxD,CAAC,GAAG,4BAAc,CAAC,MAAM,EAAE,CAAC,EAAE,sCAA8B;IAC5D,CAAC,GAAG,4BAAc,CAAC,IAAI,EAAE,CAAC,EAAE,oCAA4B;IACxD,CAAC,GAAG,4BAAc,CAAC,WAAW,EAAE,CAAC,EAAE,oCAA4B;IAC/D,CAAC,GAAG,4BAAc,CAAC,GAAG,EAAE,CAAC,EAAE,mCAA2B;IACtD,CAAC,GAAG,4BAAc,CAAC,OAAO,EAAE,CAAC,EAAE,gCAAwB;CACxD,CAAC;AAaW,QAAA,qBAAqB,GAAG,IAAA,sBAAM,EAAC;IAC1C,GAAG,kCAAoB,CAAC,MAAM;IAC9B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["// FIXME: eslint is complaning about our account union even if those accounts\n// types should all be different, so we disable this for now:\n\nimport {\n BtcAccountType,\n EthAccountType,\n KeyringAccountStruct,\n SolAccountType,\n BtcP2pkhAccountStruct,\n BtcP2shAccountStruct,\n BtcP2wpkhAccountStruct,\n BtcP2trAccountStruct,\n EthEoaAccountStruct,\n EthErc4337AccountStruct,\n SolDataAccountStruct,\n TrxAccountType,\n TrxEoaAccountStruct,\n XlmAccountType,\n XlmAccountStruct,\n} from '@metamask/keyring-api';\nimport { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer, Struct } from '@metamask/superstruct';\nimport { boolean, string, number } from '@metamask/superstruct';\n\nexport type InternalAccountType =\n | EthAccountType\n | BtcAccountType\n | SolAccountType\n | TrxAccountType\n | XlmAccountType;\n\nexport const InternalAccountMetadataStruct = object({\n metadata: object({\n name: string(),\n nameLastUpdatedAt: exactOptional(number()),\n snap: exactOptional(\n object({\n id: string(),\n enabled: boolean(),\n name: string(),\n }),\n ),\n lastSelected: exactOptional(number()),\n importTime: number(),\n keyring: object({\n type: string(),\n }),\n }),\n});\n\nexport const InternalEthEoaAccountStruct = object({\n ...EthEoaAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalEthErc4337AccountStruct = object({\n ...EthErc4337AccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2pkhAccountStruct = object({\n ...BtcP2pkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2shAccountStruct = object({\n ...BtcP2shAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2wpkhAccountStruct = object({\n ...BtcP2wpkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2trAccountStruct = object({\n ...BtcP2trAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalSolDataAccountStruct = object({\n ...SolDataAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalTrxEoaAccountStruct = object({\n ...TrxEoaAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalXlmAccountStruct = object({\n ...XlmAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;\n\nexport type InternalEthErc4337Account = Infer<\n typeof InternalEthErc4337AccountStruct\n>;\n\nexport type InternalBtcP2pkhAccount = Infer<\n typeof InternalBtcP2pkhAccountStruct\n>;\n\nexport type InternalBtcP2shAccount = Infer<typeof InternalBtcP2shAccountStruct>;\n\nexport type InternalBtcP2wpkhAccount = Infer<\n typeof InternalBtcP2wpkhAccountStruct\n>;\n\nexport type InternalBtcP2trAccount = Infer<typeof InternalBtcP2trAccountStruct>;\n\nexport type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;\n\nexport type InternalTrxEoaAccount = Infer<typeof InternalTrxEoaAccountStruct>;\n\nexport type InternalXlmAccount = Infer<typeof InternalXlmAccountStruct>;\n\nexport const InternalAccountStructs: Record<\n string,\n | Struct<InternalEthEoaAccount>\n | Struct<InternalEthErc4337Account>\n | Struct<InternalBtcP2pkhAccount>\n | Struct<InternalBtcP2shAccount>\n | Struct<InternalBtcP2wpkhAccount>\n | Struct<InternalBtcP2trAccount>\n | Struct<InternalSolDataAccount>\n | Struct<InternalTrxEoaAccount>\n | Struct<InternalXlmAccount>\n> = {\n [`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,\n [`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,\n [`${BtcAccountType.P2pkh}`]: InternalBtcP2pkhAccountStruct,\n [`${BtcAccountType.P2sh}`]: InternalBtcP2shAccountStruct,\n [`${BtcAccountType.P2wpkh}`]: InternalBtcP2wpkhAccountStruct,\n [`${BtcAccountType.P2tr}`]: InternalBtcP2trAccountStruct,\n [`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,\n [`${TrxAccountType.Eoa}`]: InternalTrxEoaAccountStruct,\n [`${XlmAccountType.Account}`]: InternalXlmAccountStruct,\n};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2pkhAccount\n | InternalBtcP2shAccount\n | InternalBtcP2wpkhAccount\n | InternalBtcP2trAccount\n | InternalSolDataAccount\n | InternalTrxEoaAccount\n | InternalXlmAccount;\n\nexport const InternalAccountStruct = object({\n ...KeyringAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\n/**\n * Internal account representation.\n *\n * This type is used internally by MetaMask to add additional metadata to the\n * account object. It's should not be used by external applications.\n */\nexport type InternalAccount = Infer<typeof InternalAccountStruct>;\n"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BtcAccountType, EthAccountType, SolAccountType, TrxAccountType } from "@metamask/keyring-api";
|
|
1
|
+
import { BtcAccountType, EthAccountType, SolAccountType, TrxAccountType, XlmAccountType } from "@metamask/keyring-api";
|
|
2
2
|
import type { Infer, Struct } from "@metamask/superstruct";
|
|
3
|
-
export type InternalAccountType = EthAccountType | BtcAccountType | SolAccountType | TrxAccountType;
|
|
3
|
+
export type InternalAccountType = EthAccountType | BtcAccountType | SolAccountType | TrxAccountType | XlmAccountType;
|
|
4
4
|
export declare const InternalAccountMetadataStruct: Struct<{
|
|
5
5
|
metadata: {
|
|
6
6
|
name: string;
|
|
@@ -806,6 +806,95 @@ export declare const InternalTrxEoaAccountStruct: Struct<{
|
|
|
806
806
|
exportable?: boolean;
|
|
807
807
|
}, null>;
|
|
808
808
|
}>;
|
|
809
|
+
export declare const InternalXlmAccountStruct: Struct<{
|
|
810
|
+
type: "stellar:account";
|
|
811
|
+
id: string;
|
|
812
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
813
|
+
entropy?: {
|
|
814
|
+
type: "mnemonic";
|
|
815
|
+
id: string;
|
|
816
|
+
derivationPath: string;
|
|
817
|
+
groupIndex: number;
|
|
818
|
+
} | {
|
|
819
|
+
type: "private-key";
|
|
820
|
+
} | {
|
|
821
|
+
type: "custom";
|
|
822
|
+
};
|
|
823
|
+
exportable?: boolean;
|
|
824
|
+
};
|
|
825
|
+
metadata: {
|
|
826
|
+
name: string;
|
|
827
|
+
importTime: number;
|
|
828
|
+
keyring: {
|
|
829
|
+
type: string;
|
|
830
|
+
};
|
|
831
|
+
snap?: {
|
|
832
|
+
name: string;
|
|
833
|
+
id: string;
|
|
834
|
+
enabled: boolean;
|
|
835
|
+
};
|
|
836
|
+
nameLastUpdatedAt?: number;
|
|
837
|
+
lastSelected?: number;
|
|
838
|
+
};
|
|
839
|
+
address: string;
|
|
840
|
+
scopes: `${string}:${string}`[];
|
|
841
|
+
methods: import("@metamask/keyring-api").XlmMethod[];
|
|
842
|
+
}, {
|
|
843
|
+
metadata: Struct<{
|
|
844
|
+
name: string;
|
|
845
|
+
importTime: number;
|
|
846
|
+
keyring: {
|
|
847
|
+
type: string;
|
|
848
|
+
};
|
|
849
|
+
snap?: {
|
|
850
|
+
name: string;
|
|
851
|
+
id: string;
|
|
852
|
+
enabled: boolean;
|
|
853
|
+
};
|
|
854
|
+
nameLastUpdatedAt?: number;
|
|
855
|
+
lastSelected?: number;
|
|
856
|
+
}, {
|
|
857
|
+
name: Struct<string, null>;
|
|
858
|
+
nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
859
|
+
snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
|
|
860
|
+
name: string;
|
|
861
|
+
id: string;
|
|
862
|
+
enabled: boolean;
|
|
863
|
+
}, {
|
|
864
|
+
id: Struct<string, null>;
|
|
865
|
+
enabled: Struct<boolean, null>;
|
|
866
|
+
name: Struct<string, null>;
|
|
867
|
+
}>;
|
|
868
|
+
lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
869
|
+
importTime: Struct<number, null>;
|
|
870
|
+
keyring: Struct<{
|
|
871
|
+
type: string;
|
|
872
|
+
}, {
|
|
873
|
+
type: Struct<string, null>;
|
|
874
|
+
}>;
|
|
875
|
+
}>;
|
|
876
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
877
|
+
type: import("@metamask/superstruct").Struct<"stellar:account", "stellar:account">;
|
|
878
|
+
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
|
|
879
|
+
methods: import("@metamask/superstruct").Struct<import("@metamask/keyring-api").XlmMethod[], import("@metamask/superstruct").Struct<import("@metamask/keyring-api").XlmMethod, {
|
|
880
|
+
signMessage: import("@metamask/keyring-api").XlmMethod.SignMessage;
|
|
881
|
+
signTransaction: import("@metamask/keyring-api").XlmMethod.SignTransaction;
|
|
882
|
+
}>>;
|
|
883
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
884
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
|
|
885
|
+
entropy?: {
|
|
886
|
+
type: "mnemonic";
|
|
887
|
+
id: string;
|
|
888
|
+
derivationPath: string;
|
|
889
|
+
groupIndex: number;
|
|
890
|
+
} | {
|
|
891
|
+
type: "private-key";
|
|
892
|
+
} | {
|
|
893
|
+
type: "custom";
|
|
894
|
+
};
|
|
895
|
+
exportable?: boolean;
|
|
896
|
+
}, null>;
|
|
897
|
+
}>;
|
|
809
898
|
export type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;
|
|
810
899
|
export type InternalEthErc4337Account = Infer<typeof InternalEthErc4337AccountStruct>;
|
|
811
900
|
export type InternalBtcP2pkhAccount = Infer<typeof InternalBtcP2pkhAccountStruct>;
|
|
@@ -814,10 +903,11 @@ export type InternalBtcP2wpkhAccount = Infer<typeof InternalBtcP2wpkhAccountStru
|
|
|
814
903
|
export type InternalBtcP2trAccount = Infer<typeof InternalBtcP2trAccountStruct>;
|
|
815
904
|
export type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;
|
|
816
905
|
export type InternalTrxEoaAccount = Infer<typeof InternalTrxEoaAccountStruct>;
|
|
817
|
-
export
|
|
818
|
-
export
|
|
906
|
+
export type InternalXlmAccount = Infer<typeof InternalXlmAccountStruct>;
|
|
907
|
+
export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2pkhAccount> | Struct<InternalBtcP2shAccount> | Struct<InternalBtcP2wpkhAccount> | Struct<InternalBtcP2trAccount> | Struct<InternalSolDataAccount> | Struct<InternalTrxEoaAccount> | Struct<InternalXlmAccount>>;
|
|
908
|
+
export type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2pkhAccount | InternalBtcP2shAccount | InternalBtcP2wpkhAccount | InternalBtcP2trAccount | InternalSolDataAccount | InternalTrxEoaAccount | InternalXlmAccount;
|
|
819
909
|
export declare const InternalAccountStruct: Struct<{
|
|
820
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
910
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
821
911
|
id: string;
|
|
822
912
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
823
913
|
entropy?: {
|
|
@@ -884,7 +974,7 @@ export declare const InternalAccountStruct: Struct<{
|
|
|
884
974
|
}>;
|
|
885
975
|
}>;
|
|
886
976
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
887
|
-
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
977
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
888
978
|
"eip155:eoa": "eip155:eoa";
|
|
889
979
|
"eip155:erc4337": "eip155:erc4337";
|
|
890
980
|
"bip122:p2pkh": "bip122:p2pkh";
|
|
@@ -893,6 +983,7 @@ export declare const InternalAccountStruct: Struct<{
|
|
|
893
983
|
"bip122:p2tr": "bip122:p2tr";
|
|
894
984
|
"solana:data-account": "solana:data-account";
|
|
895
985
|
"tron:eoa": "tron:eoa";
|
|
986
|
+
"stellar:account": "stellar:account";
|
|
896
987
|
"any:account": "any:account";
|
|
897
988
|
}>;
|
|
898
989
|
address: import("@metamask/superstruct").Struct<string, null>;
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,cAAc,EAEd,cAAc,EAQd,cAAc,EAEd,cAAc,EAEf,8BAA8B;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B;AAG3D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,cAAc,GACd,cAAc,GACd,cAAc,GACd,cAAc,CAAC;AAEnB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBxC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA6DnB,CAAC;;;;;;;;;;kBAMA,CAAC;;EAhErB,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA8GyrB,CAAC;;;;;;;;;;kBAAoP,CAAC;;EA3Gz9B,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAqC9B,CAAC;;;;;;;;;;kBAQgE,CAAC;;EA1C5E,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA8F7B,CAAC;;;;;;;;;;kBAMb,CAAC;;EAjGC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;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,OAAO,4BAA4B,CAAC,CAAC;AAEhF,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEhF,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE9E,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAExE,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,MAAM,EACJ,MAAM,CAAC,qBAAqB,CAAC,GAC7B,MAAM,CAAC,yBAAyB,CAAC,GACjC,MAAM,CAAC,uBAAuB,CAAC,GAC/B,MAAM,CAAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,wBAAwB,CAAC,GAChC,MAAM,CAAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,qBAAqB,CAAC,GAC7B,MAAM,CAAC,kBAAkB,CAAC,CAW7B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B,qBAAqB,GACrB,yBAAyB,GACzB,uBAAuB,GACvB,sBAAsB,GACtB,wBAAwB,GACxB,sBAAsB,GACtB,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAAjB,CAAC;;;;;;;;;;kBASL,CAAC;;;EANZ,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/types.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BtcAccountType, EthAccountType, SolAccountType, TrxAccountType } from "@metamask/keyring-api";
|
|
1
|
+
import { BtcAccountType, EthAccountType, SolAccountType, TrxAccountType, XlmAccountType } from "@metamask/keyring-api";
|
|
2
2
|
import type { Infer, Struct } from "@metamask/superstruct";
|
|
3
|
-
export type InternalAccountType = EthAccountType | BtcAccountType | SolAccountType | TrxAccountType;
|
|
3
|
+
export type InternalAccountType = EthAccountType | BtcAccountType | SolAccountType | TrxAccountType | XlmAccountType;
|
|
4
4
|
export declare const InternalAccountMetadataStruct: Struct<{
|
|
5
5
|
metadata: {
|
|
6
6
|
name: string;
|
|
@@ -806,6 +806,95 @@ export declare const InternalTrxEoaAccountStruct: Struct<{
|
|
|
806
806
|
exportable?: boolean;
|
|
807
807
|
}, null>;
|
|
808
808
|
}>;
|
|
809
|
+
export declare const InternalXlmAccountStruct: Struct<{
|
|
810
|
+
type: "stellar:account";
|
|
811
|
+
id: string;
|
|
812
|
+
options: Record<string, import("@metamask/utils").Json> & {
|
|
813
|
+
entropy?: {
|
|
814
|
+
type: "mnemonic";
|
|
815
|
+
id: string;
|
|
816
|
+
derivationPath: string;
|
|
817
|
+
groupIndex: number;
|
|
818
|
+
} | {
|
|
819
|
+
type: "private-key";
|
|
820
|
+
} | {
|
|
821
|
+
type: "custom";
|
|
822
|
+
};
|
|
823
|
+
exportable?: boolean;
|
|
824
|
+
};
|
|
825
|
+
metadata: {
|
|
826
|
+
name: string;
|
|
827
|
+
importTime: number;
|
|
828
|
+
keyring: {
|
|
829
|
+
type: string;
|
|
830
|
+
};
|
|
831
|
+
snap?: {
|
|
832
|
+
name: string;
|
|
833
|
+
id: string;
|
|
834
|
+
enabled: boolean;
|
|
835
|
+
};
|
|
836
|
+
nameLastUpdatedAt?: number;
|
|
837
|
+
lastSelected?: number;
|
|
838
|
+
};
|
|
839
|
+
address: string;
|
|
840
|
+
scopes: `${string}:${string}`[];
|
|
841
|
+
methods: import("@metamask/keyring-api").XlmMethod[];
|
|
842
|
+
}, {
|
|
843
|
+
metadata: Struct<{
|
|
844
|
+
name: string;
|
|
845
|
+
importTime: number;
|
|
846
|
+
keyring: {
|
|
847
|
+
type: string;
|
|
848
|
+
};
|
|
849
|
+
snap?: {
|
|
850
|
+
name: string;
|
|
851
|
+
id: string;
|
|
852
|
+
enabled: boolean;
|
|
853
|
+
};
|
|
854
|
+
nameLastUpdatedAt?: number;
|
|
855
|
+
lastSelected?: number;
|
|
856
|
+
}, {
|
|
857
|
+
name: Struct<string, null>;
|
|
858
|
+
nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
859
|
+
snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
|
|
860
|
+
name: string;
|
|
861
|
+
id: string;
|
|
862
|
+
enabled: boolean;
|
|
863
|
+
}, {
|
|
864
|
+
id: Struct<string, null>;
|
|
865
|
+
enabled: Struct<boolean, null>;
|
|
866
|
+
name: Struct<string, null>;
|
|
867
|
+
}>;
|
|
868
|
+
lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
|
|
869
|
+
importTime: Struct<number, null>;
|
|
870
|
+
keyring: Struct<{
|
|
871
|
+
type: string;
|
|
872
|
+
}, {
|
|
873
|
+
type: Struct<string, null>;
|
|
874
|
+
}>;
|
|
875
|
+
}>;
|
|
876
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
|
877
|
+
type: import("@metamask/superstruct").Struct<"stellar:account", "stellar:account">;
|
|
878
|
+
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
|
|
879
|
+
methods: import("@metamask/superstruct").Struct<import("@metamask/keyring-api").XlmMethod[], import("@metamask/superstruct").Struct<import("@metamask/keyring-api").XlmMethod, {
|
|
880
|
+
signMessage: import("@metamask/keyring-api").XlmMethod.SignMessage;
|
|
881
|
+
signTransaction: import("@metamask/keyring-api").XlmMethod.SignTransaction;
|
|
882
|
+
}>>;
|
|
883
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
|
884
|
+
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
|
|
885
|
+
entropy?: {
|
|
886
|
+
type: "mnemonic";
|
|
887
|
+
id: string;
|
|
888
|
+
derivationPath: string;
|
|
889
|
+
groupIndex: number;
|
|
890
|
+
} | {
|
|
891
|
+
type: "private-key";
|
|
892
|
+
} | {
|
|
893
|
+
type: "custom";
|
|
894
|
+
};
|
|
895
|
+
exportable?: boolean;
|
|
896
|
+
}, null>;
|
|
897
|
+
}>;
|
|
809
898
|
export type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;
|
|
810
899
|
export type InternalEthErc4337Account = Infer<typeof InternalEthErc4337AccountStruct>;
|
|
811
900
|
export type InternalBtcP2pkhAccount = Infer<typeof InternalBtcP2pkhAccountStruct>;
|
|
@@ -814,10 +903,11 @@ export type InternalBtcP2wpkhAccount = Infer<typeof InternalBtcP2wpkhAccountStru
|
|
|
814
903
|
export type InternalBtcP2trAccount = Infer<typeof InternalBtcP2trAccountStruct>;
|
|
815
904
|
export type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;
|
|
816
905
|
export type InternalTrxEoaAccount = Infer<typeof InternalTrxEoaAccountStruct>;
|
|
817
|
-
export
|
|
818
|
-
export
|
|
906
|
+
export type InternalXlmAccount = Infer<typeof InternalXlmAccountStruct>;
|
|
907
|
+
export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2pkhAccount> | Struct<InternalBtcP2shAccount> | Struct<InternalBtcP2wpkhAccount> | Struct<InternalBtcP2trAccount> | Struct<InternalSolDataAccount> | Struct<InternalTrxEoaAccount> | Struct<InternalXlmAccount>>;
|
|
908
|
+
export type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2pkhAccount | InternalBtcP2shAccount | InternalBtcP2wpkhAccount | InternalBtcP2trAccount | InternalSolDataAccount | InternalTrxEoaAccount | InternalXlmAccount;
|
|
819
909
|
export declare const InternalAccountStruct: Struct<{
|
|
820
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
910
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
821
911
|
id: string;
|
|
822
912
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
823
913
|
entropy?: {
|
|
@@ -884,7 +974,7 @@ export declare const InternalAccountStruct: Struct<{
|
|
|
884
974
|
}>;
|
|
885
975
|
}>;
|
|
886
976
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
887
|
-
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
977
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
888
978
|
"eip155:eoa": "eip155:eoa";
|
|
889
979
|
"eip155:erc4337": "eip155:erc4337";
|
|
890
980
|
"bip122:p2pkh": "bip122:p2pkh";
|
|
@@ -893,6 +983,7 @@ export declare const InternalAccountStruct: Struct<{
|
|
|
893
983
|
"bip122:p2tr": "bip122:p2tr";
|
|
894
984
|
"solana:data-account": "solana:data-account";
|
|
895
985
|
"tron:eoa": "tron:eoa";
|
|
986
|
+
"stellar:account": "stellar:account";
|
|
896
987
|
"any:account": "any:account";
|
|
897
988
|
}>;
|
|
898
989
|
address: import("@metamask/superstruct").Struct<string, null>;
|
package/dist/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRo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AEhF,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE9E,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAExE,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,MAAM,EACJ,MAAM,CAAC,qBAAqB,CAAC,GAC7B,MAAM,CAAC,yBAAyB,CAAC,GACjC,MAAM,CAAC,uBAAuB,CAAC,GAC/B,MAAM,CAAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,wBAAwB,CAAC,GAChC,MAAM,CAAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,qBAAqB,CAAC,GAC7B,MAAM,CAAC,kBAAkB,CAAC,CAW7B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B,qBAAqB,GACrB,yBAAyB,GACzB,uBAAuB,GACvB,sBAAsB,GACtB,wBAAwB,GACxB,sBAAsB,GACtB,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAAjB,CAAC;;;;;;;;;;kBASL,CAAC;;;EANZ,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/types.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// FIXME: eslint is complaning about our account union even if those accounts
|
|
2
2
|
// types should all be different, so we disable this for now:
|
|
3
|
-
|
|
4
|
-
import { BtcAccountType, EthAccountType, KeyringAccountStruct, SolAccountType, BtcP2pkhAccountStruct, BtcP2shAccountStruct, BtcP2wpkhAccountStruct, BtcP2trAccountStruct, EthEoaAccountStruct, EthErc4337AccountStruct, SolDataAccountStruct, TrxAccountType, TrxEoaAccountStruct } from "@metamask/keyring-api";
|
|
3
|
+
import { BtcAccountType, EthAccountType, KeyringAccountStruct, SolAccountType, BtcP2pkhAccountStruct, BtcP2shAccountStruct, BtcP2wpkhAccountStruct, BtcP2trAccountStruct, EthEoaAccountStruct, EthErc4337AccountStruct, SolDataAccountStruct, TrxAccountType, TrxEoaAccountStruct, XlmAccountType, XlmAccountStruct } from "@metamask/keyring-api";
|
|
5
4
|
import { exactOptional, object } from "@metamask/keyring-utils";
|
|
6
5
|
import { boolean, string, number } from "@metamask/superstruct";
|
|
7
6
|
export const InternalAccountMetadataStruct = object({
|
|
@@ -52,6 +51,10 @@ export const InternalTrxEoaAccountStruct = object({
|
|
|
52
51
|
...TrxEoaAccountStruct.schema,
|
|
53
52
|
...InternalAccountMetadataStruct.schema,
|
|
54
53
|
});
|
|
54
|
+
export const InternalXlmAccountStruct = object({
|
|
55
|
+
...XlmAccountStruct.schema,
|
|
56
|
+
...InternalAccountMetadataStruct.schema,
|
|
57
|
+
});
|
|
55
58
|
export const InternalAccountStructs = {
|
|
56
59
|
[`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,
|
|
57
60
|
[`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,
|
|
@@ -61,6 +64,7 @@ export const InternalAccountStructs = {
|
|
|
61
64
|
[`${BtcAccountType.P2tr}`]: InternalBtcP2trAccountStruct,
|
|
62
65
|
[`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,
|
|
63
66
|
[`${TrxAccountType.Eoa}`]: InternalTrxEoaAccountStruct,
|
|
67
|
+
[`${XlmAccountType.Account}`]: InternalXlmAccountStruct,
|
|
64
68
|
};
|
|
65
69
|
export const InternalAccountStruct = object({
|
|
66
70
|
...KeyringAccountStruct.schema,
|
package/dist/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,6EAA6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,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,8BAA8B;IAC5D,CAAC,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,4BAA4B;IACxD,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC,EAAE,4BAA4B;IAC/D,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC,EAAE,2BAA2B;IACtD,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE,wBAAwB;CACxD,CAAC;AAaF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;IAC1C,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["// FIXME: eslint is complaning about our account union even if those accounts\n// types should all be different, so we disable this for now:\n\nimport {\n BtcAccountType,\n EthAccountType,\n KeyringAccountStruct,\n SolAccountType,\n BtcP2pkhAccountStruct,\n BtcP2shAccountStruct,\n BtcP2wpkhAccountStruct,\n BtcP2trAccountStruct,\n EthEoaAccountStruct,\n EthErc4337AccountStruct,\n SolDataAccountStruct,\n TrxAccountType,\n TrxEoaAccountStruct,\n XlmAccountType,\n XlmAccountStruct,\n} from '@metamask/keyring-api';\nimport { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer, Struct } from '@metamask/superstruct';\nimport { boolean, string, number } from '@metamask/superstruct';\n\nexport type InternalAccountType =\n | EthAccountType\n | BtcAccountType\n | SolAccountType\n | TrxAccountType\n | XlmAccountType;\n\nexport const InternalAccountMetadataStruct = object({\n metadata: object({\n name: string(),\n nameLastUpdatedAt: exactOptional(number()),\n snap: exactOptional(\n object({\n id: string(),\n enabled: boolean(),\n name: string(),\n }),\n ),\n lastSelected: exactOptional(number()),\n importTime: number(),\n keyring: object({\n type: string(),\n }),\n }),\n});\n\nexport const InternalEthEoaAccountStruct = object({\n ...EthEoaAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalEthErc4337AccountStruct = object({\n ...EthErc4337AccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2pkhAccountStruct = object({\n ...BtcP2pkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2shAccountStruct = object({\n ...BtcP2shAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2wpkhAccountStruct = object({\n ...BtcP2wpkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2trAccountStruct = object({\n ...BtcP2trAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalSolDataAccountStruct = object({\n ...SolDataAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalTrxEoaAccountStruct = object({\n ...TrxEoaAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalXlmAccountStruct = object({\n ...XlmAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;\n\nexport type InternalEthErc4337Account = Infer<\n typeof InternalEthErc4337AccountStruct\n>;\n\nexport type InternalBtcP2pkhAccount = Infer<\n typeof InternalBtcP2pkhAccountStruct\n>;\n\nexport type InternalBtcP2shAccount = Infer<typeof InternalBtcP2shAccountStruct>;\n\nexport type InternalBtcP2wpkhAccount = Infer<\n typeof InternalBtcP2wpkhAccountStruct\n>;\n\nexport type InternalBtcP2trAccount = Infer<typeof InternalBtcP2trAccountStruct>;\n\nexport type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;\n\nexport type InternalTrxEoaAccount = Infer<typeof InternalTrxEoaAccountStruct>;\n\nexport type InternalXlmAccount = Infer<typeof InternalXlmAccountStruct>;\n\nexport const InternalAccountStructs: Record<\n string,\n | Struct<InternalEthEoaAccount>\n | Struct<InternalEthErc4337Account>\n | Struct<InternalBtcP2pkhAccount>\n | Struct<InternalBtcP2shAccount>\n | Struct<InternalBtcP2wpkhAccount>\n | Struct<InternalBtcP2trAccount>\n | Struct<InternalSolDataAccount>\n | Struct<InternalTrxEoaAccount>\n | Struct<InternalXlmAccount>\n> = {\n [`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,\n [`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,\n [`${BtcAccountType.P2pkh}`]: InternalBtcP2pkhAccountStruct,\n [`${BtcAccountType.P2sh}`]: InternalBtcP2shAccountStruct,\n [`${BtcAccountType.P2wpkh}`]: InternalBtcP2wpkhAccountStruct,\n [`${BtcAccountType.P2tr}`]: InternalBtcP2trAccountStruct,\n [`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,\n [`${TrxAccountType.Eoa}`]: InternalTrxEoaAccountStruct,\n [`${XlmAccountType.Account}`]: InternalXlmAccountStruct,\n};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2pkhAccount\n | InternalBtcP2shAccount\n | InternalBtcP2wpkhAccount\n | InternalBtcP2trAccount\n | InternalSolDataAccount\n | InternalTrxEoaAccount\n | InternalXlmAccount;\n\nexport const InternalAccountStruct = object({\n ...KeyringAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\n/**\n * Internal account representation.\n *\n * This type is used internally by MetaMask to add additional metadata to the\n * account object. It's should not be used by external applications.\n */\nexport type InternalAccount = Infer<typeof InternalAccountStruct>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/keyring-internal-api",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.1.1-7275dbc",
|
|
4
4
|
"description": "MetaMask Keyring Internal API",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
6
|
+
"keyring",
|
|
7
|
+
"metamask"
|
|
8
8
|
],
|
|
9
9
|
"homepage": "https://github.com/MetaMask/accounts/tree/main/packages/keyring-internal-api#readme",
|
|
10
10
|
"bugs": {
|
|
11
11
|
"url": "https://github.com/MetaMask/accounts/issues"
|
|
12
12
|
},
|
|
13
|
+
"license": "MIT",
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
15
16
|
"url": "https://github.com/MetaMask/accounts.git"
|
|
16
17
|
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist/"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"main": "./dist/index.cjs",
|
|
23
|
+
"types": "./dist/index.d.cts",
|
|
17
24
|
"exports": {
|
|
18
25
|
".": {
|
|
19
26
|
"import": {
|
|
@@ -24,35 +31,38 @@
|
|
|
24
31
|
"types": "./dist/index.d.cts",
|
|
25
32
|
"default": "./dist/index.cjs"
|
|
26
33
|
}
|
|
27
|
-
}
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public",
|
|
39
|
+
"registry": "https://registry.npmjs.org/"
|
|
28
40
|
},
|
|
29
|
-
"main": "./dist/index.cjs",
|
|
30
|
-
"types": "./dist/index.d.cts",
|
|
31
|
-
"files": [
|
|
32
|
-
"dist/"
|
|
33
|
-
],
|
|
34
41
|
"scripts": {
|
|
35
|
-
"build": "ts-bridge --project tsconfig.build.json --no-references",
|
|
42
|
+
"build": "ts-bridge --project tsconfig.build.json --verbose --clean --no-references",
|
|
43
|
+
"build:all": "ts-bridge --project tsconfig.build.json --verbose --clean",
|
|
36
44
|
"build:clean": "yarn build --clean",
|
|
37
45
|
"build:docs": "typedoc",
|
|
38
46
|
"changelog:update": "../../scripts/update-changelog.sh @metamask/keyring-internal-api",
|
|
39
47
|
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/keyring-internal-api",
|
|
40
48
|
"publish:preview": "yarn npm publish --tag preview",
|
|
49
|
+
"since-latest-release": "../../scripts/since-latest-release.sh",
|
|
41
50
|
"test": "yarn test:source && yarn test:types",
|
|
42
|
-
"test:clean": "jest --clearCache",
|
|
43
|
-
"test:source": "jest
|
|
51
|
+
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
|
|
52
|
+
"test:source": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
|
|
44
53
|
"test:types": "../../scripts/tsd-test.sh ./src",
|
|
45
|
-
"test:
|
|
54
|
+
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
|
|
55
|
+
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
|
|
46
56
|
},
|
|
47
57
|
"dependencies": {
|
|
48
|
-
"@metamask/keyring-api": "
|
|
58
|
+
"@metamask/keyring-api": "23.0.1",
|
|
49
59
|
"@metamask/keyring-utils": "3.2.0",
|
|
50
60
|
"@metamask/superstruct": "^3.1.0"
|
|
51
61
|
},
|
|
52
62
|
"devDependencies": {
|
|
53
63
|
"@lavamoat/allow-scripts": "^3.2.1",
|
|
54
64
|
"@lavamoat/preinstall-always-fail": "^2.1.0",
|
|
55
|
-
"@metamask/auto-changelog": "^
|
|
65
|
+
"@metamask/auto-changelog": "^6.1.0",
|
|
56
66
|
"@ts-bridge/cli": "^0.6.3",
|
|
57
67
|
"@types/jest": "^29.5.12",
|
|
58
68
|
"@types/node": "^20.12.12",
|
|
@@ -67,22 +77,18 @@
|
|
|
67
77
|
"typedoc": "^0.25.13",
|
|
68
78
|
"typescript": "~5.6.3"
|
|
69
79
|
},
|
|
80
|
+
"tsd": {
|
|
81
|
+
"compilerOptions": {
|
|
82
|
+
"composite": "false"
|
|
83
|
+
},
|
|
84
|
+
"directory": "src"
|
|
85
|
+
},
|
|
70
86
|
"engines": {
|
|
71
87
|
"node": "^18.18 || >=20"
|
|
72
88
|
},
|
|
73
|
-
"publishConfig": {
|
|
74
|
-
"access": "public",
|
|
75
|
-
"registry": "https://registry.npmjs.org/"
|
|
76
|
-
},
|
|
77
89
|
"lavamoat": {
|
|
78
90
|
"allowScripts": {
|
|
79
91
|
"@lavamoat/preinstall-always-fail": false
|
|
80
92
|
}
|
|
81
|
-
},
|
|
82
|
-
"tsd": {
|
|
83
|
-
"directory": "src",
|
|
84
|
-
"compilerOptions": {
|
|
85
|
-
"composite": "false"
|
|
86
|
-
}
|
|
87
93
|
}
|
|
88
94
|
}
|