@metamask-previews/keyring-api 22.0.0-ea8175e → 23.0.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.
Files changed (132) hide show
  1. package/CHANGELOG.md +14 -2
  2. package/README.md +0 -9
  3. package/dist/api/account.cjs +15 -1
  4. package/dist/api/account.cjs.map +1 -1
  5. package/dist/api/account.d.cts +17 -4
  6. package/dist/api/account.d.cts.map +1 -1
  7. package/dist/api/account.d.mts +17 -4
  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/keyring.cjs.map +1 -1
  12. package/dist/api/keyring.d.cts +1 -1
  13. package/dist/api/keyring.d.cts.map +1 -1
  14. package/dist/api/keyring.d.mts +1 -1
  15. package/dist/api/keyring.d.mts.map +1 -1
  16. package/dist/api/keyring.mjs.map +1 -1
  17. package/dist/eth/erc4337/types.cjs.map +1 -1
  18. package/dist/eth/erc4337/types.d.cts +1 -1
  19. package/dist/eth/erc4337/types.d.cts.map +1 -1
  20. package/dist/eth/erc4337/types.d.mts +1 -1
  21. package/dist/eth/erc4337/types.d.mts.map +1 -1
  22. package/dist/eth/erc4337/types.mjs.map +1 -1
  23. package/dist/eth/types.cjs.map +1 -1
  24. package/dist/eth/types.d.cts.map +1 -1
  25. package/dist/eth/types.d.mts.map +1 -1
  26. package/dist/eth/types.mjs.map +1 -1
  27. package/dist/events.d.cts +10 -8
  28. package/dist/events.d.cts.map +1 -1
  29. package/dist/events.d.mts +10 -8
  30. package/dist/events.d.mts.map +1 -1
  31. package/dist/index.cjs +1 -0
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +1 -0
  34. package/dist/index.d.cts.map +1 -1
  35. package/dist/index.d.mts +1 -0
  36. package/dist/index.d.mts.map +1 -1
  37. package/dist/index.mjs +1 -0
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/rpc.d.cts +22 -17
  40. package/dist/rpc.d.cts.map +1 -1
  41. package/dist/rpc.d.mts +22 -17
  42. package/dist/rpc.d.mts.map +1 -1
  43. package/dist/v2/api/create-account/bip44.cjs.map +1 -1
  44. package/dist/v2/api/create-account/bip44.d.cts +1 -1
  45. package/dist/v2/api/create-account/bip44.d.cts.map +1 -1
  46. package/dist/v2/api/create-account/bip44.d.mts +1 -1
  47. package/dist/v2/api/create-account/bip44.d.mts.map +1 -1
  48. package/dist/v2/api/create-account/bip44.mjs.map +1 -1
  49. package/dist/v2/api/create-account/custom.cjs.map +1 -1
  50. package/dist/v2/api/create-account/custom.d.cts +1 -1
  51. package/dist/v2/api/create-account/custom.d.cts.map +1 -1
  52. package/dist/v2/api/create-account/custom.d.mts +1 -1
  53. package/dist/v2/api/create-account/custom.d.mts.map +1 -1
  54. package/dist/v2/api/create-account/custom.mjs.map +1 -1
  55. package/dist/v2/api/create-account/index.cjs.map +1 -1
  56. package/dist/v2/api/create-account/index.d.cts +2 -2
  57. package/dist/v2/api/create-account/index.d.cts.map +1 -1
  58. package/dist/v2/api/create-account/index.d.mts +2 -2
  59. package/dist/v2/api/create-account/index.d.mts.map +1 -1
  60. package/dist/v2/api/create-account/index.mjs.map +1 -1
  61. package/dist/v2/api/create-account/private-key.cjs.map +1 -1
  62. package/dist/v2/api/create-account/private-key.d.cts +4 -3
  63. package/dist/v2/api/create-account/private-key.d.cts.map +1 -1
  64. package/dist/v2/api/create-account/private-key.d.mts +4 -3
  65. package/dist/v2/api/create-account/private-key.d.mts.map +1 -1
  66. package/dist/v2/api/create-account/private-key.mjs.map +1 -1
  67. package/dist/v2/api/export-account/index.cjs.map +1 -1
  68. package/dist/v2/api/export-account/index.d.cts +1 -1
  69. package/dist/v2/api/export-account/index.d.cts.map +1 -1
  70. package/dist/v2/api/export-account/index.d.mts +1 -1
  71. package/dist/v2/api/export-account/index.d.mts.map +1 -1
  72. package/dist/v2/api/export-account/index.mjs.map +1 -1
  73. package/dist/v2/api/export-account/private-key.cjs.map +1 -1
  74. package/dist/v2/api/export-account/private-key.d.cts +1 -1
  75. package/dist/v2/api/export-account/private-key.d.cts.map +1 -1
  76. package/dist/v2/api/export-account/private-key.d.mts +1 -1
  77. package/dist/v2/api/export-account/private-key.d.mts.map +1 -1
  78. package/dist/v2/api/export-account/private-key.mjs.map +1 -1
  79. package/dist/v2/api/keyring-capabilities.cjs +1 -1
  80. package/dist/v2/api/keyring-capabilities.cjs.map +1 -1
  81. package/dist/v2/api/keyring-capabilities.d.cts +7 -6
  82. package/dist/v2/api/keyring-capabilities.d.cts.map +1 -1
  83. package/dist/v2/api/keyring-capabilities.d.mts +7 -6
  84. package/dist/v2/api/keyring-capabilities.d.mts.map +1 -1
  85. package/dist/v2/api/keyring-capabilities.mjs +1 -1
  86. package/dist/v2/api/keyring-capabilities.mjs.map +1 -1
  87. package/dist/v2/api/keyring-rpc.cjs +2 -2
  88. package/dist/v2/api/keyring-rpc.cjs.map +1 -1
  89. package/dist/v2/api/keyring-rpc.d.cts +13 -10
  90. package/dist/v2/api/keyring-rpc.d.cts.map +1 -1
  91. package/dist/v2/api/keyring-rpc.d.mts +13 -10
  92. package/dist/v2/api/keyring-rpc.d.mts.map +1 -1
  93. package/dist/v2/api/keyring-rpc.mjs +2 -2
  94. package/dist/v2/api/keyring-rpc.mjs.map +1 -1
  95. package/dist/v2/api/keyring.cjs.map +1 -1
  96. package/dist/v2/api/keyring.d.cts +2 -2
  97. package/dist/v2/api/keyring.d.cts.map +1 -1
  98. package/dist/v2/api/keyring.d.mts +2 -2
  99. package/dist/v2/api/keyring.d.mts.map +1 -1
  100. package/dist/v2/api/keyring.mjs.map +1 -1
  101. package/dist/v2/api/private-key.cjs.map +1 -1
  102. package/dist/v2/api/private-key.d.cts +4 -3
  103. package/dist/v2/api/private-key.d.cts.map +1 -1
  104. package/dist/v2/api/private-key.d.mts +4 -3
  105. package/dist/v2/api/private-key.d.mts.map +1 -1
  106. package/dist/v2/api/private-key.mjs.map +1 -1
  107. package/dist/xlm/constants.cjs +15 -0
  108. package/dist/xlm/constants.cjs.map +1 -0
  109. package/dist/xlm/constants.d.cts +10 -0
  110. package/dist/xlm/constants.d.cts.map +1 -0
  111. package/dist/xlm/constants.d.mts +10 -0
  112. package/dist/xlm/constants.d.mts.map +1 -0
  113. package/dist/xlm/constants.mjs +12 -0
  114. package/dist/xlm/constants.mjs.map +1 -0
  115. package/dist/xlm/index.cjs +19 -0
  116. package/dist/xlm/index.cjs.map +1 -0
  117. package/dist/xlm/index.d.cts +3 -0
  118. package/dist/xlm/index.d.cts.map +1 -0
  119. package/dist/xlm/index.d.mts +3 -0
  120. package/dist/xlm/index.d.mts.map +1 -0
  121. package/dist/xlm/index.mjs +3 -0
  122. package/dist/xlm/index.mjs.map +1 -0
  123. package/dist/xlm/types.cjs +42 -0
  124. package/dist/xlm/types.cjs.map +1 -0
  125. package/dist/xlm/types.d.cts +71 -0
  126. package/dist/xlm/types.d.cts.map +1 -0
  127. package/dist/xlm/types.d.mts +71 -0
  128. package/dist/xlm/types.d.mts.map +1 -0
  129. package/dist/xlm/types.mjs +39 -0
  130. package/dist/xlm/types.mjs.map +1 -0
  131. package/package.json +34 -28
  132. package/v2.js +3 -0
@@ -1,10 +1,10 @@
1
1
  import { object, exactOptional, UuidStruct } from "@metamask/keyring-utils";
2
2
  import { array, literal, number, string, union } from "@metamask/superstruct";
3
3
  import { JsonStruct } from "@metamask/utils";
4
- import { CreateAccountOptionsStruct } from "./create-account/index.mjs";
5
- import { ExportAccountOptionsStruct, PrivateKeyExportedAccountStruct } from "./export-account/index.mjs";
6
4
  import { KeyringAccountStruct } from "../../api/account.mjs";
7
5
  import { KeyringRequestStruct } from "../../api/request.mjs";
6
+ import { CreateAccountOptionsStruct } from "./create-account/index.mjs";
7
+ import { ExportAccountOptionsStruct, PrivateKeyExportedAccountStruct } from "./export-account/index.mjs";
8
8
  /**
9
9
  * Keyring RPC methods used by the API.
10
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"keyring-rp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CAAC;KACnD,CAAC;CACH,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,2BAA2B,GAAG,+BAA+B,CAAC;AAI3E,+EAA+E;AAC/E,iBAAiB;AAEjB,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;IAC/C,GAAG,YAAY;IACf,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAAC,aAAa,EAAE,CAAC;IACpD,MAAM,EAAE,oBAAoB;CAC7B,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,2BAA2B,GAAG,UAAU,CAAC","sourcesContent":["import { object, exactOptional, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, literal, number, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { CreateAccountOptionsStruct } from './create-account';\nimport {\n ExportAccountOptionsStruct,\n PrivateKeyExportedAccountStruct,\n} from './export-account';\nimport type { Keyring } from './keyring';\nimport { KeyringAccountStruct } from '../../api/account';\nimport { KeyringRequestStruct } from '../../api/request';\n\n/**\n * Keyring interface for keyring methods that can be invoked through\n * RPC calls.\n */\nexport type KeyringRpc = {\n getAccount: Keyring['getAccount'];\n getAccounts: Keyring['getAccounts'];\n createAccounts: Keyring['createAccounts'];\n deleteAccount: Keyring['deleteAccount'];\n submitRequest: Keyring['submitRequest'];\n exportAccount?: Keyring['exportAccount'];\n};\n\n/**\n * Keyring RPC methods used by the API.\n */\nexport const KeyringRpcMethod = {\n GetAccounts: 'keyring_getAccounts',\n CreateAccounts: 'keyring_createAccounts',\n // Inherited from v1 (but method signatures may differ...):\n // NOTE: We use literals here to avoid circular dependencies.\n GetAccount: 'keyring_getAccount',\n DeleteAccount: 'keyring_deleteAccount',\n ExportAccount: 'keyring_exportAccount',\n SubmitRequest: 'keyring_submitRequest',\n} as const;\n\n/**\n * Keyring RPC methods used by the API.\n */\nexport type KeyringRpcMethod =\n (typeof KeyringRpcMethod)[keyof typeof KeyringRpcMethod];\n\n/**\n * Check if a method is a keyring RPC method (v2).\n *\n * @param method - Method to check.\n * @returns Whether the method is a keyring RPC method (v2).\n */\nexport function isKeyringRpcMethod(method: string): method is KeyringRpcMethod {\n return Object.values(KeyringRpcMethod).includes(method as KeyringRpcMethod);\n}\n\n// ----------------------------------------------------------------------------\n\nconst CommonHeader = {\n jsonrpc: literal('2.0'),\n id: union([string(), number(), literal(null)]),\n};\n\n// ----------------------------------------------------------------------------\n// Get accounts\n\nexport const GetAccountsRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.GetAccounts}`),\n});\n\nexport type GetAccountsRequest = Infer<typeof GetAccountsRequestStruct>;\n\nexport const GetAccountsResponseStruct = array(KeyringAccountStruct);\n\nexport type GetAccountsResponse = Infer<typeof GetAccountsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Get account\n\nexport const GetAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.GetAccount}`),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;\n\nexport const GetAccountResponseStruct = KeyringAccountStruct;\n\nexport type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Create accounts\n\nexport const CreateAccountsRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.CreateAccounts}`),\n params: CreateAccountOptionsStruct,\n});\n\nexport type CreateAccountsRequest = Infer<typeof CreateAccountsRequestStruct>;\n\nexport const CreateAccountsResponseStruct = array(KeyringAccountStruct);\n\nexport type CreateAccountsResponse = Infer<typeof CreateAccountsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Delete account\n\nexport const DeleteAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.DeleteAccount}`),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;\n\nexport const DeleteAccountResponseStruct = literal(null);\n\nexport type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Export account\n\nexport const ExportAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.ExportAccount}`),\n params: object({\n id: UuidStruct,\n options: exactOptional(ExportAccountOptionsStruct),\n }),\n});\n\nexport type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;\n\nexport const ExportAccountResponseStruct = PrivateKeyExportedAccountStruct;\n\nexport type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Submit request\n\nexport const SubmitRequestRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.SubmitRequest}`),\n params: KeyringRequestStruct,\n});\n\nexport type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;\n\nexport const SubmitRequestResponseStruct = JsonStruct;\n\nexport type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;\n\n// ----------------------------------------------------------------------------\n\n/**\n * Keyring RPC requests.\n */\nexport type KeyringRpcRequests =\n | GetAccountsRequest\n | GetAccountRequest\n | CreateAccountsRequest\n | DeleteAccountRequest\n | ExportAccountRequest\n | SubmitRequestRequest;\n\n/**\n * Extract the proper request type for a given `KeyringRpcMethod`.\n */\nexport type KeyringRpcRequest<RpcMethod extends KeyringRpcMethod> = Extract<\n KeyringRpcRequests,\n { method: `${RpcMethod}` }\n>;\n"]}
1
+ {"version":3,"file":"keyring-rpc.mjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,gCAAgC;AAE5E,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AAC9E,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,OAAO,EAAE,oBAAoB,EAAE,8BAA0B;A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C,CAAC;AAIH,MAAM,CAAC,MAAM,2BAA2B,GAAG,UAAU,CAAC","sourcesContent":["import { object, exactOptional, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, literal, number, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { KeyringAccountStruct } from '../../api/account';\nimport { KeyringRequestStruct } from '../../api/request';\nimport { CreateAccountOptionsStruct } from './create-account';\nimport {\n ExportAccountOptionsStruct,\n PrivateKeyExportedAccountStruct,\n} from './export-account';\nimport type { Keyring } from './keyring';\n\n/**\n * Keyring interface for keyring methods that can be invoked through\n * RPC calls.\n */\nexport type KeyringRpc = {\n getAccount: Keyring['getAccount'];\n getAccounts: Keyring['getAccounts'];\n createAccounts: Keyring['createAccounts'];\n deleteAccount: Keyring['deleteAccount'];\n submitRequest: Keyring['submitRequest'];\n exportAccount?: Keyring['exportAccount'];\n};\n\n/**\n * Keyring RPC methods used by the API.\n */\nexport const KeyringRpcMethod = {\n GetAccounts: 'keyring_getAccounts',\n CreateAccounts: 'keyring_createAccounts',\n // Inherited from v1 (but method signatures may differ...):\n // NOTE: We use literals here to avoid circular dependencies.\n GetAccount: 'keyring_getAccount',\n DeleteAccount: 'keyring_deleteAccount',\n ExportAccount: 'keyring_exportAccount',\n SubmitRequest: 'keyring_submitRequest',\n} as const;\n\n/**\n * Keyring RPC methods used by the API.\n */\nexport type KeyringRpcMethod =\n (typeof KeyringRpcMethod)[keyof typeof KeyringRpcMethod];\n\n/**\n * Check if a method is a keyring RPC method (v2).\n *\n * @param method - Method to check.\n * @returns Whether the method is a keyring RPC method (v2).\n */\nexport function isKeyringRpcMethod(method: string): method is KeyringRpcMethod {\n return Object.values(KeyringRpcMethod).includes(method as KeyringRpcMethod);\n}\n\n// ----------------------------------------------------------------------------\n\nconst CommonHeader = {\n jsonrpc: literal('2.0'),\n id: union([string(), number(), literal(null)]),\n};\n\n// ----------------------------------------------------------------------------\n// Get accounts\n\nexport const GetAccountsRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.GetAccounts}`),\n});\n\nexport type GetAccountsRequest = Infer<typeof GetAccountsRequestStruct>;\n\nexport const GetAccountsResponseStruct = array(KeyringAccountStruct);\n\nexport type GetAccountsResponse = Infer<typeof GetAccountsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Get account\n\nexport const GetAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.GetAccount}`),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;\n\nexport const GetAccountResponseStruct = KeyringAccountStruct;\n\nexport type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Create accounts\n\nexport const CreateAccountsRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.CreateAccounts}`),\n params: CreateAccountOptionsStruct,\n});\n\nexport type CreateAccountsRequest = Infer<typeof CreateAccountsRequestStruct>;\n\nexport const CreateAccountsResponseStruct = array(KeyringAccountStruct);\n\nexport type CreateAccountsResponse = Infer<typeof CreateAccountsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Delete account\n\nexport const DeleteAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.DeleteAccount}`),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;\n\nexport const DeleteAccountResponseStruct = literal(null);\n\nexport type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Export account\n\nexport const ExportAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.ExportAccount}`),\n params: object({\n id: UuidStruct,\n options: exactOptional(ExportAccountOptionsStruct),\n }),\n});\n\nexport type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;\n\nexport const ExportAccountResponseStruct = PrivateKeyExportedAccountStruct;\n\nexport type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Submit request\n\nexport const SubmitRequestRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.SubmitRequest}`),\n params: KeyringRequestStruct,\n});\n\nexport type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;\n\nexport const SubmitRequestResponseStruct = JsonStruct;\n\nexport type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;\n\n// ----------------------------------------------------------------------------\n\n/**\n * Keyring RPC requests.\n */\nexport type KeyringRpcRequests =\n | GetAccountsRequest\n | GetAccountRequest\n | CreateAccountsRequest\n | DeleteAccountRequest\n | ExportAccountRequest\n | SubmitRequestRequest;\n\n/**\n * Extract the proper request type for a given `KeyringRpcMethod`.\n */\nexport type KeyringRpcRequest<RpcMethod extends KeyringRpcMethod> = Extract<\n KeyringRpcRequests,\n { method: `${RpcMethod}` }\n>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { CreateAccountOptions } from './create-account';\nimport type { ExportedAccount, ExportAccountOptions } from './export-account';\nimport type { KeyringCapabilities } from './keyring-capabilities';\nimport type { KeyringType } from './keyring-type';\nimport type { KeyringAccount } from '../../api/account';\nimport type { KeyringRequest } from '../../api/request';\n\n/**\n * The Keyring interface defines methods for managing accounts and signing\n * requests. This interface unifies the existing EVM and Snap keyring interfaces\n * to provide a consistent API for all keyring type.\n *\n * This interface supports both EVM and non-EVM chains, and includes\n * account metadata needed for features like Multi-SRP and Backup and Sync.\n */\nexport type Keyring = {\n /**\n * Type of the keyring.\n */\n type: `${KeyringType}`;\n\n /**\n * List of capabilities supported by the keyring.\n */\n capabilities: KeyringCapabilities;\n\n /**\n * Serialize the keyring state to a JSON object.\n *\n * @returns A promise that resolves to a JSON-serializable representation of\n * the keyring state.\n */\n serialize(): Promise<Json>;\n\n /**\n * Restores the keyring state from a serialized JSON object.\n *\n * @param state - A JSON object representing a serialized keyring state.\n * @returns A promise that resolves when the keyring state has been restored.\n */\n deserialize(state: Json): Promise<void>;\n\n /**\n * Initialize the keyring.\n *\n * This method is called after the constructor to allow the keyring to\n * perform any necessary asynchronous initialization tasks.\n *\n * @returns A promise that resolves when initialization is complete.\n */\n init?(): Promise<void>;\n\n /**\n * Destroy the keyring.\n *\n * This method is called before the keyring is removed from the Keyring\n * Controller, allowing the keyring to perform any necessary cleanup tasks.\n *\n * @returns A promise that resolves when cleanup is complete.\n */\n destroy?(): Promise<void>;\n\n /**\n * Returns all accounts managed by the keyring.\n *\n * @returns A promise that resolves to an array of all accounts managed by\n * this keyring.\n */\n getAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Returns the account with the specified ID.\n *\n * @param accountId - ID of the account to retrieve.\n * @returns A promise that resolves to the account with the given ID.\n */\n getAccount(accountId: AccountId): Promise<KeyringAccount>;\n\n /**\n * Creates one or more new accounts according to the provided options.\n *\n * Deterministic account creation MUST be idempotent, meaning that for\n * deterministic algorithms, like BIP-44, calling this method with the same\n * options should always return the same accounts, even if the accounts\n * already exist in the keyring.\n *\n * @param options - Options describing how to create the account(s).\n * @returns A promise that resolves to an array of the created account objects.\n */\n createAccounts(options: CreateAccountOptions): Promise<KeyringAccount[]>;\n\n /**\n * Deletes the account with the specified ID.\n *\n * @param accountId - ID of the account to delete.\n * @returns A promise that resolves when the account has been deleted.\n */\n deleteAccount(accountId: AccountId): Promise<void>;\n\n /**\n * Exports the private key or secret material for the specified account.\n *\n * @param accountId - ID of the account to export.\n * @param options - Optional export options.\n * @returns A promise that resolves to the exported account data.\n */\n exportAccount?(\n accountId: AccountId,\n options?: ExportAccountOptions,\n ): Promise<ExportedAccount>;\n\n /**\n * Submits a request to the keyring.\n *\n * @param request - The `KeyringRequest` object to submit.\n * @returns A promise that resolves to the response for the request.\n */\n submitRequest(request: KeyringRequest): Promise<Json>;\n};\n"]}
1
+ {"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from '../../api/account';\nimport type { KeyringRequest } from '../../api/request';\nimport type { CreateAccountOptions } from './create-account';\nimport type { ExportedAccount, ExportAccountOptions } from './export-account';\nimport type { KeyringCapabilities } from './keyring-capabilities';\nimport type { KeyringType } from './keyring-type';\n\n/**\n * The Keyring interface defines methods for managing accounts and signing\n * requests. This interface unifies the existing EVM and Snap keyring interfaces\n * to provide a consistent API for all keyring type.\n *\n * This interface supports both EVM and non-EVM chains, and includes\n * account metadata needed for features like Multi-SRP and Backup and Sync.\n */\nexport type Keyring = {\n /**\n * Type of the keyring.\n */\n type: `${KeyringType}`;\n\n /**\n * List of capabilities supported by the keyring.\n */\n capabilities: KeyringCapabilities;\n\n /**\n * Serialize the keyring state to a JSON object.\n *\n * @returns A promise that resolves to a JSON-serializable representation of\n * the keyring state.\n */\n serialize(): Promise<Json>;\n\n /**\n * Restores the keyring state from a serialized JSON object.\n *\n * @param state - A JSON object representing a serialized keyring state.\n * @returns A promise that resolves when the keyring state has been restored.\n */\n deserialize(state: Json): Promise<void>;\n\n /**\n * Initialize the keyring.\n *\n * This method is called after the constructor to allow the keyring to\n * perform any necessary asynchronous initialization tasks.\n *\n * @returns A promise that resolves when initialization is complete.\n */\n init?(): Promise<void>;\n\n /**\n * Destroy the keyring.\n *\n * This method is called before the keyring is removed from the Keyring\n * Controller, allowing the keyring to perform any necessary cleanup tasks.\n *\n * @returns A promise that resolves when cleanup is complete.\n */\n destroy?(): Promise<void>;\n\n /**\n * Returns all accounts managed by the keyring.\n *\n * @returns A promise that resolves to an array of all accounts managed by\n * this keyring.\n */\n getAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Returns the account with the specified ID.\n *\n * @param accountId - ID of the account to retrieve.\n * @returns A promise that resolves to the account with the given ID.\n */\n getAccount(accountId: AccountId): Promise<KeyringAccount>;\n\n /**\n * Creates one or more new accounts according to the provided options.\n *\n * Deterministic account creation MUST be idempotent, meaning that for\n * deterministic algorithms, like BIP-44, calling this method with the same\n * options should always return the same accounts, even if the accounts\n * already exist in the keyring.\n *\n * @param options - Options describing how to create the account(s).\n * @returns A promise that resolves to an array of the created account objects.\n */\n createAccounts(options: CreateAccountOptions): Promise<KeyringAccount[]>;\n\n /**\n * Deletes the account with the specified ID.\n *\n * @param accountId - ID of the account to delete.\n * @returns A promise that resolves when the account has been deleted.\n */\n deleteAccount(accountId: AccountId): Promise<void>;\n\n /**\n * Exports the private key or secret material for the specified account.\n *\n * @param accountId - ID of the account to export.\n * @param options - Optional export options.\n * @returns A promise that resolves to the exported account data.\n */\n exportAccount?(\n accountId: AccountId,\n options?: ExportAccountOptions,\n ): Promise<ExportedAccount>;\n\n /**\n * Submits a request to the keyring.\n *\n * @param request - The `KeyringRequest` object to submit.\n * @returns A promise that resolves to the response for the request.\n */\n submitRequest(request: KeyringRequest): Promise<Json>;\n};\n"]}
@@ -1,11 +1,11 @@
1
1
  import type { AccountId } from "@metamask/keyring-utils";
2
2
  import type { Json } from "@metamask/utils";
3
+ import type { KeyringAccount } from "../../api/account.cjs";
4
+ import type { KeyringRequest } from "../../api/request.cjs";
3
5
  import type { CreateAccountOptions } from "./create-account/index.cjs";
4
6
  import type { ExportedAccount, ExportAccountOptions } from "./export-account/index.cjs";
5
7
  import type { KeyringCapabilities } from "./keyring-capabilities.cjs";
6
8
  import type { KeyringType } from "./keyring-type.cjs";
7
- import type { KeyringAccount } from "../../api/account.cjs";
8
- import type { KeyringRequest } from "../../api/request.cjs";
9
9
  /**
10
10
  * The Keyring interface defines methods for managing accounts and signing
11
11
  * requests. This interface unifies the existing EVM and Snap keyring interfaces
@@ -1 +1 @@
1
- {"version":3,"file":"keyring.d.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AAU,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAE1D;;;;;;;;;;OAUG;IACH,cAAc,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAEzE;;;;;OAKG;IACH,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;;;;OAMG;IACH,aAAa,CAAC,CACZ,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,eAAe,CAAC,CAAC;IAE5B;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import type { AccountId } from "@metamask/keyring-utils";
2
2
  import type { Json } from "@metamask/utils";
3
+ import type { KeyringAccount } from "../../api/account.mjs";
4
+ import type { KeyringRequest } from "../../api/request.mjs";
3
5
  import type { CreateAccountOptions } from "./create-account/index.mjs";
4
6
  import type { ExportedAccount, ExportAccountOptions } from "./export-account/index.mjs";
5
7
  import type { KeyringCapabilities } from "./keyring-capabilities.mjs";
6
8
  import type { KeyringType } from "./keyring-type.mjs";
7
- import type { KeyringAccount } from "../../api/account.mjs";
8
- import type { KeyringRequest } from "../../api/request.mjs";
9
9
  /**
10
10
  * The Keyring interface defines methods for managing accounts and signing
11
11
  * requests. This interface unifies the existing EVM and Snap keyring interfaces
@@ -1 +1 @@
1
- {"version":3,"file":"keyring.d.mts","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gCAAgC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,mCAAyB;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,mCAA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AC,CAAC;IAEnD;;;;;;OAMG;IACH,aAAa,CAAC,CACZ,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,eAAe,CAAC,CAAC;IAE5B;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { CreateAccountOptions } from './create-account';\nimport type { ExportedAccount, ExportAccountOptions } from './export-account';\nimport type { KeyringCapabilities } from './keyring-capabilities';\nimport type { KeyringType } from './keyring-type';\nimport type { KeyringAccount } from '../../api/account';\nimport type { KeyringRequest } from '../../api/request';\n\n/**\n * The Keyring interface defines methods for managing accounts and signing\n * requests. This interface unifies the existing EVM and Snap keyring interfaces\n * to provide a consistent API for all keyring type.\n *\n * This interface supports both EVM and non-EVM chains, and includes\n * account metadata needed for features like Multi-SRP and Backup and Sync.\n */\nexport type Keyring = {\n /**\n * Type of the keyring.\n */\n type: `${KeyringType}`;\n\n /**\n * List of capabilities supported by the keyring.\n */\n capabilities: KeyringCapabilities;\n\n /**\n * Serialize the keyring state to a JSON object.\n *\n * @returns A promise that resolves to a JSON-serializable representation of\n * the keyring state.\n */\n serialize(): Promise<Json>;\n\n /**\n * Restores the keyring state from a serialized JSON object.\n *\n * @param state - A JSON object representing a serialized keyring state.\n * @returns A promise that resolves when the keyring state has been restored.\n */\n deserialize(state: Json): Promise<void>;\n\n /**\n * Initialize the keyring.\n *\n * This method is called after the constructor to allow the keyring to\n * perform any necessary asynchronous initialization tasks.\n *\n * @returns A promise that resolves when initialization is complete.\n */\n init?(): Promise<void>;\n\n /**\n * Destroy the keyring.\n *\n * This method is called before the keyring is removed from the Keyring\n * Controller, allowing the keyring to perform any necessary cleanup tasks.\n *\n * @returns A promise that resolves when cleanup is complete.\n */\n destroy?(): Promise<void>;\n\n /**\n * Returns all accounts managed by the keyring.\n *\n * @returns A promise that resolves to an array of all accounts managed by\n * this keyring.\n */\n getAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Returns the account with the specified ID.\n *\n * @param accountId - ID of the account to retrieve.\n * @returns A promise that resolves to the account with the given ID.\n */\n getAccount(accountId: AccountId): Promise<KeyringAccount>;\n\n /**\n * Creates one or more new accounts according to the provided options.\n *\n * Deterministic account creation MUST be idempotent, meaning that for\n * deterministic algorithms, like BIP-44, calling this method with the same\n * options should always return the same accounts, even if the accounts\n * already exist in the keyring.\n *\n * @param options - Options describing how to create the account(s).\n * @returns A promise that resolves to an array of the created account objects.\n */\n createAccounts(options: CreateAccountOptions): Promise<KeyringAccount[]>;\n\n /**\n * Deletes the account with the specified ID.\n *\n * @param accountId - ID of the account to delete.\n * @returns A promise that resolves when the account has been deleted.\n */\n deleteAccount(accountId: AccountId): Promise<void>;\n\n /**\n * Exports the private key or secret material for the specified account.\n *\n * @param accountId - ID of the account to export.\n * @param options - Optional export options.\n * @returns A promise that resolves to the exported account data.\n */\n exportAccount?(\n accountId: AccountId,\n options?: ExportAccountOptions,\n ): Promise<ExportedAccount>;\n\n /**\n * Submits a request to the keyring.\n *\n * @param request - The `KeyringRequest` object to submit.\n * @returns A promise that resolves to the response for the request.\n */\n submitRequest(request: KeyringRequest): Promise<Json>;\n};\n"]}
1
+ {"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from '../../api/account';\nimport type { KeyringRequest } from '../../api/request';\nimport type { CreateAccountOptions } from './create-account';\nimport type { ExportedAccount, ExportAccountOptions } from './export-account';\nimport type { KeyringCapabilities } from './keyring-capabilities';\nimport type { KeyringType } from './keyring-type';\n\n/**\n * The Keyring interface defines methods for managing accounts and signing\n * requests. This interface unifies the existing EVM and Snap keyring interfaces\n * to provide a consistent API for all keyring type.\n *\n * This interface supports both EVM and non-EVM chains, and includes\n * account metadata needed for features like Multi-SRP and Backup and Sync.\n */\nexport type Keyring = {\n /**\n * Type of the keyring.\n */\n type: `${KeyringType}`;\n\n /**\n * List of capabilities supported by the keyring.\n */\n capabilities: KeyringCapabilities;\n\n /**\n * Serialize the keyring state to a JSON object.\n *\n * @returns A promise that resolves to a JSON-serializable representation of\n * the keyring state.\n */\n serialize(): Promise<Json>;\n\n /**\n * Restores the keyring state from a serialized JSON object.\n *\n * @param state - A JSON object representing a serialized keyring state.\n * @returns A promise that resolves when the keyring state has been restored.\n */\n deserialize(state: Json): Promise<void>;\n\n /**\n * Initialize the keyring.\n *\n * This method is called after the constructor to allow the keyring to\n * perform any necessary asynchronous initialization tasks.\n *\n * @returns A promise that resolves when initialization is complete.\n */\n init?(): Promise<void>;\n\n /**\n * Destroy the keyring.\n *\n * This method is called before the keyring is removed from the Keyring\n * Controller, allowing the keyring to perform any necessary cleanup tasks.\n *\n * @returns A promise that resolves when cleanup is complete.\n */\n destroy?(): Promise<void>;\n\n /**\n * Returns all accounts managed by the keyring.\n *\n * @returns A promise that resolves to an array of all accounts managed by\n * this keyring.\n */\n getAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Returns the account with the specified ID.\n *\n * @param accountId - ID of the account to retrieve.\n * @returns A promise that resolves to the account with the given ID.\n */\n getAccount(accountId: AccountId): Promise<KeyringAccount>;\n\n /**\n * Creates one or more new accounts according to the provided options.\n *\n * Deterministic account creation MUST be idempotent, meaning that for\n * deterministic algorithms, like BIP-44, calling this method with the same\n * options should always return the same accounts, even if the accounts\n * already exist in the keyring.\n *\n * @param options - Options describing how to create the account(s).\n * @returns A promise that resolves to an array of the created account objects.\n */\n createAccounts(options: CreateAccountOptions): Promise<KeyringAccount[]>;\n\n /**\n * Deletes the account with the specified ID.\n *\n * @param accountId - ID of the account to delete.\n * @returns A promise that resolves when the account has been deleted.\n */\n deleteAccount(accountId: AccountId): Promise<void>;\n\n /**\n * Exports the private key or secret material for the specified account.\n *\n * @param accountId - ID of the account to export.\n * @param options - Optional export options.\n * @returns A promise that resolves to the exported account data.\n */\n exportAccount?(\n accountId: AccountId,\n options?: ExportAccountOptions,\n ): Promise<ExportedAccount>;\n\n /**\n * Submits a request to the keyring.\n *\n * @param request - The `KeyringRequest` object to submit.\n * @returns A promise that resolves to the response for the request.\n */\n submitRequest(request: KeyringRequest): Promise<Json>;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../src/v2/api/private-key.ts"],"names":[],"mappings":";;;AAAA,uDAK+B;AAE/B,mDAA6D;AAE7D;;GAEG;AACH,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,iDAA2B,CAAA;IAE3B;;OAEG;IACH,uCAAiB,CAAA;AACnB,CAAC,EAVW,kBAAkB,kCAAlB,kBAAkB,QAU7B;AAED;;GAEG;AACU,QAAA,wBAAwB,GAAG,IAAA,mBAAK,EAAC;IAC5C,GAAG,kBAAkB,CAAC,WAAW,EAAE;IACnC,GAAG,kBAAkB,CAAC,MAAM,EAAE;CAC/B,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,4BAA4B,GAAG,IAAA,oBAAM,EAAC;IACjD;;OAEG;IACH,QAAQ,EAAE,gCAAwB;IAElC;;;;;;OAMG;IACH,IAAI,EAAE,IAAA,2BAAa,EAAC,kCAAwB,CAAC;CAC9C,CAAC,CAAC;AAOH;;GAEG;AACU,QAAA,4BAA4B,GAAG,IAAA,oBAAM,EAAC;IACjD;;OAEG;IACH,QAAQ,EAAE,gCAAwB;CACnC,CAAC,CAAC","sourcesContent":["import {\n enums,\n exactOptional,\n object,\n type Infer,\n} from '@metamask/superstruct';\n\nimport { KeyringAccountTypeStruct } from '../../api/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"]}
1
+ {"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../src/v2/api/private-key.ts"],"names":[],"mappings":";;;AAAA,uDAAqE;AAGrE,mDAA6D;AAE7D;;GAEG;AACH,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,iDAA2B,CAAA;IAE3B;;OAEG;IACH,uCAAiB,CAAA;AACnB,CAAC,EAVW,kBAAkB,kCAAlB,kBAAkB,QAU7B;AAED;;GAEG;AACU,QAAA,wBAAwB,GAAG,IAAA,mBAAK,EAAC;IAC5C,GAAG,kBAAkB,CAAC,WAAW,EAAE;IACnC,GAAG,kBAAkB,CAAC,MAAM,EAAE;CAC/B,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,4BAA4B,GAAG,IAAA,oBAAM,EAAC;IACjD;;OAEG;IACH,QAAQ,EAAE,gCAAwB;IAElC;;;;;;OAMG;IACH,IAAI,EAAE,IAAA,2BAAa,EAAC,kCAAwB,CAAC;CAC9C,CAAC,CAAC;AAOH;;GAEG;AACU,QAAA,4BAA4B,GAAG,IAAA,oBAAM,EAAC;IACjD;;OAEG;IACH,QAAQ,EAAE,gCAAwB;CACnC,CAAC,CAAC","sourcesContent":["import { enums, exactOptional, object } from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { KeyringAccountTypeStruct } from '../../api/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"]}
@@ -1,4 +1,4 @@
1
- import { type Infer } from "@metamask/superstruct";
1
+ import type { Infer } from "@metamask/superstruct";
2
2
  /**
3
3
  * Supported encoding formats for private keys.
4
4
  */
@@ -24,7 +24,7 @@ export declare const PrivateKeyEncodingStruct: import("@metamask/superstruct").S
24
24
  */
25
25
  export declare const ImportPrivateKeyFormatStruct: import("@metamask/superstruct").Struct<{
26
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";
27
+ type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
28
28
  }, {
29
29
  /**
30
30
  * Format used to encode the private key as a string.
@@ -40,7 +40,7 @@ export declare const ImportPrivateKeyFormatStruct: import("@metamask/superstruct
40
40
  * to be created from the private key. For example, in Bitcoin, a private key
41
41
  * can be used to create multiple types of accounts, such as P2WPKH, or P2TR.
42
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", {
43
+ type: import("@metamask/superstruct").ExactOptionalStruct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
44
44
  "eip155:eoa": "eip155:eoa";
45
45
  "eip155:erc4337": "eip155:erc4337";
46
46
  "bip122:p2pkh": "bip122:p2pkh";
@@ -49,6 +49,7 @@ export declare const ImportPrivateKeyFormatStruct: import("@metamask/superstruct
49
49
  "bip122:p2tr": "bip122:p2tr";
50
50
  "solana:data-account": "solana:data-account";
51
51
  "tron:eoa": "tron:eoa";
52
+ "stellar:account": "stellar:account";
52
53
  "any:account": "any:account";
53
54
  }>;
54
55
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"private-key.d.cts","sourceRoot":"","sources":["../../../src/v2/api/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"}
1
+ {"version":3,"file":"private-key.d.cts","sourceRoot":"","sources":["../../../src/v2/api/private-key.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;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"}
@@ -1,4 +1,4 @@
1
- import { type Infer } from "@metamask/superstruct";
1
+ import type { Infer } from "@metamask/superstruct";
2
2
  /**
3
3
  * Supported encoding formats for private keys.
4
4
  */
@@ -24,7 +24,7 @@ export declare const PrivateKeyEncodingStruct: import("@metamask/superstruct").S
24
24
  */
25
25
  export declare const ImportPrivateKeyFormatStruct: import("@metamask/superstruct").Struct<{
26
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";
27
+ type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
28
28
  }, {
29
29
  /**
30
30
  * Format used to encode the private key as a string.
@@ -40,7 +40,7 @@ export declare const ImportPrivateKeyFormatStruct: import("@metamask/superstruct
40
40
  * to be created from the private key. For example, in Bitcoin, a private key
41
41
  * can be used to create multiple types of accounts, such as P2WPKH, or P2TR.
42
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", {
43
+ type: import("@metamask/superstruct").ExactOptionalStruct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
44
44
  "eip155:eoa": "eip155:eoa";
45
45
  "eip155:erc4337": "eip155:erc4337";
46
46
  "bip122:p2pkh": "bip122:p2pkh";
@@ -49,6 +49,7 @@ export declare const ImportPrivateKeyFormatStruct: import("@metamask/superstruct
49
49
  "bip122:p2tr": "bip122:p2tr";
50
50
  "solana:data-account": "solana:data-account";
51
51
  "tron:eoa": "tron:eoa";
52
+ "stellar:account": "stellar:account";
52
53
  "any:account": "any:account";
53
54
  }>;
54
55
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"private-key.d.mts","sourceRoot":"","sources":["../../../src/v2/api/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"}
1
+ {"version":3,"file":"private-key.d.mts","sourceRoot":"","sources":["../../../src/v2/api/private-key.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;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"}
@@ -1 +1 @@
1
- {"version":3,"file":"private-key.mjs","sourceRoot":"","sources":["../../../src/v2/api/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,aAAa,EACb,MAAM,EAEP,8BAA8B;AAE/B,OAAO,EAAE,wBAAwB,EAAE,8BAA0B;AAE7D;;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 '../../api/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"]}
1
+ {"version":3,"file":"private-key.mjs","sourceRoot":"","sources":["../../../src/v2/api/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,8BAA8B;AAGrE,OAAO,EAAE,wBAAwB,EAAE,8BAA0B;AAE7D;;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 { enums, exactOptional, object } from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { KeyringAccountTypeStruct } from '../../api/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"]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ // istanbul ignore file
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.XlmScope = void 0;
5
+ /**
6
+ * Scopes for Stellar account type. See {@link KeyringAccount.scopes}.
7
+ *
8
+ * @see https://namespaces.chainagnostic.org/stellar/caip2
9
+ */
10
+ var XlmScope;
11
+ (function (XlmScope) {
12
+ XlmScope["Pubnet"] = "stellar:pubnet";
13
+ XlmScope["Testnet"] = "stellar:testnet";
14
+ })(XlmScope || (exports.XlmScope = XlmScope = {}));
15
+ //# sourceMappingURL=constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../../src/xlm/constants.ts"],"names":[],"mappings":";AAAA,uBAAuB;;;AAEvB;;;;GAIG;AACH,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,uCAA2B,CAAA;AAC7B,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB","sourcesContent":["// istanbul ignore file\n\n/**\n * Scopes for Stellar account type. See {@link KeyringAccount.scopes}.\n *\n * @see https://namespaces.chainagnostic.org/stellar/caip2\n */\nexport enum XlmScope {\n Pubnet = 'stellar:pubnet',\n Testnet = 'stellar:testnet',\n}\n"]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Scopes for Stellar account type. See {@link KeyringAccount.scopes}.
3
+ *
4
+ * @see https://namespaces.chainagnostic.org/stellar/caip2
5
+ */
6
+ export declare enum XlmScope {
7
+ Pubnet = "stellar:pubnet",
8
+ Testnet = "stellar:testnet"
9
+ }
10
+ //# sourceMappingURL=constants.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../../src/xlm/constants.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,oBAAY,QAAQ;IAClB,MAAM,mBAAmB;IACzB,OAAO,oBAAoB;CAC5B"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Scopes for Stellar account type. See {@link KeyringAccount.scopes}.
3
+ *
4
+ * @see https://namespaces.chainagnostic.org/stellar/caip2
5
+ */
6
+ export declare enum XlmScope {
7
+ Pubnet = "stellar:pubnet",
8
+ Testnet = "stellar:testnet"
9
+ }
10
+ //# sourceMappingURL=constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../src/xlm/constants.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,oBAAY,QAAQ;IAClB,MAAM,mBAAmB;IACzB,OAAO,oBAAoB;CAC5B"}
@@ -0,0 +1,12 @@
1
+ // istanbul ignore file
2
+ /**
3
+ * Scopes for Stellar account type. See {@link KeyringAccount.scopes}.
4
+ *
5
+ * @see https://namespaces.chainagnostic.org/stellar/caip2
6
+ */
7
+ export var XlmScope;
8
+ (function (XlmScope) {
9
+ XlmScope["Pubnet"] = "stellar:pubnet";
10
+ XlmScope["Testnet"] = "stellar:testnet";
11
+ })(XlmScope || (XlmScope = {}));
12
+ //# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../src/xlm/constants.ts"],"names":[],"mappings":"AAAA,uBAAuB;AAEvB;;;;GAIG;AACH,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,uCAA2B,CAAA;AAC7B,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB","sourcesContent":["// istanbul ignore file\n\n/**\n * Scopes for Stellar account type. See {@link KeyringAccount.scopes}.\n *\n * @see https://namespaces.chainagnostic.org/stellar/caip2\n */\nexport enum XlmScope {\n Pubnet = 'stellar:pubnet',\n Testnet = 'stellar:testnet',\n}\n"]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants.cjs"), exports);
18
+ __exportStar(require("./types.cjs"), exports);
19
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/xlm/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA4B;AAC5B,8CAAwB","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
@@ -0,0 +1,3 @@
1
+ export * from "./constants.cjs";
2
+ export * from "./types.cjs";
3
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/xlm/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB"}
@@ -0,0 +1,3 @@
1
+ export * from "./constants.mjs";
2
+ export * from "./types.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/xlm/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB"}
@@ -0,0 +1,3 @@
1
+ export * from "./constants.mjs";
2
+ export * from "./types.mjs";
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/xlm/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.XlmAccountStruct = exports.XlmMethod = exports.XlmAddressStruct = void 0;
4
+ const keyring_utils_1 = require("@metamask/keyring-utils");
5
+ const superstruct_1 = require("@metamask/superstruct");
6
+ const utils_1 = require("@metamask/utils");
7
+ const api_1 = require("../api/index.cjs");
8
+ /**
9
+ * Stellar account addresses use strkey encoding: non-muxed accounts start with `G`
10
+ * and are 56 characters long.
11
+ *
12
+ * TODO: Add checksum validation.
13
+ */
14
+ exports.XlmAddressStruct = (0, utils_1.definePattern)('XlmAddress', /^G[A-Z2-7]{55}$/u);
15
+ /**
16
+ * Supported Stellar methods.
17
+ */
18
+ var XlmMethod;
19
+ (function (XlmMethod) {
20
+ XlmMethod["SignMessage"] = "signMessage";
21
+ XlmMethod["SignTransaction"] = "signTransaction";
22
+ })(XlmMethod || (exports.XlmMethod = XlmMethod = {}));
23
+ exports.XlmAccountStruct = (0, keyring_utils_1.object)({
24
+ ...api_1.KeyringAccountStruct.schema,
25
+ /**
26
+ * Account address.
27
+ */
28
+ address: exports.XlmAddressStruct,
29
+ /**
30
+ * Account type.
31
+ */
32
+ type: (0, superstruct_1.literal)(`${api_1.XlmAccountType.Account}`),
33
+ /**
34
+ * Account supported scopes (CAIP-2 chain IDs).
35
+ */
36
+ scopes: (0, superstruct_1.nonempty)((0, superstruct_1.array)(api_1.CaipChainIdStruct)),
37
+ /**
38
+ * Account supported methods.
39
+ */
40
+ methods: (0, superstruct_1.array)((0, superstruct_1.enums)(Object.values(XlmMethod))),
41
+ });
42
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/xlm/types.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AAEjD,uDAAwE;AACxE,2CAAgD;AAEhD,0CAIgB;AAEhB;;;;;GAKG;AACU,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;AAEhF;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,gDAAmC,CAAA;AACrC,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAEY,QAAA,gBAAgB,GAAG,IAAA,sBAAM,EAAC;IACrC,GAAG,0BAAoB,CAAC,MAAM;IAC9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IACzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,OAAO,EAAE,CAAC;IAC1C;;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 XlmAccountType,\n} from '../api';\n\n/**\n * Stellar account addresses use strkey encoding: non-muxed accounts start with `G`\n * and are 56 characters long.\n *\n * TODO: Add checksum validation.\n */\nexport const XlmAddressStruct = definePattern('XlmAddress', /^G[A-Z2-7]{55}$/u);\n\n/**\n * Supported Stellar methods.\n */\nexport enum XlmMethod {\n SignMessage = 'signMessage',\n SignTransaction = 'signTransaction',\n}\n\nexport const XlmAccountStruct = object({\n ...KeyringAccountStruct.schema,\n /**\n * Account address.\n */\n address: XlmAddressStruct,\n /**\n * Account type.\n */\n type: literal(`${XlmAccountType.Account}`),\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(XlmMethod))),\n});\n\nexport type XlmAccount = Infer<typeof XlmAccountStruct>;\n"]}
@@ -0,0 +1,71 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ /**
3
+ * Stellar account addresses use strkey encoding: non-muxed accounts start with `G`
4
+ * and are 56 characters long.
5
+ *
6
+ * TODO: Add checksum validation.
7
+ */
8
+ export declare const XlmAddressStruct: import("@metamask/superstruct").Struct<string, null>;
9
+ /**
10
+ * Supported Stellar methods.
11
+ */
12
+ export declare enum XlmMethod {
13
+ SignMessage = "signMessage",
14
+ SignTransaction = "signTransaction"
15
+ }
16
+ export declare const XlmAccountStruct: import("@metamask/superstruct").Struct<{
17
+ type: "stellar:account";
18
+ id: string;
19
+ options: Record<string, import("@metamask/utils").Json> & {
20
+ entropy?: {
21
+ type: "mnemonic";
22
+ id: string;
23
+ derivationPath: string;
24
+ groupIndex: number;
25
+ } | {
26
+ type: "private-key";
27
+ } | {
28
+ type: "custom";
29
+ };
30
+ exportable?: boolean;
31
+ };
32
+ address: string;
33
+ scopes: `${string}:${string}`[];
34
+ methods: XlmMethod[];
35
+ }, {
36
+ /**
37
+ * Account address.
38
+ */
39
+ address: import("@metamask/superstruct").Struct<string, null>;
40
+ /**
41
+ * Account type.
42
+ */
43
+ type: import("@metamask/superstruct").Struct<"stellar:account", "stellar:account">;
44
+ /**
45
+ * Account supported scopes (CAIP-2 chain IDs).
46
+ */
47
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
48
+ /**
49
+ * Account supported methods.
50
+ */
51
+ methods: import("@metamask/superstruct").Struct<XlmMethod[], import("@metamask/superstruct").Struct<XlmMethod, {
52
+ signMessage: XlmMethod.SignMessage;
53
+ signTransaction: XlmMethod.SignTransaction;
54
+ }>>;
55
+ id: import("@metamask/superstruct").Struct<string, null>;
56
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
57
+ entropy?: {
58
+ type: "mnemonic";
59
+ id: string;
60
+ derivationPath: string;
61
+ groupIndex: number;
62
+ } | {
63
+ type: "private-key";
64
+ } | {
65
+ type: "custom";
66
+ };
67
+ exportable?: boolean;
68
+ }, null>;
69
+ }>;
70
+ export type XlmAccount = Infer<typeof XlmAccountStruct>;
71
+ //# sourceMappingURL=types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/xlm/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,sDAAkD,CAAC;AAEhF;;GAEG;AACH,oBAAY,SAAS;IACnB,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;CACpC;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;IAE3B;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,71 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ /**
3
+ * Stellar account addresses use strkey encoding: non-muxed accounts start with `G`
4
+ * and are 56 characters long.
5
+ *
6
+ * TODO: Add checksum validation.
7
+ */
8
+ export declare const XlmAddressStruct: import("@metamask/superstruct").Struct<string, null>;
9
+ /**
10
+ * Supported Stellar methods.
11
+ */
12
+ export declare enum XlmMethod {
13
+ SignMessage = "signMessage",
14
+ SignTransaction = "signTransaction"
15
+ }
16
+ export declare const XlmAccountStruct: import("@metamask/superstruct").Struct<{
17
+ type: "stellar:account";
18
+ id: string;
19
+ options: Record<string, import("@metamask/utils").Json> & {
20
+ entropy?: {
21
+ type: "mnemonic";
22
+ id: string;
23
+ derivationPath: string;
24
+ groupIndex: number;
25
+ } | {
26
+ type: "private-key";
27
+ } | {
28
+ type: "custom";
29
+ };
30
+ exportable?: boolean;
31
+ };
32
+ address: string;
33
+ scopes: `${string}:${string}`[];
34
+ methods: XlmMethod[];
35
+ }, {
36
+ /**
37
+ * Account address.
38
+ */
39
+ address: import("@metamask/superstruct").Struct<string, null>;
40
+ /**
41
+ * Account type.
42
+ */
43
+ type: import("@metamask/superstruct").Struct<"stellar:account", "stellar:account">;
44
+ /**
45
+ * Account supported scopes (CAIP-2 chain IDs).
46
+ */
47
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
48
+ /**
49
+ * Account supported methods.
50
+ */
51
+ methods: import("@metamask/superstruct").Struct<XlmMethod[], import("@metamask/superstruct").Struct<XlmMethod, {
52
+ signMessage: XlmMethod.SignMessage;
53
+ signTransaction: XlmMethod.SignTransaction;
54
+ }>>;
55
+ id: import("@metamask/superstruct").Struct<string, null>;
56
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
57
+ entropy?: {
58
+ type: "mnemonic";
59
+ id: string;
60
+ derivationPath: string;
61
+ groupIndex: number;
62
+ } | {
63
+ type: "private-key";
64
+ } | {
65
+ type: "custom";
66
+ };
67
+ exportable?: boolean;
68
+ }, null>;
69
+ }>;
70
+ export type XlmAccount = Infer<typeof XlmAccountStruct>;
71
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/xlm/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,sDAAkD,CAAC;AAEhF;;GAEG;AACH,oBAAY,SAAS;IACnB,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;CACpC;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;IAE3B;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}