@metamask/keyring-api 23.0.0 → 23.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -8
- package/README.md +0 -9
- package/dist/api/keyring.cjs.map +1 -1
- package/dist/api/keyring.d.cts +1 -1
- package/dist/api/keyring.d.cts.map +1 -1
- package/dist/api/keyring.d.mts +1 -1
- package/dist/api/keyring.d.mts.map +1 -1
- package/dist/api/keyring.mjs.map +1 -1
- package/dist/api/transaction.cjs +5 -0
- package/dist/api/transaction.cjs.map +1 -1
- package/dist/api/transaction.d.cts +12 -6
- package/dist/api/transaction.d.cts.map +1 -1
- package/dist/api/transaction.d.mts +12 -6
- package/dist/api/transaction.d.mts.map +1 -1
- package/dist/api/transaction.mjs +5 -0
- package/dist/api/transaction.mjs.map +1 -1
- package/dist/eth/erc4337/types.cjs.map +1 -1
- package/dist/eth/erc4337/types.d.cts +1 -1
- package/dist/eth/erc4337/types.d.cts.map +1 -1
- package/dist/eth/erc4337/types.d.mts +1 -1
- package/dist/eth/erc4337/types.d.mts.map +1 -1
- package/dist/eth/erc4337/types.mjs.map +1 -1
- package/dist/eth/types.cjs.map +1 -1
- package/dist/eth/types.d.cts.map +1 -1
- package/dist/eth/types.d.mts.map +1 -1
- package/dist/eth/types.mjs.map +1 -1
- package/dist/events.d.cts +3 -3
- package/dist/events.d.mts +3 -3
- package/dist/rpc.d.cts +5 -4
- package/dist/rpc.d.cts.map +1 -1
- package/dist/rpc.d.mts +5 -4
- package/dist/rpc.d.mts.map +1 -1
- package/dist/v2/api/create-account/bip44.cjs.map +1 -1
- package/dist/v2/api/create-account/bip44.d.cts +1 -1
- package/dist/v2/api/create-account/bip44.d.cts.map +1 -1
- package/dist/v2/api/create-account/bip44.d.mts +1 -1
- package/dist/v2/api/create-account/bip44.d.mts.map +1 -1
- package/dist/v2/api/create-account/bip44.mjs.map +1 -1
- package/dist/v2/api/create-account/custom.cjs.map +1 -1
- package/dist/v2/api/create-account/custom.d.cts +1 -1
- package/dist/v2/api/create-account/custom.d.cts.map +1 -1
- package/dist/v2/api/create-account/custom.d.mts +1 -1
- package/dist/v2/api/create-account/custom.d.mts.map +1 -1
- package/dist/v2/api/create-account/custom.mjs.map +1 -1
- package/dist/v2/api/create-account/index.cjs.map +1 -1
- package/dist/v2/api/create-account/index.d.cts +1 -1
- package/dist/v2/api/create-account/index.d.cts.map +1 -1
- package/dist/v2/api/create-account/index.d.mts +1 -1
- package/dist/v2/api/create-account/index.d.mts.map +1 -1
- package/dist/v2/api/create-account/index.mjs.map +1 -1
- package/dist/v2/api/create-account/private-key.cjs.map +1 -1
- package/dist/v2/api/create-account/private-key.d.cts +1 -1
- package/dist/v2/api/create-account/private-key.d.cts.map +1 -1
- package/dist/v2/api/create-account/private-key.d.mts +1 -1
- package/dist/v2/api/create-account/private-key.d.mts.map +1 -1
- package/dist/v2/api/create-account/private-key.mjs.map +1 -1
- package/dist/v2/api/export-account/index.cjs.map +1 -1
- package/dist/v2/api/export-account/index.d.cts +1 -1
- package/dist/v2/api/export-account/index.d.cts.map +1 -1
- package/dist/v2/api/export-account/index.d.mts +1 -1
- package/dist/v2/api/export-account/index.d.mts.map +1 -1
- package/dist/v2/api/export-account/index.mjs.map +1 -1
- package/dist/v2/api/export-account/private-key.cjs.map +1 -1
- package/dist/v2/api/export-account/private-key.d.cts +1 -1
- package/dist/v2/api/export-account/private-key.d.cts.map +1 -1
- package/dist/v2/api/export-account/private-key.d.mts +1 -1
- package/dist/v2/api/export-account/private-key.d.mts.map +1 -1
- package/dist/v2/api/export-account/private-key.mjs.map +1 -1
- package/dist/v2/api/keyring-capabilities.cjs +1 -1
- package/dist/v2/api/keyring-capabilities.cjs.map +1 -1
- package/dist/v2/api/keyring-capabilities.d.cts +1 -1
- package/dist/v2/api/keyring-capabilities.d.cts.map +1 -1
- package/dist/v2/api/keyring-capabilities.d.mts +1 -1
- package/dist/v2/api/keyring-capabilities.d.mts.map +1 -1
- package/dist/v2/api/keyring-capabilities.mjs +1 -1
- package/dist/v2/api/keyring-capabilities.mjs.map +1 -1
- package/dist/v2/api/keyring-rpc.cjs +2 -2
- package/dist/v2/api/keyring-rpc.cjs.map +1 -1
- package/dist/v2/api/keyring-rpc.d.cts.map +1 -1
- package/dist/v2/api/keyring-rpc.d.mts.map +1 -1
- package/dist/v2/api/keyring-rpc.mjs +2 -2
- package/dist/v2/api/keyring-rpc.mjs.map +1 -1
- package/dist/v2/api/keyring.cjs.map +1 -1
- package/dist/v2/api/keyring.d.cts +2 -2
- package/dist/v2/api/keyring.d.cts.map +1 -1
- package/dist/v2/api/keyring.d.mts +2 -2
- package/dist/v2/api/keyring.d.mts.map +1 -1
- package/dist/v2/api/keyring.mjs.map +1 -1
- package/dist/v2/api/private-key.cjs.map +1 -1
- package/dist/v2/api/private-key.d.cts +1 -1
- package/dist/v2/api/private-key.d.cts.map +1 -1
- package/dist/v2/api/private-key.d.mts +1 -1
- package/dist/v2/api/private-key.d.mts.map +1 -1
- package/dist/v2/api/private-key.mjs.map +1 -1
- package/package.json +20 -19
- package/v2.js +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/create-account/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/create-account/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAWnD,4BAAwB;AACxB,6BAAyB;AACzB,kCAA8B;AAE9B;;GAEG;AACH,oBAAY,mBAAmB;IAC7B;;OAEG;IACH,eAAe,sBAAsB;IAErC;;;;;;OAMG;IACH,gBAAgB,uBAAuB;IAEvC;;;;;;OAMG;IACH,qBAAqB,6BAA6B;IAElD;;;;;;OAMG;IACH,aAAa,mBAAmB;IAEhC;;OAEG;IACH,gBAAgB,uBAAuB;IAEvC;;;;;OAKG;IACH,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;QAmBrC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oCAAoC,CAClD,OAAO,SAAS,oBAAoB,EAEpC,IAAI,SAAS,GAAG,oBAAoB,CAAC,MAAM,CAAC,EAAE,EAE9C,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,SAAS,GAAG,IAAI,EAAE,EAAE,GAEnC,OAAO,CAAC,OAAO,IAAI,OAAO,GAAG;IAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAA;CAAE,CAOzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/create-account/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/create-account/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAWnD,4BAAwB;AACxB,6BAAyB;AACzB,kCAA8B;AAE9B;;GAEG;AACH,oBAAY,mBAAmB;IAC7B;;OAEG;IACH,eAAe,sBAAsB;IAErC;;;;;;OAMG;IACH,gBAAgB,uBAAuB;IAEvC;;;;;;OAMG;IACH,qBAAqB,6BAA6B;IAElD;;;;;;OAMG;IACH,aAAa,mBAAmB;IAEhC;;OAEG;IACH,gBAAgB,uBAAuB;IAEvC;;;;;OAKG;IACH,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;QAmBrC,CAAC;AAEH;;GAEG;AACH,MAA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AG,KAAK,EAAE,IAA2B,CAAC;IAC/D,QAAQ,mBAAmB,EAAE,CAAC;QAC5B,KAAK,mBAAmB,CAAC,eAAe;YACtC,OAAO,yCAAyC,CAAC;QACnD,KAAK,mBAAmB,CAAC,gBAAgB;YACvC,OAAO,0CAA0C,CAAC;QACpD,KAAK,mBAAmB,CAAC,qBAAqB;YAC5C,OAAO,+CAA+C,CAAC;QACzD,KAAK,mBAAmB,CAAC,aAAa;YACpC,OAAO,uCAAuC,CAAC;QACjD,KAAK,mBAAmB,CAAC,gBAAgB;YACvC,OAAO,oCAAoC,CAAC;QAC9C,KAAK,mBAAmB,CAAC,MAAM;YAC7B,OAAO,gCAAgC,CAAC;QAC1C;YACE,wGAAwG;YACxG,OAAO,yCAAyC,CAAC;IACrD,CAAC;AACH,CAAC,CAAC,CAAC;AAOH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,oCAAoC,CAKlD,OAAgB,EAChB,cAAoC;IAGpC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACzB,MAAM,KAAK,GAA4C,cAAc,CAAC;IAEtE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,2CAA2C,IAAI,EAAE,CAAC,CAAC;IACrE,CAAC;AACH,CAAC","sourcesContent":["import { selectiveUnion } from '@metamask/keyring-utils';\nimport {
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/v2/api/create-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gCAAgC;AAGzD,OAAO,EACL,uCAAuC,EACvC,0CAA0C,EAC1C,+CAA+C,EAC/C,yCAAyC,EAC1C,oBAAgB;AACjB,OAAO,EAAE,gCAAgC,EAAE,qBAAiB;AAC5D,OAAO,EAAE,oCAAoC,EAAE,0BAAsB;AAErE,4BAAwB;AACxB,6BAAyB;AACzB,kCAA8B;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CAAC,2CAA2C,IAAI,EAAE,CAAC,CAAC;IACrE,CAAC;AACH,CAAC","sourcesContent":["import { selectiveUnion } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\n\nimport {\n CreateAccountBip44DiscoverOptionsStruct,\n CreateAccountBip44DeriveIndexOptionsStruct,\n CreateAccountBip44DeriveIndexRangeOptionsStruct,\n CreateAccountBip44DerivePathOptionsStruct,\n} from './bip44';\nimport { CreateAccountCustomOptionsStruct } from './custom';\nimport { CreateAccountPrivateKeyOptionsStruct } from './private-key';\n\nexport * from './bip44';\nexport * from './custom';\nexport * from './private-key';\n\n/**\n * Enum representing the different ways an account can be created.\n */\nexport enum AccountCreationType {\n /**\n * Represents an account created using a BIP-44 derivation path.\n */\n Bip44DerivePath = 'bip44:derive-path',\n\n /**\n * Represents accounts created using a BIP-44 account index.\n *\n * More than one account can be created, for example, the keyring can create\n * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account\n * index.\n */\n Bip44DeriveIndex = 'bip44:derive-index',\n\n /**\n * Represents accounts created by deriving a range of BIP-44 account indices.\n *\n * More than one account can be created per index, for example, the keyring\n * can create multiple account types (e.g., P2PKH, P2TR, P2WPKH) for each\n * account index in the range.\n */\n Bip44DeriveIndexRange = 'bip44:derive-index-range',\n\n /**\n * Represents accounts created through BIP-44 account discovery.\n *\n * More than one account can be created, for example, the keyring can create\n * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account\n * index.\n */\n Bip44Discover = 'bip44:discover',\n\n /**\n * Represents an account imported from a private key.\n */\n PrivateKeyImport = 'private-key:import',\n\n /**\n * Represents an account created using a custom, keyring-specific method.\n *\n * This is used by keyrings that have non-standard account creation flows\n * and declare `custom.createAccounts: true` in their capabilities.\n */\n Custom = 'custom',\n}\n\n/**\n * Struct for {@link CreateAccountOptions}.\n */\nexport const CreateAccountOptionsStruct = selectiveUnion((value: any) => {\n const accountCreationType = value?.type as AccountCreationType;\n switch (accountCreationType) {\n case AccountCreationType.Bip44DerivePath:\n return CreateAccountBip44DerivePathOptionsStruct;\n case AccountCreationType.Bip44DeriveIndex:\n return CreateAccountBip44DeriveIndexOptionsStruct;\n case AccountCreationType.Bip44DeriveIndexRange:\n return CreateAccountBip44DeriveIndexRangeOptionsStruct;\n case AccountCreationType.Bip44Discover:\n return CreateAccountBip44DiscoverOptionsStruct;\n case AccountCreationType.PrivateKeyImport:\n return CreateAccountPrivateKeyOptionsStruct;\n case AccountCreationType.Custom:\n return CreateAccountCustomOptionsStruct;\n default:\n // Return first struct as fallback - validation will fail with proper error indicating the type mismatch\n return CreateAccountBip44DerivePathOptionsStruct;\n }\n});\n\n/**\n * Represents the available options for creating a new account.\n */\nexport type CreateAccountOptions = Infer<typeof CreateAccountOptionsStruct>;\n\n/**\n * Asserts that a given create account option type is supported by the keyring.\n *\n * @example\n * ```ts\n * createAccounts(options: CreateAccountOptions) {\n * assertCreateAccountOptionIsSupported(options, [\n * ${AccountCreationType.Bip44DeriveIndex},\n * ${AccountCreationType.Bip44DeriveIndexRange},\n * ] as const);\n *\n * // At this point, TypeScript knows that options.type is either Bip44DeriveIndex or Bip44DeriveIndexRange.\n * if (options.type === AccountCreationType.Bip44DeriveIndex) {\n * ... // Handle Bip44DeriveIndex case.\n * } else {\n * ... // Handle Bip44DeriveIndexRange case.\n * }\n * ...\n * return accounts;\n * }\n * ```\n *\n * @param options - The create account option object to check.\n * @param supportedTypes - The list of supported create account option types for this keyring.\n * @throws Will throw an error if the provided options are not supported.\n */\nexport function assertCreateAccountOptionIsSupported<\n Options extends CreateAccountOptions,\n // We use template literal types to enforce string-literal over strict enum values.\n Type extends `${CreateAccountOptions['type']}`,\n>(\n options: Options,\n supportedTypes: readonly `${Type}`[],\n // Use intersection to avoid widening `type` beyond `Options['type']`.\n): asserts options is Options & { type: `${Type}` & `${Options['type']}` } {\n const { type } = options;\n const types: readonly CreateAccountOptions['type'][] = supportedTypes;\n\n if (!types.includes(type)) {\n throw new Error(`Unsupported create account option type: ${type}`);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":";;;AAAA,uDAA+E;AAG/E,sDAAgE;AAChE,oDAA0D;AAE1D;;GAEG;AACU,QAAA,oCAAoC,GAAG,IAAA,oBAAM,EAAC;IACzD;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,oBAAoB,CAAC;IACnC;;OAEG;IACH,UAAU,EAAE,IAAA,oBAAM,GAAE;IACpB;;OAEG;IACH,QAAQ,EAAE,sCAAwB;IAClC;;OAEG;IACH,WAAW,EAAE,IAAA,2BAAa,EAAC,kCAAwB,CAAC;CACrD,CAAC,CAAC","sourcesContent":["import { exactOptional, literal, object, string } from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { KeyringAccountTypeStruct } from '../../../api/account';\nimport { PrivateKeyEncodingStruct } from '../private-key';\n\n/**\n * Struct for {@link CreateAccountPrivateKeyOptions}.\n */\nexport const CreateAccountPrivateKeyOptionsStruct = object({\n /**\n * The type of the options.\n */\n type: literal('private-key:import'),\n /**\n * The encoded private key to be imported.\n */\n privateKey: string(),\n /**\n * The encoding of the private key.\n */\n encoding: PrivateKeyEncodingStruct,\n /**\n * The account type of the imported account.\n */\n accountType: exactOptional(KeyringAccountTypeStruct),\n});\n\n/**\n * Options for importing an account from a private key.\n */\nexport type CreateAccountPrivateKeyOptions = Infer<\n typeof CreateAccountPrivateKeyOptionsStruct\n>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private-key.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;IAC/C;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;IAEH;;OAEG;;;;;;;;;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAChD,OAAO,oCAAoC,CAC5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private-key.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;IAC/C;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;IAEH;;OAEG;;;;;;;;;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAChD,OAAO,oCAAoC,CAC5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.mjs","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"private-key.mjs","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAG/E,OAAO,EAAE,wBAAwB,EAAE,iCAA6B;AAChE,OAAO,EAAE,wBAAwB,EAAE,2BAAuB;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,MAAM,CAAC;IACzD;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,oBAAoB,CAAC;IACnC;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE;IACpB;;OAEG;IACH,QAAQ,EAAE,wBAAwB;IAClC;;OAEG;IACH,WAAW,EAAE,aAAa,CAAC,wBAAwB,CAAC;CACrD,CAAC,CAAC","sourcesContent":["import { exactOptional, literal, object, string } from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { KeyringAccountTypeStruct } from '../../../api/account';\nimport { PrivateKeyEncodingStruct } from '../private-key';\n\n/**\n * Struct for {@link CreateAccountPrivateKeyOptions}.\n */\nexport const CreateAccountPrivateKeyOptionsStruct = object({\n /**\n * The type of the options.\n */\n type: literal('private-key:import'),\n /**\n * The encoded private key to be imported.\n */\n privateKey: string(),\n /**\n * The encoding of the private key.\n */\n encoding: PrivateKeyEncodingStruct,\n /**\n * The account type of the imported account.\n */\n accountType: exactOptional(KeyringAccountTypeStruct),\n});\n\n/**\n * Options for importing an account from a private key.\n */\nexport type CreateAccountPrivateKeyOptions = Infer<\n typeof CreateAccountPrivateKeyOptionsStruct\n>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../../src/v2/api/export-account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,mDAGuB;AAEvB,oDAA8B;AAE9B;;GAEG;AACH,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,+CAA0B,CAAA;AAC5B,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B;AAED;;GAEG;AACU,QAAA,0BAA0B,GAAG,kDAAoC,CAAC;AAO/E;;GAEG;AACU,QAAA,qBAAqB,GAAG,6CAA+B,CAAC","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../../src/v2/api/export-account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,mDAGuB;AAEvB,oDAA8B;AAE9B;;GAEG;AACH,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,+CAA0B,CAAA;AAC5B,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B;AAED;;GAEG;AACU,QAAA,0BAA0B,GAAG,kDAAoC,CAAC;AAO/E;;GAEG;AACU,QAAA,qBAAqB,GAAG,6CAA+B,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\n\nimport {\n ExportAccountPrivateKeyOptionsStruct,\n PrivateKeyExportedAccountStruct,\n} from './private-key';\n\nexport * from './private-key';\n\n/**\n * Enum representing the different types of account export methods.\n */\nexport enum AccountExportType {\n /**\n * Export account as a private key.\n */\n PrivateKey = 'private-key',\n}\n\n/**\n * Struct for {@link ExportAccountOptions}.\n */\nexport const ExportAccountOptionsStruct = ExportAccountPrivateKeyOptionsStruct;\n\n/**\n * Represents the options for exporting an account.\n */\nexport type ExportAccountOptions = Infer<typeof ExportAccountOptionsStruct>;\n\n/**\n * Struct for {@link ExportedAccount}.\n */\nexport const ExportedAccountStruct = PrivateKeyExportedAccountStruct;\n\n/**\n * Represents an account that has been exported.\n */\nexport type ExportedAccount = Infer<typeof ExportedAccountStruct>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,kCAA8B;AAE9B;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,UAAU,gBAAgB;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;EAAuC,CAAC;AAE/E;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;EAAkC,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,kCAA8B;AAE9B;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,UAAU,gBAAgB;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;EAAuC,CAAC;AAE/E;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;EAAkC,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/v2/api/export-account/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oCAAoC,EACpC,+BAA+B,EAChC,0BAAsB;AAEvB,kCAA8B;AAE9B;;GAEG;AACH,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,+CAA0B,CAAA;AAC5B,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oCAAoC,CAAC;AAO/E;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,+BAA+B,CAAC","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/v2/api/export-account/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oCAAoC,EACpC,+BAA+B,EAChC,0BAAsB;AAEvB,kCAA8B;AAE9B;;GAEG;AACH,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,+CAA0B,CAAA;AAC5B,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oCAAoC,CAAC;AAO/E;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,+BAA+B,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\n\nimport {\n ExportAccountPrivateKeyOptionsStruct,\n PrivateKeyExportedAccountStruct,\n} from './private-key';\n\nexport * from './private-key';\n\n/**\n * Enum representing the different types of account export methods.\n */\nexport enum AccountExportType {\n /**\n * Export account as a private key.\n */\n PrivateKey = 'private-key',\n}\n\n/**\n * Struct for {@link ExportAccountOptions}.\n */\nexport const ExportAccountOptionsStruct = ExportAccountPrivateKeyOptionsStruct;\n\n/**\n * Represents the options for exporting an account.\n */\nexport type ExportAccountOptions = Infer<typeof ExportAccountOptionsStruct>;\n\n/**\n * Struct for {@link ExportedAccount}.\n */\nexport const ExportedAccountStruct = PrivateKeyExportedAccountStruct;\n\n/**\n * Represents an account that has been exported.\n */\nexport type ExportedAccount = Infer<typeof ExportedAccountStruct>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":";;;AAAA,uDAAgE;AAGhE,oDAA0D;AAE1D;;GAEG;AACU,QAAA,+BAA+B,GAAG,IAAA,oBAAM,EAAC;IACpD;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,UAAU,EAAE,IAAA,oBAAM,GAAE;IACpB;;OAEG;IACH,QAAQ,EAAE,sCAAwB;CACnC,CAAC,CAAC;AASH;;GAEG;AACU,QAAA,oCAAoC,GAAG,IAAA,oBAAM,EAAC;IACzD;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,QAAQ,EAAE,sCAAwB;CACnC,CAAC,CAAC","sourcesContent":["import { literal, object, string } from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { PrivateKeyEncodingStruct } from '../private-key';\n\n/**\n * Struct for {@link PrivateKeyExportedAccount}.\n */\nexport const PrivateKeyExportedAccountStruct = object({\n /**\n * The type of the account export.\n */\n type: literal('private-key'),\n /**\n * The private key of the exported account.\n */\n privateKey: string(),\n /**\n * The encoding of the exported private key.\n */\n encoding: PrivateKeyEncodingStruct,\n});\n\n/**\n * Represents an account that has been exported using a private key.\n */\nexport type PrivateKeyExportedAccount = Infer<\n typeof PrivateKeyExportedAccountStruct\n>;\n\n/**\n * Struct for {@link ExportAccountPrivateKeyOptions}.\n */\nexport const ExportAccountPrivateKeyOptionsStruct = object({\n /**\n * The type of the account export.\n */\n type: literal('private-key'),\n /**\n * The encoding of the exported private key.\n */\n encoding: PrivateKeyEncodingStruct,\n});\n\n/**\n * Options for exporting an account's private key.\n */\nexport type ExportAccountPrivateKeyOptions = Infer<\n typeof ExportAccountPrivateKeyOptionsStruct\n>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private-key.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;IAC1C;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAC3C,OAAO,+BAA+B,CACvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;IAC/C;;OAEG;;IAEH;;OAEG;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAChD,OAAO,oCAAoC,CAC5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private-key.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;IAC1C;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAC3C,OAAO,+BAA+B,CACvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;IAC/C;;OAEG;;IAEH;;OAEG;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAChD,OAAO,oCAAoC,CAC5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.mjs","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"private-key.mjs","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAGhE,OAAO,EAAE,wBAAwB,EAAE,2BAAuB;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC;IACpD;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE;IACpB;;OAEG;IACH,QAAQ,EAAE,wBAAwB;CACnC,CAAC,CAAC;AASH;;GAEG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,MAAM,CAAC;IACzD;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,QAAQ,EAAE,wBAAwB;CACnC,CAAC,CAAC","sourcesContent":["import { literal, object, string } from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { PrivateKeyEncodingStruct } from '../private-key';\n\n/**\n * Struct for {@link PrivateKeyExportedAccount}.\n */\nexport const PrivateKeyExportedAccountStruct = object({\n /**\n * The type of the account export.\n */\n type: literal('private-key'),\n /**\n * The private key of the exported account.\n */\n privateKey: string(),\n /**\n * The encoding of the exported private key.\n */\n encoding: PrivateKeyEncodingStruct,\n});\n\n/**\n * Represents an account that has been exported using a private key.\n */\nexport type PrivateKeyExportedAccount = Infer<\n typeof PrivateKeyExportedAccountStruct\n>;\n\n/**\n * Struct for {@link ExportAccountPrivateKeyOptions}.\n */\nexport const ExportAccountPrivateKeyOptionsStruct = object({\n /**\n * The type of the account export.\n */\n type: literal('private-key'),\n /**\n * The encoding of the exported private key.\n */\n encoding: PrivateKeyEncodingStruct,\n});\n\n/**\n * Options for exporting an account's private key.\n */\nexport type ExportAccountPrivateKeyOptions = Infer<\n typeof ExportAccountPrivateKeyOptionsStruct\n>;\n"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.KeyringCapabilitiesStruct = void 0;
|
|
4
4
|
const superstruct_1 = require("@metamask/superstruct");
|
|
5
|
-
const private_key_1 = require("./private-key.cjs");
|
|
6
5
|
const caip_1 = require("../../api/caip.cjs");
|
|
6
|
+
const private_key_1 = require("./private-key.cjs");
|
|
7
7
|
/**
|
|
8
8
|
* Struct for {@link KeyringCapabilities}.
|
|
9
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-capabilities.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"keyring-capabilities.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":";;;AAAA,uDAO+B;AAG/B,6CAAmD;AACnD,mDAGuB;AAEvB;;GAEG;AACU,QAAA,yBAAyB,GAAG,IAAA,oBAAM,EAAC;IAC9C;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,wBAAiB,CAAC,CAAC;IAC1C;;OAEG;IACH,KAAK,EAAE,IAAA,2BAAa,EAClB,IAAA,oBAAM,EAAC;QACL;;WAEG;QACH,UAAU,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;QACpC;;WAEG;QACH,WAAW,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;QACrC;;WAEG;QACH,gBAAgB,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;QAC1C;;WAEG;QACH,QAAQ,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;KACnC,CAAC,CACH;IACD;;OAEG;IACH,UAAU,EAAE,IAAA,2BAAa,EACvB,IAAA,oBAAM,EAAC;QACL;;WAEG;QACH,aAAa,EAAE,IAAA,2BAAa,EAAC,IAAA,mBAAK,EAAC,0CAA4B,CAAC,CAAC;QACjE;;WAEG;QACH,aAAa,EAAE,IAAA,2BAAa,EAAC,IAAA,mBAAK,EAAC,0CAA4B,CAAC,CAAC;KAClE,CAAC,CACH;IACD;;;;;;OAMG;IACH,MAAM,EAAE,IAAA,2BAAa,EACnB,IAAA,qBAAO,EACL,IAAA,oBAAM,EAAC;QACL,cAAc,EAAE,IAAA,qBAAO,GAAE;KAC1B,CAAC,CACH,CACF;CACF,CAAC,CAAC","sourcesContent":["import {\n array,\n boolean,\n exactOptional,\n nonempty,\n object,\n partial,\n} from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { CaipChainIdStruct } from '../../api/caip';\nimport {\n ExportPrivateKeyFormatStruct,\n ImportPrivateKeyFormatStruct,\n} from './private-key';\n\n/**\n * Struct for {@link KeyringCapabilities}.\n */\nexport const KeyringCapabilitiesStruct = object({\n /**\n * List of CAIP-2 chain IDs that this keyring supports.\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n /**\n * BIP-44 capabilities supported by this keyring.\n */\n bip44: exactOptional(\n object({\n /**\n * Whether the keyring supports deriving accounts from a specific BIP-44 path.\n */\n derivePath: exactOptional(boolean()),\n /**\n * Whether the keyring supports deriving accounts from a BIP-44 account index.\n */\n deriveIndex: exactOptional(boolean()),\n /**\n * Whether the keyring supports deriving accounts from a range of BIP-44 account indices.\n */\n deriveIndexRange: exactOptional(boolean()),\n /**\n * Whether the keyring supports BIP-44 account discovery.\n */\n discover: exactOptional(boolean()),\n }),\n ),\n /**\n * Private key capabilities supported by this keyring.\n */\n privateKey: exactOptional(\n object({\n /**\n * List of supported formats for importing private keys.\n */\n importFormats: exactOptional(array(ImportPrivateKeyFormatStruct)),\n /**\n * List of supported formats for exporting private keys.\n */\n exportFormats: exactOptional(array(ExportPrivateKeyFormatStruct)),\n }),\n ),\n /**\n * Indicates which Keyring methods accept non-standard options.\n *\n * When a method is set to `true`, it signals that the keyring implementation\n * accepts custom options for that method, different from the standard API.\n * This is a workaround for keyrings with very specific requirements.\n */\n custom: exactOptional(\n partial(\n object({\n createAccounts: boolean(),\n }),\n ),\n ),\n});\n\n/**\n * Type representing the capabilities supported by a keyring.\n *\n * @example\n * ```ts\n * const capabilities: KeyringCapabilities = {\n * scopes: ['bip122:_'],\n * bip44: {\n * derivePath: true,\n * deriveIndex: true,\n * deriveIndexRange: true,\n * discover: true,\n * },\n * privateKey: {\n * importFormats: [\n * { encoding: 'base58', type: 'bip122:p2sh' },\n * { encoding: 'base58', type: 'bip122:p2tr' },\n * { encoding: 'base58', type: 'bip122:p2pkh' },\n * { encoding: 'base58', type: 'bip122:p2wpkh' },\n * ],\n * exportFormats: [\n * { encoding: 'base58' },\n * { encoding: 'base58' },\n * ],\n * },\n * };\n * ```\n */\nexport type KeyringCapabilities = Infer<typeof KeyringCapabilitiesStruct>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-capabilities.d.cts","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keyring-capabilities.d.cts","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAQnD;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;IACpC;;OAEG;;IAEH;;OAEG;;;;;;;QAGC;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;;IAIP;;OAEG;;;;;;;;;;QAGC;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;QAEH;;WAEG;;;;;;;;;;;;IAIP;;;;;;OAMG;;;;;;EAQH,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-capabilities.d.mts","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keyring-capabilities.d.mts","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAQnD;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;IACpC;;OAEG;;IAEH;;OAEG;;;;;;;QAGC;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;;IAIP;;OAEG;;;;;;;;;;QAGC;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;QAEH;;WAEG;;;;;;;;;;;;IAIP;;;;;;OAMG;;;;;;EAQH,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { array, boolean, exactOptional, nonempty, object, partial } from "@metamask/superstruct";
|
|
2
|
-
import { ExportPrivateKeyFormatStruct, ImportPrivateKeyFormatStruct } from "./private-key.mjs";
|
|
3
2
|
import { CaipChainIdStruct } from "../../api/caip.mjs";
|
|
3
|
+
import { ExportPrivateKeyFormatStruct, ImportPrivateKeyFormatStruct } from "./private-key.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* Struct for {@link KeyringCapabilities}.
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-capabilities.mjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,OAAO,EACP,aAAa,EACb,QAAQ,EACR,MAAM,EACN,OAAO,
|
|
1
|
+
{"version":3,"file":"keyring-capabilities.mjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,OAAO,EACP,aAAa,EACb,QAAQ,EACR,MAAM,EACN,OAAO,EACR,8BAA8B;AAG/B,OAAO,EAAE,iBAAiB,EAAE,2BAAuB;AACnD,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC7B,0BAAsB;AAEvB;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC;IAC9C;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC1C;;OAEG;IACH,KAAK,EAAE,aAAa,CAClB,MAAM,CAAC;QACL;;WAEG;QACH,UAAU,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC;QACpC;;WAEG;QACH,WAAW,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC;QACrC;;WAEG;QACH,gBAAgB,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC;QAC1C;;WAEG;QACH,QAAQ,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC;KACnC,CAAC,CACH;IACD;;OAEG;IACH,UAAU,EAAE,aAAa,CACvB,MAAM,CAAC;QACL;;WAEG;QACH,aAAa,EAAE,aAAa,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QACjE;;WAEG;QACH,aAAa,EAAE,aAAa,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;KAClE,CAAC,CACH;IACD;;;;;;OAMG;IACH,MAAM,EAAE,aAAa,CACnB,OAAO,CACL,MAAM,CAAC;QACL,cAAc,EAAE,OAAO,EAAE;KAC1B,CAAC,CACH,CACF;CACF,CAAC,CAAC","sourcesContent":["import {\n array,\n boolean,\n exactOptional,\n nonempty,\n object,\n partial,\n} from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { CaipChainIdStruct } from '../../api/caip';\nimport {\n ExportPrivateKeyFormatStruct,\n ImportPrivateKeyFormatStruct,\n} from './private-key';\n\n/**\n * Struct for {@link KeyringCapabilities}.\n */\nexport const KeyringCapabilitiesStruct = object({\n /**\n * List of CAIP-2 chain IDs that this keyring supports.\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n /**\n * BIP-44 capabilities supported by this keyring.\n */\n bip44: exactOptional(\n object({\n /**\n * Whether the keyring supports deriving accounts from a specific BIP-44 path.\n */\n derivePath: exactOptional(boolean()),\n /**\n * Whether the keyring supports deriving accounts from a BIP-44 account index.\n */\n deriveIndex: exactOptional(boolean()),\n /**\n * Whether the keyring supports deriving accounts from a range of BIP-44 account indices.\n */\n deriveIndexRange: exactOptional(boolean()),\n /**\n * Whether the keyring supports BIP-44 account discovery.\n */\n discover: exactOptional(boolean()),\n }),\n ),\n /**\n * Private key capabilities supported by this keyring.\n */\n privateKey: exactOptional(\n object({\n /**\n * List of supported formats for importing private keys.\n */\n importFormats: exactOptional(array(ImportPrivateKeyFormatStruct)),\n /**\n * List of supported formats for exporting private keys.\n */\n exportFormats: exactOptional(array(ExportPrivateKeyFormatStruct)),\n }),\n ),\n /**\n * Indicates which Keyring methods accept non-standard options.\n *\n * When a method is set to `true`, it signals that the keyring implementation\n * accepts custom options for that method, different from the standard API.\n * This is a workaround for keyrings with very specific requirements.\n */\n custom: exactOptional(\n partial(\n object({\n createAccounts: boolean(),\n }),\n ),\n ),\n});\n\n/**\n * Type representing the capabilities supported by a keyring.\n *\n * @example\n * ```ts\n * const capabilities: KeyringCapabilities = {\n * scopes: ['bip122:_'],\n * bip44: {\n * derivePath: true,\n * deriveIndex: true,\n * deriveIndexRange: true,\n * discover: true,\n * },\n * privateKey: {\n * importFormats: [\n * { encoding: 'base58', type: 'bip122:p2sh' },\n * { encoding: 'base58', type: 'bip122:p2tr' },\n * { encoding: 'base58', type: 'bip122:p2pkh' },\n * { encoding: 'base58', type: 'bip122:p2wpkh' },\n * ],\n * exportFormats: [\n * { encoding: 'base58' },\n * { encoding: 'base58' },\n * ],\n * },\n * };\n * ```\n */\nexport type KeyringCapabilities = Infer<typeof KeyringCapabilitiesStruct>;\n"]}
|
|
@@ -5,10 +5,10 @@ exports.isKeyringRpcMethod = isKeyringRpcMethod;
|
|
|
5
5
|
const keyring_utils_1 = require("@metamask/keyring-utils");
|
|
6
6
|
const superstruct_1 = require("@metamask/superstruct");
|
|
7
7
|
const utils_1 = require("@metamask/utils");
|
|
8
|
-
const create_account_1 = require("./create-account/index.cjs");
|
|
9
|
-
const export_account_1 = require("./export-account/index.cjs");
|
|
10
8
|
const account_1 = require("../../api/account.cjs");
|
|
11
9
|
const request_1 = require("../../api/request.cjs");
|
|
10
|
+
const create_account_1 = require("./create-account/index.cjs");
|
|
11
|
+
const export_account_1 = require("./export-account/index.cjs");
|
|
12
12
|
/**
|
|
13
13
|
* Keyring RPC methods used by the API.
|
|
14
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-rpc.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":";;;AAqDA,gDAEC;AAvDD,2DAA4E;AAE5E,uDAA8E;AAC9E,2CAA6C;AAE7C,+DAA8D;AAC9D,+DAG0B;
|
|
1
|
+
{"version":3,"file":"keyring-rpc.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":";;;AAqDA,gDAEC;AAvDD,2DAA4E;AAE5E,uDAA8E;AAC9E,2CAA6C;AAE7C,mDAAyD;AACzD,mDAAyD;AACzD,+DAA8D;AAC9D,+DAG0B;AAgB1B;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B,WAAW,EAAE,qBAAqB;IAClC,cAAc,EAAE,wBAAwB;IACxC,2DAA2D;IAC3D,6DAA6D;IAC7D,UAAU,EAAE,oBAAoB;IAChC,aAAa,EAAE,uBAAuB;IACtC,aAAa,EAAE,uBAAuB;IACtC,aAAa,EAAE,uBAAuB;CAC9B,CAAC;AAQX;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,M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G,IAAA,sBAAM,EAAC;IAC/C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,wBAAgB,CAAC,aAAa,EAAE,CAAC;IACpD,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb,EAAE,EAAE,0BAAU;KACf,CAAC;CACH,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,IAAA,qBAAO,EAAC,IAAI,CAAC,CAAC;AAIzD,+EAA+E;AAC/E,iBAAiB;AAEJ,QAAA,0BAA0B,GAAG,IAAA,sBAAM,EAAC;IAC/C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,wBAAgB,CAAC,aAAa,EAAE,CAAC;IACpD,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb,EAAE,EAAE,0BAAU;QACd,OAAO,EAAE,IAAA,6BAAa,EAAC,2CAA0B,CAAC;KACnD,CAAC;CACH,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,gDAA+B,CAAC;AAI3E,+EAA+E;AAC/E,iBAAiB;AAEJ,QAAA,0BAA0B,GAAG,IAAA,sBAAM,EAAC;IAC/C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,wBAAgB,CAAC,aAAa,EAAE,CAAC;IACpD,MAAM,EAAE,8BAAoB;CAC7B,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,kBAAU,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-rpc.d.cts","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;
|
|
1
|
+
{"version":3,"file":"keyring-rpc.d.cts","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAWnD,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAkB;AAEzC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,WAAW,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACpC,cAAc,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC1C,aAAa,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACxC,aAAa,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACxC,aAAa,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;CASnB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,gBAAgB,CAE7E;AAYD,eAAO,MAAM,wBAAwB;;;;;;;;EAGnC,CAAC;AAEH,MAAM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;;;;;;;EAOrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B;;;;;;;;;;;EAAkC,CAAC;AAE3E,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAK9E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B,iFAAa,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAI9E;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,kBAAkB,GAClB,iBAAiB,GACjB,qBAAqB,GACrB,oBAAoB,GACpB,oBAAoB,GACpB,oBAAoB,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,SAAS,SAAS,gBAAgB,IAAI,OAAO,CACzE,kBAAkB,EAClB;IAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAA;CAAE,CAC3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-rpc.d.mts","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;
|
|
1
|
+
{"version":3,"file":"keyring-rpc.d.mts","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAWnD,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAkB;AAEzC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,WA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M,iBAAiB,CAAC,SAAS,SAAS,gBAAgB,IAAI,OAAO,CACzE,kBAAkB,EAClB;IAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAA;CAAE,CAC3B,CAAC"}
|
|
@@ -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-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,
|
|
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,EAA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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 { 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 {
|
|
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.cts","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,
|
|
1
|
+
{"version":3,"file":"keyring.d.cts","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gCAAg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7B,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,
|
|
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,cAAc,EAAE,8BAA0B;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA0B;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,mCAAyB;AAC7D,OAAO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Root":"","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 {
|
|
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"]}
|