@aptos-labs/ts-sdk
Version:
Aptos TypeScript SDK
61 lines • 2.89 kB
TypeScript
import { AccountAddress } from "../core/index.js";
import { AbstractPublicKey, AbstractSignature } from "../core/crypto/abstraction.js";
import { SigningScheme, HexInput, MoveFunctionId } from "../types/index.js";
import { Account } from "./Account.js";
import { AnyRawTransaction } from "../transactions/types.js";
import { AccountAuthenticatorAbstraction } from "../transactions/authenticator/account.js";
import { Ed25519Account } from "./Ed25519Account.js";
type AbstractedAccountConstructorArgs = {
/**
* The account address of the account.
*/
accountAddress: AccountAddress;
/**
* 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;
};
export declare class AbstractedAccount extends Account {
readonly publicKey: AbstractPublicKey;
readonly accountAddress: AccountAddress;
readonly authenticationFunction: MoveFunctionId;
readonly signingScheme = SigningScheme.SingleKey;
constructor({ signer, accountAddress, authenticationFunction }: AbstractedAccountConstructorArgs);
/**
* Creates an `AbstractedAccount` from an `Ed25519Account` that has a permissioned signer function and
* using the `0x1::permissioned_delegation::authenticate` function to verify the signature.
*
* @param signer - The `Ed25519Account` that can be used to sign permissioned transactions.
* @returns The `AbstractedAccount`
*/
static fromPermissionedSigner({ signer, accountAddress, }: {
signer: Ed25519Account;
accountAddress?: AccountAddress;
}): AbstractedAccount;
static generateAccountAbstractionMessage(message: HexInput, functionInfo: string): HexInput;
signWithAuthenticator(message: HexInput): AccountAuthenticatorAbstraction;
signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorAbstraction;
sign: (message: HexInput) => AbstractSignature;
signTransaction(transaction: AnyRawTransaction): AbstractSignature;
/**
* Update the signer function for the account. This can be done after asynchronous operations are complete
* to update the context of the signer function.
*
* @param signer - The new signer function to use for the account.
*/
setSigner(signer: (digest: HexInput) => HexInput): void;
}
export {};
//# sourceMappingURL=AbstractedAccount.d.ts.map