The account to add the authentication function to.
The authentication function info to add.
Optional
options?: InputGenerateTransactionOptionsThe options for the transaction.
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.
The account to disable account abstraction for.
Optional
authenticationThe authentication function info to remove.
Optional
options?: InputGenerateTransactionOptionsThe options for the transaction.
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.
The account to get the dispatchable authentication function for.
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.
The account to check.
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.
The account to remove the authentication function from.
The authentication function info to remove.
Optional
options?: InputGenerateTransactionOptionsThe options for the transaction.
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 });
Removes a dispatchable authenticator from the account.
The account to remove the authenticator from.
Optional
options?: InputGenerateTransactionOptionsThe options for the transaction.
A transaction to remove the authenticator from the account.
Readonly
configCreates a transaction to enable account abstraction with the given authentication function.
Adds a dispatchable authentication function to the account.
The account to add the authentication function to.
The authentication function info to add.
Optional
options?: InputGenerateTransactionOptionsThe options for the transaction.
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 });
Adds a dispatchable authentication function to the account.