import type { Hex, CaipChainId, CaipNamespace } from '@metamask/utils'; import type { Caip25CaveatValue } from '../caip25Permission.js'; import type { InternalScopesObject, InternalScopeString } from '../scope/types.js'; /** * Gets the Ethereum (EIP155 namespaced) chainIDs from the required and optional scopes. * * @param caip25CaveatValue - The CAIP-25 caveat value from which to get the Ethereum chainIDs. * @returns An array of Ethereum chainIDs. */ export declare const getPermittedEthChainIds: (caip25CaveatValue: Pick) => `0x${string}`[]; /** * Adds an Ethereum (EIP155 namespaced) chainID to the optional scopes if it is not already present * in either the pre-existing required or optional scopes. * * @param caip25CaveatValue - The CAIP-25 caveat value to add the Ethereum chainID to. * @param chainId - The Ethereum chainID to add. * @returns The updated CAIP-25 caveat value with the added Ethereum chainID. */ export declare const addPermittedEthChainId: (caip25CaveatValue: Caip25CaveatValue, chainId: Hex) => Caip25CaveatValue; /** * Sets the permitted Ethereum (EIP155 namespaced) chainIDs for the required and optional scopes. * * @param caip25CaveatValue - The CAIP-25 caveat value to set the permitted Ethereum chainIDs for. * @param chainIds - The Ethereum chainIDs to set as permitted. * @returns The updated CAIP-25 caveat value with the permitted Ethereum chainIDs. */ export declare const setPermittedEthChainIds: (caip25CaveatValue: Caip25CaveatValue, chainIds: Hex[]) => Caip25CaveatValue; /** * Gets all scopes from a CAIP-25 caveat value * * @param scopesObjects - The scopes objects to get the scopes from. * @returns An array of InternalScopeStrings. */ export declare function getAllScopesFromScopesObjects(scopesObjects: InternalScopesObject[]): InternalScopeString[]; /** * Gets all scopes (chain IDs) from a CAIP-25 caveat * This extracts all scopes from both required and optional scopes * and returns a unique set. * * @param caip25CaveatValue - The CAIP-25 caveat value to extract scopes from * @returns Array of unique scope strings (chain IDs) */ export declare function getAllScopesFromCaip25CaveatValue(caip25CaveatValue: Caip25CaveatValue): CaipChainId[]; /** * Gets all non-wallet namespaces from a CAIP-25 caveat value * This extracts all namespaces from both required and optional scopes * and returns a unique set. * * @param caip25CaveatValue - The CAIP-25 caveat value to extract namespaces from * @returns Array of unique namespace strings */ export declare function getAllNamespacesFromCaip25CaveatValue(caip25CaveatValue: Caip25CaveatValue): CaipNamespace[]; /** * Gets all scopes (chain IDs) from a CAIP-25 permission * This extracts all scopes from both required and optional scopes * and returns a unique set. * * @param caip25Permission - The CAIP-25 permission object * @param caip25Permission.caveats - The caveats of the CAIP-25 permission * @returns Array of unique scope strings (chain IDs) */ export declare function getAllScopesFromPermission(caip25Permission: { caveats: { type: string; value: Caip25CaveatValue; }[]; }): CaipChainId[]; /** * Adds a chainID to the optional scopes if it is not already present * in either the pre-existing required or optional scopes. * * @param caip25CaveatValue - The CAIP-25 caveat value to add the chainID to. * @param chainId - The chainID to add. * @returns The updated CAIP-25 caveat value with the added chainID. */ export declare const addCaipChainIdInCaip25CaveatValue: (caip25CaveatValue: Caip25CaveatValue, chainId: CaipChainId) => Caip25CaveatValue; /** * Sets the CAIP-2 chainIds for the required and optional scopes. * If the caip25CaveatValue contains chainIds not in the chainIds array arg they are filtered out * * @param caip25CaveatValue - The CAIP-25 caveat value to set the permitted CAIP-2 chainIDs for. * @param chainIds - The CAIP-2 chainIDs to set. * @returns The updated CAIP-25 caveat value with the CAIP-2 chainIDs. */ export declare const setChainIdsInCaip25CaveatValue: (caip25CaveatValue: Caip25CaveatValue, chainIds: CaipChainId[]) => Caip25CaveatValue; //# sourceMappingURL=caip-permission-operator-permittedChains.d.ts.map