@aptos-labs/ts-sdk - v3.1.1
    Preparing search index...

    Class AccountAbstraction

    Index

    Constructors

    Methods

    • Adds a dispatchable authentication function to the account.

      Parameters

      Returns Promise<SimpleTransaction>

      A transaction to add the authentication function to the account.

      const txn = await aptos.abstraction.addAuthenticationFunctionTransaction({
      accountAddress: alice.accountAddress,
      authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
      });

      const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction});
      await aptos.waitForTransaction({ transactionHash: txn.hash });
    • Creates a transaction to disable account abstraction. If an authentication function is provided, it will specify to remove the authentication function.

      Parameters

      Returns Promise<SimpleTransaction>

      A transaction to disable account abstraction for the account.

      const txn = await aptos.abstraction.disableAccountAbstractionTransaction({
      accountAddress: alice.accountAddress,
      authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
      });

      const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });
      await aptos.waitForTransaction({ transactionHash: txn.hash });
    • Gets the dispatchable authentication function for the account.

      Parameters

      Returns Promise<
          | undefined
          | {
              functionName: string;
              moduleAddress: AccountAddress;
              moduleName: string;
          }[],
      >

      The dispatchable authentication function for the account.

      const functionInfos = await aptos.abstraction.getAuthenticationFunction({
      accountAddress: alice.accountAddress,
      });

      if (functionInfos) {
      console.log(`Account ${alice.accountAddress.toString()} is using account abstraction!`);
      } else {
      console.log(`Account ${alice.accountAddress.toString()} is not using account abstraction.`);
      }
    • Will return true if the account is abstracted, otherwise false.

      Parameters

      Returns Promise<boolean>

      Whether the account is abstracted.

      const isAccountAbstractionEnabled = await aptos.abstraction.isAccountAbstractionEnabled({
      accountAddress: alice.accountAddress,
      authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
      });
      if (isAccountAbstractionEnabled) {
      console.log(`Account ${alice.accountAddress.toString()} is using account abstraction!`);
      } else {
      console.log(`Account ${alice.accountAddress.toString()} is not using account abstraction.`);
      }
    • Removes a dispatchable authentication function from the account.

      Parameters

      Returns Promise<SimpleTransaction>

      A transaction to remove the authentication function from the account.

      const txn = await aptos.abstraction.removeAuthenticationFunctionTransaction({
      accountAddress: alice.accountAddress,
      authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
      });

      const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });
      await aptos.waitForTransaction({ transactionHash: txn.hash });

    Properties

    config: AptosConfig
    enableAccountAbstractionTransaction: (
        args: {
            accountAddress: AccountAddressInput;
            authenticationFunction: string;
            options?: InputGenerateTransactionOptions;
        },
    ) => Promise<SimpleTransaction> = ...

    Creates a transaction to enable account abstraction with the given authentication function.

    Type declaration

      • (
            args: {
                accountAddress: AccountAddressInput;
                authenticationFunction: string;
                options?: InputGenerateTransactionOptions;
            },
        ): Promise<SimpleTransaction>
      • Adds a dispatchable authentication function to the account.

        Parameters

        Returns Promise<SimpleTransaction>

        A transaction to add the authentication function to the account.

        const txn = await aptos.abstraction.addAuthenticationFunctionTransaction({
        accountAddress: alice.accountAddress,
        authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
        });

        const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction});
        await aptos.waitForTransaction({ transactionHash: txn.hash });
    const txn = await aptos.abstraction.enableAccountAbstractionTransaction({
    accountAddress: alice.accountAddress,
    authenticationFunction: `{alice.accountAddress}::any_authenticator::authenticate`,
    });

    const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });
    await aptos.waitForTransaction({ transactionHash: txn.hash });

    The account to enable account abstraction for.

    The authentication function info to use.

    The options for the transaction.

    A transaction to enable account abstraction for the account.