import { Address, Hash, Hex } from 'viem'; import { C as ClientConfig, a as BaseClient, T as TransactionOptions } from './BaseClient-CkBhQ1ou.cjs'; import './doc-types-471vSmPO.cjs'; interface UserClientConfig extends ClientConfig { accountAddress: Address; sbtAddress?: Address; entryPointAddress?: Address; superPaymasterAddress?: Address; gTokenStakingAddress?: Address; registryAddress?: Address; gTokenAddress?: Address; bundlerClient?: any; } declare class UserClient extends BaseClient { accountAddress: Address; sbtAddress?: Address; entryPointAddress?: Address; gTokenStakingAddress?: Address; registryAddress?: Address; gTokenAddress?: Address; bundlerClient?: any; constructor(config: UserClientConfig); /** * Deploy a new Smart Account (Supports multiple factory types) * Static helper to facilitate onboarding before instantiating the UserClient. * * @param client - WalletClient to sign the deployment transaction * @param params - Deployment parameters * @returns Object containing the deployed account address and transaction hash */ static deployAccount(client: any, params: { owner: Address; salt?: bigint; factoryAddress?: Address; publicClient?: any; accountType?: 'simple' | 'kernel' | 'safe' | string; customAbi?: any; }): Promise<{ accountAddress: Address; hash: Hash; }>; /** * Get the nonce of the account from EntryPoint (more reliable for 4337) */ getNonce(key?: bigint): Promise; /** * Get the owner of the AA account */ getOwner(): Promise
; /** * Execute a transaction from the AA account */ execute(target: Address, value: bigint, data: Hex, options?: TransactionOptions): Promise; /** * Execute a batch of transactions */ executeBatch(targets: Address[], values: bigint[], datas: Hex[], options?: TransactionOptions): Promise; /** * Get user's SBT balance */ getSBTBalance(): Promise; mintSBT(roleId: Hex, options?: TransactionOptions): Promise; transferToken(token: Address, to: Address, amount: bigint, options?: TransactionOptions): Promise; /** * Get Token Balance */ getTokenBalance(token: Address): Promise; stakeForRole(roleId: Hex, amount: bigint, options?: TransactionOptions): Promise; unstakeFromRole(roleId: Hex, options?: TransactionOptions): Promise; /** * Get staked balance for a specific role */ getStakedBalance(roleId: Hex): Promise; exitRole(roleId: Hex, options?: TransactionOptions): Promise; leaveCommunity(community: Address, options?: TransactionOptions): Promise; /** * Register as EndUser (One-click: Approve + Register) * Handles GToken approval to Staking contract and Role registration. */ registerAsEndUser(communityAddress: Address, stakeAmount: bigint, options?: TransactionOptions): Promise; /** * Execute a transaction with Gasless Sponsorship */ executeGasless(params: { target: Address; value: bigint; data: Hex; paymaster: Address; paymasterType: 'V4' | 'Super'; /** ERC-20 used to pay gas under a V4 paymaster (e.g. the community's xPNTs/aPNTs). REQUIRED for V4. */ gasToken?: Address; operator?: Address; maxRate?: bigint; }, options?: TransactionOptions): Promise; } interface CommunityClientConfig extends ClientConfig { sbtAddress?: Address; factoryAddress?: Address; reputationAddress?: Address; } interface CreateCommunityParams { name: string; tokenSymbol: string; ensName?: string; description?: string; } interface CommunityInfo { address: Address; } /** * Client for Community Managers (`ROLE_COMMUNITY`) */ declare class CommunityClient extends BaseClient { sbtAddress?: Address; factoryAddress?: Address; reputationAddress?: Address; constructor(config: CommunityClientConfig); /** * Create a new Community Token (xPNTs) and register it. * Note: In the current architecture, creating a community often involves: * 1. Registering the ROLE_COMMUNITY on Registry (if not exists) -> usually manual or self-register * 2. Deploying a Token (xPNTs) via Factory * 3. Linking the Token to the Community in Registry */ createCommunityToken(params: CreateCommunityParams, options?: TransactionOptions): Promise; /** * Get Community Details (Decodes Role Metadata) * @param communityAddress - The address of the community manager (defaults to self) */ getCommunityInfo(communityAddress?: Address): Promise<{ name: string; ensName: string; website: string; description: string; logoURI: string; stakeAmount: bigint; }>; /** * Register self as a Community Manager. * This method handles all necessary steps: * 1. Checks and approves GToken to GTokenStaking * 2. Encodes CommunityRoleData with provided parameters * 3. Calls registerRoleSelf on Registry * * @param params Community registration parameters * @param options Transaction options * @returns Transaction hash */ registerAsCommunity(params: { name: string; ensName?: string; website?: string; description?: string; logoURI?: string; stakeAmount?: bigint; }, options?: TransactionOptions): Promise; /** * One-click Setup: Register Community + Deploy Token * Orchestrates the complete community initialization flow. */ setupCommunity(params: { name: string; tokenName: string; tokenSymbol: string; description?: string; logoURI?: string; website?: string; stakeAmount?: bigint; }, options?: TransactionOptions): Promise<{ tokenAddress: Address; hashes: Hash[]; }>; /** * Airdrop SBTs to users to make them members */ airdropSBT(users: Address[], roleId: bigint, options?: TransactionOptions): Promise; setReputationRule(ruleId: bigint, ruleConfig: any, options?: TransactionOptions): Promise; /** * Revoke membership (Burn SBT) */ revokeMembership(userAddr: Address, options?: TransactionOptions): Promise; /** * Transfer ownership of the Community Token */ transferCommunityTokenOwnership(tokenAddress: Address, newOwner: Address, options?: TransactionOptions): Promise; } interface GaslessConfig { paymasterUrl: string; policy?: 'CREDIT' | 'TOKEN' | 'SPONSORED'; /** * Explicit paymaster for TOKEN/SPONSORED (V4) policies. If omitted, the chain's canonical * PaymasterV4 is used. CREDIT always routes to the SuperPaymaster (registry-resolved). */ paymasterAddress?: Address; /** ERC-20 used to pay gas under a V4 paymaster (TOKEN/SPONSORED). Required for those policies. */ gasToken?: Address; } interface UserLifecycleConfig extends ClientConfig { accountAddress: Address; registryAddress: Address; sbtAddress: Address; gTokenAddress: Address; gTokenStakingAddress: Address; entryPointAddress: Address; gasless?: GaslessConfig; } interface OnboardResult { success: boolean; sbtId?: bigint; txHash?: Hash; } interface ReputationData { score: bigint; level: bigint; creditLimit: bigint; } /** * UserLifecycle - L3 Pattern * * Responsibilities: * 1. Managing the complete lifecycle of an End User (Onboard -> Operate -> Exit) * 2. Providing a unified interface for Gasless operations * 3. Abstracting underlying contract interactions via L2 Actions */ declare class UserLifecycle extends BaseClient { accountAddress: Address; registryAddress: Address; sbtAddress: Address; gTokenAddress: Address; gTokenStakingAddress: Address; entryPointAddress: Address; gaslessConfig?: GaslessConfig; config: UserLifecycleConfig; constructor(config: UserLifecycleConfig); /** * Check if user is eligible to join a community * @param community Address of the community */ checkEligibility(_community: Address): Promise; /** * One-click Onboarding: Approve -> Stake -> Register -> Mint SBT * @param community Address of the community to join * @param stakeAmount Amount of GToken to stake (default 0.4 GT) */ onboard(community: Address, stakeAmount?: bigint): Promise; /** * Enable or update Gasless configuration */ enableGasless(config: GaslessConfig): Promise; /** * Execute a transaction effectively using Gasless configuration if available */ executeGaslessTx(params: { target: Address; value: bigint; data: Hex; operator?: Address; }): Promise; claimSBT(roleId: Hex, options?: TransactionOptions): Promise; getMyReputation(): Promise; getCreditLimit(): Promise; leaveCommunity(community: Address, options?: TransactionOptions): Promise; exitRole(roleId: Hex, options?: TransactionOptions): Promise; unstakeAll(roleId: Hex, options?: TransactionOptions): Promise; } export { CommunityClient, type CommunityClientConfig, type CommunityInfo, type CreateCommunityParams, type GaslessConfig, type OnboardResult, type ReputationData, UserClient, type UserClientConfig, UserLifecycle, type UserLifecycleConfig };