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.

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
// 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);

The AptosProvider instance used to interact with the Aptos blockchain.

Optional Ed25519Account signer for transaction signing.

Hierarchy (View Summary)

Constructors

Properties

AclManagerContract: AclManagerContract

Methods

  • Adds an admin controlled ecosystem reserve admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Adds an asset listing admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Adds a bridge.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Adds an emergency admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Adds an emission admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Adds a flash borrower.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Adds a funds admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Adds a pool admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Adds a rewards controller admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Adds a risk admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Builds a transaction for the specified user, function, and arguments.

    Parameters

    • user: AccountAddress

      The account address of the user initiating the transaction.

    • functionId: `${string}::${string}::${string}`

      The identifier of the Move function to be called.

    • funcArgs: (EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes)[]

      An array of arguments for the entry function.

    • typeArgs: string[] = []

    Returns Promise<SimpleTransaction>

    A promise that resolves to a SimpleTransaction object.

  • Calls a view method on the Aptos blockchain.

    Type Parameters

    • T extends MoveValue[]

      The type of the return value, which extends an array of MoveValue.

    Parameters

    • functionId: `${string}::${string}::${string}`

      The identifier of the function to call.

    • funcArgs: (EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes)[]

      The arguments to pass to the function.

    • typeArgs: string[] = []

      Optional generic type arguments for the function (e.g. ["0x1::aptos_coin::AptosCoin"]).

    Returns Promise<T>

    • A promise that resolves to the result of the view method call.
  • Removes an admin controlled ecosystem reserve admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Funds an account with a specified amount.

    Parameters

    • account: AccountAddress

      The address of the account to be funded.

    • amount: bigint

      The amount to fund the account with, in bigint.

    Returns Promise<UserTransactionResponse>

    A promise that resolves to a UserTransactionResponse.

  • Retrieves the Aptos balance of a specified account.

    Parameters

    • account: Ed25519Account

      The Ed25519 account object.

    • accountAddress: AccountAddress

      The address of the account to retrieve the balance for.

    • OptionalversionToWaitFor: bigint

      (Optional) The specific version to wait for before retrieving the balance.

    Returns Promise<bigint>

    A promise that resolves to the balance of the account in bigint.

  • Gets the admin controlled ecosystem reserve admin role.

    Returns Promise<string>

    A promise that resolves to the admin controlled ecosystem reserve admin role as a string.

  • Gets the asset listing admin role.

    Returns Promise<string>

    A promise that resolves to the asset listing admin role as a string.

  • Gets the bridge role.

    Returns Promise<string>

    A promise that resolves to the bridge role as a string.

  • Gets the default admin role.

    Returns Promise<string>

    A promise that resolves to the default admin role as a string.

  • Gets the emergency admin role.

    Returns Promise<string>

    A promise that resolves to the emergency admin role as a string.

  • Gets the emissions admin role.

    Returns Promise<string>

    A promise that resolves to the emissions admin role as a string.

  • Retrieves events associated with a specific account.

    Parameters

    • account: AccountAddress

      The address of the account to retrieve events for.

    • limit: number

      The maximum number of events to retrieve.

    Returns Promise<
        {
            account_address: string;
            creation_number: any;
            data: any;
            event_index: any;
            indexed_type: string;
            sequence_number: any;
            transaction_block_height: any;
            transaction_version: any;
            type: string;
        }[],
    >

    A promise that resolves to an array of event objects, each containing:

    • account_address: The address of the account.
    • creation_number: The creation number of the event.
    • data: The data associated with the event.
    • event_index: The index of the event.
    • sequence_number: The sequence number of the event.
    • transaction_block_height: The block height of the transaction.
    • transaction_version: The version of the transaction.
    • type: The type of the event.
    • indexed_type: The indexed type of the event.
  • Gets the flash borrower role.

    Returns Promise<string>

    A promise that resolves to the flash borrower role as a string.

  • Gets the funds admin role.

    Returns Promise<string>

    A promise that resolves to the funds admin role as a string.

  • Gets the pool admin role.

    Returns Promise<string>

    A promise that resolves to the pool admin role as a string.

  • Gets the rewards controller role.

    Returns Promise<string>

    A promise that resolves to the rewards controller admin role as a string.

  • Gets the risk admin role.

    Returns Promise<string>

    A promise that resolves to the risk admin role as a string.

  • Gets the admin role for a specific role.

    Parameters

    • role: string

      The role to get the admin role for.

    Returns Promise<string>

    A promise that resolves to the admin role as a string.

  • Retrieves the events associated with a given transaction hash.

    Parameters

    • txHash: HexInput

      The hash of the transaction to retrieve events for.

    Returns Promise<{ data: unknown }[]>

    A promise that resolves to an array of objects containing the event data.

    This method fetches the transaction details using the provided Aptos provider. It then checks if the transaction response is of type BlockMetadataTransactionResponse or UserTransactionResponse to extract the events. The event data is parsed from JSON and returned in an array.

  • Grants a role to a user.

    Parameters

    • role: string

      The role to grant.

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Checks if a user has a specific role.

    Parameters

    • role: string

      The role to check.

    • user: AccountAddress

      The account address of the user.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating if the user has the role.

  • Checks if a user is an admin controlled ecosystem reserve admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating if the user is an admin controlled ecosystem reserve admin.

  • Checks if a user is an asset listing admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating if the user is an asset listing admin.

  • Checks if a user is a bridge.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating if the user is a bridge.

  • Checks if a user is an emergency admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating if the user is an emergency admin.

  • Checks if a user is an emission admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating if the user is an emission admin.

  • Checks if a user is a flash borrower.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating if the user is a flash borrower.

  • Checks if a user is a funds admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating if the user is a funds admin.

  • Checks if a user is a pool admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating if the user is a pool admin.

  • Checks if a user is a rewards controller admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating if the user is a rewards controller admin.

  • Checks if a user is a risk admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating if the user is a risk admin.

  • Removes an asset listing admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Removes a bridge.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Removes an emergency admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Removes an emissions admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Removes a flash borrower.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Removes a funds admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Removes a pool admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Removes a rewards controller admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Removes a risk admin.

    Parameters

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Renounces a role for a user.

    Parameters

    • role: string

      The role to renounce.

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Revokes a role from a user.

    Parameters

    • role: string

      The role to revoke.

    • user: AccountAddress

      The account address of the user.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.

  • Sends a transaction and awaits the response.

    Parameters

    • functionId: `${string}::${string}::${string}`

      The ID of the Move function to be called.

    • funcArgs: (EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes)[]

      An array of arguments for the entry function.

    • typeArgs: string[] = []

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to the committed transaction response.

  • Sets the admin role for a specific role.

    Parameters

    • role: string

      The role to set the admin role for.

    • adminRole: string

      The admin role to set.

    Returns Promise<CommittedTransactionResponse>

    A promise that resolves to a CommittedTransactionResponse.