A representation of a SmartContract on the blockchain.

Constructors

Properties

Accessors

  • get isExternal(): boolean
  • Returns whether the SmartContract is external.

    Returns boolean

    True if the SmartContract is external, false otherwise.

Methods

  • Returns the Deployer Address of the smart contract.

    Returns undefined | string

    The Deployer Address.

  • Returns the Wallet ID that deployed the smart contract.

    Returns undefined | string

    The Wallet ID.

  • Reloads the SmartContract model with the latest data from the server.

    Returns Promise<void>

    Throws

    if the API request to get a SmartContract fails.

  • Signs the SmartContract deployment with the provided key and returns the hex signature required for broadcasting the SmartContract deployment.

    Parameters

    • key: Wallet

      The key to sign the SmartContract deployment with

    Returns Promise<string>

    The hex-encoded signed payload

  • Returns a string representation of the SmartContract.

    Returns string

    The string representation of the SmartContract.

  • Waits for the SmartContract deployment to be confirmed on the Network or fail on chain. Waits until the SmartContract deployment is completed or failed on-chain by polling at the given interval. Raises an error if the SmartContract deployment takes longer than the given timeout.

    Parameters

    • options: {
          intervalSeconds: undefined | number;
          timeoutSeconds: undefined | number;
      } = {}

      The options to configure the wait function.

      • intervalSeconds: undefined | number

        The interval to check the status of the SmartContract deployment.

      • timeoutSeconds: undefined | number

        The maximum time to wait for the SmartContract deployment to be confirmed.

    Returns Promise<SmartContract>

    The SmartContract object in a terminal state.

    Throws

    if the SmartContract deployment times out.

  • Returns a list of ContractEvents for the provided network, contract, and event details.

    Parameters

    • networkId: string

      The network ID.

    • protocolName: string

      The protocol name.

    • contractAddress: string

      The contract address.

    • contractName: string

      The contract name.

    • eventName: string

      The event name.

    • fromBlockHeight: number

      The start block height.

    • toBlockHeight: number

      The end block height.

    Returns Promise<ContractEvent[]>

    The contract events.