Contestar Caução
Responsável por iniciar uma disputa em uma caução. Muda o valor da flag “disputed” de “disputed” para true.
Cabeçalhos
Nome
Valor
Content-Type
application/json
x-api-key
<token>
Open API
post
Autorizações
Corpo
contractIdstringObrigatórioExample:
ID (address) that identifies the escrow contract
CAZ6UQX7...signerstringObrigatórioExample:
Entity that signs the transaction that deploys and initializes the escrow
GSIGN...XYZRespostas
201
This endpoint returns an unsigned transaction in XDR format. This XDR is then used to sign the transaction using the “/helper/send-transaction” endpoint.
application/json
400
Bad request
401
Unauthorized access
429
Too Many Requests
500
Possible errors:
- Escrow not found
- Escrow already in dispute
- You are not authorized to change the dispute flag
- The dispute resolver cannot dispute the escrow
- An unexpected error occurred
application/json
post
/escrow/single-release/dispute-escrowPOST /escrow/single-release/dispute-escrow HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 62
{
"contractId": "CAZ6UQX7...",
"signer": "GAPPROVER1234567890..."
}{
"status": "SUCCESS",
"unsignedTransaction": "AAAAAgAAAAAtWsgedQ...."
}
O que este Endpoint retorna?
Este endpoint retorna a transação não assinada para que a transação possa ser assinada por meio da carteira do cliente.
Exemplo 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 () => {
// Obter o endereço do signatário
const { address } = await kit.getAddress();
// Execute o endpoint
const response = await http.post(
"/escrow/single-release/dispute-escrow",
{
// corpo solicitado para o endpoint
},
);
// Obter o hash da transação não assinada
const { unsignedTransaction } = response.data;
// Assinar a transação pelo wallet
const { signedTxXdr } = await signTransaction(unsignedTransaction, {
address,
networkPassphrase: WalletNetwork.TESTNET,
});
// Enviar a transação para a Rede Stellar
const tx = await http.post("/helper/send-transaction", {
signedXdr: signedTxXdr,
});
const { data } = tx;
return data;
}Atualizado
Isto foi útil?