import { n as FheChain } from "../types-BgczXqW2.js"; import { B as TransactionReceipt, F as WalletAccount, J as WriteContractConfig, N as GenericProvider, W as ReadContractConfig, l as EIP712TypedData, p as EncryptedValue } from "../relayer-cleartext-DkKKjfI6.js"; import { a as ZamaConfig } from "../types-BjDu-RZg.js"; import { t as ZamaConfigEthers } from "../types-Xg_On_yY.js"; import { t as BaseSigner } from "../base-signer-ByGw5ReU.js"; import { Abi, Address, ContractFunctionArgs, ContractFunctionName, ContractFunctionReturnType, EIP1193EventMap, EIP1193Events, EIP1193Provider, EIP1193Provider as EIP1193Provider$1, Hex, Hex as Hex$1, ProviderConnectInfo, ProviderMessage, ProviderRpcError } from "viem"; import { Signer, ethers } from "ethers"; //#region src/ethers/config.d.ts /** Create a {@link ZamaConfig} from ethers types. */ declare function createConfig(params: ZamaConfigEthers): ZamaConfig; //#endregion //#region src/ethers/ethers-signer.d.ts /** * Configuration for {@link EthersSigner}. * * Two variants: * * - **Browser** — `{ ethereum }`: pass the raw EIP-1193 provider (e.g. `window.ethereum`). * A `BrowserProvider` is created internally and wallet events update `walletAccount`. * * - **Node / direct signer** — `{ signer }`: pass an ethers `Signer` (e.g. `Wallet`). * The initial wallet account is discovered asynchronously and emitted through * `walletAccount` once available. * * For public chain reads, construct a separate {@link EthersProvider}. */ type EthersSignerConfig = { ethereum: EIP1193Provider$1; } | { signer: Signer; }; /** * GenericSigner backed by ethers. * * Accepts either a raw EIP-1193 provider (`{ ethereum }`) which creates a * `BrowserProvider` internally, or a `Signer` directly (`{ signer }`) * for Node.js scripts. * * @param config - {@link EthersSignerConfig} */ declare class EthersSigner extends BaseSigner { #private; constructor(config: EthersSignerConfig); requireWalletAccount(operation: string): WalletAccount; refreshWalletAccount(): Promise; protected onDispose(): void; signTypedData(typedData: EIP712TypedData): Promise; writeContract, const TArgs extends ContractFunctionArgs>(config: WriteContractConfig): Promise; } //#endregion //#region src/ethers/ethers-provider.d.ts /** * Configuration for {@link EthersProvider}. * * Two variants: * * - **EIP-1193** — `{ ethereum }`: pass the raw EIP-1193 provider (e.g. `window.ethereum`). * A `BrowserProvider` is created internally. * * - **Pre-built** — `{ provider }`: pass any ethers `Provider` * (e.g. `JsonRpcProvider`, `WebSocketProvider`). */ type EthersProviderConfig = { ethereum: EIP1193Provider$1; } | { provider: ethers.Provider; }; /** * Read-only {@link GenericProvider} backed by ethers v6. * * Use this for integrations that only need public chain reads before the user has connected their * wallet. * * @example * ```ts * // Dedicated RPC * const provider = new EthersProvider({ * provider: new ethers.JsonRpcProvider(ALCHEMY_URL), * }); * * // Wallet-sourced RPC (shares transport with EthersSigner) * const provider = new EthersProvider({ ethereum: window.ethereum }); * ``` */ declare class EthersProvider implements GenericProvider { #private; constructor(config: EthersProviderConfig); getChainId(): Promise; readContract, const TArgs extends ContractFunctionArgs>(config: ReadContractConfig): Promise>; getBlockTimestamp(): Promise; waitForTransactionReceipt(hash: Hex$1): Promise; } //#endregion //#region src/ethers/contracts.d.ts interface EthersTransactionRequest { to: Address; data: Hex$1; gasLimit?: bigint; value?: bigint; } interface EthersTransactionResponse { hash: string; } interface EthersCallProvider { call(tx: EthersTransactionRequest): Promise; } interface EthersTransactionSigner extends EthersCallProvider { sendTransaction(tx: EthersTransactionRequest): Promise; } declare function readConfidentialBalanceOfContract(provider: EthersCallProvider, tokenAddress: Address, userAddress: Address): Promise; declare function readUnderlyingTokenContract(provider: EthersCallProvider, wrapperAddress: Address): Promise; declare function readSupportsInterfaceContract(provider: EthersCallProvider, tokenAddress: Address, interfaceId: Address): Promise; declare function writeConfidentialTransferContract(signer: EthersTransactionSigner, tokenAddress: Address, to: Address, encryptedAmount: EncryptedValue, inputProof: Hex$1): Promise<`0x${string}`>; declare function writeUnwrapContract(signer: EthersTransactionSigner, encryptedErc20: Address, from: Address, to: Address, encryptedAmount: EncryptedValue, inputProof: Hex$1): Promise<`0x${string}`>; declare function writeUnwrapFromBalanceContract(signer: EthersTransactionSigner, encryptedErc20: Address, from: Address, to: Address, encryptedBalance: EncryptedValue): Promise<`0x${string}`>; declare function writeFinalizeUnwrapContract(signer: EthersTransactionSigner, wrapper: Address, unwrapRequestId: EncryptedValue, unwrapAmountCleartext: bigint, decryptionProof: Hex$1): Promise<`0x${string}`>; declare function writeSetOperatorContract(signer: EthersTransactionSigner, tokenAddress: Address, operator: Address, until?: number): Promise<`0x${string}`>; declare function writeWrapContract(signer: EthersTransactionSigner, wrapperAddress: Address, to: Address, amount: bigint): Promise<`0x${string}`>; declare function readTokenPairsContract(provider: EthersCallProvider, registry: Address): Promise; declare function readTokenPairsLengthContract(provider: EthersCallProvider, registry: Address): Promise; declare function readTokenPairsSliceContract(provider: EthersCallProvider, registry: Address, fromIndex: bigint, toIndex: bigint): Promise; declare function readTokenPairContract(provider: EthersCallProvider, registry: Address, index: bigint): Promise; declare function readConfidentialTokenAddressContract(provider: EthersCallProvider, registry: Address, tokenAddress: Address): Promise; declare function readTokenAddressContract(provider: EthersCallProvider, registry: Address, confidentialTokenAddress: Address): Promise; declare function readIsConfidentialTokenValidContract(provider: EthersCallProvider, registry: Address, confidentialTokenAddress: Address): Promise; //#endregion export { type EIP1193EventMap, type EIP1193Events, type EIP1193Provider, type EncryptedValue, EthersProvider, type EthersProviderConfig, EthersSigner, type EthersSignerConfig, type Hex, type ProviderConnectInfo, type ProviderMessage, ProviderRpcError, type ZamaConfigEthers, createConfig, readConfidentialBalanceOfContract, readConfidentialTokenAddressContract, readIsConfidentialTokenValidContract, readSupportsInterfaceContract, readTokenAddressContract, readTokenPairContract, readTokenPairsContract, readTokenPairsLengthContract, readTokenPairsSliceContract, readUnderlyingTokenContract, writeConfidentialTransferContract, writeFinalizeUnwrapContract, writeSetOperatorContract, writeUnwrapContract, writeUnwrapFromBalanceContract, writeWrapContract }; //# sourceMappingURL=index.d.ts.map