Skip to content

Implement durable sponsored Stellar account funding workflow - #99

Merged
3m1n3nc3 merged 2 commits into
learnault:mainfrom
afeezorobsco-cyber:feat/sponsored-stellar-account-funding
Jul 18, 2026
Merged

Implement durable sponsored Stellar account funding workflow#99
3m1n3nc3 merged 2 commits into
learnault:mainfrom
afeezorobsco-cyber:feat/sponsored-stellar-account-funding

Conversation

@afeezorobsco-cyber

@afeezorobsco-cyber afeezorobsco-cyber commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

#close #91

Summary

This PR implements a durable sponsored Stellar account funding workflow with idempotent transaction handling, persistent funding state, reconciliation, and secure funding execution.

Changes

Funding Policy

  • Added configurable funding policy for sponsored account creation.
  • Supports configurable funding amount, funding source, eligibility rules, and operational limits.

Funding Job

  • Added asynchronous funding job using the existing outbox/job infrastructure.
  • Processes newly provisioned Stellar accounts safely and idempotently.

Transaction State

  • Persisted funding lifecycle information including:
    • idempotency key
    • transaction status
    • transaction hash
    • ledger
    • retry metadata
    • provider errors
    • final state

Idempotency

  • Prevents duplicate funding during retries.
  • Reconciles transactions after timeout-before-confirmation scenarios.
  • Recovers existing transaction state before retrying.

Already Funded Detection

  • Detects accounts that already meet the funding requirements.
  • Skips unnecessary funding transactions.

Failure Handling

  • Handles:
    • provider outages
    • insufficient funding balance
    • transient failures
    • delayed confirmations
    • manual review scenarios

Security

  • Funding secrets are never logged.
  • Funding secrets are never persisted.
  • Sensitive configuration remains protected.

Testing

Added mocked Horizon tests covering:

  • duplicate execution
  • idempotency
  • timeout-after-submit
  • reconciliation
  • already-funded detection
  • provider failures
  • insufficient balance
  • confirmation handling
  • funding policy enforcement
  • secret redaction

Verification

  • ✅ Tests pass
  • ✅ Funding is idempotent
  • ✅ Transaction hash and ledger are persisted
  • ✅ Funding secrets remain protected
  • ✅ Mocked Horizon integration passes

@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor Author

@3m1n3nc3 pls review and merge

@3m1n3nc3
3m1n3nc3 merged commit 45329b9 into learnault:main Jul 18, 2026
1 check passed
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.

Feature: Implement Sponsored Stellar Account Funding

2 participants