@metamask/keyring-api
Version:
MetaMask Keyring API
1 lines • 3.11 kB
Source Map (JSON)
{"version":3,"file":"bip44.mjs","sourceRoot":"","sources":["../../../../src/api/v2/create-account/bip44.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,MAAM,EAEP,8BAA8B;AAE/B,OAAO,EAAE,oBAAoB,EAAE,6BAAyB;AAExD;;GAEG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,MAAM,CAAC;IAC9D;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,mBAAmB,CAAC;IAClC;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE;IACvB;;OAEG;IACH,cAAc,EAAE,oBAAoB;CACrC,CAAC,CAAC;AASH;;GAEG;AACH,MAAM,CAAC,MAAM,0CAA0C,GAAG,MAAM,CAAC;IAC/D;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,oBAAoB,CAAC;IACnC;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE;IACvB;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE;CACrB,CAAC,CAAC;AAYH;;GAEG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,MAAM,CAAC;IAC5D;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC;IAC/B;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE;IACvB;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE;CACrB,CAAC,CAAC","sourcesContent":["import {\n literal,\n number,\n object,\n string,\n type Infer,\n} from '@metamask/superstruct';\n\nimport { DerivationPathStruct } from '../../derivation';\n\n/**\n * Struct for {@link CreateAccountBip44DerivePathOptions}.\n */\nexport const CreateAccountBip44DerivePathOptionsStruct = object({\n /**\n * Type of the options.\n */\n type: literal('bip44:derive-path'),\n /**\n * ID of the entropy source to be used to derive the account.\n */\n entropySource: string(),\n /**\n * BIP-44 derivation path to be used to derive the account.\n */\n derivationPath: DerivationPathStruct,\n});\n\n/**\n * Options for creating an account using the given BIP-44 derivation path.\n */\nexport type CreateAccountBip44DerivePathOptions = Infer<\n typeof CreateAccountBip44DerivePathOptionsStruct\n>;\n\n/**\n * Struct for {@link CreateAccountBip44DeriveIndexOptions}.\n */\nexport const CreateAccountBip44DeriveIndexOptionsStruct = object({\n /**\n * The type of the options.\n */\n type: literal('bip44:derive-index'),\n /**\n * ID of the entropy source to be used to derive the account.\n */\n entropySource: string(),\n /**\n * The index of the account group to be derived.\n */\n groupIndex: number(),\n});\n\n/**\n * Options for creating an account using the given BIP-44 account group index.\n *\n * Note that the keyring can support non-standard BIP-44 paths for\n * compatibility with other wallets.\n */\nexport type CreateAccountBip44DeriveIndexOptions = Infer<\n typeof CreateAccountBip44DeriveIndexOptionsStruct\n>;\n\n/**\n * Struct for {@link CreateAccountBip44DiscoverOptions}.\n */\nexport const CreateAccountBip44DiscoverOptionsStruct = object({\n /**\n * The type of the options.\n */\n type: literal('bip44:discover'),\n /**\n * ID of the entropy source to be used to derive the account.\n */\n entropySource: string(),\n /**\n * The index of the account group to be derived.\n */\n groupIndex: number(),\n});\n\n/**\n * Options for creating accounts by performing a BIP-44 account discovery.\n *\n * Note that the keyring can support non-standard BIP-44 paths for\n * compatibility with other wallets.\n */\nexport type CreateAccountBip44DiscoverOptions = Infer<\n typeof CreateAccountBip44DiscoverOptionsStruct\n>;\n"]}