@metamask/keyring-api 21.2.0 → 21.3.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.
Files changed (107) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/README.md +7 -0
  3. package/dist/api/account.cjs +15 -1
  4. package/dist/api/account.cjs.map +1 -1
  5. package/dist/api/account.d.cts +14 -0
  6. package/dist/api/account.d.cts.map +1 -1
  7. package/dist/api/account.d.mts +14 -0
  8. package/dist/api/account.d.mts.map +1 -1
  9. package/dist/api/account.mjs +14 -0
  10. package/dist/api/account.mjs.map +1 -1
  11. package/dist/api/index.cjs +1 -0
  12. package/dist/api/index.cjs.map +1 -1
  13. package/dist/api/index.d.cts +1 -0
  14. package/dist/api/index.d.cts.map +1 -1
  15. package/dist/api/index.d.mts +1 -0
  16. package/dist/api/index.d.mts.map +1 -1
  17. package/dist/api/index.mjs +1 -0
  18. package/dist/api/index.mjs.map +1 -1
  19. package/dist/api/v2/create-account/bip44.cjs +57 -0
  20. package/dist/api/v2/create-account/bip44.cjs.map +1 -0
  21. package/dist/api/v2/create-account/bip44.d.cts +83 -0
  22. package/dist/api/v2/create-account/bip44.d.cts.map +1 -0
  23. package/dist/api/v2/create-account/bip44.d.mts +83 -0
  24. package/dist/api/v2/create-account/bip44.d.mts.map +1 -0
  25. package/dist/api/v2/create-account/bip44.mjs +54 -0
  26. package/dist/api/v2/create-account/bip44.mjs.map +1 -0
  27. package/dist/api/v2/create-account/index.cjs +72 -0
  28. package/dist/api/v2/create-account/index.cjs.map +1 -0
  29. package/dist/api/v2/create-account/index.d.cts +58 -0
  30. package/dist/api/v2/create-account/index.d.cts.map +1 -0
  31. package/dist/api/v2/create-account/index.d.mts +58 -0
  32. package/dist/api/v2/create-account/index.d.mts.map +1 -0
  33. package/dist/api/v2/create-account/index.mjs +55 -0
  34. package/dist/api/v2/create-account/index.mjs.map +1 -0
  35. package/dist/api/v2/create-account/private-key.cjs +28 -0
  36. package/dist/api/v2/create-account/private-key.cjs.map +1 -0
  37. package/dist/api/v2/create-account/private-key.d.cts +45 -0
  38. package/dist/api/v2/create-account/private-key.d.cts.map +1 -0
  39. package/dist/api/v2/create-account/private-key.d.mts +45 -0
  40. package/dist/api/v2/create-account/private-key.d.mts.map +1 -0
  41. package/dist/api/v2/create-account/private-key.mjs +25 -0
  42. package/dist/api/v2/create-account/private-key.mjs.map +1 -0
  43. package/dist/api/v2/export-account/index.cjs +38 -0
  44. package/dist/api/v2/export-account/index.cjs.map +1 -0
  45. package/dist/api/v2/export-account/index.d.cts +48 -0
  46. package/dist/api/v2/export-account/index.d.cts.map +1 -0
  47. package/dist/api/v2/export-account/index.d.mts +48 -0
  48. package/dist/api/v2/export-account/index.d.mts.map +1 -0
  49. package/dist/api/v2/export-account/index.mjs +21 -0
  50. package/dist/api/v2/export-account/index.mjs.map +1 -0
  51. package/dist/api/v2/export-account/private-key.cjs +36 -0
  52. package/dist/api/v2/export-account/private-key.cjs.map +1 -0
  53. package/dist/api/v2/export-account/private-key.d.cts +53 -0
  54. package/dist/api/v2/export-account/private-key.d.cts.map +1 -0
  55. package/dist/api/v2/export-account/private-key.d.mts +53 -0
  56. package/dist/api/v2/export-account/private-key.d.mts.map +1 -0
  57. package/dist/api/v2/export-account/private-key.mjs +33 -0
  58. package/dist/api/v2/export-account/private-key.mjs.map +1 -0
  59. package/dist/api/v2/index.cjs +22 -0
  60. package/dist/api/v2/index.cjs.map +1 -0
  61. package/dist/api/v2/index.d.cts +7 -0
  62. package/dist/api/v2/index.d.cts.map +1 -0
  63. package/dist/api/v2/index.d.mts +7 -0
  64. package/dist/api/v2/index.d.mts.map +1 -0
  65. package/dist/api/v2/index.mjs +6 -0
  66. package/dist/api/v2/index.mjs.map +1 -0
  67. package/dist/api/v2/keyring-capabilities.cjs +46 -0
  68. package/dist/api/v2/keyring-capabilities.cjs.map +1 -0
  69. package/dist/api/v2/keyring-capabilities.d.cts +128 -0
  70. package/dist/api/v2/keyring-capabilities.d.cts.map +1 -0
  71. package/dist/api/v2/keyring-capabilities.d.mts +128 -0
  72. package/dist/api/v2/keyring-capabilities.d.mts.map +1 -0
  73. package/dist/api/v2/keyring-capabilities.mjs +43 -0
  74. package/dist/api/v2/keyring-capabilities.mjs.map +1 -0
  75. package/dist/api/v2/keyring-type.cjs +44 -0
  76. package/dist/api/v2/keyring-type.cjs.map +1 -0
  77. package/dist/api/v2/keyring-type.d.cts +40 -0
  78. package/dist/api/v2/keyring-type.d.cts.map +1 -0
  79. package/dist/api/v2/keyring-type.d.mts +40 -0
  80. package/dist/api/v2/keyring-type.d.mts.map +1 -0
  81. package/dist/api/v2/keyring-type.mjs +41 -0
  82. package/dist/api/v2/keyring-type.mjs.map +1 -0
  83. package/dist/api/v2/keyring.cjs +3 -0
  84. package/dist/api/v2/keyring.cjs.map +1 -0
  85. package/dist/api/v2/keyring.d.cts +107 -0
  86. package/dist/api/v2/keyring.d.cts.map +1 -0
  87. package/dist/api/v2/keyring.d.mts +107 -0
  88. package/dist/api/v2/keyring.d.mts.map +1 -0
  89. package/dist/api/v2/keyring.mjs +2 -0
  90. package/dist/api/v2/keyring.mjs.map +1 -0
  91. package/dist/api/v2/private-key.cjs +53 -0
  92. package/dist/api/v2/private-key.cjs.map +1 -0
  93. package/dist/api/v2/private-key.d.cts +77 -0
  94. package/dist/api/v2/private-key.d.cts.map +1 -0
  95. package/dist/api/v2/private-key.d.mts +77 -0
  96. package/dist/api/v2/private-key.d.mts.map +1 -0
  97. package/dist/api/v2/private-key.mjs +50 -0
  98. package/dist/api/v2/private-key.mjs.map +1 -0
  99. package/dist/trx/types.cjs +4 -0
  100. package/dist/trx/types.cjs.map +1 -1
  101. package/dist/trx/types.d.cts +4 -0
  102. package/dist/trx/types.d.cts.map +1 -1
  103. package/dist/trx/types.d.mts +4 -0
  104. package/dist/trx/types.d.mts.map +1 -1
  105. package/dist/trx/types.mjs +4 -0
  106. package/dist/trx/types.mjs.map +1 -1
  107. package/package.json +1 -1
@@ -0,0 +1,77 @@
1
+ import { type Infer } from "@metamask/superstruct";
2
+ /**
3
+ * Supported encoding formats for private keys.
4
+ */
5
+ export declare enum PrivateKeyEncoding {
6
+ /**
7
+ * Hexadecimal encoding format.
8
+ */
9
+ Hexadecimal = "hexadecimal",
10
+ /**
11
+ * Base58 encoding format.
12
+ */
13
+ Base58 = "base58"
14
+ }
15
+ /**
16
+ * Struct for {@link PrivateKeyEncoding}.
17
+ */
18
+ export declare const PrivateKeyEncodingStruct: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
19
+ hexadecimal: "hexadecimal";
20
+ base58: "base58";
21
+ }>;
22
+ /**
23
+ * Struct for {@link ImportPrivateKeyFormat}.
24
+ */
25
+ export declare const ImportPrivateKeyFormatStruct: import("@metamask/superstruct").Struct<{
26
+ encoding: "hexadecimal" | "base58";
27
+ type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
28
+ }, {
29
+ /**
30
+ * Format used to encode the private key as a string.
31
+ */
32
+ encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
33
+ hexadecimal: "hexadecimal";
34
+ base58: "base58";
35
+ }>;
36
+ /**
37
+ * Type of the account to be created.
38
+ *
39
+ * This field is necessary when there is ambiguity about the type of account
40
+ * to be created from the private key. For example, in Bitcoin, a private key
41
+ * can be used to create multiple types of accounts, such as P2WPKH, or P2TR.
42
+ */
43
+ type: import("@metamask/superstruct").ExactOptionalStruct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
44
+ "eip155:eoa": "eip155:eoa";
45
+ "eip155:erc4337": "eip155:erc4337";
46
+ "bip122:p2pkh": "bip122:p2pkh";
47
+ "bip122:p2sh": "bip122:p2sh";
48
+ "bip122:p2wpkh": "bip122:p2wpkh";
49
+ "bip122:p2tr": "bip122:p2tr";
50
+ "solana:data-account": "solana:data-account";
51
+ "tron:eoa": "tron:eoa";
52
+ "any:account": "any:account";
53
+ }>;
54
+ }>;
55
+ /**
56
+ * Represents the format for importing a private key into a keyring.
57
+ */
58
+ export type ImportPrivateKeyFormat = Infer<typeof ImportPrivateKeyFormatStruct>;
59
+ /**
60
+ * Struct for {@link ExportPrivateKeyFormat}.
61
+ */
62
+ export declare const ExportPrivateKeyFormatStruct: import("@metamask/superstruct").Struct<{
63
+ encoding: "hexadecimal" | "base58";
64
+ }, {
65
+ /**
66
+ * Format used to encode the private key as a string.
67
+ */
68
+ encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
69
+ hexadecimal: "hexadecimal";
70
+ base58: "base58";
71
+ }>;
72
+ }>;
73
+ /**
74
+ * Represents the format for exporting a private key from a keyring.
75
+ */
76
+ export type ExportPrivateKeyFormat = Infer<typeof ExportPrivateKeyFormatStruct>;
77
+ //# sourceMappingURL=private-key.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-key.d.mts","sourceRoot":"","sources":["../../../src/api/v2/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,KAAK,EACX,8BAA8B;AAI/B;;GAEG;AACH,oBAAY,kBAAkB;IAC5B;;OAEG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;EAGnC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;IACvC;;OAEG;;;;;IAGH;;;;;;OAMG;;;;;;;;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;IACvC;;OAEG;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { enums, exactOptional, object } from "@metamask/superstruct";
2
+ import { KeyringAccountTypeStruct } from "../account.mjs";
3
+ /**
4
+ * Supported encoding formats for private keys.
5
+ */
6
+ export var PrivateKeyEncoding;
7
+ (function (PrivateKeyEncoding) {
8
+ /**
9
+ * Hexadecimal encoding format.
10
+ */
11
+ PrivateKeyEncoding["Hexadecimal"] = "hexadecimal";
12
+ /**
13
+ * Base58 encoding format.
14
+ */
15
+ PrivateKeyEncoding["Base58"] = "base58";
16
+ })(PrivateKeyEncoding || (PrivateKeyEncoding = {}));
17
+ /**
18
+ * Struct for {@link PrivateKeyEncoding}.
19
+ */
20
+ export const PrivateKeyEncodingStruct = enums([
21
+ `${PrivateKeyEncoding.Hexadecimal}`,
22
+ `${PrivateKeyEncoding.Base58}`,
23
+ ]);
24
+ /**
25
+ * Struct for {@link ImportPrivateKeyFormat}.
26
+ */
27
+ export const ImportPrivateKeyFormatStruct = object({
28
+ /**
29
+ * Format used to encode the private key as a string.
30
+ */
31
+ encoding: PrivateKeyEncodingStruct,
32
+ /**
33
+ * Type of the account to be created.
34
+ *
35
+ * This field is necessary when there is ambiguity about the type of account
36
+ * to be created from the private key. For example, in Bitcoin, a private key
37
+ * can be used to create multiple types of accounts, such as P2WPKH, or P2TR.
38
+ */
39
+ type: exactOptional(KeyringAccountTypeStruct),
40
+ });
41
+ /**
42
+ * Struct for {@link ExportPrivateKeyFormat}.
43
+ */
44
+ export const ExportPrivateKeyFormatStruct = object({
45
+ /**
46
+ * Format used to encode the private key as a string.
47
+ */
48
+ encoding: PrivateKeyEncodingStruct,
49
+ });
50
+ //# sourceMappingURL=private-key.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-key.mjs","sourceRoot":"","sources":["../../../src/api/v2/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,aAAa,EACb,MAAM,EAEP,8BAA8B;AAE/B,OAAO,EAAE,wBAAwB,EAAE,uBAAmB;AAEtD;;GAEG;AACH,MAAM,CAAN,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,iDAA2B,CAAA;IAE3B;;OAEG;IACH,uCAAiB,CAAA;AACnB,CAAC,EAVW,kBAAkB,KAAlB,kBAAkB,QAU7B;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC;IAC5C,GAAG,kBAAkB,CAAC,WAAW,EAAE;IACnC,GAAG,kBAAkB,CAAC,MAAM,EAAE;CAC/B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;IACjD;;OAEG;IACH,QAAQ,EAAE,wBAAwB;IAElC;;;;;;OAMG;IACH,IAAI,EAAE,aAAa,CAAC,wBAAwB,CAAC;CAC9C,CAAC,CAAC;AAOH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;IACjD;;OAEG;IACH,QAAQ,EAAE,wBAAwB;CACnC,CAAC,CAAC","sourcesContent":["import {\n enums,\n exactOptional,\n object,\n type Infer,\n} from '@metamask/superstruct';\n\nimport { KeyringAccountTypeStruct } from '../account';\n\n/**\n * Supported encoding formats for private keys.\n */\nexport enum PrivateKeyEncoding {\n /**\n * Hexadecimal encoding format.\n */\n Hexadecimal = 'hexadecimal',\n\n /**\n * Base58 encoding format.\n */\n Base58 = 'base58',\n}\n\n/**\n * Struct for {@link PrivateKeyEncoding}.\n */\nexport const PrivateKeyEncodingStruct = enums([\n `${PrivateKeyEncoding.Hexadecimal}`,\n `${PrivateKeyEncoding.Base58}`,\n]);\n\n/**\n * Struct for {@link ImportPrivateKeyFormat}.\n */\nexport const ImportPrivateKeyFormatStruct = object({\n /**\n * Format used to encode the private key as a string.\n */\n encoding: PrivateKeyEncodingStruct,\n\n /**\n * Type of the account to be created.\n *\n * This field is necessary when there is ambiguity about the type of account\n * to be created from the private key. For example, in Bitcoin, a private key\n * can be used to create multiple types of accounts, such as P2WPKH, or P2TR.\n */\n type: exactOptional(KeyringAccountTypeStruct),\n});\n\n/**\n * Represents the format for importing a private key into a keyring.\n */\nexport type ImportPrivateKeyFormat = Infer<typeof ImportPrivateKeyFormatStruct>;\n\n/**\n * Struct for {@link ExportPrivateKeyFormat}.\n */\nexport const ExportPrivateKeyFormatStruct = object({\n /**\n * Format used to encode the private key as a string.\n */\n encoding: PrivateKeyEncodingStruct,\n});\n\n/**\n * Represents the format for exporting a private key from a keyring.\n */\nexport type ExportPrivateKeyFormat = Infer<typeof ExportPrivateKeyFormatStruct>;\n"]}
@@ -15,7 +15,11 @@ exports.TrxAddressStruct = (0, utils_1.definePattern)('TrxAddress', /^T[1-9A-HJ-
15
15
  */
16
16
  var TrxMethod;
17
17
  (function (TrxMethod) {
18
+ TrxMethod["SignMessage"] = "signMessage";
19
+ TrxMethod["SignTransaction"] = "signTransaction";
20
+ // @deprecated Use `SignMessage` instead.
18
21
  TrxMethod["SignMessageV2"] = "signMessageV2";
22
+ // @deprecated Not supported anymore.
19
23
  TrxMethod["VerifyMessageV2"] = "verifyMessageV2";
20
24
  })(TrxMethod || (exports.TrxMethod = TrxMethod = {}));
21
25
  exports.TrxEoaAccountStruct = (0, keyring_utils_1.object)({
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/trx/types.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AAEjD,uDAAwE;AACxE,2CAAgD;AAEhD,0CAIgB;AAEhB;;;GAGG;AACU,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAC3C,YAAY,EACZ,+BAA+B,CAChC,CAAC;AAEF;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,4CAA+B,CAAA;IAC/B,gDAAmC,CAAA;AACrC,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAEY,QAAA,mBAAmB,GAAG,IAAA,sBAAM,EAAC;IACxC,GAAG,0BAAoB,CAAC,MAAM;IAC9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IACzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,GAAG,EAAE,CAAC;IACtC;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,uBAAiB,CAAC,CAAC;IAC1C;;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 TrxAccountType,\n} from '../api';\n\n/**\n * TRON addresses are Base58-encoded strings that are exactly 34 characters long\n * and start with the letter 'T'.\n */\nexport const TrxAddressStruct = definePattern(\n 'TrxAddress',\n /^T[1-9A-HJ-NP-Za-km-z]{33}$/iu,\n);\n\n/**\n * Supported TRON methods.\n */\nexport enum TrxMethod {\n SignMessageV2 = 'signMessageV2',\n VerifyMessageV2 = 'verifyMessageV2',\n}\n\nexport const TrxEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n /**\n * Account address.\n */\n address: TrxAddressStruct,\n /**\n * Account type.\n */\n type: literal(`${TrxAccountType.Eoa}`),\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n /**\n * Account supported methods.\n */\n methods: array(enums(Object.values(TrxMethod))),\n});\n\nexport type TrxEoaAccount = Infer<typeof TrxEoaAccountStruct>;\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/trx/types.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AAEjD,uDAAwE;AACxE,2CAAgD;AAEhD,0CAIgB;AAEhB;;;GAGG;AACU,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAC3C,YAAY,EACZ,+BAA+B,CAChC,CAAC;AAEF;;GAEG;AACH,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,gDAAmC,CAAA;IAEnC,yCAAyC;IACzC,4CAA+B,CAAA;IAC/B,qCAAqC;IACrC,gDAAmC,CAAA;AACrC,CAAC,EARW,SAAS,yBAAT,SAAS,QAQpB;AAEY,QAAA,mBAAmB,GAAG,IAAA,sBAAM,EAAC;IACxC,GAAG,0BAAoB,CAAC,MAAM;IAC9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IACzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,GAAG,EAAE,CAAC;IACtC;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,uBAAiB,CAAC,CAAC;IAC1C;;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 TrxAccountType,\n} from '../api';\n\n/**\n * TRON addresses are Base58-encoded strings that are exactly 34 characters long\n * and start with the letter 'T'.\n */\nexport const TrxAddressStruct = definePattern(\n 'TrxAddress',\n /^T[1-9A-HJ-NP-Za-km-z]{33}$/iu,\n);\n\n/**\n * Supported TRON methods.\n */\nexport enum TrxMethod {\n SignMessage = 'signMessage',\n SignTransaction = 'signTransaction',\n\n // @deprecated Use `SignMessage` instead.\n SignMessageV2 = 'signMessageV2',\n // @deprecated Not supported anymore.\n VerifyMessageV2 = 'verifyMessageV2',\n}\n\nexport const TrxEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n /**\n * Account address.\n */\n address: TrxAddressStruct,\n /**\n * Account type.\n */\n type: literal(`${TrxAccountType.Eoa}`),\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n /**\n * Account supported methods.\n */\n methods: array(enums(Object.values(TrxMethod))),\n});\n\nexport type TrxEoaAccount = Infer<typeof TrxEoaAccountStruct>;\n"]}
@@ -8,6 +8,8 @@ export declare const TrxAddressStruct: import("@metamask/superstruct").Struct<st
8
8
  * Supported TRON methods.
9
9
  */
10
10
  export declare enum TrxMethod {
11
+ SignMessage = "signMessage",
12
+ SignTransaction = "signTransaction",
11
13
  SignMessageV2 = "signMessageV2",
12
14
  VerifyMessageV2 = "verifyMessageV2"
13
15
  }
@@ -45,6 +47,8 @@ export declare const TrxEoaAccountStruct: import("@metamask/superstruct").Struct
45
47
  * Account supported methods.
46
48
  */
47
49
  methods: import("@metamask/superstruct").Struct<TrxMethod[], import("@metamask/superstruct").Struct<TrxMethod, {
50
+ signMessage: TrxMethod.SignMessage;
51
+ signTransaction: TrxMethod.SignTransaction;
48
52
  signMessageV2: TrxMethod.SignMessageV2;
49
53
  verifyMessageV2: TrxMethod.VerifyMessageV2;
50
54
  }>>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/trx/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IACnB,aAAa,kBAAkB;IAC/B,eAAe,oBAAoB;CACpC;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;IAE9B;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/trx/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IACnB,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IAGnC,aAAa,kBAAkB;IAE/B,eAAe,oBAAoB;CACpC;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;IAE9B;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -8,6 +8,8 @@ export declare const TrxAddressStruct: import("@metamask/superstruct").Struct<st
8
8
  * Supported TRON methods.
9
9
  */
10
10
  export declare enum TrxMethod {
11
+ SignMessage = "signMessage",
12
+ SignTransaction = "signTransaction",
11
13
  SignMessageV2 = "signMessageV2",
12
14
  VerifyMessageV2 = "verifyMessageV2"
13
15
  }
@@ -45,6 +47,8 @@ export declare const TrxEoaAccountStruct: import("@metamask/superstruct").Struct
45
47
  * Account supported methods.
46
48
  */
47
49
  methods: import("@metamask/superstruct").Struct<TrxMethod[], import("@metamask/superstruct").Struct<TrxMethod, {
50
+ signMessage: TrxMethod.SignMessage;
51
+ signTransaction: TrxMethod.SignTransaction;
48
52
  signMessageV2: TrxMethod.SignMessageV2;
49
53
  verifyMessageV2: TrxMethod.VerifyMessageV2;
50
54
  }>>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/trx/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IACnB,aAAa,kBAAkB;IAC/B,eAAe,oBAAoB;CACpC;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;IAE9B;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/trx/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IACnB,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IAGnC,aAAa,kBAAkB;IAE/B,eAAe,oBAAoB;CACpC;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;IAE9B;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -12,7 +12,11 @@ export const TrxAddressStruct = definePattern('TrxAddress', /^T[1-9A-HJ-NP-Za-km
12
12
  */
13
13
  export var TrxMethod;
14
14
  (function (TrxMethod) {
15
+ TrxMethod["SignMessage"] = "signMessage";
16
+ TrxMethod["SignTransaction"] = "signTransaction";
17
+ // @deprecated Use `SignMessage` instead.
15
18
  TrxMethod["SignMessageV2"] = "signMessageV2";
19
+ // @deprecated Not supported anymore.
16
20
  TrxMethod["VerifyMessageV2"] = "verifyMessageV2";
17
21
  })(TrxMethod || (TrxMethod = {}));
18
22
  export const TrxEoaAccountStruct = object({
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/trx/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;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,YAAY,EACZ,+BAA+B,CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,4CAA+B,CAAA;IAC/B,gDAAmC,CAAA;AACrC,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;IACxC,GAAG,oBAAoB,CAAC,MAAM;IAC9B;;OAEG;IACH,OAAO,EAAE,gBAAgB;IACzB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC;IACtC;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC1C;;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 TrxAccountType,\n} from '../api';\n\n/**\n * TRON addresses are Base58-encoded strings that are exactly 34 characters long\n * and start with the letter 'T'.\n */\nexport const TrxAddressStruct = definePattern(\n 'TrxAddress',\n /^T[1-9A-HJ-NP-Za-km-z]{33}$/iu,\n);\n\n/**\n * Supported TRON methods.\n */\nexport enum TrxMethod {\n SignMessageV2 = 'signMessageV2',\n VerifyMessageV2 = 'verifyMessageV2',\n}\n\nexport const TrxEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n /**\n * Account address.\n */\n address: TrxAddressStruct,\n /**\n * Account type.\n */\n type: literal(`${TrxAccountType.Eoa}`),\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n /**\n * Account supported methods.\n */\n methods: array(enums(Object.values(TrxMethod))),\n});\n\nexport type TrxEoaAccount = Infer<typeof TrxEoaAccountStruct>;\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/trx/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;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,YAAY,EACZ,+BAA+B,CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,gDAAmC,CAAA;IAEnC,yCAAyC;IACzC,4CAA+B,CAAA;IAC/B,qCAAqC;IACrC,gDAAmC,CAAA;AACrC,CAAC,EARW,SAAS,KAAT,SAAS,QAQpB;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;IACxC,GAAG,oBAAoB,CAAC,MAAM;IAC9B;;OAEG;IACH,OAAO,EAAE,gBAAgB;IACzB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC;IACtC;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC1C;;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 TrxAccountType,\n} from '../api';\n\n/**\n * TRON addresses are Base58-encoded strings that are exactly 34 characters long\n * and start with the letter 'T'.\n */\nexport const TrxAddressStruct = definePattern(\n 'TrxAddress',\n /^T[1-9A-HJ-NP-Za-km-z]{33}$/iu,\n);\n\n/**\n * Supported TRON methods.\n */\nexport enum TrxMethod {\n SignMessage = 'signMessage',\n SignTransaction = 'signTransaction',\n\n // @deprecated Use `SignMessage` instead.\n SignMessageV2 = 'signMessageV2',\n // @deprecated Not supported anymore.\n VerifyMessageV2 = 'verifyMessageV2',\n}\n\nexport const TrxEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n /**\n * Account address.\n */\n address: TrxAddressStruct,\n /**\n * Account type.\n */\n type: literal(`${TrxAccountType.Eoa}`),\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n /**\n * Account supported methods.\n */\n methods: array(enums(Object.values(TrxMethod))),\n});\n\nexport type TrxEoaAccount = Infer<typeof TrxEoaAccountStruct>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/keyring-api",
3
- "version": "21.2.0",
3
+ "version": "21.3.0",
4
4
  "description": "MetaMask Keyring API",
5
5
  "keywords": [
6
6
  "metamask",