Trustless Work
Spanish
Spanish
  • Bienvenido
  • Inicio
    • Guía rápida
    • Conceptos clave
    • Herramientas esenciales
  • ☀️Acerca de Trustless Work
    • Visión y Misión
    • 🛤️Nuestro Camino Hasta Ahora
      • 🤔El Problema: Orígen de Trustless Work
      • 👾El Equipo Se Une
      • 💡La Solución: Escrows
      • 🏆Hitos Clave
        • 🌠DraperU Stellar Astro Hacker House: Un Antes y Un Después
        • Lanzamiento de la API V1 en el Pura Vida ETH Hackathon
      • 🚀Programas Actuales
        • 🌟DraperU Embark Program
        • 💻OD Hack Campaigns
      • 🛠️Desarrollo Vertical
      • 🔮Visión a Futuro
    • Equipo
  • ⚒️Descripción de la Tecnología
    • 🚀Smart Escrow API
    • ⛓️Smart Contracts Open-Source de Escrow
    • 📂Plantillas Open-Source y Herramientas Para Desarrolladores
    • 💵USDC: La Stablecoin Detrás de Trustless Work
    • 🌟Stellar y Soroban: El Motor de Trustless Work
  • 🌍Casos de Uso: Escrow-as-a-Service Para Cualquier Industria
    • 🌎Proyecto Destacado: Kindfi
  • 🤖Tutorial de Trustless Work Dapp
    • Paso 1: Accediendo a la Trustless Work Dapp e Iniciando Sesión
    • Paso 2: Creación de Perfil y Solicitud de Clave API
    • Step 3: Crea un Escrow
    • Step 4: Financiando un Escrow
    • Paso 5: Marcando un Hito Como Completo ✅
    • Paso 6: Aprobando el Hito
    • Paso 7: Liberación del Pago
    • Cómo Obtener Testnet Tokens
  • 💻Recursos Para Desarrolladores
    • Smart Escrow Design
      • ¿Cómo Se Ve un Smart Escrow?
      • Roles En Trustless Work
    • Ciclo de Vida del Escrow
      • Fase de Iniciación
      • Fase de Financiamiento
      • Fase de Completamiento
      • Fase de Aprobación
      • Fase de Liberación
      • Resolución de Disputas
    • Referencia de API
      • Introducción
        • Cómo Integrarnos
      • Implementación (Deploy)
        • Inicia el escrow
      • Autenticación
        • Solicitar una Clave API
      • Escrows
        • Schema
        • Financiar Escrow
        • Obtener Escrow por Contract ID
        • Resolución de Disputas
        • Cambiar el Estado del Hito (Milestone)
        • Cambiar el Flag del Hito (Milestone)
        • Cambiar Flag de Disputa
        • Obtener el Balance de Múltiples Escrows
        • Distribuir Ganancias del Escrow
      • Helpers (Funciones Auxiliares)
        • Establecer Trustline
        • Enviar Transacción
    • Stellar Wallets
      • Freighter Wallet
      • Albedo Wallet
      • xBull Wallet
      • Rabet Wallet
      • Lobstr Wallet
      • Hana Wallet
      • Recursos adicionales
      • Solución de problemas y preguntas frecuentes
  • 🫂Comunidad y Roadmap
    • Comunidad
      • Notion para Startups
      • Meru
    • Involúcrate
    • 🛣️Roadmap: El Camino por Delante
  • 🎒Contexto Histórico
    • 📜Historia de los Escrows:
      • 🗿De la Era Antigua a la Colonial
      • 🏦La Era Bancaria (Siglo XIX - XX)
      • 💻La Era Digital y el Escrow en Línea
    • ⛓️La Era de la Blockchain: Smart Escrows
  • 📢Apéndices
    • Contacto y Soporte
    • Enlaces
      • ⚒️Trustless Work dApp
      • 🌐Trustless Work Website
      • 📣Telegram Chat
      • 💎Only Dust Profile
      • 👩‍💻Swagger for API
      • 📜Github
Powered by GitBook
LogoLogo

Links

  • Website
On this page

Was this helpful?

Export as PDF
  1. Recursos Para Desarrolladores
  2. Referencia de API
  3. Escrows

Resolución de Disputas

Resuelve disputas de escrow distribuyendo fondos al aprobador y al proveedor de servicios según lo determinado por el solucionador de disputas (dispute resolver).

POST escrow/resolving-disputes

Encabezados

Nombre
Valor

Content-Type

application/json

Authorization

Bearer <token>

Cuerpo

Nombre
Tipo
Descripción

string

ID (dirección) que identifica el contrato de escrow.

string

Dirección del solucionador de disputas, quien resuelve disputas en un escrow.

string

Monto a transferir al aprobador para la resolución de disputas.

string

Monto a transferir al proveedor de servicios por la solución de disputas.

Ejemplo de un cuerpo de solicitud (request body):

{
	"contractId": "GC3DJY4LLQYJHEONXFDLQVVRCFZQCPFX7VD33KP4P7QSVZY3SJHQBZGV",
	"disputeResolver": "GBY3PAJY5R3ZIXTYBGFW4URB4RINEXQBC3T4RWDDKJ5TZXQYZUN6A4TP", 
	"approverFunds": "100",
	"serviceProviderFunds": "50"
}

Respuestas posibles

{    
    "status": "SUCCESS",
    "unsignedTransaction": "AAAAAgAAAABfQAm/gS..."  // XDR Hash Transaction
}

Only the dispute resolver

{
  "status": "FAILED"
  "messgae": "Only the dispute resolver can execute this function"
}

Escrow not in dispute

{
  "status": "FAILED"
  "messgae": "Escrow not in dispute"
}

Insufficient approver funds for commissions

{
  "status": "FAILED"
  "messgae": "Insufficient approver funds for commissions"
}

Insufficient service provider funds for commissions

{
  "status": "FAILED"
  "messgae": "Insufficient Service Provider funds for commissions"
}

500

{
  "status": "500"
  "messgae": "An unexpected error occurred"
}
{
    "message": "Message",
    "error": "Bad Request",
    "statusCode": 400
}
{
  "statusCode": 401,
  "message": "Unauthorized",
  "error": "Unauthorized"
}
{
    "statusCode": 429,
    "message": "ThrottlerException: Too Many Requests"
}

¿Qué retorna este endpoint?

Este endpoint retorna la transacción sin firmar, para que pueda ser firmada mediante una billetera del usuario.

Ejemplo de uso (usando axios):

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 useExample = async () => {
    // Get the signer address
    const { address } = await kit.getAddress();

    const response = await http.post(
      "/escrow/resolving-disputes",
      {
        // body requested for the endpoint
      },
    ); 
    
    // Get the unsigned transaction hash
    const { unsignedTransaction } = response.data;

    // Sign the transaction by wallet
    const { signedTxXdr } = await signTransaction(unsignedTransaction, {
      address,
      networkPassphrase: WalletNetwork.TESTNET,
    });

    // Send the transaction to Stellar Network
    const tx = await http.post("/helper/send-transaction", {
      signedXdr: signedTxXdr,
      returnValueIsRequired: true,
    });

    const { data } = tx;

    return data;
}
PreviousObtener Escrow por Contract IDNextCambiar el Estado del Hito (Milestone)

Last updated 1 month ago

Was this helpful?

💻
contractId
disputeResolver
approverFunds
 serviceProviderFunds