Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [0.2.1] - 2026-06-29
- Add shared backend API transport in `src/utils/http.ts` using `axios` + `axios-retry`
- Add automatic retries for transient backend failures (`429`, `5xx`, network errors)
- Migrate backend SDK endpoints from `fetch` to shared retry-aware transport:
- `TrustFlowEscrowClient.getGigs`
- `DisputeClient.raiseDispute` / `DisputeClient.getDispute`
- `requestChallenge` / `verifyAndGetToken`
- Add Jest coverage for retry policy and backend transport behavior
- Add Jest tests validating contract argument XDR payload encoding
- Architectural decision: centralize backend HTTP behavior to avoid endpoint-specific retry drift

## [0.2.0] - 2026-04-28
- Add DisputeClient for dispute management
- Add EscrowMonitor for real-time event polling
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ See [examples/multisig-escrow.ts](./examples/multisig-escrow.ts) for the full wa
- **🔐 Escrow Management**: Create, fund, release, and monitor escrows
- **✍️ Multi-Sig Escrows**: M-of-N signature collection for shared backend Escrows via `MultiSigEscrowClient`
- **⚖️ Dispute Resolution**: Raise and track disputes with on-chain governance
- **🔁 Backend API Auto-Retries**: Resilient backend calls via `axios-retry` for transient failures
- **🔑 Wallet Integration**: Built-in support for Freighter and Albedo wallets
- **📊 Event Monitoring**: Real-time escrow state change tracking
- **🛡️ Type Safety**: Full TypeScript support with Zod validation schemas
Expand Down Expand Up @@ -122,10 +123,10 @@ Read more in [docs/ARCHITECTURE.md](./docs/ARCHITECTURE.md)
The SDK is under active development. Here's what's coming:

### In Progress
- [ ] Tsup bundler configuration for ESM/CJS exports
- [x] Tsup bundler configuration for ESM/CJS exports
- [ ] NPM publishing pipeline with provenance
- [ ] Simulation wrappers for transaction cost estimation
- [ ] Auto-retry logic for RPC endpoints
- [x] Auto-retry logic for backend API endpoints (`axios-retry`)

### Planned Features
- [x] Multi-signature support for corporate escrows
Expand Down
15 changes: 11 additions & 4 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- `createEscrow(params)` — create a new escrow
- `releaseEscrow(id, signer)` — release funds to beneficiary
- `getEscrow(id)` — read escrow state from contract
- `getGigs(params)` — fetch paginated gigs via backend API with automatic retries for transient failures (`429`, `5xx`, network)

## EscrowBuilder
Fluent builder: `.setDepositor().setBeneficiary().setAmount().build()`
Expand All @@ -13,9 +14,15 @@ Fluent builder: `.setDepositor().setBeneficiary().setAmount().build()`
- `.startPolling(intervalMs, fetchFn)` — begin polling

## DisputeClient
- `.raiseDispute(params)` — raise a dispute
- `.getDispute(escrowId)` — get dispute status
- `.raiseDispute(params)` — raise a dispute (automatic retry on transient backend failures)
- `.getDispute(escrowId)` — get dispute status (automatic retry on transient backend failures)

## Auth
- `requestChallenge(apiUrl, address)` — get signing challenge
- `verifyAndGetToken(apiUrl, address, signature)` — exchange signature for JWT
- `requestChallenge(apiUrl, address, options?)` — get signing challenge with retry-aware backend transport
- `verifyAndGetToken(apiUrl, address, signature, options?)` — exchange signature for JWT with retry-aware backend transport

## Backend API Retry Behavior
- Backend API endpoints now use a shared Axios transport configured with `axios-retry`.
- Default retry policy: 3 retries, exponential backoff (250ms base, 2000ms max cap).
- Retry conditions: network errors, HTTP `429`, and HTTP `5xx` responses.
- Non-transient `4xx` responses are returned without retry.
Loading