# Desplegar

### Encabezados

<table><thead><tr><th width="366">Nombre</th><th>Valor</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr><tr><td>x-api-key</td><td><code>&#x3C;token></code></td></tr></tbody></table>

### Hito

| Nombre      | Tipo                                 | Descripción                                                       |
| ----------- | ------------------------------------ | ----------------------------------------------------------------- |
| descripción | cadena                               | Texto que describe la función del hito                            |
| estado      | cadena (Valor por defecto: "peding") | Estado del hito. Ej: Aprobado, En disputa, etc...                 |
| aprobado    | booleano (Valor por defecto: false)  | Indicador que señala si un hito ha sido aprobado por el aprobador |

### Roles:

| Nombre               | Tipo   | Descripción                                                                                 |
| -------------------- | ------ | ------------------------------------------------------------------------------------------- |
| aprobador            | cadena | Dirección de la entidad que requiere el servicio.                                           |
| proveedorDeServicios | cadena | Dirección de la entidad que presta el servicio.                                             |
| direccionPlataforma  | cadena | Dirección de la entidad que es dueña del escrow                                             |
| firmaDeLiberacion    | cadena | Dirección del usuario encargado de liberar los fondos del escrow al proveedor del servicio. |
| resolutorDeDisputas  | cadena | Dirección encargada de resolver disputas dentro del escrow.                                 |
| receptor             | cadena | Dirección a la que se enviarán los fondos del escrow                                        |

### Línea de confianza:

| Nombre    | Tipo   | Descripción                                                                         |
| --------- | ------ | ----------------------------------------------------------------------------------- |
| dirección | cadena | Dirección pública que establece permiso para aceptar y usar un token específico.    |
| símbolo   | cadena | Abreviatura oficial que representa el token en carteras, exchanges y documentación. |

### Inicializar Escrow

## POST /deployer/single-release

>

```json
{"openapi":"3.0.0","info":{"title":"Trustless Work API","version":"1.0"},"security":[{}],"paths":{"/deployer/single-release":{"post":{"operationId":"DeployerController_deploySingleReleaseContract","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SingleReleaseContract"}}}},"responses":{"201":{"description":"This endpoint returns an unsigned transaction in XDR format. This XDR is then used to sign the transaction using the “/helper/send-transaction” endpoint.","content":{"application/json":{}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized access"},"429":{"description":"Too Many Requests"},"500":{"description":"Possible errors:\n- Amount cannot be zero\n- Escrow already initialized\n- The platform fee cannot exceed 99%\n- Escrow initialized without milestone\n- Cannot define more than 50 milestones in an escrow\n- All flags (approved, disputed, released) must be false in order to execute this function\n- An unexpected error occurred","content":{"application/json":{}}}},"tags":["Deployer"]}}},"components":{"schemas":{"SingleReleaseContract":{"type":"object","properties":{"signer":{"type":"string","description":"Entity that signs the transaction that deploys and initializes the escrow"},"engagementId":{"type":"string","description":"Unique identifier for the escrow"},"title":{"type":"string","description":"Name of the escrow"},"description":{"type":"string","description":"Text describing the function of the escrow"},"roles":{"description":"Roles that make up the escrow structure","type":"array","items":{"type":"object"}},"amount":{"type":"number","description":"Amount to be transferred upon completion of escrow milestones"},"platformFee":{"type":"number","description":"Commission that the platform will receive when the escrow is completed"},"milestones":{"description":"Objectives to be completed to define the escrow as completed. (In this case it is not necessary to send the properties “approvedFlag” and “status” inside the objects of these milestones)","type":"array","items":{"type":"object"}},"trustline":{"description":"Information on the trustline that will manage the movement of funds in escrow","type":"array","items":{"type":"object"}}},"required":["signer","engagementId","title","description","roles","amount","platformFee","milestones","trustline"]}}}}
```

<figure><img src="/files/8951b85941f4980a7fc229214064a9d599cddd56" alt=""><figcaption></figcaption></figure>

### **¿Qué devuelve este Endpoint?**

Este endpoint devuelve la transacción sin firmar para que la transacción pueda ser firmada por medio de la cartera del cliente.

### Ejemplo de uso:

<pre class="language-typescript"><code class="lang-typescript">import axios from "axios";

const http = axios.create({
  baseURL: "https://dev.api.trustlesswork.com",
  timeout: 10000,
  headers: {
    "Content-Type": "application/json",
    "x-api-key": tu_api_key,
  },
});

export const useExample = async () => {
    // Obtener la dirección del firmante
    const { address } = await kit.getAddress();

    // Ejecutar el endpoint
<strong>    const response = await http.post(
</strong>      "/deployer/single-release",
      {
        // cuerpo solicitado para el endpoint
      },
    );
    
    // Obtener el hash de la transacción sin firmar
    const { unsignedTransaction } = response.data;

    // Firmar la transacción con la cartera
    const { signedTxXdr } = await signTransaction(unsignedTransaction, {
      address,
      networkPassphrase: WalletNetwork.TESTNET,
    });

    // Enviar la transacción a la Red Stellar
    const tx = await http.post("/helper/send-transaction", {
      signedXdr: signedTxXdr,
    });

    const { data } = tx;

    return data; 
}
</code></pre>


---

# 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.trustlesswork.com/trustless-work/v1-es/api-rest/deploy/initialize-escrow.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.
