import { type Address, type GetContractReturnType, type Hex, type PublicClient } from "viem"; import type { IBundler } from "../bundler/IBundler.js"; import { type UserOpResponse } from "../bundler/index.js"; import { BaseValidationModule, type ModuleInfo, type SendUserOpParams } from "../modules/index.js"; import { type FeeQuotesOrDataResponse, type IPaymaster } from "../paymaster/index.js"; import { BaseSmartContractAccount } from "./BaseSmartContractAccount.js"; import { ZeroXgaslessAccountAbi } from "./abi/SmartAccount.js"; import { type StateOverrideSet, type UserOperationStruct } from "./index.js"; import type { BalancePayload, BatchUserOperationCallData, BuildUserOpOptions, CounterFactualAddressParam, PaymasterUserOperationDto, QueryParamsForAddressResolver, SimulationType, SupportedToken, Transaction, TransferOwnershipCompatibleModule, WithdrawalRequest, ZeroXgaslessSmartAccountV2Config, ZeroXgaslessSmartAccountV2ConfigConstructorProps, ZeroXgaslessTokenPaymasterRequest } from "./utils/Types.js"; type UserOperationKey = keyof UserOperationStruct; export declare class ZeroXgaslessSmartAccount extends BaseSmartContractAccount { readonly SmartAccountConfig: ZeroXgaslessSmartAccountV2ConfigConstructorProps; private sessionData?; private SENTINEL_MODULE; private index; private chainId; private provider; paymaster?: IPaymaster; bundler?: IBundler; private accountContract?; private defaultFallbackHandlerAddress; private implementationAddress; private scanForUpgradedAccountsFromV1; private maxIndexForScan; defaultValidationModule: BaseValidationModule; activeValidationModule: BaseValidationModule; private constructor(); static create(SmartAccountConfig: ZeroXgaslessSmartAccountV2Config): Promise; getAddress(params?: CounterFactualAddressParam): Promise; getAccountAddress(params?: CounterFactualAddressParam): Promise<`0x${string}`>; getGasEstimate(transactions: Transaction[], buildUseropDto?: BuildUserOpOptions): Promise; getBalances(addresses?: Array): Promise>; withdraw(withdrawalRequests?: WithdrawalRequest[] | null, defaultRecipient?: Hex | null, buildUseropDto?: BuildUserOpOptions): Promise; /** * Return the account's address. This value is valid even before deploying the contract. */ getCounterFactualAddress(params?: CounterFactualAddressParam): Promise; private getCounterFactualAddressV2; _getAccountContract(): Promise>; isActiveValidationModuleDefined(): boolean; isDefaultValidationModuleDefined(): boolean; setActiveValidationModule(validationModule: BaseValidationModule): ZeroXgaslessSmartAccount; setDefaultValidationModule(validationModule: BaseValidationModule): ZeroXgaslessSmartAccount; getV1AccountsUpgradedToV2(params: QueryParamsForAddressResolver): Promise; /** * Return the value to put into the "initCode" field, if the account is not yet deployed. * This value holds the "factory" address, followed by this account's information */ getAccountInitCode(): Promise; /** * * @param to { target } address of transaction * @param value represents amount of native tokens * @param data represent data associated with transaction * @returns encoded data for execute function */ encodeExecute(to: Hex, value: bigint, data: Hex): Promise; /** * * @param to { target } array of addresses in transaction * @param value represents array of amount of native tokens associated with each transaction * @param data represent array of data associated with each transaction * @returns encoded data for executeBatch function */ encodeExecuteBatch(to: Array, value: Array, data: Array): Promise; encodeBatchExecute(txs: BatchUserOperationCallData): Promise; getDummySignatures(_params?: ModuleInfo): Promise; getDummySignature(): Hex; getDummyPaymasterData(): string; validateUserOp(userOp: Partial, requiredFields: UserOperationKey[]): boolean; signUserOp(userOp: Partial, _params?: SendUserOpParams): Promise; getSignatureWithModuleAddress(moduleSignature: Hex, moduleAddress?: Hex): Hex; getPaymasterUserOp(userOp: Partial, paymasterServiceData: PaymasterUserOperationDto): Promise>; private getPaymasterAndData; private getPaymasterFeeQuotesOrData; getTokenFees(manyOrOneTransactions: Transaction | Transaction[], buildUseropDto: BuildUserOpOptions): Promise; getSupportedTokens(): Promise; sendUserOp(userOp: Partial, params?: SendUserOpParams): Promise; /** * * @param userOp - The signed user operation to send * @param simulationType - The type of simulation to perform ("validation" | "validation_and_execution") * @description This function call will take 'signedUserOp' as input and send it to the bundler * @returns */ sendSignedUserOp(userOp: UserOperationStruct, simulationType?: SimulationType): Promise; getUserOpHash(userOp: Partial): Promise; estimateUserOpGas(userOp: Partial, stateOverrideSet?: StateOverrideSet): Promise>; getNonce(nonceKey?: number): Promise; private getBuildUserOpNonce; /** * Transfers ownership of the smart account to a new owner. * @param newOwner The address of the new owner. * @param moduleAddress {@link TransferOwnershipCompatibleModule} The address of the validation module (ECDSA Ownership Module or Multichain Validation Module). * @param buildUseropDto {@link BuildUserOpOptions}. Optional parameter * @returns A Promise that resolves to a UserOpResponse or rejects with an Error. * @description This function will transfer ownership of the smart account to a new owner. If you use session key manager module, after transferring the ownership * you will need to re-create a session for the smart account with the new owner (signer) and specify "accountAddress" in "createSmartAccountClient" function. * @example * ```typescript * * let walletClient = createWalletClient({ account, chain: baseSepolia, transport: http() }); let smartAccount = await createSmartAccountClient({ signer: walletClient, paymasterUrl: "https://paymaster.0xgasless.com/api/v1/...", bundlerUrl: `https://bundler.0xgasless.com/api/v2/84532/nJPK7B3ru.dd7f7861-190d-41bd-af80-6877f74b8f44`, chainId: 84532 }); const response = await smartAccount.transferOwnership(newOwner, DEFAULT_ECDSA_OWNERSHIP_MODULE, {paymasterServiceData: {mode: PaymasterMode.SPONSORED}}); walletClient = createWalletClient({ newOwnerAccount, chain: baseSepolia, transport: http() }) smartAccount = await createSmartAccountClient({ signer: walletClient, paymasterUrl: "https://paymaster.0xgasless.com/api/v1/...", bundlerUrl: `https://bundler.0xgasless.com/api/v2/84532/nJPK7B3ru.dd7f7861-190d-41bd-af80-6877f74b8f44`, chainId: 84532, accountAddress: await smartAccount.getAccountAddress() }) * ``` */ transferOwnership(newOwner: Address, moduleAddress: TransferOwnershipCompatibleModule, buildUseropDto?: BuildUserOpOptions): Promise; sendTransaction(manyOrOneTransactions: Transaction | Transaction[], buildUseropDto?: BuildUserOpOptions): Promise; buildUserOp(transactions: Transaction[], buildUseropDto?: BuildUserOpOptions): Promise>; private validateUserOpAndPaymasterRequest; buildTokenPaymasterUserOp(userOp: Partial, tokenPaymasterRequest: ZeroXgaslessTokenPaymasterRequest): Promise>; signUserOpHash(userOpHash: string, params?: ModuleInfo): Promise; deploy(buildUseropDto?: BuildUserOpOptions): Promise; deployAccount(): Promise; getFactoryData(): Promise<`0x${string}` | undefined>; signMessage(message: string | Uint8Array): Promise; getIsValidSignatureData(messageHash: Hex, signature: Hex): Promise; enableModule(moduleAddress: Hex): Promise; getEnableModuleData(moduleAddress: Hex): Promise; getSetupAndEnableModuleData(moduleAddress: Hex, moduleSetupData: Hex): Promise; disableModule(prevModule: Hex, moduleAddress: Hex): Promise; getDisableModuleData(prevModule: Hex, moduleAddress: Hex): Promise; isModuleEnabled(moduleAddress: Hex): Promise; getAllModules(pageSize?: number): Promise>; } export {}; //# sourceMappingURL=0xGaslessSmartAccount.d.ts.map