@metamask/keyring-api
Version:
MetaMask Keyring API
40 lines • 1.5 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DiscoveredAccountStruct = exports.DiscoveredBip44AccountStruct = exports.DiscoveredAccountType = void 0;
const superstruct_1 = require("@metamask/superstruct");
const caip_1 = require("./caip.cjs");
const derivation_1 = require("./derivation.cjs");
/**
* Account type tag.
*
* The main use of this enum is to tag the {@link DiscoveredAccount} type for
* future use.
*/
var DiscoveredAccountType;
(function (DiscoveredAccountType) {
// BIP-44 compatible accounts.
DiscoveredAccountType["Bip44"] = "bip44";
})(DiscoveredAccountType || (exports.DiscoveredAccountType = DiscoveredAccountType = {}));
/**
* This struct represents a discovered BIP-44 compatible account.
*
* It supports BIP-44 in a non-strict way. The derivation path MUST HAVE at
* least 1 segment.
*/
exports.DiscoveredBip44AccountStruct = (0, superstruct_1.object)({
/**
* Account type.
*/
type: (0, superstruct_1.literal)(`${DiscoveredAccountType.Bip44}`),
/**
* Account supported scopes (CAIP-2 chain IDs).
*/
scopes: (0, superstruct_1.array)(caip_1.CaipChainIdStruct),
/**
* The derivation path for this account. It MUST HAVE at least 1 segment.
*/
derivationPath: derivation_1.DerivationPathStruct,
});
// Could become a union if we have new discovered account type.
exports.DiscoveredAccountStruct = exports.DiscoveredBip44AccountStruct;
//# sourceMappingURL=discovery.cjs.map