import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem'; import { getContract } from 'viem'; /** * SafeProxy_json ABI * * This ABI is typed using viem's type system for full type safety. */ export const SafeProxy_jsonAbi = [ { "inputs": [ { "internalType": "address", "name": "_singleton", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "stateMutability": "payable", "type": "fallback" } ] as const satisfies Abi; /** * Type-safe ABI for SafeProxy_json */ export type SafeProxy_jsonAbi = typeof SafeProxy_jsonAbi; /** * Contract instance type for SafeProxy_json */ // Use any for contract type to avoid complex viem type issues // The runtime behavior is type-safe through viem's ABI typing export type SafeProxy_jsonContract = any; /** * SafeProxy_json Contract Class * * Provides a class-based API similar to TypeChain for interacting with the contract. * * @example * ```typescript * import { createPublicClient, createWalletClient, http } from 'viem'; * import { mainnet } from 'viem/chains'; * import { SafeProxy_json } from 'SafeProxy_json'; * * const publicClient = createPublicClient({ chain: mainnet, transport: http() }); * const walletClient = createWalletClient({ chain: mainnet, transport: http() }); * * const contract = new SafeProxy_json('0x...', { publicClient, walletClient }); * * // Read functions * const result = await contract.balanceOf('0x...'); * * // Write functions * const hash = await contract.transfer('0x...', 1000n); * * // Simulate transactions (dry-run) * const simulation = await contract.simulate.transfer('0x...', 1000n); * console.log('Gas estimate:', simulation.request.gas); * * // Watch events * const unwatch = contract.watch.Transfer((event) => { * console.log('Transfer event:', event); * }); * ``` */ export class SafeProxy_json { private contract: SafeProxy_jsonContract; private contractAddress: Address; private publicClient: PublicClient; constructor( address: Address, clients: { publicClient: PublicClient; walletClient?: WalletClient; } ) { this.contractAddress = address; this.publicClient = clients.publicClient; this.contract = getContract({ address, abi: SafeProxy_jsonAbi, client: { public: clients.publicClient, wallet: clients.walletClient, }, }); } /** * Get the contract address */ get address(): Address { return this.contractAddress; } /** * Get the underlying viem contract instance */ getContract(): SafeProxy_jsonContract { return this.contract; } // No read functions // No write functions /** * Simulate contract write operations (dry-run without sending transaction) * * Note: This contract has no write functions, so simulate returns an empty object. */ get simulate() { return {}; } /** * Watch contract events * * Note: This contract has no events, so watch returns an empty object. */ get watch() { return {}; } }