UNPKG

@metamask/keyring-api

Version:
1 lines 1.38 kB
{"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../../src/api/v2/create-account/private-key.ts"],"names":[],"mappings":";;;AAAA,uDAM+B;AAE/B,+CAAyD;AACzD,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 {\n exactOptional,\n literal,\n object,\n string,\n type Infer,\n} from '@metamask/superstruct';\n\nimport { KeyringAccountTypeStruct } from '../../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"]}