@metamask-previews/keyring-api 10.1.0-3416820 → 11.0.0-22cd5fe
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 +9 -1
- package/dist/api/account.cjs +4 -0
- package/dist/api/account.cjs.map +1 -1
- package/dist/api/account.d.cts +5 -0
- package/dist/api/account.d.cts.map +1 -1
- package/dist/api/account.d.mts +5 -0
- package/dist/api/account.d.mts.map +1 -1
- package/dist/api/account.mjs +6 -2
- package/dist/api/account.mjs.map +1 -1
- package/dist/api/caip.cjs +3 -3
- package/dist/api/caip.cjs.map +1 -1
- package/dist/btc/constants.cjs +13 -0
- package/dist/btc/constants.cjs.map +1 -0
- package/dist/btc/constants.d.cts +9 -0
- package/dist/btc/constants.d.cts.map +1 -0
- package/dist/btc/constants.d.mts +9 -0
- package/dist/btc/constants.d.mts.map +1 -0
- package/dist/btc/constants.mjs +10 -0
- package/dist/btc/constants.mjs.map +1 -0
- package/dist/btc/index.cjs +1 -0
- package/dist/btc/index.cjs.map +1 -1
- package/dist/btc/index.d.cts +1 -0
- package/dist/btc/index.d.cts.map +1 -1
- package/dist/btc/index.d.mts +1 -0
- package/dist/btc/index.d.mts.map +1 -1
- package/dist/btc/index.mjs +1 -0
- package/dist/btc/index.mjs.map +1 -1
- package/dist/btc/types.d.cts +2 -0
- package/dist/btc/types.d.cts.map +1 -1
- package/dist/btc/types.d.mts +2 -0
- package/dist/btc/types.d.mts.map +1 -1
- package/dist/eth/constants.cjs +12 -0
- package/dist/eth/constants.cjs.map +1 -0
- package/dist/eth/constants.d.cts +8 -0
- package/dist/eth/constants.d.cts.map +1 -0
- package/dist/eth/constants.d.mts +8 -0
- package/dist/eth/constants.d.mts.map +1 -0
- package/dist/eth/constants.mjs +9 -0
- package/dist/eth/constants.mjs.map +1 -0
- package/dist/eth/index.cjs +1 -0
- package/dist/eth/index.cjs.map +1 -1
- package/dist/eth/index.d.cts +1 -0
- package/dist/eth/index.d.cts.map +1 -1
- package/dist/eth/index.d.mts +1 -0
- package/dist/eth/index.d.mts.map +1 -1
- package/dist/eth/index.mjs +1 -0
- package/dist/eth/index.mjs.map +1 -1
- package/dist/eth/types.d.cts +4 -0
- package/dist/eth/types.d.cts.map +1 -1
- package/dist/eth/types.d.mts +4 -0
- package/dist/eth/types.d.mts.map +1 -1
- package/dist/eth/utils.cjs +1 -2
- package/dist/eth/utils.cjs.map +1 -1
- package/dist/internal/api.d.cts +11 -0
- package/dist/internal/api.d.cts.map +1 -1
- package/dist/internal/api.d.mts +11 -0
- package/dist/internal/api.d.mts.map +1 -1
- package/dist/internal/events.d.cts +8 -0
- package/dist/internal/events.d.cts.map +1 -1
- package/dist/internal/events.d.mts +8 -0
- package/dist/internal/events.d.mts.map +1 -1
- package/dist/internal/rpc.cjs +2 -2
- package/dist/internal/rpc.cjs.map +1 -1
- package/dist/internal/types.d.cts +10 -0
- package/dist/internal/types.d.cts.map +1 -1
- package/dist/internal/types.d.mts +10 -0
- package/dist/internal/types.d.mts.map +1 -1
- package/dist/rpc-handler.cjs +2 -2
- package/dist/rpc-handler.cjs.map +1 -1
- package/dist/snap-utils.cjs +1 -2
- package/dist/snap-utils.cjs.map +1 -1
- package/dist/sol/constants.cjs +14 -0
- package/dist/sol/constants.cjs.map +1 -0
- package/dist/sol/constants.d.cts +10 -0
- package/dist/sol/constants.d.cts.map +1 -0
- package/dist/sol/constants.d.mts +10 -0
- package/dist/sol/constants.d.mts.map +1 -0
- package/dist/sol/constants.mjs +11 -0
- package/dist/sol/constants.mjs.map +1 -0
- package/dist/sol/index.cjs +1 -0
- package/dist/sol/index.cjs.map +1 -1
- package/dist/sol/index.d.cts +1 -0
- package/dist/sol/index.d.cts.map +1 -1
- package/dist/sol/index.d.mts +1 -0
- package/dist/sol/index.d.mts.map +1 -1
- package/dist/sol/index.mjs +1 -0
- package/dist/sol/index.mjs.map +1 -1
- package/dist/sol/types.d.cts +2 -0
- package/dist/sol/types.d.cts.map +1 -1
- package/dist/sol/types.d.mts +2 -0
- package/dist/sol/types.d.mts.map +1 -1
- package/dist/superstruct.cjs +4 -5
- package/dist/superstruct.cjs.map +1 -1
- package/dist/utils/typing.cjs +1 -2
- package/dist/utils/typing.cjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [11.0.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **BREAKING:** Add ESM build ([#40](https://github.com/MetaMask/accounts/pull/40))
|
|
15
|
+
- It's no longer possible to import files from `./dist` directly.
|
|
16
|
+
|
|
10
17
|
## [10.1.0]
|
|
11
18
|
|
|
12
19
|
### Added
|
|
@@ -431,7 +438,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
431
438
|
- SnapController keyring client. It is intended to be used by MetaMask to talk to the snap.
|
|
432
439
|
- Helper functions to create keyring handler in the snap.
|
|
433
440
|
|
|
434
|
-
[Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@
|
|
441
|
+
[Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@11.0.0...HEAD
|
|
442
|
+
[11.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@10.1.0...@metamask/keyring-api@11.0.0
|
|
435
443
|
[10.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@10.0.0...@metamask/keyring-api@10.1.0
|
|
436
444
|
[10.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@9.0.0...@metamask/keyring-api@10.0.0
|
|
437
445
|
[9.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@8.1.3...@metamask/keyring-api@9.0.0
|
package/dist/api/account.cjs
CHANGED
|
@@ -52,6 +52,10 @@ exports.KeyringAccountStruct = (0, superstruct_2.object)({
|
|
|
52
52
|
* Account main address.
|
|
53
53
|
*/
|
|
54
54
|
address: (0, superstruct_1.string)(),
|
|
55
|
+
/**
|
|
56
|
+
* Account supported scopes (CAIP-2 chain IDs).
|
|
57
|
+
*/
|
|
58
|
+
scopes: (0, superstruct_1.array)((0, superstruct_1.union)([utils_1.CaipNamespaceStruct, utils_1.CaipChainIdStruct])),
|
|
55
59
|
/**
|
|
56
60
|
* Account options.
|
|
57
61
|
*/
|
package/dist/api/account.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":";;;AACA,uDAA4E;AAC5E,2CAIyB;AAEzB,oDAAwC;AACxC,8CAAsC;AAEtC;;GAEG;AACH,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,IAAA,oBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,kBAAU;IAEd;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,MAAM,EAAE,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,CAAC,2BAAmB,EAAE,yBAAiB,CAAC,CAAC,CAAC;IAE9D;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { array, enums, record, string, union } from '@metamask/superstruct';\nimport {\n CaipChainIdStruct,\n CaipNamespaceStruct,\n JsonStruct,\n} from '@metamask/utils';\n\nimport { object } from '../superstruct';\nimport { UuidStruct } from '../utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: array(union([CaipNamespaceStruct, CaipChainIdStruct])),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
|
package/dist/api/account.d.cts
CHANGED
|
@@ -33,6 +33,7 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
|
|
|
33
33
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
34
34
|
id: string;
|
|
35
35
|
address: string;
|
|
36
|
+
scopes: string[];
|
|
36
37
|
options: Record<string, import("@metamask/utils").Json>;
|
|
37
38
|
methods: string[];
|
|
38
39
|
}, {
|
|
@@ -53,6 +54,10 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
|
|
|
53
54
|
* Account main address.
|
|
54
55
|
*/
|
|
55
56
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
57
|
+
/**
|
|
58
|
+
* Account supported scopes (CAIP-2 chain IDs).
|
|
59
|
+
*/
|
|
60
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
56
61
|
/**
|
|
57
62
|
* Account options.
|
|
58
63
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;
|
|
1
|
+
{"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAWnD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/api/account.d.mts
CHANGED
|
@@ -33,6 +33,7 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
|
|
|
33
33
|
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
|
|
34
34
|
id: string;
|
|
35
35
|
address: string;
|
|
36
|
+
scopes: string[];
|
|
36
37
|
options: Record<string, import("@metamask/utils").Json>;
|
|
37
38
|
methods: string[];
|
|
38
39
|
}, {
|
|
@@ -53,6 +54,10 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
|
|
|
53
54
|
* Account main address.
|
|
54
55
|
*/
|
|
55
56
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
57
|
+
/**
|
|
58
|
+
* Account supported scopes (CAIP-2 chain IDs).
|
|
59
|
+
*/
|
|
60
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
56
61
|
/**
|
|
57
62
|
* Account options.
|
|
58
63
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;
|
|
1
|
+
{"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAWnD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/api/account.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { array, enums, record, string } from "@metamask/superstruct";
|
|
2
|
-
import { JsonStruct } from "@metamask/utils";
|
|
1
|
+
import { array, enums, record, string, union } from "@metamask/superstruct";
|
|
2
|
+
import { CaipChainIdStruct, CaipNamespaceStruct, JsonStruct } from "@metamask/utils";
|
|
3
3
|
import { object } from "../superstruct.mjs";
|
|
4
4
|
import { UuidStruct } from "../utils/index.mjs";
|
|
5
5
|
/**
|
|
@@ -49,6 +49,10 @@ export const KeyringAccountStruct = object({
|
|
|
49
49
|
* Account main address.
|
|
50
50
|
*/
|
|
51
51
|
address: string(),
|
|
52
|
+
/**
|
|
53
|
+
* Account supported scopes (CAIP-2 chain IDs).
|
|
54
|
+
*/
|
|
55
|
+
scopes: array(union([CaipNamespaceStruct, CaipChainIdStruct])),
|
|
52
56
|
/**
|
|
53
57
|
* Account options.
|
|
54
58
|
*/
|
package/dist/api/account.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.mjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;
|
|
1
|
+
{"version":3,"file":"account.mjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AAC5E,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACX,wBAAwB;AAEzB,OAAO,EAAE,MAAM,EAAE,2BAAuB;AACxC,OAAO,EAAE,UAAU,EAAE,2BAAiB;AAEtC;;GAEG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,UAAU;IAEd;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE;IAEjB;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE9D;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { array, enums, record, string, union } from '@metamask/superstruct';\nimport {\n CaipChainIdStruct,\n CaipNamespaceStruct,\n JsonStruct,\n} from '@metamask/utils';\n\nimport { object } from '../superstruct';\nimport { UuidStruct } from '../utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: array(union([CaipNamespaceStruct, CaipChainIdStruct])),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
|
package/dist/api/caip.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CaipAssetIdStruct = exports.CaipAssetTypeStruct = void 0;
|
|
4
|
+
exports.isCaipAssetType = isCaipAssetType;
|
|
5
|
+
exports.isCaipAssetId = isCaipAssetId;
|
|
4
6
|
const superstruct_1 = require("@metamask/superstruct");
|
|
5
7
|
const superstruct_2 = require("../superstruct.cjs");
|
|
6
8
|
const CAIP_ASSET_TYPE_REGEX = /^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u;
|
|
@@ -28,7 +30,6 @@ exports.CaipAssetIdStruct = (0, superstruct_2.definePattern)('CaipAssetId', CAIP
|
|
|
28
30
|
function isCaipAssetType(value) {
|
|
29
31
|
return (0, superstruct_1.is)(value, exports.CaipAssetTypeStruct);
|
|
30
32
|
}
|
|
31
|
-
exports.isCaipAssetType = isCaipAssetType;
|
|
32
33
|
/**
|
|
33
34
|
* Check if the given value is a {@link CaipAssetId}.
|
|
34
35
|
*
|
|
@@ -44,5 +45,4 @@ exports.isCaipAssetType = isCaipAssetType;
|
|
|
44
45
|
function isCaipAssetId(value) {
|
|
45
46
|
return (0, superstruct_1.is)(value, exports.CaipAssetIdStruct);
|
|
46
47
|
}
|
|
47
|
-
exports.isCaipAssetId = isCaipAssetId;
|
|
48
48
|
//# sourceMappingURL=caip.cjs.map
|
package/dist/api/caip.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caip.cjs","sourceRoot":"","sources":["../../src/api/caip.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"caip.cjs","sourceRoot":"","sources":["../../src/api/caip.ts"],"names":[],"mappings":";;;AAwCA,0CAEC;AAcD,sCAEC;AA1DD,uDAAuD;AAEvD,oDAA+C;AAE/C,MAAM,qBAAqB,GACzB,2JAA2J,CAAC;AAE9J,MAAM,mBAAmB,GACvB,6LAA6L,CAAC;AAEhM;;GAEG;AACU,QAAA,mBAAmB,GAAG,IAAA,2BAAa,EAC9C,eAAe,EACf,qBAAqB,CACtB,CAAC;AAGF;;GAEG;AACU,QAAA,iBAAiB,GAAG,IAAA,2BAAa,EAC5C,aAAa,EACb,mBAAmB,CACpB,CAAC;AAGF;;;;;;;;;;;GAWG;AACH,SAAgB,eAAe,CAAC,KAAc;IAC5C,OAAO,IAAA,gBAAE,EAAC,KAAK,EAAE,2BAAmB,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,aAAa,CAAC,KAAc;IAC1C,OAAO,IAAA,gBAAE,EAAC,KAAK,EAAE,yBAAiB,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { is, type Infer } from '@metamask/superstruct';\n\nimport { definePattern } from '../superstruct';\n\nconst CAIP_ASSET_TYPE_REGEX =\n /^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u;\n\nconst CAIP_ASSET_ID_REGEX =\n /^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u;\n\n/**\n * A CAIP-19 asset type identifier, i.e., a human-readable type of asset identifier.\n */\nexport const CaipAssetTypeStruct = definePattern(\n 'CaipAssetType',\n CAIP_ASSET_TYPE_REGEX,\n);\nexport type CaipAssetType = Infer<typeof CaipAssetTypeStruct>;\n\n/**\n * A CAIP-19 asset ID identifier, i.e., a human-readable type of asset ID.\n */\nexport const CaipAssetIdStruct = definePattern(\n 'CaipAssetId',\n CAIP_ASSET_ID_REGEX,\n);\nexport type CaipAssetId = Infer<typeof CaipAssetIdStruct>;\n\n/**\n * Check if the given value is a {@link CaipAssetType}.\n *\n * @param value - The value to check.\n * @returns Whether the value is a {@link CaipAssetType}.\n * @example\n * ```ts\n * isCaipAssetType('eip155:1/slip44:60'); // true\n * isCaipAssetType('cosmos:cosmoshub-3/slip44:118'); // true\n * isCaipAssetType('hedera:mainnet/nft:0.0.55492/12'); // false\n * ```\n */\nexport function isCaipAssetType(value: unknown): value is CaipAssetType {\n return is(value, CaipAssetTypeStruct);\n}\n\n/**\n * Check if the given value is a {@link CaipAssetId}.\n *\n * @param value - The value to check.\n * @returns Whether the value is a {@link CaipAssetId}.\n * @example\n * ```ts\n * isCaipAssetType('eip155:1/slip44:60'); // false\n * isCaipAssetType('cosmos:cosmoshub-3/slip44:118'); // false\n * isCaipAssetType('hedera:mainnet/nft:0.0.55492/12'); // true\n * ```\n */\nexport function isCaipAssetId(value: unknown): value is CaipAssetId {\n return is(value, CaipAssetIdStruct);\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BtcScopes = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
|
|
6
|
+
*/
|
|
7
|
+
var BtcScopes;
|
|
8
|
+
(function (BtcScopes) {
|
|
9
|
+
BtcScopes["Namespace"] = "bip122";
|
|
10
|
+
BtcScopes["Mainnet"] = "bip122:000000000019d6689c085ae165831e93";
|
|
11
|
+
BtcScopes["Testnet"] = "bip122:000000000933ea01ad0ee984209779ba";
|
|
12
|
+
})(BtcScopes || (exports.BtcScopes = BtcScopes = {}));
|
|
13
|
+
//# sourceMappingURL=constants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,iCAAoB,CAAA;IACpB,gEAAmD,CAAA;IACnD,gEAAmD,CAAA;AACrD,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB","sourcesContent":["/**\n * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.\n */\nexport enum BtcScopes {\n Namespace = 'bip122',\n Mainnet = 'bip122:000000000019d6689c085ae165831e93',\n Testnet = 'bip122:000000000933ea01ad0ee984209779ba',\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum BtcScopes {
|
|
5
|
+
Namespace = "bip122",
|
|
6
|
+
Mainnet = "bip122:000000000019d6689c085ae165831e93",
|
|
7
|
+
Testnet = "bip122:000000000933ea01ad0ee984209779ba"
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=constants.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,SAAS;IACnB,SAAS,WAAW;IACpB,OAAO,4CAA4C;IACnD,OAAO,4CAA4C;CACpD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum BtcScopes {
|
|
5
|
+
Namespace = "bip122",
|
|
6
|
+
Mainnet = "bip122:000000000019d6689c085ae165831e93",
|
|
7
|
+
Testnet = "bip122:000000000933ea01ad0ee984209779ba"
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=constants.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,SAAS;IACnB,SAAS,WAAW;IACpB,OAAO,4CAA4C;IACnD,OAAO,4CAA4C;CACpD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
|
|
3
|
+
*/
|
|
4
|
+
export var BtcScopes;
|
|
5
|
+
(function (BtcScopes) {
|
|
6
|
+
BtcScopes["Namespace"] = "bip122";
|
|
7
|
+
BtcScopes["Mainnet"] = "bip122:000000000019d6689c085ae165831e93";
|
|
8
|
+
BtcScopes["Testnet"] = "bip122:000000000933ea01ad0ee984209779ba";
|
|
9
|
+
})(BtcScopes || (BtcScopes = {}));
|
|
10
|
+
//# sourceMappingURL=constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,iCAAoB,CAAA;IACpB,gEAAmD,CAAA;IACnD,gEAAmD,CAAA;AACrD,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB","sourcesContent":["/**\n * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.\n */\nexport enum BtcScopes {\n Namespace = 'bip122',\n Mainnet = 'bip122:000000000019d6689c085ae165831e93',\n Testnet = 'bip122:000000000933ea01ad0ee984209779ba',\n}\n"]}
|
package/dist/btc/index.cjs
CHANGED
|
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./constants.cjs"), exports);
|
|
17
18
|
__exportStar(require("./types.cjs"), exports);
|
|
18
19
|
//# sourceMappingURL=index.cjs.map
|
package/dist/btc/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAAwB","sourcesContent":["export * from './types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA4B;AAC5B,8CAAwB","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
|
package/dist/btc/index.d.cts
CHANGED
package/dist/btc/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB"}
|
package/dist/btc/index.d.mts
CHANGED
package/dist/btc/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB"}
|
package/dist/btc/index.mjs
CHANGED
package/dist/btc/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB","sourcesContent":["export * from './types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
|
package/dist/btc/types.d.cts
CHANGED
|
@@ -10,6 +10,7 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
|
|
|
10
10
|
type: "bip122:p2wpkh";
|
|
11
11
|
id: string;
|
|
12
12
|
address: string;
|
|
13
|
+
scopes: string[];
|
|
13
14
|
options: Record<string, import("@metamask/utils").Json>;
|
|
14
15
|
methods: "sendBitcoin"[];
|
|
15
16
|
}, {
|
|
@@ -28,6 +29,7 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
|
|
|
28
29
|
sendBitcoin: "sendBitcoin";
|
|
29
30
|
}>>;
|
|
30
31
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
32
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
31
33
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
32
34
|
}>;
|
|
33
35
|
export type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;
|
package/dist/btc/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
package/dist/btc/types.d.mts
CHANGED
|
@@ -10,6 +10,7 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
|
|
|
10
10
|
type: "bip122:p2wpkh";
|
|
11
11
|
id: string;
|
|
12
12
|
address: string;
|
|
13
|
+
scopes: string[];
|
|
13
14
|
options: Record<string, import("@metamask/utils").Json>;
|
|
14
15
|
methods: "sendBitcoin"[];
|
|
15
16
|
}, {
|
|
@@ -28,6 +29,7 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
|
|
|
28
29
|
sendBitcoin: "sendBitcoin";
|
|
29
30
|
}>>;
|
|
30
31
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
32
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
31
33
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
32
34
|
}>;
|
|
33
35
|
export type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;
|
package/dist/btc/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EthScopes = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Scopes for EVM account type. See {@link KeyringAccount.scopes}.
|
|
6
|
+
*/
|
|
7
|
+
var EthScopes;
|
|
8
|
+
(function (EthScopes) {
|
|
9
|
+
EthScopes["Namespace"] = "eip155";
|
|
10
|
+
EthScopes["Mainnet"] = "eip155:1";
|
|
11
|
+
})(EthScopes || (exports.EthScopes = EthScopes = {}));
|
|
12
|
+
//# sourceMappingURL=constants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../../src/eth/constants.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,iCAAoB,CAAA;IACpB,iCAAoB,CAAA;AACtB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB","sourcesContent":["/**\n * Scopes for EVM account type. See {@link KeyringAccount.scopes}.\n */\nexport enum EthScopes {\n Namespace = 'eip155',\n Mainnet = 'eip155:1',\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../../src/eth/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,SAAS;IACnB,SAAS,WAAW;IACpB,OAAO,aAAa;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../src/eth/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,SAAS;IACnB,SAAS,WAAW;IACpB,OAAO,aAAa;CACrB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scopes for EVM account type. See {@link KeyringAccount.scopes}.
|
|
3
|
+
*/
|
|
4
|
+
export var EthScopes;
|
|
5
|
+
(function (EthScopes) {
|
|
6
|
+
EthScopes["Namespace"] = "eip155";
|
|
7
|
+
EthScopes["Mainnet"] = "eip155:1";
|
|
8
|
+
})(EthScopes || (EthScopes = {}));
|
|
9
|
+
//# sourceMappingURL=constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../src/eth/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,iCAAoB,CAAA;IACpB,iCAAoB,CAAA;AACtB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB","sourcesContent":["/**\n * Scopes for EVM account type. See {@link KeyringAccount.scopes}.\n */\nexport enum EthScopes {\n Namespace = 'eip155',\n Mainnet = 'eip155:1',\n}\n"]}
|
package/dist/eth/index.cjs
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./constants.cjs"), exports);
|
|
17
18
|
__exportStar(require("./erc4337/index.cjs"), exports);
|
|
18
19
|
__exportStar(require("./types.cjs"), exports);
|
|
19
20
|
__exportStar(require("./utils.cjs"), exports);
|
package/dist/eth/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAA0B;AAC1B,8CAAwB;AACxB,8CAAwB","sourcesContent":["export * from './erc4337';\nexport * from './types';\nexport * from './utils';\n"]}
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA4B;AAC5B,sDAA0B;AAC1B,8CAAwB;AACxB,8CAAwB","sourcesContent":["export * from './constants';\nexport * from './erc4337';\nexport * from './types';\nexport * from './utils';\n"]}
|
package/dist/eth/index.d.cts
CHANGED
package/dist/eth/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB"}
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB"}
|
package/dist/eth/index.d.mts
CHANGED
package/dist/eth/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB"}
|
package/dist/eth/index.mjs
CHANGED
package/dist/eth/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB","sourcesContent":["export * from './erc4337';\nexport * from './types';\nexport * from './utils';\n"]}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB","sourcesContent":["export * from './constants';\nexport * from './erc4337';\nexport * from './types';\nexport * from './utils';\n"]}
|
package/dist/eth/types.d.cts
CHANGED
|
@@ -20,6 +20,7 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
|
|
|
20
20
|
type: "eip155:eoa";
|
|
21
21
|
id: string;
|
|
22
22
|
address: string;
|
|
23
|
+
scopes: string[];
|
|
23
24
|
options: Record<string, import("@metamask/utils").Json>;
|
|
24
25
|
methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
|
|
25
26
|
}, {
|
|
@@ -43,6 +44,7 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
|
|
|
43
44
|
eth_signTypedData_v4: "eth_signTypedData_v4";
|
|
44
45
|
}>>;
|
|
45
46
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
47
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
46
48
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
47
49
|
}>;
|
|
48
50
|
export type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;
|
|
@@ -50,6 +52,7 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
|
|
|
50
52
|
type: "eip155:erc4337";
|
|
51
53
|
id: string;
|
|
52
54
|
address: string;
|
|
55
|
+
scopes: string[];
|
|
53
56
|
options: Record<string, import("@metamask/utils").Json>;
|
|
54
57
|
methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
|
|
55
58
|
}, {
|
|
@@ -75,6 +78,7 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
|
|
|
75
78
|
eth_signUserOperation: "eth_signUserOperation";
|
|
76
79
|
}>>;
|
|
77
80
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
81
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
78
82
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
79
83
|
}>;
|
|
80
84
|
export type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;
|
package/dist/eth/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;EAWH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;;;IAGlC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;EAaH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
package/dist/eth/types.d.mts
CHANGED
|
@@ -20,6 +20,7 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
|
|
|
20
20
|
type: "eip155:eoa";
|
|
21
21
|
id: string;
|
|
22
22
|
address: string;
|
|
23
|
+
scopes: string[];
|
|
23
24
|
options: Record<string, import("@metamask/utils").Json>;
|
|
24
25
|
methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
|
|
25
26
|
}, {
|
|
@@ -43,6 +44,7 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
|
|
|
43
44
|
eth_signTypedData_v4: "eth_signTypedData_v4";
|
|
44
45
|
}>>;
|
|
45
46
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
47
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
46
48
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
47
49
|
}>;
|
|
48
50
|
export type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;
|
|
@@ -50,6 +52,7 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
|
|
|
50
52
|
type: "eip155:erc4337";
|
|
51
53
|
id: string;
|
|
52
54
|
address: string;
|
|
55
|
+
scopes: string[];
|
|
53
56
|
options: Record<string, import("@metamask/utils").Json>;
|
|
54
57
|
methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
|
|
55
58
|
}, {
|
|
@@ -75,6 +78,7 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
|
|
|
75
78
|
eth_signUserOperation: "eth_signUserOperation";
|
|
76
79
|
}>>;
|
|
77
80
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
81
|
+
scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
78
82
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
|
79
83
|
}>;
|
|
80
84
|
export type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;
|
package/dist/eth/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;EAWH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;;;IAGlC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;EAaH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
package/dist/eth/utils.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isEvmAccountType =
|
|
3
|
+
exports.isEvmAccountType = isEvmAccountType;
|
|
4
4
|
const api_1 = require("../api/index.cjs");
|
|
5
5
|
/**
|
|
6
6
|
* Checks if the given type is an EVM account type.
|
|
@@ -11,5 +11,4 @@ const api_1 = require("../api/index.cjs");
|
|
|
11
11
|
function isEvmAccountType(type) {
|
|
12
12
|
return type === api_1.EthAccountType.Eoa || type === api_1.EthAccountType.Erc4337;
|
|
13
13
|
}
|
|
14
|
-
exports.isEvmAccountType = isEvmAccountType;
|
|
15
14
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/eth/utils.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sourceRoot":"","sources":["../../src/eth/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.cjs","sourceRoot":"","sources":["../../src/eth/utils.ts"],"names":[],"mappings":";;AASA,4CAEC;AAVD,0CAAwC;AAExC;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,IAAwB;IACvD,OAAO,IAAI,KAAK,oBAAc,CAAC,GAAG,IAAI,IAAI,KAAK,oBAAc,CAAC,OAAO,CAAC;AACxE,CAAC","sourcesContent":["import type { KeyringAccountType } from '../api';\nimport { EthAccountType } from '../api';\n\n/**\n * Checks if the given type is an EVM account type.\n *\n * @param type - The type to check.\n * @returns Returns true if the type is an EVM account type, false otherwise.\n */\nexport function isEvmAccountType(type: KeyringAccountType): boolean {\n return type === EthAccountType.Eoa || type === EthAccountType.Erc4337;\n}\n"]}
|