Repository navigation
feat(api): añadir esqueleto de la API compatible con TW v2 - #40
Merged
Merged
Conversation
…et.json - DECISIONS: vault propio de DeFindex desplegado en testnet (CDKNUOYY…KDOQO), deposit(invest=true) basta para el escrow tras el rebalance inicial, el faucet de Blend no da USDC (se compra en Soroswap), comisión de protocolo = 20 % de la comisión del vault, e identidades. - deployments/testnet.json: token, vault y estrategia por defecto, DeFindex, Soroswap, identidades, Relayer y smart account (de P3). factory y escrow a null hasta el primer deploy.
El build script de soroban-sdk 28 rechaza `cargo build --target
wasm32v1-none` ("requires stellar-cli v25.2.0+ to build a contract").
La CI instala la Stellar CLI con la acción oficial stellar/stellar-cli
y construye con `stellar contract build`, como indica
contracts/escrow/CLAUDE.md.
- apps/api (@fianzas/api): Hono con basePath /api, configuración desde
deployments/testnet.json + entorno del servidor, Problem Details
RFC 9457, 501 con replacement en las rutas de TW que no encajan,
POST /stellar/send-transaction, GET /fianzas/v1/{config,strategies,
strategies/:id/price} con comisiones y precio por share leídos de la
cadena, y montaje de /fianzas/v1/relay y /fianzas/v1/ramp con los
handlers de @fianzas/wallet y @fianzas/anchor. Cliente @fianzas/api/client.
- apps/web/app/api/[[...path]]/route.ts: catch-all con nextHandlers().
- apps/web/package.json: dependencia @fianzas/api (cross-area, P4).
- .env.example: variables de la API (solo servidor).
- 9 tests offline con Chain falso; next build compila la ruta.
jzelada97
requested review from
CarlosJX7,
Diego-Matoss and
RicardoMatosR
as code owners
October 25, 2026 19:16
CarlosJX7
approved these changes
Oct 25, 2026
CarlosJX7
left a comment
Collaborator
There was a problem hiding this comment.
OK de P1 a la parte de la API. Dos cosas:
- El check
harnessfalla por mi lock dedeps(#38), que tengo para #39 (factory en el workspace). En cuanto se fusione #39 lo libero y vuelves a lanzar la CI. - Toca
apps/web(route.tsypackage.json): concross-areanecesita también el OK de @Diego-Matoss. deployments/testnet.jsontambién lo crea #35: el segundo en fusionarse tendrá que resolver el conflicto.
4 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Qué cambia
Primer esqueleto de
apps/api(@fianzas/api), la API compatible con la Core API v2 de Trustless Work (arquitectura § 6.8, INTERFACES § 8):basePath("/api"), configuración desdedeployments/testnet.json+ variables del servidor (ningunaNEXT_PUBLIC_).FZ_*; las rutas de TW que no encajan responden501 FZ_ENDPOINT_NOT_SUPPORTEDconextensions.replacement(dispute→/fianzas/v1/…/stop,resolve-dispute→…/resolve,deploy→POST /fianzas/v1/fianzas…).POST /stellar/send-transaction(misma forma que TW; nunca patrocina).GET /fianzas/v1/config,GET /fianzas/v1/strategies(comisiones y precio por share leídos del vault en vivo) yGET /fianzas/v1/strategies/:id/price./fianzas/v1/relay(createRelayHandlerde @RicardoMatosR) y/fianzas/v1/ramp(createSimRampHandler), conRelayPolicyconstruida desdedeployments.@fianzas/api/clientpara web y backoffice.501 FZ_NOT_IMPLEMENTED_YEThasta la fase 3a.cross-area: una línea enapps/web/package.json(dependencia@fianzas/api) y el catch-allapps/web/app/api/[[...path]]/route.ts(áreaapi). @Diego-Matoss, revisa por favor. Esta rama incluye además la de #35 (deployments/testnet.json), que la API necesita.Cómo probarlo
En local: typecheck limpio, 9 tests,
next buildconƒ /api/[[...path]], y lecturas reales de testnet (vault propio) desde el dev server.Checklist
api(P2),harnesscon lock (LOCK: harness #23),webconcross-area🤖 Generated with Claude Code