# Transfer

The `Transfer` entity represents a successful native token (CSPR) transfer on the Casper network. Transfers are tracked from the [`WriteTransfer`](https://docs.casper.network/developers/json-rpc/types_chain/#transform) transforms found in the deploy execution results.

## Properties

The `Transfer` entity has the following properties:

| Property                 | Type         | Description                                                                                                                                 |
| ------------------------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                     | `uint64`     | Transfer identifier provided by the deploy caller if the deploy is a native transfer. Default is `0`.                                       |
| `deploy_hash`            | `string(64)` | Deploy hash represented as a hexadecimal string                                                                                             |
| `block_height`           | `uint64`     | Height of the block in which the transfer happened                                                                                          |
| `transform_key`          | `string(64)` | [`WriteTransfer`](https://docs.casper.network/developers/json-rpc/types_chain/#transform) transform key represented as a hexademical string |
| `transfer_index`         | `uint64`     | Transfer order within the deploy                                                                                                            |
| `initiator_account_hash` | `string(64)` | Deploy caller account hash represented as a hexadecimal string                                                                              |
| `from_purse`             | `string(73)` | Source purse URef in the `uref-dead...beef-007` format                                                                                      |
| `to_purse`               | `string(73)` | Target purse URef in the `uref-dead...beef-007` format                                                                                      |
| `to_account_hash`        | `string(64)` | Transfer recipient account hash represetnted as a hexadecimal string                                                                        |
| `amount`                 | `string`     | Transfer amount in motes. The type is `string` to avoid overflow in languages that don't support uint64, which is the correct type.         |
| `timestamp`              | `string`     | Deploy creation timestmap in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format                                                  |

**Example**

```json
{
  "amount": "999900000000",
  "deploy_hash": "00002856709bb267fefac532afa41fdb7b66af0521b344dd218f0386b725bcfc",
  "block_height": 2404577,
  "from_purse": "uref-1fba1ec9ab80f4df6d4dd2b9963fc0e8bcd3e3ae2479bd89133213398f463f8b-007",
  "id": 1674228372106,
  "initiator_account_hash": "d1e7f6267837c30c7e3356f049836b5db71ab10f023ddb00e6ab0bd960bf7e4d",
  "timestamp": "2023-01-20T15:26:34Z",
  "to_account_hash": "11f03518b71ba8ac0e6087d1a2b0a82a97de66f640ae77e661ce80e365196a24",
  "to_purse": "uref-6ccb3f9c96957eae5c0f2d4d1106926bcf5ab5a2690a3f07da9603d8236e3e26-004",
  "transform_key": "ab152ea01deca92473828fff439d6b8498397a7cceaff059e12d2aa2fe3f5ce5",
  "transfer_index": 1
}
```

## Optional properties

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

| Property                              | Type                                                              | Description                                                                                                                                            |
| ------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `initiator_public_key`                | `string(68)`                                                      | Initiator public key represented as a hexademical string                                                                                               |
| `to_public_key`                       | `string(68)`                                                      | Transfer recipient public key represented as a hexademical string                                                                                      |
| `from_purse_public_key`               | `string(68)`                                                      | Public key of the account that owns the transfer source purse represented as a hexademical string. null when the sender purse is not own by an account |
| `to_purse_public_key`                 | `string(68)`                                                      | Public key of the account that owns the transfer target purse represented as a hexademical string. null when the target purse is not own by an account |
| `to_account_info`                     | [`AccountInfo`](/rest-api/account-info.md)                        | Transfer recipient account info                                                                                                                        |
| `to_centralized_account_info`         | [`CentralizedAccountInfo`](/rest-api/centralized-account-info.md) | Transfer recipient centralized account info                                                                                                            |
| `from_purse_account_info`             | [`AccountInfo`](/rest-api/account-info.md)                        | Account info of the account that owns the transfer source purse. null when the sender purse is not own by an account                                   |
| `from_purse_centralized_account_info` | [`CentralizedAccountInfo`](/rest-api/centralized-account-info.md) | Centralized account info that owns the transfer source purse. null when the sender purse is not own by an account                                      |
| `to_purse_account_info`               | [`AccountInfo`](/rest-api/account-info.md)                        | Account info of the account that owns the transfer target purse. null when the target purse is not own by an account                                   |
| `to_purse_centralized_account_info`   | [`CentralizedAccountInfo`](/rest-api/centralized-account-info.md) | Centralized account info of the account that owns the transfer target purse. null when the target purse is not own by an account                       |
| `initiator_public_key`                | `string(68)`                                                      | Deploy caller public key represented as a hexadecimal string                                                                                           |
| `rate`                                | `float32`                                                         | CSPR rate for specified currency that was relevant at the moment of deploy creation                                                                    |
| `initiator_cspr_name`                 | `string`                                                          | Primary CSPR.name of the initiator account                                                                                                             |
| `to_cspr_name`                        | `string`                                                          | Primary CSPR.name of the recipient account                                                                                                             |
| `from_purse_cspr_name`                | `string`                                                          | Primary CSPR.name of the account that owns the transfer source purse                                                                                   |
| `to_purse_cspr_name`                  | `string`                                                          | Primary CSPR.name of the account that owns the transfer target purse                                                                                   |

## Relations

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

| Entity                             | Mapping property                            | Description                               |
| ---------------------------------- | ------------------------------------------- | ----------------------------------------- |
| [`Account`](/rest-api/account.md)  | `initiator_account_hash`, `to_account_hash` | Accounts can send and receive transfers   |
| [`Purse`](/rest-api/purse-uref.md) | `from_purse`, `to_purse`                    | Purses can send and receive transfers     |
| [`Deploy`](/rest-api/deploy.md)    | `deploy_hash`                               | Transfers are results of deploy execution |

## Endpoints

The `Transfer` entity has the following endpoints:

* [Get deploy transfers](/rest-api/transfer/get-deploy-transfers.md)
* [Get account transfers](/rest-api/transfer/get-account-transfers.md)
* [Get purse transfers](/rest-api/transfer/get-purse-uref-transfers.md)

## Relation endpoints

None


---

# 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/rest-api/transfer.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.
