A class representing a smart contract deployed on the blockchain.

Type Parameters

  • TAbi extends Abi

Constructors

  • Initializes a new instance of the Contract class.

    Type Parameters

    • TAbi extends Abi

    Parameters

    • address: string

      The address of the contract.

    • abi: Abi

      The Application Binary Interface (ABI) of the contract, which defines the contract's methods and events.

    • contractsModule: ContractsModule
    • Optionalsigner: VeChainSigner

      The signer caller used for signing transactions.

    • OptionaltransactionReceipt: TransactionReceipt

      (Optional) The transaction receipt of the contract deployment.

    Returns Contract<TAbi>

Properties

abi: Abi
address: string
clause: ContractFunctionClause<TAbi, ExtractAbiFunctionNames<TAbi>> = ...
contractsModule: ContractsModule
criteria: ContractFunctionCriteria<TAbi, ExtractAbiEventNames<TAbi>> = ...
deployTransactionReceipt: TransactionReceipt
filters: ContractFunctionFilter<TAbi, ExtractAbiEventNames<TAbi>> = ...
read: ContractFunctionRead<TAbi, ExtractAbiFunctionNames<TAbi, "pure" | "view">> = ...
transact: ContractFunctionTransact<TAbi, ExtractAbiFunctionNames<TAbi, "nonpayable" | "payable">> = ...

Methods

  • Retrieves the event ABI for the specified event name.

    Parameters

    • eventName: string | symbol

      The name of the event.

    Returns ABIEvent<Abi, string>

    The event ABI for the specified event name.

  • Retrieves the function ABI for the specified function name.

    Parameters

    • prop: string | symbol

      The name of the function.

    Returns ABIFunction<Abi, string>

    The function ABI for the specified event name.