{
"contractId": "GC3DJY4LLQYJHEONXFDLQVVRCFZQCPFX7VD33KP4P7QSVZY3SJHQBZGV",
"signer": "GBY3PAJY5R3ZIXTYBGFW4URB4RINEXQBC3T4RWDDKJ5TZXQYZUN6A4TP",
}
{
"status": "SUCCESS",
"unsignedTransaction": "AAAAAgAAAABfQAm/gS..." // XDR Hash Transaction
}
Not found
{
"status": "FAILED"
"message": "Escrow not found"
}
Escrow already in dispute
{
"status": "FAILED"
"message": "Escrow already in dispute"
}
{
"message": "Message",
"error": "Bad Request",
"statusCode": 400
}
{
"statusCode": 401,
"message": "Unauthorized",
"error": "Unauthorized"
}
{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}
This endpoint returns the transaction unsigned so that the transaction can be signed by means of a customer wallet.
Use example (Using 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();
// Execute the endpoint
const response = await http.post(
"/escrow/change-dispute-flag",
{
// 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,
});
const { data } = tx;
return data;
}