This class represent a transaction clause.

Implements

Constructors

  • Creates an instance of the class.

    Parameters

    • to: string

      The address to transfer token or the smart contract to call, can be null.

    • value: string

      The token amount being transferred in wei units as hexadecimal expression.

    • data: string

      Arguments of the smart contract function called as encoded as a hexadecimal expression

    • Optionalcomment: string

      An optional comment.

    • Optionalabi: string

      An optional ABI string.

    Returns Clause

Properties

abi?: string

An optional Application Binary Interface (ABI) of the called function of a smart contract.

comment?: string

An optional comment to describe the purpose of the clause.

data: string

Return the hexadecimal expression of the encoding of the arguments of the called function of a smart contract.

to: string

Represents the address where:

  • transfer token to, or
  • invoke contract method on.
value: string

Return the hexadecimal expression of the amount of VET or VTHO token in Units.wei to transfer to the destination.

NO_VALUE: string = ...

Used publicly to tag a transaction not tranferring token amount.

Methods

  • Return a new clause to call a function of a smart contract.

    Parameters

    • contractAddress: Address

      The address of the smart contract.

    • functionAbi: ABIFunction<Abi, string>

      The ABI definition of the function to be called.

    • args: unknown[]

      The arguments for the function.

    • Optionalamount: VET = ...

      The amount of VET to be sent with the transaction calling the function.

    • OptionalclauseOptions: ClauseOptions

      Optional clause settings.

    Returns Clause

    A clause object to call the function in a transaction.

    Throws an error if the amount is not a finite positive value.

  • Returns a new clause to deploy a smart contract.

    Parameters

    • contractBytecode: HexUInt

      The bytecode of the contract to be deployed.

    • OptionaldeployParams: DeployParams

      Optional parameters to pass to the smart contract constructor.

    • OptionalclauseOptions: ClauseOptions

      Optional clause settings.

    Returns Clause

    The clause to deploy the smart contract as part of a transaction.

  • Transfers an NFT from the sender to the recipient.

    Parameters

    • contractAddress: Address

      The address of the NFT contract.

    • senderAddress: Address

      The address of the current owner (sender) of the NFT.

    • recipientAddress: Address

      The address of the new owner (recipient) of the NFT.

    • tokenId: HexUInt

      The unique identifier of the NFT to be transferred.

    • OptionalclauseOptions: ClauseOptions

      Optional clause settings.

    Returns Clause

    The clause object representing the transfer operation as part of a transaction.

  • Return a new clause to transfer a generic VIP180/ERC20 Token

    Parameters

    • recipientAddress: Address

      The address of the recipient.

    • token: Token

    Returns Clause

    The clause to transfer tokens as part of a transaction.

    Throws an error if the amount is not a positive integer.

  • Return a new clause to transfers VET to a specified recipient address.

    Parameters

    • recipientAddress: Address

      The address of the recipient.

    • amount: VET

      The amount of VET to transfer.

    • OptionalclauseOptions: ClauseOptions

      Optional clause settings.

    Returns Clause

    • The clause object to transfer VET as part of a transaction.
    • If the amount is not a finite positive value.

    VET.transferTo

  • Return a new clause to transfers the specified amount of VTHO

    Parameters

    • recipientAddress: Address

      The address of the recipient.

    • amount: VTHO

      The amount of token to be transferred.

    Returns Clause

    The clause to transfer VIP180 tokens as part of a transaction.

    Throws an error if the amount is not a positive integer.

    VTHO.transferTokenTo