Function personalSign

  • Create an Ethereum-specific signature for a message.

    This function is equivalent to the eth_sign Ethereum JSON-RPC method as specified in EIP-1417, as well as the MetaMask's personal_sign method.

    Parameters

    • options: {
          data: ToBufferInputTypes;
          privateKey: Buffer;
      }

      The personal sign options.

      • data: ToBufferInputTypes

        The hex data to sign.

      • privateKey: Buffer

        The key to sign with.

    Returns string

    The '0x'-prefixed hex encoded signature.