import { t as SignAndBroadcast } from "./helpers-ZShvV2Sa-DopIiEty.mjs"; import { ExecutionConfig, IRSCapability, NetworkConfig, OperationResult, TransactionStatusUpdate, TxStatus } from "@openzeppelin/ui-types"; import { Chain } from "viem"; //#region ../adapter-evm-core/dist/irs-B3kbyWmK.d.mts //#endregion //#region src/irs/identity-keys.d.ts /** * Result of probing `keyHasPurpose` on an ONCHAINID identity. * * `lacks` (on-chain false) is distinct from `read_failed` (RPC/transport failure). */ type IdentityKeyPurposeLookup = { readonly status: 'has'; } | { readonly status: 'lacks'; } | { readonly status: 'read_failed'; readonly cause: Error; }; //#endregion //#region src/irs/onchain-reader.d.ts /** * Look up the ONCHAINID registered for `holder` in the identity registry. * * @returns `{ found: true, onchainId }` when registered, `{ found: false }` otherwise. * @throws {IdentityOperationFailed} On RPC failure (not for the expected-negative case). */ /** * Resolve the ONCHAINID deployed for a wallet via the identity factory. * * @returns Explicit lookup — `not_found` (zero address) is distinct from `read_failed`. */ type FactoryIdentityLookup = { readonly status: 'found'; readonly onchainId: string; } | { readonly status: 'not_found'; } | { readonly status: 'read_failed'; readonly cause: Error; }; //#endregion //#region src/irs/receipt-identity.d.ts /** Tunables for the deploy confirmation wait. */ interface DeployReceiptWaitOptions { /** * Confirmations to require. Must be an integer >= 1. Defaults to * {@link DEFAULT_DEPLOY_CONFIRMATIONS}. */ confirmations?: number; /** * Milliseconds before giving up. Must be a finite integer > 0. Defaults to * {@link DEFAULT_DEPLOY_RECEIPT_TIMEOUT_MS}. */ timeoutMs?: number; } //#endregion //#region src/irs/types.d.ts /** * Deployment-specific IRS / ONCHAINID contract addresses the capability operates against. * * Supplied by the consuming plugin at `createIRS` time, since the capability's methods * take holder/claim arguments rather than per-call contract addresses. */ interface EvmIRSAddresses { /** ERC-3643 Identity Registry. */ identityRegistry: string; /** ONCHAINID identity factory (IdFactory). */ identityFactory: string; /** ERC-3643 Trusted Issuers Registry. */ trustedIssuersRegistry: string; } /** * Transaction executor callback — decouples the IRS service from wallet/signing. * Same shape as {@link CapabilityExecutor} (returns {@link WriteExecutionResult}). */ //#endregion //#region src/capabilities/irs.d.ts /** * Options for {@link createIRS}. * * `addresses` carries the deployment-specific IRS / ONCHAINID contract addresses (the * capability methods take holder/claim arguments rather than per-call addresses). The * capability never holds the trusted-issuer signing key — only the optional `trustedIssuer` * identity address used as a fallback when an attached claim omits its issuer. */ interface CreateIRSOptions { signAndBroadcast: SignAndBroadcast; addresses: EvmIRSAddresses; /** * Address that receives MANAGEMENT on deploy and executes `attachClaim` in the onboarding saga. * * Must be the operator EOA — never inferred from the transaction signer, because the IdFactory * `onlyOwner` caller may be a relayer contract. */ operatorManagementKey: string; trustedIssuer?: string; /** * Bounds on the `deployOnchainId` confirmation wait (confirmations + timeout). * * Validated eagerly here, so an out-of-range bound throws at capability construction rather than * on a holder's first deploy. See `DeployReceiptWaitOptions`. */ deployReceiptWait?: DeployReceiptWaitOptions; } /** * EVM IRS capability surface. * * A **plain extension** of the shared `IRSCapability`: as of `@openzeppelin/ui-types` 3.5.0 * `IRSCapability.deployOnchainId` already returns the completion-keyed * {@link DeployOnchainIdOutcome}, so submit-only is honestly typed by the shared interface * itself (INV-4 / INV-6) and `onchainId` is still never optionalized. * * This restores two-way assignability with `IRSCapability`: the previous * `Omit` + local override widened the return type in a way * the shared interface rejected, so an `EvmIRSCapability` could not be passed where an * `IRSCapability` was expected. Locked by the INV-4 type guards in * `irs.deploy-submit-only.test.ts`. */ interface EvmIRSCapability extends IRSCapability { getFactoryIdentity(holder: string): Promise; hasIdentityKeyPurpose(input: { onchainId: string; address: string; purpose: number; }): Promise; grantHolderManagementKey(input: { onchainId: string; holder: string; }, executionConfig: ExecutionConfig, onStatusChange?: (status: TxStatus, details: TransactionStatusUpdate) => void, runtimeApiKey?: string): Promise; } /** * Create the EVM IRS / ONCHAINID capability. * * Mirrors {@link createAccessControl}: assembles the service, adapts the injected * `signAndBroadcast` into the service's executor, and wraps the result with * `guardRuntimeCapability` for the `RuntimeCapability` surface and idempotent `dispose()`. */ declare function createIRS(config: NetworkConfig, options: CreateIRSOptions): EvmIRSCapability; //#endregion //#endregion export { EvmIRSAddresses as n, createIRS as r, CreateIRSOptions as t }; //# sourceMappingURL=irs-B3kbyWmK-ZaM_ZVaW.d.mts.map