# Implantar

### Cabeçalhos

<table><thead><tr><th width="366">Nome</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>

### Marco

| Nome         | Tipo                            | Descrição                                               |
| ------------ | ------------------------------- | ------------------------------------------------------- |
| descrição    | string                          | Texto descrevendo a função do marco                     |
| status       | string (Valor padrão: "peding") | Status do marco. Ex: Aprovado, Em disputa, etc...       |
| aprovado     | booleano (Valor padrão: false)  | Flag indicando se um marco foi aprovado pelo aprovador  |
| quantia      | string                          | Valor do marco                                          |
| destinatário | string                          | Endereço para onde os recursos do escrow serão enviados |

### Papéis:

| Nome                 | Tipo   | Descrição                                                                                |
| -------------------- | ------ | ---------------------------------------------------------------------------------------- |
| aprovador            | string | Endereço da entidade que requer o serviço.                                               |
| prestadorDeServiço   | string | Endereço da entidade que fornece o serviço.                                              |
| endereçoDaPlataforma | string | Endereço da entidade que possui o escrow                                                 |
| assinanteDeLiberação | string | Endereço do usuário responsável por liberar os fundos do escrow ao prestador de serviço. |
| resolvedorDeDisputas | string | Endereço responsável por resolver disputas dentro do escrow.                             |

### Trustline:

| Nome     | Tipo   | Descrição                                                                          |
| -------- | ------ | ---------------------------------------------------------------------------------- |
| endereço | string | Endereço público que estabelece permissão para aceitar e usar um token específico. |
| símbolo  | string | Abreviação oficial que representa o token em carteiras, exchanges e documentação.  |

### Inicializar Escrow

## POST /deployer/multi-release

>

```json
{"openapi":"3.0.0","info":{"title":"Trustless Work API","version":"1.0"},"security":[{}],"paths":{"/deployer/multi-release":{"post":{"operationId":"DeployerController_deployMultiReleaseContract","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiReleaseContract"}}}},"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- 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- Amount cannot be zero\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":{"MultiReleaseContract":{"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"}},"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","platformFee","milestones","trustline"]}}}}
```

<figure><img src="/files/0925a3cc21ffa485e672e13276e76ba7b214ea31" alt=""><figcaption></figcaption></figure>

### **O que este endpoint retorna?**

Este endpoint retorna a transação não assinada para que a transação possa ser assinada por meio da carteira do cliente.

### Exemplo 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": your_api_key,
  },
});

export const useExample = async () => {
    // Obter o endereço do assinante
    const { address } = await kit.getAddress();

    // Executar o endpoint
<strong>    const response = await http.post(
</strong>      "/deployer/multi-release",
      {
        // corpo requisitado para o endpoint
      },
    );
    
    // Obter o hash da transação não assinada
    const { unsignedTransaction } = response.data;

    // Assinar a transação pela carteira
    const { signedTxXdr } = await signTransaction(unsignedTransaction, {
      address,
      networkPassphrase: WalletNetwork.TESTNET,
    });

    // Enviar a transação para a Rede 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-pt/api-rest/deploy-1/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.
