Dfns TypeScript SDK - v0.7.14
    Preparing search index...

    Hierarchy

    • VeChainAbstractSigner
      • DfnsWallet
    Index

    Properties

    address: string
    MESSAGE_PREFIX: Uint8Array<ArrayBufferLike>
    provider?: AvailableVeChainProviders

    The provider attached to this Signer (if any).

    walletId: string

    Methods

    • Build the transaction clauses form a transaction given as input

      Parameters

      • transaction: TransactionRequestInput

        The transaction to sign

      Returns TransactionClause[]

      The transaction clauses

    • 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: Revision

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

      Returns Promise<string>

      the result of the evaluation

    • Returns a new instance of this Signer connected to //provider// or detached from any Provider if undefined.

      Parameters

      • provider: AvailableVeChainProviders

        The provider to connect to

      Returns this

      a new instance of this Signer connected to //provider// or detached

    • Estimates the gas required to execute //tx// on the Blockchain. This will be the expected amount a transaction will need to successfully run all the necessary computations and store the changed state that the transaction intends.

      Parameters

      • transactionToEstimate: TransactionRequestInput

        The transaction to estimate gas for

      Returns Promise<number>

      the total estimated gas required

    • Get the address of the Signer.

      Returns Promise<string>

      the address of the signer

    • 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>

    • Prepares a TransactionRequestInput for calling:

      • resolves to and from addresses
      • if from is specified, check that it matches this Signer

      @note: Here the base support of multi-clause transaction is added. So, if clauses are provided in the transaction, it will be used as it is. Otherwise, standard transaction will be prepared.

      Parameters

      • transactionToPopulate: TransactionRequestInput

        The call to prepare

      Returns Promise<TransactionRequestInput>

      the prepared call transaction

    • Prepares a TransactionRequestInput for sending to the network by populating any missing properties:

      • resolves to and from addresses
      • if from is specified , check that it matches this Signer
      • populates nonce via signer.getNonce("pending")
      • populates gas parameters via signer.estimateGas(tx)
      • ... and other necessary properties

      Parameters

      • transactionToPopulate: TransactionRequestInput

        The call to prepare

      Returns Promise<TransactionBody>

      the prepared transaction

    • Use vet.domains to resolve name to address

      Parameters

      • vnsName: string

        The name to resolve

      Returns Promise<null | string>

      the address for a name or null

    • Sends %%transactionToSend%% to the Network. The signer.populateTransaction(transactionToSend) is called first to ensure all necessary properties for the transaction to be valid have been populated first.

      Parameters

      • transactionToSend: TransactionRequestInput

        The transaction to send

      Returns Promise<string>

      The transaction response

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

      Parameters

      • message: string | Uint8Array<ArrayBufferLike>

        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 a bytes payload returning the VeChain signature in hexadecimal format.

      Parameters

      • payload: Uint8Array

        in bytes to sign.

      Returns Promise<string>

      The VeChain signature in hexadecimal format.

    • Signs %%transactionToSign%%, returning the fully signed transaction. This does not populate any additional properties with eth_getTransactionCount: RPC_METHODS, p0: (string | undefined)[], args: EIP1193RequestArguments*

      Parameters

      • transactionToSign: TransactionRequestInput

        The transaction to sign

      Returns Promise<string>

      The fully signed transaction

    • 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.