Signer implementation for the SingleKey authentication scheme. This class extends a SingleKeyAccount by adding signing capabilities through a valid private key. Currently, the only supported signature schemes are Ed25519 and Secp256k1.

Note: Generating a signer instance does not create the account on-chain.

Implements

Implementation - Account (On-Chain Model)

accountAddress: AccountAddress

Account address associated with the account

privateKey: PrivateKeyInput

Private key associated with the account

publicKey: AnyPublicKey

Public key associated with the account

signingScheme: SingleKey = SigningScheme.SingleKey

Signing scheme used to sign transactions

  • Verify the given message and signature with the account's public key.

    This function checks if the provided signature is valid for the given message using the account's public key.

    Parameters

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

      The arguments for verifying the signature.

      • aptosConfig: AptosConfig
      • message: HexInput

        The raw message data in HexInput format.

      • Optionaloptions?: {
            throwErrorWithReason?: boolean;
        }
        • OptionalthrowErrorWithReason?: boolean
      • signature: Signature

        The signed message signature.

    Returns Promise<boolean>

    A boolean indicating whether the signature is valid for the message.

  • Derives an account from a randomly generated private key based on the specified signing scheme. The default generation scheme is Ed25519, but it can also support Secp256k1Ecdsa.

    Parameters

    Returns SingleKeyAccount

    An account with the generated private key based on the specified signing scheme.

    Error if an unsupported signature scheme is provided.

Methods