Actualizar desde Tx Hash
Este endpoint te permite cambiar las propiedades de un escrow siempre que se cumpla una serie de requisitos, que se mencionarán en esta sección.
Requisitos de uso:
Debe tener el
txHashgenerado a partir de una transacción enviada directamente a la red Stellar.Los datos de escrow asociados con este
txHashya deben existir en la cola interna.
Encabezados
Content-Type
application/json
x-api-key
<token>
Flujo de trabajo:
El XDR se obtiene de cualquier transacción (no firmada) generada con cualquiera de los endpoints de nuestra API REST.
Se genera y devuelve un XDR no firmado.
El XDR se firma externamente y se envía directamente a Stellar.
Se recupera el
txHashresultante.El
txHashse envía a/indexer/update-from-txHash.La información de escrow se recupera de la cola interna y se almacena en Firebase.
Open API
Transaction hash
b0e61d4...f1cb2d29Returns the escrow object that was just saved/updated in the indexer and the success or failure of the response.
Bad request
Unauthorized access
Too Many Requests
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...",
"name": "USDC"
},
"isActive": true,
"updatedAt": {
"_seconds": 1750698602,
"_nanoseconds": 356000000
},
"createdAt": {
"_seconds": 1750698602,
"_nanoseconds": 356000000
},
"balance": 0
}
}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": tu_api_key,
},
});
export const updateEscrowFromTxHash = async (txHash) => {
const response = await http.post("/indexer/update-from-txHash", { txHash });
return response.data;
};Última actualización
¿Te fue útil?