import { AccountAddress, CommittedTransactionResponse, Ed25519Account } from "@aptos-labs/ts-sdk"; import { AptosContractWrapperBaseClass } from "./baseClass"; import { AclManagerContract } from "../contracts/aclManage"; import { AptosProvider } from "./aptosProvider"; /** * Represents the AclClient class which provides methods to interact with the ACL (Access Control List) manager contract * within the AAVE protocol on the Aptos blockchain. * * @remarks * This client extends AptosContractWrapperBaseClass and provides a comprehensive set of methods for managing roles and permissions, * including core role management, pool administration, emergency controls, risk management, and various specialized admin roles. * Each method corresponds to a specific ACL operation in the AAVE protocol. * * The client can be instantiated in two ways: * 1. Using the constructor directly with a provider and optional signer * 2. Using the static buildWithDefaultSigner method which automatically configures the client with the provider's ACL profile account * * @example * ```typescript * // Using buildWithDefaultSigner * const provider = new AptosProvider(); * const aclClient = AclClient.buildWithDefaultSigner(provider); * * // Using constructor directly * const provider = new AptosProvider(); * const signer = provider.getAclProfileAccount(); * const aclClient = new AclClient(provider, signer); * * // Check if an address has a specific role * const hasRole = await aclClient.hasRole("POOL_ADMIN", userAddress); * ``` * * @param provider - The AptosProvider instance used to interact with the Aptos blockchain. * @param signer - Optional Ed25519Account signer for transaction signing. */ export declare class AclClient extends AptosContractWrapperBaseClass { AclManagerContract: AclManagerContract; /** * Constructs an instance of AclClient. * @param provider - The AptosProvider instance. * @param signer - Optional Ed25519Account signer. */ constructor(provider: AptosProvider, signer?: Ed25519Account); /** * Creates an instance of AclClient using the default signer from the provided AptosProvider. * * @param provider - The AptosProvider instance to use for creating the AclClient. * @returns A new instance of AclClient. */ static buildWithDefaultSigner(provider: AptosProvider): AclClient; /** * Checks if a user has a specific role. * @param role - The role to check. * @param user - The account address of the user. * @returns A promise that resolves to a boolean indicating if the user has the role. */ hasRole(role: string, user: AccountAddress): Promise; /** * Grants a role to a user. * @param role - The role to grant. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ grantRole(role: string, user: AccountAddress): Promise; /** * Renounces a role for a user. * @param role - The role to renounce. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ renounceRole(role: string, user: AccountAddress): Promise; /** * Revokes a role from a user. * @param role - The role to revoke. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ revokeRole(role: string, user: AccountAddress): Promise; /** * Gets the default admin role. * @returns A promise that resolves to the default admin role as a string. */ getDefaultAdminRole(): Promise; /** * Gets the admin role for a specific role. * @param role - The role to get the admin role for. * @returns A promise that resolves to the admin role as a string. */ getRoleAdmin(role: string): Promise; /** * Sets the admin role for a specific role. * @param role - The role to set the admin role for. * @param adminRole - The admin role to set. * @returns A promise that resolves to a CommittedTransactionResponse. */ setRoleAdmin(role: string, adminRole: string): Promise; /** * Adds a pool admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ addPoolAdmin(user: AccountAddress): Promise; /** * Removes a pool admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ removePoolAdmin(user: AccountAddress): Promise; /** * Checks if a user is a pool admin. * @param user - The account address of the user. * @returns A promise that resolves to a boolean indicating if the user is a pool admin. */ isPoolAdmin(user: AccountAddress): Promise; /** * Gets the pool admin role. * @returns A promise that resolves to the pool admin role as a string. */ getPoolAdminRole(): Promise; /** * Adds an emergency admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ addEmergencyAdmin(user: AccountAddress): Promise; /** * Removes an emergency admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ removeEmergencyAdmin(user: AccountAddress): Promise; /** * Checks if a user is an emergency admin. * @param user - The account address of the user. * @returns A promise that resolves to a boolean indicating if the user is an emergency admin. */ isEmergencyAdmin(user: AccountAddress): Promise; /** * Gets the emergency admin role. * @returns A promise that resolves to the emergency admin role as a string. */ getEmergencyAdminRole(): Promise; /** * Adds a risk admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ addRiskAdmin(user: AccountAddress): Promise; /** * Removes a risk admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ removeRiskAdmin(user: AccountAddress): Promise; /** * Checks if a user is a risk admin. * @param user - The account address of the user. * @returns A promise that resolves to a boolean indicating if the user is a risk admin. */ isRiskAdmin(user: AccountAddress): Promise; /** * Gets the risk admin role. * @returns A promise that resolves to the risk admin role as a string. */ getRiskAdminRole(): Promise; /** * Adds a flash borrower. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ addFlashBorrower(user: AccountAddress): Promise; /** * Removes a flash borrower. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ removeFlashBorrower(user: AccountAddress): Promise; /** * Checks if a user is a flash borrower. * @param user - The account address of the user. * @returns A promise that resolves to a boolean indicating if the user is a flash borrower. */ isFlashBorrower(user: AccountAddress): Promise; /** * Gets the flash borrower role. * @returns A promise that resolves to the flash borrower role as a string. */ getFlashBorrowerRole(): Promise; /** * Adds a bridge. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ addBridge(user: AccountAddress): Promise; /** * Removes a bridge. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ removeBridge(user: AccountAddress): Promise; /** * Checks if a user is a bridge. * @param user - The account address of the user. * @returns A promise that resolves to a boolean indicating if the user is a bridge. */ isBridge(user: AccountAddress): Promise; /** * Gets the bridge role. * @returns A promise that resolves to the bridge role as a string. */ getBridgeRole(): Promise; /** * Adds an asset listing admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ addAssetListingAdmin(user: AccountAddress): Promise; /** * Removes an asset listing admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ removeAssetListingAdmin(user: AccountAddress): Promise; /** * Checks if a user is an asset listing admin. * @param user - The account address of the user. * @returns A promise that resolves to a boolean indicating if the user is an asset listing admin. */ isAssetListingAdmin(user: AccountAddress): Promise; /** * Gets the asset listing admin role. * @returns A promise that resolves to the asset listing admin role as a string. */ getAssetListingAdminRole(): Promise; /** * Adds a funds admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ addFundsAdmin(user: AccountAddress): Promise; /** * Removes a funds admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ removeFundsAdmin(user: AccountAddress): Promise; /** * Checks if a user is a funds admin. * @param user - The account address of the user. * @returns A promise that resolves to a boolean indicating if the user is a funds admin. */ isFundsAdmin(user: AccountAddress): Promise; /** * Gets the funds admin role. * @returns A promise that resolves to the funds admin role as a string. */ getFundsAdminRole(): Promise; /** * Adds an emission admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ addEmissionAdmin(user: AccountAddress): Promise; /** * Removes an emissions admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ removeEmissionAdmin(user: AccountAddress): Promise; /** * Checks if a user is an emission admin. * @param user - The account address of the user. * @returns A promise that resolves to a boolean indicating if the user is an emission admin. */ isEmissionAdmin(user: AccountAddress): Promise; /** * Gets the emissions admin role. * @returns A promise that resolves to the emissions admin role as a string. */ getEmissionAdminRole(): Promise; /** * Adds an admin controlled ecosystem reserve admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ addAdminControlledEcosystemReserveAdmin(user: AccountAddress): Promise; /** * Removes an admin controlled ecosystem reserve admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ emoveAdminControlledEcosystemReserveAdmin(user: AccountAddress): Promise; /** * Checks if a user is an admin controlled ecosystem reserve admin. * @param user - The account address of the user. * @returns A promise that resolves to a boolean indicating if the user is an admin controlled ecosystem reserve admin. */ isAdminControlledEcosystemReserveAdmin(user: AccountAddress): Promise; /** * Gets the admin controlled ecosystem reserve admin role. * @returns A promise that resolves to the admin controlled ecosystem reserve admin role as a string. */ getAdminControlledEcosystemReserveAdmin(): Promise; /** * Adds a rewards controller admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ addRewardsControllerAdmin(user: AccountAddress): Promise; /** * Removes a rewards controller admin. * @param user - The account address of the user. * @returns A promise that resolves to a CommittedTransactionResponse. */ removeRewardsControllerAdmin(user: AccountAddress): Promise; /** * Checks if a user is a rewards controller admin. * @param user - The account address of the user. * @returns A promise that resolves to a boolean indicating if the user is a rewards controller admin. */ isRewardsControllerAdminFunc(user: AccountAddress): Promise; /** * Gets the rewards controller role. * @returns A promise that resolves to the rewards controller admin role as a string. */ getRewardsControllerAdmin(): Promise; }