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 s
    • 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
  • 💻Developer Resources
    • Smart Escrow Design
      • What does a Smart Escrow "look like"?
      • Roles in Trustless Work
    • Escrow Lifecycle
      • Initiation Phase
      • Funding Phase
      • Complete phase
      • Approval phase
      • Release phase
      • Dispute Resolution
    • Referencia de API
      • Introduction
        • How to Integrate us
      • Deploy
        • Initialize Escrow
      • Autenticación
        • Request Api Key
      • Escrows
        • Schema
        • Fund Escrow
        • Get Escrow by Contract ID
        • Resolve Dispute
        • Change Milestone Status
        • Change Milestone Flag
        • Change Dispute Flag
        • Get Multiple Escrow Balance
        • Distribute Escrow Earnings
      • Helpers
        • Set Trustline
        • Send Transaction
    • Stellar Wallets
      • Freighter Wallet
      • Albedo Wallet
      • xBull Wallet
      • Rabet Wallet
      • Lobstr Wallet
      • Hana Wallet
      • Additional Resources
      • Troubleshooting & FAQs
  • 🫂Community and Roadmap
    • Community
      • Notion for Startups
      • Meru
    • Get Involved
    • 🛣️Roadmap: The Journey Ahead
  • 🎒Historical Context
    • 📜Escrow History:
      • 🗿Ancient to Colonial Era
      • 🏦Banking Era (19th - 20th Century)
      • 💻The Digital Era and Online Escrow
    • ⛓️Blockchain Era: Smart Escrows
  • 📢Appendices
    • Contact and Support
    • Links
      • ⚒️Trustless Work dApp
      • 🌐Trustless Work Website
      • 📣Telegram Chat
      • 💎Only Dust Profile
      • 👩‍💻Swagger for API
      • 📜Github
Powered by GitBook
LogoLogo

Links

  • Website
On this page
  • Headers
  • Body params:

Was this helpful?

Export as PDF
  1. Developer Resources
  2. Referencia de API
  3. Deploy

Initialize Escrow

Deploy the escrow contract and define the escrow properties.

POST deployer/invoke-deployer-contract

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body params:

Name
Type
Description

signer

string

Entity that signs the transaction that deploys and initializes the escrow engagementId: Unique identifier for the escrow

title

string

Name of the escrow

description

string

Text describing the function of the escrow

approver

string

Address of the entity requiring the service

serviceProvider

string

Address of the entity providing the service

platformAddress

string

Address of the platform that owns the escrow

amount

string

Amount to be transferred upon completion of escrow milestones

plataformFee

string

Commission that the platform will receive when the escrow is completed

milestones

Milestones<Array>

Objectives to be completed to define the escrow as completed releaseSigner: Address of the entity in charge of releasing escrow funds

disputeResolver

string

Address in charge of resolving disputes within the escrow

Milestone

Name
Type
Description

description

string

Text describing the function of the milestone

status

string

Milestone status. Ex: Approved, In dispute, etc...

approved_flag

boolean

Flag indicating whether a milestone has been approved by the approver

Example:

{
	signer: "GAD4T6Z63N5NJLQYY3J5MVYFHH5I5UB7NDUUYZD7HHB3RMS6X3H4YK7P", 
	engagementId: "ENG12345",
	title: "Project Title",
	description: "This is a detailed description of the project.",
	approver: "GAHJZHVKFLATA7RVGXSFKXAKT5H4RXJ4LU2UR2W2IDFXOJQ2BR7RHW62",
	serviceProvider: "GDWPCWWH7IXQJHDF7FJUI7VOGD5IT72T7YX55F4BR2H4WXFRBVMBK6A3", 
	platformAddress: "GBC5DVYUBTBSXJ3ZMRPGXDDDLKTALIFGRW73B33AF5EFSZBUECKSFO4R",
	amount: "1000.00",
	platformFee: "50.00", 
	milestones: [
		{ description: "Initial phase of the project", status: "Pending", approved_flag: false },
		{ description: "Completion of design work", status: "Pending", approved_flag: false }
	],
	releaseSigner: "GBDKXCG6FHJMTUBWGAVVOD5PB5QXLYTRJGCH4NR4IMJVPXHHTBBXPY3V",
	disputeResolver: "GDJVCNR5GPOJH7XMOVMHBKZV7V7WQ3B7QK75C76HLOBD4AKHFG5OCARJ"
};

Possible Responses

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

Prices

{
  "status": "FAILED",
  "message": "Amount cannot be zero"
}

Escrow already initialized

{
  "status": "FAILED",
  "message": "Escrow already initialized"
}
{
    "message": "Message",
    "error": "Bad Request",
    "statusCode": 400
}
{
    "statusCode": 429,
    "message": "ThrottlerException: Too Many Requests"
}

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(
      "/deployer/invoke-deployer-contract",
      {
        // 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; 
}
PreviousDeployNextAutenticación

Was this helpful?

💻