Description:
Before an intent is accepted into the open book, verify the Stellar destination account exists and holds a trustline (with sufficient limit) for the destination asset, and surface actionable errors.
Problem Statement & Context:
If the user's Stellar account doesn't exist or lacks a trustline for the destination classic asset, the solver's fill fails on-chain, wasting solver funds/time and potentially triggering unfair slashing.
Scope & Acceptance Criteria:
- Horizon/RPC check for account existence, trustline presence, authorisation flags, and remaining limit ≥
minDstAmount.
- SAC/contract tokens handled via balance-entry checks where applicable.
- Error codes:
DST_ACCOUNT_NOT_FOUND, DST_TRUSTLINE_MISSING, DST_TRUSTLINE_LIMIT, DST_NOT_AUTHORIZED.
- Re-check at accept time; if the trustline was removed, accept is rejected and user notified.
- Out of scope: sponsoring account creation.
Implementation Guidelines:
- Key Files/Modules: new
src/soroban/destination-preflight.service.ts, src/intents/intents.controller.ts, src/soroban/soroban.service.ts.
- Design/Architecture: Short-TTL cache per
(account, asset) to limit Horizon load.
- Edge Cases/Constraints: Muxed accounts (
M…); native XLM needs no trustline.
- Testing: Tests for each error code; e2e with mocked Horizon responses.
Definition of "Done": Common DoD.
Resources:
Common Definition of "Done" (applies in addition to the criteria above):
- Code written, tested, and documented (TSDoc on public APIs, README/runbook/ADR updates where behaviour changes).
- All acceptance criteria met;
npm run lint, npm run typecheck, npm test, npm run test:e2e pass in CI.
- PR follows
.github/PULL_REQUEST_TEMPLATE, uses a Conventional Commit title (enforced by commitlint), includes test output / metrics screenshots, and references the issue.
- New env vars are added to
.env.example variants and src/config/env.validation.ts (the check:env-drift script must pass).
- Reviewed and approved by at least one CODEOWNER.
Description:
Before an intent is accepted into the open book, verify the Stellar destination account exists and holds a trustline (with sufficient limit) for the destination asset, and surface actionable errors.
Problem Statement & Context:
If the user's Stellar account doesn't exist or lacks a trustline for the destination classic asset, the solver's fill fails on-chain, wasting solver funds/time and potentially triggering unfair slashing.
Scope & Acceptance Criteria:
minDstAmount.DST_ACCOUNT_NOT_FOUND,DST_TRUSTLINE_MISSING,DST_TRUSTLINE_LIMIT,DST_NOT_AUTHORIZED.Implementation Guidelines:
src/soroban/destination-preflight.service.ts,src/intents/intents.controller.ts,src/soroban/soroban.service.ts.(account, asset)to limit Horizon load.M…); native XLM needs no trustline.Definition of "Done": Common DoD.
Resources:
Common Definition of "Done" (applies in addition to the criteria above):
npm run lint,npm run typecheck,npm test,npm run test:e2epass in CI..github/PULL_REQUEST_TEMPLATE, uses a Conventional Commit title (enforced by commitlint), includes test output / metrics screenshots, and references the issue..env.examplevariants andsrc/config/env.validation.ts(thecheck:env-driftscript must pass).