nxt.addons

## Class BlockContext

- java.lang.Object
- - nxt.addons.AbstractContractContext
  - - nxt.addons.BlockContext

-     public class BlockContext
      extends AbstractContractContext

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class nxt.addons.AbstractContractContext

      `AbstractContractContext.EventSource`

  - ### Field Summary

    - ### Fields inherited from class nxt.addons.AbstractContractContext

      `chainById, chainByName, config, contractName, FEE_CANNOT_CALCULATE, FEE_EXCEEDS_AMOUNT, INTERNAL_ERROR_CODE_THRESHOLD, MESSAGE_TO_ENCRYPT_WITHOUT_SECRET_PHRASE, source, VALIDATE_SAME_ACCOUNT_CODE, VALIDATE_SAME_CHAIN, VALIDATE_SAME_TRANSACTION_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BlockContext(Block block, ContractRunnerConfig config, java.lang.String contractName)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BlockResponse` | `getBlock()` Returns the block in which this transaction is stored
    `int` | `getHeight()` Returns the height of the block which triggered the contract
    `protected java.lang.String` | `getReferencedTransaction()`

    - ### Methods inherited from class nxt.addons.AbstractContractContext

      `addTriggerData, createTransaction, createTransaction, fullHashToId, fullHashToId, generateErrorResponse, generateInfoResponse, generateInternalErrorResponse, generateResponse, getAccount, getAccountRs, getBlockchainConstants, getBlockchainHeight, getChain, getChain, getConfig, getContext, getContractName, getContractRunnerConfigParams, getContractSetupParameters, getHash, getHash, getParams, getParentChain, getPhasingAttachment, getPublicKey, getPublicKey, getPublicKeyHexString, getRandomnessSource, getResponse, getRuntimeParams, getSource, initRandom, isPermissionGranted, loadContract, logErrorMessage, logInfoMessage, parseAccountId, parseHexString, publicKeyToAccountId, publicKeyToAccountId, rsAccount, setContractSetupParameters, sign, toHexString, verify`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BlockContext

          public BlockContext(Block block,
                              ContractRunnerConfig config,
                              java.lang.String contractName)

  - ### Method Detail

    - #### getBlock

          public BlockResponse getBlock()

      Returns the block in which this transaction is stored
      Specified by:
        `getBlock` in class `AbstractContractContext`
      Returns:
        the block response

    - #### getHeight

          public int getHeight()

      Returns the height of the block which triggered the contract
      Returns:
        the block height

    - #### getReferencedTransaction

          protected java.lang.String getReferencedTransaction()

      Specified by:
        `getReferencedTransaction` in class `AbstractContractContext`