# Deploy

The `Deploy` entity provides a normalized representation of the Casper Network deploy. It is enriched with normalized contract data to make it possible to filter deploys by the contract regardless of the execution type.

## Properties

The `Deploy` entity has the following properties:

| Property                | Type          | Description                                                                                                                                                                                                                                             |
| ----------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `deploy_hash`           | `string(64)`  | Deploy hash represented as a hexadecimal string. Primary deploy identifier.                                                                                                                                                                             |
| `block_hash`            | `string(64)`  | Hash of the block containing the deploy represented as a hexadecimal string.                                                                                                                                                                            |
| `block_height`          | `uint64`      | Height of the block containing the deploy.                                                                                                                                                                                                              |
| `caller_public_key`     | `string(68)`  | Public key of the deploy caller account represented as a hexademical string.                                                                                                                                                                            |
| `execution_type_id`     | `uint8`       | [`DeployExecutionType`](/1.3.x/rest-api/deploy/get-deploy-execution-types.md) unique identifier.                                                                                                                                                        |
| `contract_package_hash` | `string(64)`  | Hash of the contract package called by the deploy represented as a hexadecimal string. `null` if the deploy had no contract call.                                                                                                                       |
| `contract_hash`         | `string(64)`  | Hash of the contract called by the deploy represented as a hexadecimal string. `null` if the deploy had no contract call.                                                                                                                               |
| `entry_point_id`        | `uint32`      | Identifier of the [`ContractEntrypoint`](/1.3.x/rest-api/contract-entry-point.md) called by deploy. `null` if the deploy had no contract call.                                                                                                          |
| `args`                  | `JSON`        | Deploy sessions arguments provided for contract execution.                                                                                                                                                                                              |
| `payment_amount`        | `string`      | Payment amount provided by the caller in motes. The type is string to avoid overflow in languages that don't support `uint64`, which is the correct type. `null` if a custom payment contract was provided to the deploy instead of the value in motes. |
| `cost`                  | `string`      | Deploy execution cost. The type is `string` to avoid overflow in languages that don't support `uint64`, which is the correct type.                                                                                                                      |
| `error_message`         | `string(128)` | Error message in case of a failed deploy. `null` for successful. deploys.                                                                                                                                                                               |
| `status`                | `string`      | Deploy status (`pending`, `expired`, or `processed`).                                                                                                                                                                                                   |
| `timestamp`             | `string`      | Deploy creation timestamp in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.                                                                                                                                                             |

**Example**

```json
{
  "deploy_hash": "88461218a5e972fcda1d764d7cc4edb2e0c3a538123b97890d484f43c55935f5",
  "block_hash": "d76b4ce5281f2306911a0e5e9ac0b29f1f4daf36f4636e78599ce64a7f7528a1",
  "block_height": 2404577,
  "caller_public_key": "020304811a7b142c32860cb1c114f23b0754215918d819f485b0a201af6cde70fa6c",
  "execution_type_id": 6,
  "contract_package_hash": null,
  "contract_hash": null,
  "entry_point_id": null,
  "args": {
    "amount": {
      "cl_type": "U512",
      "parsed": "2500000000"
    },
    "id": {
      "cl_type": {
        "Option": "U64"
      },
      "parsed": null
    },
    "target": {
      "cl_type": {
        "ByteArray": 32
      },
      "parsed": "536345751b7c6c6299d5ef10862d76736ed062bc32c1dabcd1179c06469d93ca"
    }
  },
  "payment_amount": "100000000",
  "cost": "100000000",
  "error_message": null,
  "status": "processed",
  "timestamp": "2024-01-08T15:24:47Z"
}
```

## Optional properties

Depending on the endpoint some of the following optional properties may be included in the `Deploy` entity:

| Property                   | Type                                                                    | Description                                                                                                         |
| -------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `account_info`             | [`AccountInfo`](/1.3.x/rest-api/account-info.md)                        | [Account info](https://github.com/make-software/casper-account-info-contract) provided by the deploy caller account |
| `centralized_account_info` | [`CentralizedAccountInfo`](/1.3.x/rest-api/centralized-account-info.md) | Account information available for known accounts provided by CSPR.cloud team                                        |
| `contract_package`         | [`ContractPackage`](/1.3.x/rest-api/contract-package.md)                | [`ContractPackage`](/1.3.x/rest-api/contract-package.md) called by deploy.                                          |
| `contract`                 | [`Contract`](/1.3.x/rest-api/contract.md)                               | [`Contract`](/1.3.x/rest-api/contract.md) called by deploy.                                                         |
| `contract_entrypoint`      | [`ContractEntrypoint`](/1.3.x/rest-api/contract-entry-point.md)         | [`ContractEntrypoint`](/1.3.x/rest-api/contract-entry-point.md) called by deploy.                                   |
| `rate`                     | `float32`                                                               | CSPR rate for specified currency that was relevant at the moment of deploy creation.                                |

## Relations

The `Deploy` entity has the following relations with other entities:

| Entity                                                                        | Mapping property        | Description                                                                                                                                    |
| ----------------------------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [`Account`](/1.3.x/rest-api/account.md)                                       | `caller_public_key`     | Deploys are called by accounts.                                                                                                                |
| [`Block`](/1.3.x/rest-api/block.md)                                           | `block_hash`            | Deploys are executed in blocks.                                                                                                                |
| [`Contract`](/1.3.x/rest-api/contract.md)                                     | `contract_hash`         | Deploys can call contracts, and contracts are deployed with deploys.                                                                           |
| [`ContractEntrypoint`](/1.3.x/rest-api/contract-package.md)                   | `entry_point`           | Deploys can call entry points.                                                                                                                 |
| [`ContractPackage`](/1.3.x/rest-api/contract-package.md)                      | `contract_package_hash` | Deploys can call contracts in contract packages.                                                                                               |
| [`DeployExecutionType`](/1.3.x/rest-api/deploy/get-deploy-execution-types.md) | `execution_type_id`     | Deploys call contracts via different [execution types](https://docs.casper.network/developers/writing-onchain-code/calling-contracts/).        |
| [`Fungible token action`](/1.3.x/rest-api/fungible-token-action.md)           | `deploy_hash`           | Fungible token actions are result of deploy execution.                                                                                         |
| [`NFT`](/1.3.x/rest-api/non-fungible-token.md)                                |                         | NFTs are created as result of deploy execution. There is no direct mapping, but rather a semantic relationship between deploys and nft tokens. |
| [`NFT Action`](/1.3.x/rest-api/non-fungible-token-action.md)                  | `deploy_hash`           | NFT actions are result of deploy execution.                                                                                                    |
| [`Transfer`](/1.3.x/rest-api/transfer.md)                                     | `deploy_hash`           | Transfers are result of deploy execution.                                                                                                      |

## Endpoints

The `Deploy` entity has the following endpoints:

* [Get deploy](/1.3.x/rest-api/deploy/get-deploy.md)
* [Get deploys](/1.3.x/rest-api/deploy/get-deploys.md)
* [Get account deploys](/1.3.x/rest-api/deploy/get-account-deploys.md)
* [Get block deploys](/1.3.x/rest-api/deploy/get-block-deploys.md)

## Relation endpoints

* [Get deploy execution types](/1.3.x/rest-api/deploy/get-deploy-execution-types.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cspr.cloud/1.3.x/rest-api/deploy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
