Class ContractCallBuilder

Builder for creating Contract Call transactions. Enables calling entry points on deployed smart contracts. Supports multiple addressing modes: by hash, by name, by package hash, and by package name.

Example

const transaction = new ContractCallBuilder()
.from(callerPublicKey)
.byHash(contractHash)
.entryPoint('transfer')
.runtimeArgs(args)
.chainName('casper')
.payment(3_000_000_000)
.build();

Hierarchy

Constructors

Properties

_chainName: string
_contractHash: string
_initiatorAddr: InitiatorAddr
_invocationTarget: TransactionTarget
_pricingMode: PricingMode
_runtimeArgs: Args
_scheduling: TransactionScheduling = ...
_timestamp: Timestamp = ...
_transactionInvocationTarget: TransactionInvocationTarget
_ttl: Duration = ...

Methods

  • Protected

    Creates a default deploy header with the configured transaction settings.

    Returns

    A deploy header with account, chain name, timestamp, TTL, and gas price

    Returns DeployHeader

  • Builds and returns the Contract Call transaction for Casper 1.5. Uses the legacy deploy format for backward compatibility.

    Returns

    A Transaction object compatible with Casper 1.5

    Throws

    If entry point is not specified

    Returns Transaction

  • Sets the contract to call using its package hash and optional version.

    Returns

    The builder instance for method chaining

    Parameters

    • contractHash: string

      The contract package hash in hexadecimal format

    • Optional version: number

      Optional specific version of the contract to call

    • protocolVersionMajor: null | number = null

      Optional protocol version major number

    Returns ContractCallBuilder

  • Sets the contract to call using its package name and optional version.

    Returns

    The builder instance for method chaining

    Parameters

    • name: string

      The package name under which the contract is stored

    • Optional version: number

      Optional specific version of the contract to call

    • protocolVersionMajor: null | number = null

      Optional protocol version major number

    Returns ContractCallBuilder

  • Sets the payment amount for the transaction using a limited payment mode.

    Returns

    The builder instance for method chaining

    Parameters

    • paymentAmount: number

      The payment amount in motes

    • gasPriceTolerance: number = 1

      Gas price tolerance multiplier (default: 1)

    Returns ContractCallBuilder

Generated using TypeDoc