Basic VeChain signer with the private key. This signer can be initialized using a private key.

Hierarchy (view full)

Constructors

Properties

MESSAGE_PREFIX: Uint8Array = ...

The provider attached to this Signer (if any).

Methods

  • Evaluates the //tx// by running it against the current Blockchain state. This cannot change state and has no cost, as it is effectively simulating execution.

    This can be used to have the Blockchain perform computations based on its state (e.g. running a Contract's getters) or to simulate the effect of a transaction before actually performing an operation.

    Parameters

    • transactionToEvaluate: TransactionRequestInput

      The transaction to evaluate

    • Optionalrevision: string

      The block number or block ID of which the transaction simulation is based on

    Returns Promise<string>

    the result of the evaluation

  • Gets the next nonce required for this Signer to send a transaction.

    Parameters

    • OptionalblockTag: string

      The blocktag to base the transaction count on, keep in mind many nodes do not honour this value and silently ignore it [default: "latest"]

      @NOTE: This method generates a random number as nonce. It is because the nonce in VeChain is a 6-byte number.

    Returns Promise<string>

  • Signs an [[link-eip-191]] prefixed a personal message.

    Parameters

    • message: string | Uint8Array

      The message to be signed. If the %%message%% is a string, it is signed as UTF-8 encoded bytes. It is not interpreted as a [[BytesLike]]; so the string "0x1234" is signed as six characters, not two bytes.

    Returns Promise<string>

    • A Promise that resolves to the signature as a string.
  • Signs the [[link-eip-712]] typed data.

    Parameters

    • domain: TypedDataDomain

      The domain parameters used for signing.

    • types: Record<string, TypedDataParameter[]>

      The types used for signing.

    • message: Record<string, unknown>

      The message data to be signed.

    • OptionalprimaryType: string

      The primary type used for signing.

    Returns Promise<string>

    • A promise that resolves with the signature string.