Update From Tx Hash

This endpoint allows you to change the properties of an escrow as long as a series of requirements are met, which will be mentioned in this section.

Requirements for Use:

  • You must have the valid txHash generated from a transaction sent directly to the Stellar network.

  • The escrow data associated with this txHash must already exist in the internal queue.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Workflow:

  1. The XDR is obtained from any transaction (not signed) generated with any of the endpoints of our REST API.

  2. An unsigned XDR is generated and returned.

  3. The XDR is signed externally and sent directly to Stellar.

  4. The resulting txHash is retrieved.

  5. The txHash is sent to /indexer/update-from-txHash.

  6. The escrow information is retrieved from the internal queue and stored in Firebase.

Open API

put
Body
txHashstringRequired

Transaction hash

Example: b0e61d4...f1cb2d29
Responses
200
Returns the escrow object that was just saved/updated in the indexer and the success or failure of the response.
application/json
put
PUT /indexer/update-from-txhash HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 31

{
  "txHash": "b0e61d4...f1cb2d29"
}
{
  "status": "SUCCESS",
  "message": "Escrow saved successfully / The escrow has been correctly indexed in our database.",
  "savedEscrow": {
    "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...",
      "decimals": 10000000
    },
    "isActive": true,
    "updatedAt": {
      "_seconds": 1750698602,
      "_nanoseconds": 356000000
    },
    "createdAt": {
      "_seconds": 1750698602,
      "_nanoseconds": 356000000
    },
    "balance": 0
  }
}

Use Example:

import axios from "axios";

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

export const updateEscrowFromTxHash = async (txHash) => {
  const response = await http.post("/indexer/update-from-txHash", { txHash });
  return response.data;
};

Last updated

Was this helpful?