{"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"]}