Obtener escrows por IDs de contrato

Devuelve toda la información de un depósito de garantía solicitada mediante uno o más IDs de contrato solicitados.

Encabezados

Nombre
Valor

Tipo de contenido

application/json

x-api-key

<token>

Open API

get
Autorizaciones
Parámetros de consulta
contractIdsstring[]Requerido

Array of contract IDs to query

Example: [CB25FW...,CBHEQBV...]
isActivebooleanOpcional

Is the escrow active

validateOnChainbooleanOpcional

When set to true, the endpoint will verify each escrow’s data against the blockchain to ensure accuracy and integrity. Enabling this adds an extra security layer but may increase the response time slightly due to the additional validation step

Respuestas
200

Collection of data containing information from different scans requested by a signatory, role or contract ids.

application/json
get
/helper/get-escrow-by-contract-ids
GET /helper/get-escrow-by-contract-ids?contractIds=[CB25FW...%2CCBHEQBV...] HTTP/1.1
Host: 
Accept: */*
[
  {
    "contractId": "CB25FW....",
    "signer": "GBPUA....",
    "type": "multi-release",
    "engagementId": "ENG-003",
    "title": "Title of the Escrow",
    "description": "Description of the Escrow",
    "milestones": [
      {
        "description": "Initial payment",
        "amount": 2,
        "status": "pending",
        "flags": {
          "disputed": false,
          "released": false,
          "resolved": false,
          "approved": false
        }
      },
      {
        "description": "Final payment",
        "amount": 5,
        "status": "pending",
        "flags": {
          "disputed": false,
          "released": false,
          "resolved": false,
          "approved": false
        }
      }
    ],
    "platformFee": 5,
    "receiverMemo": 0,
    "roles": {
      "approver": "GBPUACN....",
      "serviceProvider": "GA2RRI....",
      "platformAddress": "GBPA2LO....",
      "releaseSigner": "GCPZUO....",
      "disputeResolver": "GDBMRV...",
      "receiver": "GA2RRI...",
      "issuer": "GBPUAC..."
    },
    "trustline": {
      "address": "CBIELT...",
      "name": "USDC"
    },
    "isActive": true,
    "updatedAt": {
      "_seconds": 1750698602,
      "_nanoseconds": 356000000
    },
    "createdAt": {
      "_seconds": 1750698602,
      "_nanoseconds": 356000000
    },
    "balance": 0
  },
  {
    "contractId": "CF35XW....",
    "signer": "GBPUA....",
    "type": "single-release",
    "engagementId": "ENG-003",
    "title": "Title of the Escrow",
    "description": "Description of the Escrow",
    "milestones": [
      {
        "description": "Initial payment",
        "amount": 5,
        "status": "pending",
        "flags": {
          "disputed": false,
          "released": false,
          "resolved": false,
          "approved": false
        }
      },
      {
        "description": "Final payment",
        "amount": 3,
        "status": "pending",
        "flags": {
          "disputed": false,
          "released": false,
          "resolved": false,
          "approved": false
        }
      }
    ],
    "platformFee": 3,
    "receiverMemo": 0,
    "roles": {
      "approver": "GBPUACN....",
      "serviceProvider": "GA2RRI....",
      "platformAddress": "GBPA2LO....",
      "releaseSigner": "GCPZUO....",
      "disputeResolver": "GDBMRV...",
      "receiver": "GA2RRI...",
      "issuer": "GBPUAC..."
    },
    "trustline": {
      "address": "CBIELT...",
      "name": "USDC"
    },
    "isActive": true,
    "updatedAt": {
      "_seconds": 1750698602,
      "_nanoseconds": 356000000
    },
    "createdAt": {
      "_seconds": 1750698602,
      "_nanoseconds": 356000000
    },
    "balance": 3
  }
]

Ejemplo de uso:

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 () => {
  const contractIds = [
    "CCR6HLU3LQMXOESNA6TOS2RZKGEBWQG3EN5FMZNC43RVXZWTTDCZ...",
    "CCA7WTCVCQ5JPKNIFSHPSJLJ3FJ3GKPNEVAIHP6T..."
  ];
  const validateOnChain = true;

  const params = new URLSearchParams();
  contractIds.forEach(id => params.append("contractIds[]", id));
  params.append("signer", signer);
  params.append("validateOnChain", validateOnChain.toString());

  const response = await http.get(`/helper/get-escrow-by-contract-ids?${params.toString()}`);
  return response;
}

Última actualización

¿Te fue útil?