@metamask/keyring-api
Version:
MetaMask Keyring API
43 lines • 1.48 kB
JavaScript
import { array, boolean, exactOptional, nonempty, object } from "@metamask/superstruct";
import { ExportPrivateKeyFormatStruct, ImportPrivateKeyFormatStruct } from "./private-key.mjs";
import { CaipChainIdStruct } from "../caip.mjs";
/**
* Struct for {@link KeyringCapabilities}.
*/
export const KeyringCapabilitiesStruct = object({
/**
* List of CAIP-2 chain IDs that this keyring supports.
*/
scopes: nonempty(array(CaipChainIdStruct)),
/**
* BIP-44 capabilities supported by this keyring.
*/
bip44: exactOptional(object({
/**
* Whether the keyring supports deriving accounts from a specific BIP-44 path.
*/
derivePath: boolean(),
/**
* Whether the keyring supports deriving accounts from a BIP-44 account index.
*/
deriveIndex: boolean(),
/**
* Whether the keyring supports BIP-44 account discovery.
*/
discover: boolean(),
})),
/**
* Private key capabilities supported by this keyring.
*/
privateKey: exactOptional(object({
/**
* List of supported formats for importing private keys.
*/
importFormats: exactOptional(array(ImportPrivateKeyFormatStruct)),
/**
* List of supported formats for exporting private keys.
*/
exportFormats: exactOptional(array(ExportPrivateKeyFormatStruct)),
})),
});
//# sourceMappingURL=keyring-capabilities.mjs.map