@aptos-labs/ts-sdk
Version:
Aptos TypeScript SDK
51 lines • 2.24 kB
TypeScript
import { AccountAuthenticatorAbstraction } from "../transactions/authenticator/account.js";
import { HexInput, MoveFunctionId } from "../types/index.js";
import { AbstractedAccount } from "./AbstractedAccount.js";
type DerivableAbstractedAccountArgs = {
/**
* The signer function signs transactions and returns the `authenticator` bytes in the `AbstractionAuthData`.
*
* @param digest - The SHA256 hash of the transaction signing message
* @returns The `authenticator` bytes that can be used to verify the signature.
*/
signer: (digest: HexInput) => Uint8Array;
/**
* The authentication function that will be used to verify the signature.
*
* @example
* ```ts
* const authenticationFunction = `${accountAddress}::permissioned_delegation::authenticate`;
* ```
*/
authenticationFunction: MoveFunctionId;
/**
* The abstract public key that is used to identify the account.
* Depends on the use cases, most of the time it is the public key of the source wallet
*/
abstractPublicKey: Uint8Array;
};
export declare class DerivableAbstractedAccount extends AbstractedAccount {
/**
* The abstract public key that is used to identify the account.
* Depends on the use cases, most of the time it is the public key of the source wallet
*/
readonly abstractPublicKey: Uint8Array;
/**
* The domain separator used to calculate the DAA account address.
*/
static readonly ADDRESS_DOMAIN_SEPERATOR: number;
constructor({ signer, authenticationFunction, abstractPublicKey }: DerivableAbstractedAccountArgs);
/**
* Compute the account address of the DAA
* The DAA account address is computed by hashing the function info and the account identity
* and appending the domain separator (5)
*
* @param functionInfo - The authentication function
* @param accountIdentifier - The account identity
* @returns The account address
*/
static computeAccountAddress(functionInfo: string, accountIdentifier: Uint8Array): Uint8Array;
signWithAuthenticator(message: HexInput): AccountAuthenticatorAbstraction;
}
export {};
//# sourceMappingURL=DerivableAbstractedAccount.d.ts.map