UNPKG

@metamask/keyring-api

Version:
1 lines 1.46 kB
{"version":3,"file":"private-key.mjs","sourceRoot":"","sources":["../../../../src/api/v2/create-account/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,OAAO,EACP,MAAM,EACN,MAAM,EAEP,8BAA8B;AAE/B,OAAO,EAAE,wBAAwB,EAAE,0BAAsB;AACzD,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 {\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"]}