All types below ship with @trustless-work/escrow. Import them from the package root or from @trustless-work/escrow/types.
@trustless-work/escrow
@trustless-work/escrow/types
import type { DeploySingleReleaseEscrowPayload, EscrowSummary, Roles, } from "@trustless-work/escrow";
Three buckets
Entities β on-chain shapes (roles, milestones, escrow).
Payloads β what you send to operate hooks / REST (deploy, fund, release, β¦).
Reads & responses β what Core returns after build, submit, or GET.
Amounts
Operate payloads use human numbers (amount: 1000).
amount: 1000
Read-model fields use decimal strings (balance: "1000", amount: "250").
balance: "1000"
amount: "250"
There is no UUID id / escrowId. Always identify an escrow with contractId (Cβ¦).
id
escrowId
contractId
Cβ¦
Entities β Roles, milestones, SingleReleaseEscrow / MultiReleaseEscrow, trustline
Roles
SingleReleaseEscrow
MultiReleaseEscrow
Payloads β Deploy, update, fund, release, dispute, manage milestones
Reads & responses β EscrowSummary, snapshots, list params, build/send responses
EscrowSummary
Errors β ApiProblemDetails and escrow error codes
ApiProblemDetails
single-release
One payout for the whole escrow after milestones are done
multi-release
Each milestone can be released on its own
active / released / disputed
active
released
disputed
Derived status on list/detail rows
Deploy an escrow
Payloads β DeploySingleReleaseEscrowPayload / DeployMultiReleaseEscrowPayload
DeploySingleReleaseEscrowPayload
DeployMultiReleaseEscrowPayload
Fund / release / dispute
Payloads
Show a list in the UI
Reads & responses β EscrowSummary
Show one escrow
Reads & responses β EscrowDetail
EscrowDetail
Sign & submit
BuildTransactionResponse β wallet β SendTransactionResponse
BuildTransactionResponse
SendTransactionResponse
Handle failures
Errors
Last updated 16 minutes ago
type EscrowType = "single-release" | "multi-release"; type EscrowStatus = "active" | "released" | "disputed"; type EscrowNetwork = string; // network id from Core type baseURL = string; // Core API base URL