@metamask/keyring-api
Version:
MetaMask Keyring API
58 lines • 1.97 kB
text/typescript
import { type Infer } from "@metamask/superstruct";
export * from "./bip44.cjs";
export * from "./private-key.cjs";
/**
* Enum representing the different ways an account can be created.
*/
export declare enum AccountCreationType {
/**
* Represents an account created using a BIP-44 derivation path.
*/
Bip44DerivePath = "bip44:derive-path",
/**
* Represents accounts created using a BIP-44 account index.
*
* More than one account can be created, for example, the keyring can create
* multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account
* index.
*/
Bip44DeriveIndex = "bip44:derive-index",
/**
* Represents accounts created through BIP-44 account discovery.
*
* More than one account can be created, for example, the keyring can create
* multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account
* index.
*/
Bip44Discover = "bip44:discover",
/**
* Represents an account imported from a private key.
*/
PrivateKeyImport = "private-key:import"
}
/**
* Struct for {@link CreateAccountOptions}.
*/
export declare const CreateAccountOptionsStruct: import("@metamask/superstruct").Struct<{
type: "bip44:derive-path";
derivationPath: `m/${string}`;
entropySource: string;
} | {
type: "bip44:derive-index";
groupIndex: number;
entropySource: string;
} | {
type: "bip44:discover";
groupIndex: number;
entropySource: string;
} | {
type: "private-key:import";
encoding: "hexadecimal" | "base58";
privateKey: string;
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
}, null>;
/**
* Represents the available options for creating a new account.
*/
export type CreateAccountOptions = Infer<typeof CreateAccountOptionsStruct>;
//# sourceMappingURL=index.d.cts.map