@aptos-labs/ts-sdk - v5.1.4
    Preparing search index...

    Class AbstractKeylessAccountAbstract

    Account implementation for the Keyless authentication scheme. This abstract class is used for standard Keyless Accounts and Federated Keyless Accounts.

    Hierarchy (View Summary)

    Implements

    Index

    Implementation - Account (On-Chain Model)

    accountAddress: AccountAddress

    Account address associated with the account

    aud: string

    The value of the 'aud' claim on the JWT, also known as client ID. This is the identifier for the dApp's OIDC registration with the identity provider.

    ephemeralKeyPair: EphemeralKeyPair

    The EphemeralKeyPair used to generate sign.

    jwt: string

    The JWT token used to derive the account

    pepper: Uint8Array

    A value contains 31 bytes of entropy that preserves privacy of the account. Typically fetched from a pepper provider.

    proof: undefined | ZeroKnowledgeSig

    The zero knowledge signature (if ready) which contains the proof used to validate the EphemeralKeyPair.

    proofOrPromise: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>

    The proof of the EphemeralKeyPair or a promise that provides the proof. This is used to allow for awaiting on fetching the proof.

    The KeylessPublicKey associated with the account

    signingScheme: SigningScheme = SigningScheme.SingleKey

    Signing scheme used to sign transactions

    uidKey: string

    The claim on the JWT to identify a user. This is typically 'sub' or 'email'.

    uidVal: string

    The value of the uidKey claim on the JWT. This intended to be a stable user identifier.

    • Checks if the proof is expired. If so the account must be re-derived with a new EphemeralKeyPair and JWT token.

      Returns boolean

      boolean

    • Verify the given message and signature with the public key. It fetches any on chain state if needed for verification.

      Parameters

      • args: {
            aptosConfig: AptosConfig;
            message: HexInput;
            options?: { throwErrorWithReason?: boolean };
            signature: KeylessSignature;
        }

        The arguments for verifying the signature.

        • aptosConfig: AptosConfig

          The configuration object for connecting to the Aptos network

        • message: HexInput

          Raw message data in HexInput format.

        • Optionaloptions?: { throwErrorWithReason?: boolean }
        • signature: KeylessSignature

          Signed message signature.

      Returns Promise<boolean>

      A boolean indicating whether the signature is valid.

    Implementation - BCS

    • Serializes a Serializable value to its BCS representation. This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.

      Returns Uint8Array

      the BCS representation of the Serializable instance as a byte buffer.

    • Converts the BCS-serialized bytes of a value into a Hex instance. This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.

      Returns Hex

      A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.

    Methods

    • Returns the hex string representation of the Serializable value with the 0x prefix.

      Returns string

      the hex formatas a string prefixed by 0x.

    Properties

    verificationKeyHash?: Uint8Array<ArrayBufferLike>

    The hash of the verification key used to verify the proof. This is optional and can be used to check verifying key rotations which may invalidate the proof.

    PEPPER_LENGTH: number = 31