Skip to content

feature: SEP-6#133

Merged
jopmiddelkamp merged 15 commits intomasterfrom
feature/sep-6
Dec 25, 2025
Merged

feature: SEP-6#133
jopmiddelkamp merged 15 commits intomasterfrom
feature/sep-6

Conversation

@jopmiddelkamp
Copy link
Copy Markdown
Contributor

@jopmiddelkamp jopmiddelkamp commented Dec 23, 2025

#8

Auto-generated Summary 🤖

This pull request primarily adds comprehensive SEP-0006 test data files and introduces improvements to the StellarToml class to support cancellation via CancellationToken. The new test data covers a wide range of SEP-0006 scenarios, including deposit, withdrawal, transaction status, error cases, and fee information, which will help ensure robust testing of SEP-0006 flows. Additionally, the StellarToml class now allows async operations to be cancelled, improving resilience and control for consumers of the SDK.

SEP-0006 Test Data Additions:

  • Added multiple JSON files under StellarDotnetSdk.Tests/TestData/Sep/Sep0006/ to cover scenarios such as authentication required, customer information needed, deposit and withdrawal instructions for various assets, fee responses, transaction and transactions responses, and various error cases. These files will enable more thorough and realistic testing of SEP-0006 flows. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]

StellarToml Class Improvements:

  • Updated the StellarToml.FromDomainAsync method to accept an optional CancellationToken, allowing callers to cancel the operation if needed. This includes propagating the token to all relevant async operations and handling OperationCanceledException appropriately. [1] [2] [3]
  • Added using System.Threading; to support cancellation token usage.

Other Minor Improvements:

  • Minor formatting cleanup in ResponseHandler.cs (no functional change).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@jopmiddelkamp jopmiddelkamp changed the title feature: SEP-24 feature: SEP-6 Dec 23, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces comprehensive support for SEP-6 (Programmatic Deposit and Withdrawal API) to the Stellar .NET SDK. SEP-6 enables non-interactive deposit and withdrawal flows between Stellar assets and external systems (fiat, crypto, etc.), complementing the interactive SEP-24 flow with a programmatic alternative designed for API integration.

Key changes:

  • Implements a complete TransferServerService class with methods for deposit, withdrawal, fee queries, and transaction management
  • Adds request/response models for all SEP-6 operations including deposit-exchange and withdrawal-exchange (with SEP-38 quote support)
  • Introduces custom exception handling for authentication, customer information requirements, and general transfer server errors
  • Provides a custom JSON converter to handle special nested structures in anchor transaction responses

Reviewed changes

Copilot reviewed 51 out of 51 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
TransferServerService.cs Core service implementing all SEP-6 endpoints with HTTP client management, error handling, and domain discovery
Response models (18 files) Complete set of response DTOs for info, deposits, withdrawals, transactions, fees, and customer information
Request models (7 files) Request DTOs for all SEP-6 operations with proper validation and parameter mapping
Exception classes (4 files) Custom exceptions for transfer server errors with detailed context and response encapsulation
AnchorTransactionJsonConverter.cs Custom JSON converter handling nested "transaction" keys in required_info_updates fields
JsonOptions.cs Registration of the new converter in global JSON serialization options
Test data (11 JSON files) Comprehensive test fixtures covering various asset types, error states, and transaction flows
TransferServerServiceTest.cs 20 test methods validating all service operations, error handling, and edge cases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread StellarDotnetSdk/Sep/Sep0006/TransferServerService.cs Outdated
Comment thread StellarDotnetSdk/Sep/Sep0006/TransferServerService.cs Outdated
Comment thread StellarDotnetSdk/Converters/AnchorTransactionJsonConverter.cs Outdated
Comment thread StellarDotnetSdk/Converters/AnchorTransactionJsonConverter.cs Outdated
Comment thread StellarDotnetSdk/Sep/Sep0006/TransferServerService.cs
Comment thread StellarDotnetSdk/Sep/Sep0006/Requests/FeeRequest.cs Outdated
Comment thread StellarDotnetSdk/Sep/Sep0006/TransferServerService.cs Outdated
Comment thread StellarDotnetSdk/Sep/Sep0006/TransferServerService.cs Outdated
Comment thread StellarDotnetSdk.Tests/Sep/Sep0006/TransferServerServiceTest.cs Outdated
Comment thread StellarDotnetSdk.Tests/Sep/Sep0006/TransferServerServiceTest.cs Outdated
Comment thread StellarDotnetSdk.Tests/Sep/Sep0006/TransferServerServiceTest.cs
Comment thread StellarDotnetSdk.Tests/Sep/Sep0006/TransferServerServiceTest.cs Outdated
Comment thread StellarDotnetSdk/Converters/AnchorTransactionJsonConverter.cs Outdated
Copy link
Copy Markdown
Contributor

@cuongph87 cuongph87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested.

Base automatically changed from feature/sep-9 to master December 25, 2025 06:34
@jopmiddelkamp jopmiddelkamp force-pushed the feature/sep-6 branch 2 times, most recently from 04868b4 to 604793d Compare December 25, 2025 12:05
Comment thread StellarDotnetSdk/Sep/Sep0006/Responses/WithdrawResponse.cs
Comment thread StellarDotnetSdk/Sep/Sep0006/TransferServerService.cs
cuongph87
cuongph87 previously approved these changes Dec 25, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 57 out of 57 changed files in this pull request and generated 21 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread StellarDotnetSdk/Sep/Sep0006/TransferServerService.cs
Comment thread StellarDotnetSdk/Sep/Sep0006/TransferServerService.cs
Comment thread StellarDotnetSdk/Sep/Sep0006/Responses/TransactionRefunds.cs
Comment thread StellarDotnetSdk/Sep/Sep0006/Responses/TransactionRefunds.cs
Comment thread StellarDotnetSdk/Sep/Sep0006/Responses/TransactionRefunds.cs
Comment thread StellarDotnetSdk/Sep/Sep0006/Responses/TransactionRefundPayment.cs
Comment thread StellarDotnetSdk/Sep/Sep0006/Responses/TransactionRefundPayment.cs
Comment thread StellarDotnetSdk/Sep/Sep0006/Responses/AnchorTransaction.cs
Comment thread StellarDotnetSdk/Sep/Sep0006/Responses/AnchorTransaction.cs
Comment thread StellarDotnetSdk/Sep/Sep0006/Responses/AnchorTransaction.cs
@jopmiddelkamp jopmiddelkamp merged commit 9902ea2 into master Dec 25, 2025
4 checks passed
@jopmiddelkamp jopmiddelkamp deleted the feature/sep-6 branch December 25, 2025 16:32
@cuongph87 cuongph87 added the feature New feature label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants