UNPKG

@metamask/account-api

Version:
39 lines 1.15 kB
/** * Default account group unique ID. * * This constant can be used to reference the "default" group from * an account wallet. */ export const DEFAULT_ACCOUNT_GROUP_UNIQUE_ID = 'default'; /** * Account group object. * * Each group types groups accounts using different criterias. */ export var AccountGroupType; (function (AccountGroupType) { /** Group that represents a multichain account. */ AccountGroupType["MultichainAccount"] = "multichain-account"; /** Group that represents a single account. */ AccountGroupType["SingleAccount"] = "single-account"; })(AccountGroupType || (AccountGroupType = {})); /** * Convert a wallet ID and a unique ID, to a group ID. * * @param walletId - A wallet ID. * @param id - A unique ID. * @returns A group ID. */ export function toAccountGroupId(walletId, id) { return `${walletId}/${id}`; } /** * Convert a wallet ID to the default group ID. * * @param walletId - A wallet ID. * @returns The default group ID. */ export function toDefaultAccountGroupId(walletId) { return toAccountGroupId(walletId, DEFAULT_ACCOUNT_GROUP_UNIQUE_ID); } //# sourceMappingURL=group.mjs.map