@metamask/keyring-api
Version:
MetaMask Keyring API
131 lines • 3.78 kB
text/typescript
import type { Infer } from "@metamask/superstruct";
/**
* Keyring account entropy valid types.
*/
export declare enum KeyringAccountEntropyTypeOption {
/**
* Indicates that the account was created from a mnemonic phrase.
*/
Mnemonic = "mnemonic",
/**
* Indicates that the account was imported from a private key.
*/
PrivateKey = "private-key"
}
/**
* Keyring account options struct for mnemonics (BIP-44).
*/
export declare const KeyringAccountEntropyMnemonicOptionsStruct: import("@metamask/superstruct").Struct<{
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
}, {
/**
* Indicates that the account was created from a mnemonic phrase.
*/
type: import("@metamask/superstruct").Struct<"mnemonic", "mnemonic">;
/**
* The ID of the entropy source.
*/
id: import("@metamask/superstruct").Struct<string, null>;
/**
* The BIP-44 derivation path used to derive the account.
*/
derivationPath: import("@metamask/superstruct").Struct<string, null>;
/**
* Index used to group accounts in the UI.
*
* Accounts sharing the same `groupIndex` are displayed together as a
* multichain account group.
*/
groupIndex: import("@metamask/superstruct").Struct<number, null>;
}>;
/**
* Keyring account options for mnemonics (BIP-44) {@link KeyringAccountEntropyMnemonicOptionsStruct}.
*/
export type KeyringAccountEntropyMnemonicOptions = Infer<typeof KeyringAccountEntropyMnemonicOptionsStruct>;
/**
* Keyring account options struct for private keys.
*/
export declare const KeyringAccountEntropyPrivateKeyOptionsStruct: import("@metamask/superstruct").Struct<{
type: "private-key";
}, {
/**
* Indicates that the account was imported from a private key.
*/
type: import("@metamask/superstruct").Struct<"private-key", "private-key">;
}>;
/**
* Keyring account options for private keys {@link KeyringAccountEntropyPrivateKeyOptionsStruct}.
*/
export type KeyringAccountEntropyPrivateKeyOptions = Infer<typeof KeyringAccountEntropyPrivateKeyOptionsStruct>;
/**
* Keyring account entropy options struct.
*/
export declare const KeyringAccountEntropyOptionsStruct: import("@metamask/superstruct").Struct<{
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
}, null>;
/**
* Keyring account entropy options {@link KeyringAccountEntropyOptionsStruct}.
*/
export type KeyringAccountEntropyOptions = Infer<typeof KeyringAccountEntropyOptionsStruct>;
/**
* Keyring options struct. This represents various options for a Keyring account object.
*
* See {@link KeyringAccountEntropyMnemonicOptionsStruct} and
* {@link KeyringAccountEntropyPrivateKeyOptionsStruct}.
*
* @example
* ```ts
* {
* entropy: {
* type: 'mnemonic',
* id: '01K0BX6VDR5DPDPGGNA8PZVBVB',
* derivationPath: "m/44'/60'/0'/0/0",
* groupIndex: 0,
* },
* }
* ```
*
* @example
* ```ts
* {
* entropy: {
* type: 'private-key',
* },
* exportable: true,
* }
* ```
*
* @example
* ```ts
* {
* some: {
* untyped: 'options',
* something: true,
* },
* }
* ```
*/
export declare const KeyringAccountOptionsStruct: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
};
exportable?: boolean;
}, null>;
/**
* Keyring account options {@link KeyringAccountOptionsStruct}.
*/
export type KeyringAccountOptions = Infer<typeof KeyringAccountOptionsStruct>;
//# sourceMappingURL=account-options.d.cts.map