@metamask/keyring-api 17.0.0 → 17.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [17.1.0]
11
+
12
+ ### Added
13
+
14
+ - Add new `SolMethod.Sign{AndSendTransaction,Transaction,Message,In}` methods ([#191](https://github.com/MetaMask/accounts/pull/191))
15
+
16
+ ### Changed
17
+
18
+ - Deprecates `SolMethod.SendAndConfirmTransaction` method ([#191](https://github.com/MetaMask/accounts/pull/191))
19
+
10
20
  ## [17.0.0]
11
21
 
12
22
  ### Added
@@ -519,7 +529,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
519
529
  - SnapController keyring client. It is intended to be used by MetaMask to talk to the snap.
520
530
  - Helper functions to create keyring handler in the snap.
521
531
 
522
- [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@17.0.0...HEAD
532
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@17.1.0...HEAD
533
+ [17.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@17.0.0...@metamask/keyring-api@17.1.0
523
534
  [17.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@16.1.0...@metamask/keyring-api@17.0.0
524
535
  [16.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@16.0.0...@metamask/keyring-api@16.1.0
525
536
  [16.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@15.0.0...@metamask/keyring-api@16.0.0
@@ -17,7 +17,13 @@ exports.SolAddressStruct = (0, utils_1.definePattern)('SolAddress', /^[1-9A-HJ-N
17
17
  var SolMethod;
18
18
  (function (SolMethod) {
19
19
  // General transaction methods
20
+ // @deprecated
21
+ // TODO: Remove this once the new methods are fully adopted
20
22
  SolMethod["SendAndConfirmTransaction"] = "sendAndConfirmTransaction";
23
+ SolMethod["SignAndSendTransaction"] = "signAndSendTransaction";
24
+ SolMethod["SignTransaction"] = "signTransaction";
25
+ SolMethod["SignMessage"] = "signMessage";
26
+ SolMethod["SignIn"] = "signIn";
21
27
  })(SolMethod || (exports.SolMethod = SolMethod = {}));
22
28
  exports.SolDataAccountStruct = (0, keyring_utils_1.object)({
23
29
  ...api_1.KeyringAccountStruct.schema,
@@ -36,6 +42,6 @@ exports.SolDataAccountStruct = (0, keyring_utils_1.object)({
36
42
  /**
37
43
  * Account supported methods.
38
44
  */
39
- methods: (0, superstruct_1.array)((0, superstruct_1.enums)([`${SolMethod.SendAndConfirmTransaction}`])),
45
+ methods: (0, superstruct_1.array)((0, superstruct_1.enums)(Object.values(SolMethod))),
40
46
  });
41
47
  //# sourceMappingURL=types.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AAEjD,uDAAwE;AACxE,2CAAgD;AAEhD,0CAIgB;AAEhB;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAC3C,YAAY,EACZ,iCAAiC,CAClC,CAAC;AAEF;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAA8B;IAC9B,oEAAuD,CAAA;AACzD,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAEY,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,WAAW,EAAE,CAAC;IAE9C;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,uBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,CAAC,GAAG,SAAS,CAAC,yBAAyB,EAAE,CAAC,CAAC,CAAC;CAClE,CAAC,CAAC","sourcesContent":["import { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal, nonempty } from '@metamask/superstruct';\nimport { definePattern } from '@metamask/utils';\n\nimport {\n CaipChainIdStruct,\n KeyringAccountStruct,\n SolAccountType,\n} from '../api';\n\n/**\n * Solana addresses are represented in the format of a 256-bit ed25519 public key and\n * are encoded using base58.\n * They are usually 32 to 44 characters long.\n */\nexport const SolAddressStruct = definePattern(\n 'SolAddress',\n /^[1-9A-HJ-NP-Za-km-z]{32,44}$/iu,\n);\n\n/**\n * Supported Solana methods.\n */\nexport enum SolMethod {\n // General transaction methods\n SendAndConfirmTransaction = 'sendAndConfirmTransaction',\n}\n\nexport const SolDataAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: SolAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${SolAccountType.DataAccount}`),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account supported methods.\n */\n methods: array(enums([`${SolMethod.SendAndConfirmTransaction}`])),\n});\n\nexport type SolDataAccount = Infer<typeof SolDataAccountStruct>;\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AAEjD,uDAAwE;AACxE,2CAAgD;AAEhD,0CAIgB;AAEhB;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAC3C,YAAY,EACZ,iCAAiC,CAClC,CAAC;AAEF;;GAEG;AACH,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,8BAA8B;IAE9B,cAAc;IACd,2DAA2D;IAC3D,oEAAuD,CAAA;IAEvD,8DAAiD,CAAA;IACjD,gDAAmC,CAAA;IACnC,wCAA2B,CAAA;IAC3B,8BAAiB,CAAA;AACnB,CAAC,EAXW,SAAS,yBAAT,SAAS,QAWpB;AAEY,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,WAAW,EAAE,CAAC;IAE9C;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,uBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;CAChD,CAAC,CAAC","sourcesContent":["import { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal, nonempty } from '@metamask/superstruct';\nimport { definePattern } from '@metamask/utils';\n\nimport {\n CaipChainIdStruct,\n KeyringAccountStruct,\n SolAccountType,\n} from '../api';\n\n/**\n * Solana addresses are represented in the format of a 256-bit ed25519 public key and\n * are encoded using base58.\n * They are usually 32 to 44 characters long.\n */\nexport const SolAddressStruct = definePattern(\n 'SolAddress',\n /^[1-9A-HJ-NP-Za-km-z]{32,44}$/iu,\n);\n\n/**\n * Supported Solana methods.\n */\nexport enum SolMethod {\n // General transaction methods\n\n // @deprecated\n // TODO: Remove this once the new methods are fully adopted\n SendAndConfirmTransaction = 'sendAndConfirmTransaction',\n\n SignAndSendTransaction = 'signAndSendTransaction',\n SignTransaction = 'signTransaction',\n SignMessage = 'signMessage',\n SignIn = 'signIn',\n}\n\nexport const SolDataAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: SolAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${SolAccountType.DataAccount}`),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account supported methods.\n */\n methods: array(enums(Object.values(SolMethod))),\n});\n\nexport type SolDataAccount = Infer<typeof SolDataAccountStruct>;\n"]}
@@ -9,7 +9,11 @@ export declare const SolAddressStruct: import("@metamask/superstruct").Struct<st
9
9
  * Supported Solana methods.
10
10
  */
11
11
  export declare enum SolMethod {
12
- SendAndConfirmTransaction = "sendAndConfirmTransaction"
12
+ SendAndConfirmTransaction = "sendAndConfirmTransaction",
13
+ SignAndSendTransaction = "signAndSendTransaction",
14
+ SignTransaction = "signTransaction",
15
+ SignMessage = "signMessage",
16
+ SignIn = "signIn"
13
17
  }
14
18
  export declare const SolDataAccountStruct: import("@metamask/superstruct").Struct<{
15
19
  type: "solana:data-account";
@@ -17,7 +21,7 @@ export declare const SolDataAccountStruct: import("@metamask/superstruct").Struc
17
21
  options: Record<string, import("@metamask/utils").Json>;
18
22
  address: string;
19
23
  scopes: `${string}:${string}`[];
20
- methods: "sendAndConfirmTransaction"[];
24
+ methods: SolMethod[];
21
25
  }, {
22
26
  /**
23
27
  * Account address.
@@ -34,8 +38,12 @@ export declare const SolDataAccountStruct: import("@metamask/superstruct").Struc
34
38
  /**
35
39
  * Account supported methods.
36
40
  */
37
- methods: import("@metamask/superstruct").Struct<"sendAndConfirmTransaction"[], import("@metamask/superstruct").Struct<"sendAndConfirmTransaction", {
38
- sendAndConfirmTransaction: "sendAndConfirmTransaction";
41
+ methods: import("@metamask/superstruct").Struct<SolMethod[], import("@metamask/superstruct").Struct<SolMethod, {
42
+ sendAndConfirmTransaction: SolMethod.SendAndConfirmTransaction;
43
+ signAndSendTransaction: SolMethod.SignAndSendTransaction;
44
+ signTransaction: SolMethod.SignTransaction;
45
+ signMessage: SolMethod.SignMessage;
46
+ signIn: SolMethod.SignIn;
39
47
  }>>;
40
48
  id: import("@metamask/superstruct").Struct<string, null>;
41
49
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,yBAAyB,8BAA8B;CACxD;AAED,eAAO,MAAM,oBAAoB;;;;;;;;IAG/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAKnB,yBAAyB,8BAA8B;IAEvD,sBAAsB,2BAA2B;IACjD,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;IAC3B,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,oBAAoB;;;;;;;;IAG/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -9,7 +9,11 @@ export declare const SolAddressStruct: import("@metamask/superstruct").Struct<st
9
9
  * Supported Solana methods.
10
10
  */
11
11
  export declare enum SolMethod {
12
- SendAndConfirmTransaction = "sendAndConfirmTransaction"
12
+ SendAndConfirmTransaction = "sendAndConfirmTransaction",
13
+ SignAndSendTransaction = "signAndSendTransaction",
14
+ SignTransaction = "signTransaction",
15
+ SignMessage = "signMessage",
16
+ SignIn = "signIn"
13
17
  }
14
18
  export declare const SolDataAccountStruct: import("@metamask/superstruct").Struct<{
15
19
  type: "solana:data-account";
@@ -17,7 +21,7 @@ export declare const SolDataAccountStruct: import("@metamask/superstruct").Struc
17
21
  options: Record<string, import("@metamask/utils").Json>;
18
22
  address: string;
19
23
  scopes: `${string}:${string}`[];
20
- methods: "sendAndConfirmTransaction"[];
24
+ methods: SolMethod[];
21
25
  }, {
22
26
  /**
23
27
  * Account address.
@@ -34,8 +38,12 @@ export declare const SolDataAccountStruct: import("@metamask/superstruct").Struc
34
38
  /**
35
39
  * Account supported methods.
36
40
  */
37
- methods: import("@metamask/superstruct").Struct<"sendAndConfirmTransaction"[], import("@metamask/superstruct").Struct<"sendAndConfirmTransaction", {
38
- sendAndConfirmTransaction: "sendAndConfirmTransaction";
41
+ methods: import("@metamask/superstruct").Struct<SolMethod[], import("@metamask/superstruct").Struct<SolMethod, {
42
+ sendAndConfirmTransaction: SolMethod.SendAndConfirmTransaction;
43
+ signAndSendTransaction: SolMethod.SignAndSendTransaction;
44
+ signTransaction: SolMethod.SignTransaction;
45
+ signMessage: SolMethod.SignMessage;
46
+ signIn: SolMethod.SignIn;
39
47
  }>>;
40
48
  id: import("@metamask/superstruct").Struct<string, null>;
41
49
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,yBAAyB,8BAA8B;CACxD;AAED,eAAO,MAAM,oBAAoB;;;;;;;;IAG/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAKnB,yBAAyB,8BAA8B;IAEvD,sBAAsB,2BAA2B;IACjD,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;IAC3B,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,oBAAoB;;;;;;;;IAG/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -14,7 +14,13 @@ export const SolAddressStruct = definePattern('SolAddress', /^[1-9A-HJ-NP-Za-km-
14
14
  export var SolMethod;
15
15
  (function (SolMethod) {
16
16
  // General transaction methods
17
+ // @deprecated
18
+ // TODO: Remove this once the new methods are fully adopted
17
19
  SolMethod["SendAndConfirmTransaction"] = "sendAndConfirmTransaction";
20
+ SolMethod["SignAndSendTransaction"] = "signAndSendTransaction";
21
+ SolMethod["SignTransaction"] = "signTransaction";
22
+ SolMethod["SignMessage"] = "signMessage";
23
+ SolMethod["SignIn"] = "signIn";
18
24
  })(SolMethod || (SolMethod = {}));
19
25
  export const SolDataAccountStruct = object({
20
26
  ...KeyringAccountStruct.schema,
@@ -33,6 +39,6 @@ export const SolDataAccountStruct = object({
33
39
  /**
34
40
  * Account supported methods.
35
41
  */
36
- methods: array(enums([`${SolMethod.SendAndConfirmTransaction}`])),
42
+ methods: array(enums(Object.values(SolMethod))),
37
43
  });
38
44
  //# sourceMappingURL=types.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gCAAgC;AAEjD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AACxE,OAAO,EAAE,aAAa,EAAE,wBAAwB;AAEhD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACf,yBAAe;AAEhB;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,YAAY,EACZ,iCAAiC,CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAA8B;IAC9B,oEAAuD,CAAA;AACzD,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC,GAAG,oBAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,gBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;IAE9C;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC,yBAAyB,EAAE,CAAC,CAAC,CAAC;CAClE,CAAC,CAAC","sourcesContent":["import { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal, nonempty } from '@metamask/superstruct';\nimport { definePattern } from '@metamask/utils';\n\nimport {\n CaipChainIdStruct,\n KeyringAccountStruct,\n SolAccountType,\n} from '../api';\n\n/**\n * Solana addresses are represented in the format of a 256-bit ed25519 public key and\n * are encoded using base58.\n * They are usually 32 to 44 characters long.\n */\nexport const SolAddressStruct = definePattern(\n 'SolAddress',\n /^[1-9A-HJ-NP-Za-km-z]{32,44}$/iu,\n);\n\n/**\n * Supported Solana methods.\n */\nexport enum SolMethod {\n // General transaction methods\n SendAndConfirmTransaction = 'sendAndConfirmTransaction',\n}\n\nexport const SolDataAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: SolAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${SolAccountType.DataAccount}`),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account supported methods.\n */\n methods: array(enums([`${SolMethod.SendAndConfirmTransaction}`])),\n});\n\nexport type SolDataAccount = Infer<typeof SolDataAccountStruct>;\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gCAAgC;AAEjD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AACxE,OAAO,EAAE,aAAa,EAAE,wBAAwB;AAEhD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACf,yBAAe;AAEhB;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,YAAY,EACZ,iCAAiC,CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,8BAA8B;IAE9B,cAAc;IACd,2DAA2D;IAC3D,oEAAuD,CAAA;IAEvD,8DAAiD,CAAA;IACjD,gDAAmC,CAAA;IACnC,wCAA2B,CAAA;IAC3B,8BAAiB,CAAA;AACnB,CAAC,EAXW,SAAS,KAAT,SAAS,QAWpB;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC,GAAG,oBAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,gBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;IAE9C;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;CAChD,CAAC,CAAC","sourcesContent":["import { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal, nonempty } from '@metamask/superstruct';\nimport { definePattern } from '@metamask/utils';\n\nimport {\n CaipChainIdStruct,\n KeyringAccountStruct,\n SolAccountType,\n} from '../api';\n\n/**\n * Solana addresses are represented in the format of a 256-bit ed25519 public key and\n * are encoded using base58.\n * They are usually 32 to 44 characters long.\n */\nexport const SolAddressStruct = definePattern(\n 'SolAddress',\n /^[1-9A-HJ-NP-Za-km-z]{32,44}$/iu,\n);\n\n/**\n * Supported Solana methods.\n */\nexport enum SolMethod {\n // General transaction methods\n\n // @deprecated\n // TODO: Remove this once the new methods are fully adopted\n SendAndConfirmTransaction = 'sendAndConfirmTransaction',\n\n SignAndSendTransaction = 'signAndSendTransaction',\n SignTransaction = 'signTransaction',\n SignMessage = 'signMessage',\n SignIn = 'signIn',\n}\n\nexport const SolDataAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: SolAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${SolAccountType.DataAccount}`),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account supported methods.\n */\n methods: array(enums(Object.values(SolMethod))),\n});\n\nexport type SolDataAccount = Infer<typeof SolDataAccountStruct>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/keyring-api",
3
- "version": "17.0.0",
3
+ "version": "17.1.0",
4
4
  "description": "MetaMask Keyring API",
5
5
  "keywords": [
6
6
  "metamask",
@@ -46,7 +46,7 @@
46
46
  "test:watch": "jest --watch"
47
47
  },
48
48
  "dependencies": {
49
- "@metamask/keyring-utils": "^2.0.0",
49
+ "@metamask/keyring-utils": "^2.1.1",
50
50
  "@metamask/superstruct": "^3.1.0",
51
51
  "@metamask/utils": "^11.1.0",
52
52
  "bech32": "^2.0.0"
@@ -55,7 +55,7 @@
55
55
  "@lavamoat/allow-scripts": "^3.2.1",
56
56
  "@lavamoat/preinstall-always-fail": "^2.1.0",
57
57
  "@metamask/auto-changelog": "^3.4.4",
58
- "@metamask/keyring-utils": "^2.0.0",
58
+ "@metamask/keyring-utils": "^2.1.1",
59
59
  "@ts-bridge/cli": "^0.6.1",
60
60
  "@types/jest": "^29.5.12",
61
61
  "@types/node": "^20.12.12",