Skip to content

Commit 9902ea2

Browse files
feature: SEP-6 (#133)
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).
1 parent 7fe724e commit 9902ea2

57 files changed

Lines changed: 4711 additions & 11 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

StellarDotnetSdk.Tests/Sep/Sep0006/TransferServerServiceTest.cs

Lines changed: 1548 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "authentication_required"
3+
}
4+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "non_interactive_customer_info_needed"
3+
}
4+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"type": "non_interactive_customer_info_needed",
3+
"fields": [
4+
"family_name",
5+
"given_name",
6+
"address",
7+
"tax_id"
8+
]
9+
}
10+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "customer_info_status",
3+
"status": "denied",
4+
"more_info_url": "https://api.example.com/kycstatus?account=GACW7NONV43MZIFHCOKCQJAKSJSISSICFVUJ2C6EZIW5773OU3HD64VI",
5+
"eta": 3600
6+
}
7+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"id": "9421871e-0623-4356-b7b5-5996da122f3e",
3+
"instructions": {
4+
"organization.bank_number": {
5+
"value": "121122676",
6+
"description": "US bank routing number"
7+
},
8+
"organization.bank_account_number": {
9+
"value": "13719713158835300",
10+
"description": "US bank account number"
11+
}
12+
},
13+
"how": "Make a payment to Bank: 121122676 Account: 13719713158835300",
14+
"min_amount": 10.0,
15+
"max_amount": 5000.0
16+
}
17+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"id": "9421871e-0623-4356-b7b5-5996da122f3e",
3+
"instructions": {
4+
"organization.crypto_address": {
5+
"value": "1Nh7uHdvY6fNwtQtM1G5EZAFPLC33B59rB",
6+
"description": "Bitcoin address"
7+
}
8+
},
9+
"how": "Make a payment to Bitcoin address 1Nh7uHdvY6fNwtQtM1G5EZAFPLC33B59rB",
10+
"fee_fixed": 0.0002
11+
}
12+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"id": "9421871e-0623-4356-b7b5-5996da122f3e",
3+
"instructions": {
4+
"organization.clabe_number": {
5+
"value": "646180111803859359",
6+
"description": "CLABE number"
7+
}
8+
},
9+
"how": "Make a payment to Bank: STP Account: 646180111803859359",
10+
"eta": 1800
11+
}
12+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"id": "9421871e-0623-4356-b7b5-5996da122f3e",
3+
"instructions": {
4+
"organization.crypto_address": {
5+
"value": "rNXEkKCxvfLcM1h4HJkaj2FtmYuAWrHGbf",
6+
"description": "Ripple address"
7+
},
8+
"organization.crypto_memo": {
9+
"value": "88",
10+
"description": "Ripple tag"
11+
}
12+
},
13+
"how": "Make a payment to Ripple address rNXEkKCxvfLcM1h4HJkaj2FtmYuAWrHGbf with tag 88",
14+
"eta": 60,
15+
"fee_percent": 0.1,
16+
"extra_info": {
17+
"message": "You must include the tag. If the amount is more than 1000 XRP, deposit will take 24h to complete."
18+
}
19+
}
20+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"fee": 0.013
3+
}
4+

0 commit comments

Comments
 (0)