Resolver disputa de hito
Resuelve disputas de hitos de escrow distribuyendo los fondos al approver y al proveedor de servicios según lo determine el resolvedor de disputas.
Encabezados
Content-Type
application/json
x-api-key
<token>
API Abierta
ID (address) that identifies the escrow contract
CAZ6UQX7...Address of the user defined to resolve disputes in an escrow
GDISPUTE...XYZPosition that identifies the milestone within the group of milestones in the escrow
1This endpoint returns an unsigned transaction in XDR format. This XDR is then used to sign the transaction using the “/helper/send-transaction” endpoint.
Bad request
Unauthorized access
Too Many Requests
Possible errors:
- Escrow not found
- Invalid milestone index
- None of the amounts to be transferred should be less or equal than 0
- Only the dispute resolver can execute this function
- This milestone is already released
- This milestone is already resolved
- Milestone not in dispute
- The total funds to resolve the dispute must not exceed the amount defined for this milestone
- Insufficient funds for resolution
- The total amount to be transferred cannot be zero
- An unexpected error occurred
POST /escrow/multi-release/resolve-milestone-dispute HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 210
{
"contractId": "CAZ6UQX7...",
"disputeResolver": "GAPPROVER1234567890...",
"milestoneIndex": "1",
"distributions": [
{
"address": "GAPPROVER1234567890...",
"amount": 300
},
{
"address": "GRECEIVER1234567890...",
"amount": 700
}
]
}{
"status": "SUCCESS",
"unsignedTransaction": "AAAAAgAAAAAtWsgedQ...."
}
¿Qué devuelve este endpoint?
Este endpoint devuelve la transacción sin firmar para que la transacción pueda ser firmada por medio de la billetera del cliente.
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 () => {
// Obtener la dirección del firmante
const { address } = await kit.getAddress();
const response = await http.post(
"/escrow/multi-release/resolve-milestone-dispute",
{
// cuerpo solicitado para el endpoint
},
);
// Obtener el hash de la transacción sin firmar
const { unsignedTransaction } = response.data;
// Firmar la transacción con la billetera
const { signedTxXdr } = await signTransaction(unsignedTransaction, {
address,
networkPassphrase: WalletNetwork.TESTNET,
});
// Enviar la transacción a la Red Stellar
const tx = await http.post("/helper/send-transaction", {
signedXdr: signedTxXdr,
});
const { data } = tx;
return data;
}Última actualización
¿Te fue útil?