import type { InternalAccount } from '@metamask/keyring-internal-api'; import type { CaipAccountId, CaipChainId, Hex } from '@metamask/utils'; import type { Caip25CaveatValue } from '../caip25Permission.js'; import type { InternalScopesObject } from '../scope/types.js'; /** * Gets the Ethereum (EIP155 namespaced) accounts from the required and optional scopes. * * @param caip25CaveatValue - The CAIP-25 caveat value to get the Ethereum accounts from. * @returns An array of Ethereum accounts. */ export declare const getEthAccounts: (caip25CaveatValue: Pick) => Hex[]; /** * Gets the Ethereum (EIP155 namespaced) accounts for a single scope. * * @param caip25CaveatValue - The CAIP-25 caveat value to get the Ethereum accounts from. * @param scope - The CAIP-2 scope to get the Ethereum accounts for. * @returns An array of Ethereum accounts. */ export declare function getEthAccountsForScope(caip25CaveatValue: Pick, scope: CaipChainId): Hex[]; /** * Sets the Ethereum (EIP155 namespaced) accounts for the given CAIP-25 caveat value. * We set the same accounts for all the scopes that are EIP155 or Wallet namespaced because * we do not provide UI/UX flows for selecting different accounts across different chains. * * @param caip25CaveatValue - The CAIP-25 caveat value to set the Ethereum accounts for. * @param accounts - The Ethereum accounts to set. * @returns The updated CAIP-25 caveat value with the Ethereum accounts set. */ export declare const setEthAccounts: (caip25CaveatValue: Caip25CaveatValue, accounts: Hex[]) => Caip25CaveatValue; /** * * Getters * */ /** * Gets all accounts from an array of scopes objects * This extracts all account IDs from both required and optional scopes * and returns a unique set. * * @param scopesObjects - The scopes objects to extract accounts from * @returns Array of unique account IDs */ export declare function getCaipAccountIdsFromScopesObjects(scopesObjects: InternalScopesObject[]): CaipAccountId[]; /** * Gets all permitted accounts from a CAIP-25 caveat * This extracts all account IDs from both required and optional scopes * and returns a unique set. * * @param caip25CaveatValue - The CAIP-25 caveat value to extract accounts from * @returns Array of unique account IDs */ export declare function getCaipAccountIdsFromCaip25CaveatValue(caip25CaveatValue: Caip25CaveatValue): CaipAccountId[]; /** * Sets the permitted accounts to scopes with matching namespaces in the given CAIP-25 caveat value. * This function should not be used with Smart Contract Accounts (SCA) because * it adds the same account ID to all scopes that have the same namespace as the account. * * @param caip25CaveatValue - The CAIP-25 caveat value to set the permitted accounts for. * @param accounts - The permitted accounts to add to the appropriate scopes. * @returns The updated CAIP-25 caveat value with the permitted accounts set. */ export declare const setNonSCACaipAccountIdsInCaip25CaveatValue: (caip25CaveatValue: Caip25CaveatValue, accounts: CaipAccountId[]) => Caip25CaveatValue; /** * Checks if an internal account is connected to any of the permitted accounts * based on scope matching * * @param internalAccount - The internal account to check against permitted accounts * @param permittedAccounts - Array of CAIP account IDs that are permitted * @returns True if the account is connected to any permitted account */ export declare function isInternalAccountInPermittedAccountIds(internalAccount: InternalAccount, permittedAccounts: CaipAccountId[]): boolean; /** * Checks if an CAIP account ID is connected to any of the permitted accounts * based on scope matching * * @param accountId - The CAIP account ID to check against permitted accounts * @param permittedAccounts - Array of CAIP account IDs that are permitted * @returns True if the account is connected to any permitted account */ export declare function isCaipAccountIdInPermittedAccountIds(accountId: CaipAccountId, permittedAccounts: CaipAccountId[]): boolean; //# sourceMappingURL=caip-permission-operator-accounts.d.ts.map