EscrowManager gives you a typed API for every operation on a deployed MilestoneEscrow contract. The payer funds individual milestones, the payee marks them delivered, and the payer approves release — with optional arbiter-driven dispute resolution and a timelock auto-release safety net. It works identically against both an EVM MilestoneEscrow.sol and a Soroban milestone-escrow contract — pass the appropriate adapter.
Import
Constructor
IAdapter
required
The
EVMAdapter or StellarAdapter connected to the network where the escrow is deployed. Obtain it from tokenFactory.adapter or construct one directly.string
required
The deployed
MilestoneEscrow contract address (EVM hex address or Stellar contract ID).Read Methods
getPayer
getPayee
getArbiter
getToken
getTotalAmount
isFunded
true if at least one milestone has been funded.
isCancelled
true if both parties voted to cancel and the deal was cancelled.
milestoneCount
getMilestone
number
required
Zero-based milestone index.
bigint
The milestone’s locked amount in wei.
string
A
bytes32 hex string — the IPFS or off-chain document hash describing the deliverable.MilestoneStatus
Current status:
PENDING (0) · DELIVERED (1) · DISPUTED (2) · RELEASED (3) · REFUNDED (4)bigint
Unix timestamp when the payee called
markDelivered(). Zero if not yet delivered.boolean
Whether the payer has funded this milestone yet.
getAllMilestones
0 to milestoneCount() - 1. Convenient for dashboard views.
remainingBalance
getActivity
EscrowActivityType
One of:
"funded" · "delivered" · "released" · "disputed" · "resolved" · "refunded" · "cancel-vote" · "cancelled" · "arbiter-changed"number | undefined
Present for milestone-scoped events; absent for deal-level events like
"cancelled".string
The transaction hash of the event.
number
Unix seconds.
0 if the underlying event did not carry a resolvable timestamp.Lifecycle Write Methods
fund
fund(). On Stellar, the nested token transfer is authorized within the same call.
number
required
Zero-based index of the milestone to fund.
markDelivered
claimTimelockRelease.
number
required
Zero-based index of the milestone to mark as delivered.
approveMilestone
number
required
Zero-based index of the delivered milestone to approve.
raiseDispute
DISPUTED status pending arbiter review. Either the payer or the payee can raise a dispute.
number
required
Zero-based index of the milestone to dispute.
Raising a dispute requires an arbiter address to have been set at deployment time (or via
setArbiter()). If the arbiter is the zero address, there is no path to resolve a disputed milestone other than a voteCancel() by both parties.resolveDispute
number
required
Zero-based index of the disputed milestone.
boolean
required
Pass
true to release funds to the payee, or false to refund the payer.claimTimelockRelease
number
required
Zero-based index of a delivered, non-disputed milestone.
voteCancel
voteCancel() — the deal is not cancelled until both votes are recorded. Any remaining funded balance is refunded to the payer on cancellation.
Admin Methods
setArbiter
MANAGER_ROLE.
string
required
Address of the new arbiter. Pass the zero address to remove arbiter access.
setIdentityVerifier
MANAGER_ROLE. Pass the zero address to disable KYC gating.