Skip to content

feat(backend): add rebuild, cancel, and expiry for AWAITING_SIGNATURE float transfers - #910

Open
jeffrey-graham wants to merge 1 commit into
ExcelDsigN-tech:mainfrom
jeffrey-graham:fix/float-transfer-awaiting-signature-lifecycle
Open

jeffrey-graham wants to merge 1 commit into
ExcelDsigN-tech:mainfrom
jeffrey-graham:fix/float-transfer-awaiting-signature-lifecycle

Conversation

@jeffrey-graham

Copy link
Copy Markdown

Closes #842

Summary

Adds lifecycle paths so float transfers cannot remain stuck in AWAITING_SIGNATURE indefinitely:

  1. Rebuild unsigned transaction (POST /api/agents/float-transfer/:id/rebuild):
    • Allows the initiating agent (from_agent) to rebuild a fresh unsigned Soroban transaction (unsignedTxXdr + networkPassphrase) for an AWAITING_SIGNATURE transfer without re-running approval steps when the original transaction sequence number or validity bounds have gone stale.
    • Emits an AGENT_FLOAT_TRANSFER_TX_REBUILT audit entry.
  2. Cancel transfer (POST /api/agents/float-transfer/:id/cancel):
    • Allows the initiating agent (from_agent), recipient agent (to_agent), or an admin to cancel a transfer in PENDING_APPROVAL or AWAITING_SIGNATURE (status = 'CANCELLED').
    • Releases the transfer amount from the 24h daily and 7d weekly pair limit windows (PENDING_APPROVAL, AWAITING_SIGNATURE, COMPLETED).
    • Emits an AGENT_FLOAT_TRANSFER_CANCELLED audit entry.
  3. Automatic expiry (AgentFloatService.expireStaleTransfers):
    • Marks AWAITING_SIGNATURE transfers older than FLOAT_TRANSFER_AWAITING_SIGNATURE_TTL_MS (default 86400000 ms / 24h, configurable via envSchema.ts) as EXPIRED, logs an AGENT_FLOAT_TRANSFER_EXPIRED audit entry for each, and releases their pair limits.
  4. OpenAPI & Tests:
    • Regenerated and validated backend/src/swagger/openapi.json.
    • Added unit and route tests in agentFloatService.test.ts and agentFloatTransfer.test.ts covering rebuild, cancellation, expiry, audit logging, and pair-limit release.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2816980e-1b38-4b96-8042-c37615d633d7
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Float transfers can stay in AWAITING_SIGNATURE forever

1 participant