Issue
The SubmitTransactionAsync method throws SubmitTransactionUnknownResponseException when receiving valid HTTP 201 Created responses with PENDING status from Horizon's asynchronous transaction submission endpoint.
Details
- This SDK only handles traditional synchronous responses (HTTP 200, 400, 504) in the transaction submission logic
- Horizon's POST
/transactions_async endpoint returns HTTP 201 Created with body: {"tx_status": "PENDING", "hash": "..."}
- The SDK treats this valid response as an "unknown response" and throws an exception
- The issue most likely is located at:
|
switch (response.StatusCode) |
Impact
Developers cannot use the SDK to submit transactions to modern Horizon instances that return PENDING responses. This affects all mainnet usage where the async endpoint is now standard.
Solution
Update SubmitTransactionAsync to recognize and properly handle HTTP 201 Created responses with PENDING status, returning a response object that includes the transaction hash and pending status indicator.
Reproduction
// This throws SubmitTransactionUnknownResponseException
var response = await _stellarServer.SubmitTransactionAsync(transaction);
Environment
- Package Version(s): stellar-dotnet-sdk 13.1.4 and 13.2.0
- Network: Mainnet
- Occurs: Consistently when Horizon returns PENDING status
Issue
The
SubmitTransactionAsyncmethod throwsSubmitTransactionUnknownResponseExceptionwhen receiving valid HTTP 201 Created responses with PENDING status from Horizon's asynchronous transaction submission endpoint.Details
/transactions_asyncendpoint returns HTTP 201 Created with body:{"tx_status": "PENDING", "hash": "..."}dotnet-stellar-sdk/StellarDotnetSdk/Server.cs
Line 286 in 108c159
Impact
Developers cannot use the SDK to submit transactions to modern Horizon instances that return PENDING responses. This affects all mainnet usage where the async endpoint is now standard.
Solution
Update
SubmitTransactionAsyncto recognize and properly handle HTTP 201 Created responses with PENDING status, returning a response object that includes the transaction hash and pending status indicator.Reproduction
Environment