Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend token SDK with async methods & fixes #45

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

raymens
Copy link
Member

@raymens raymens commented Jul 15, 2024

  • Added GetEnvelope and WaitForCompletionAsync methods to MockTokenServerProvider.
  • Introduced WaitForCompletionAsync in ISubmitFacade and its implementation in SubmitFacade.
  • Updated ITokenServerProvider and TokenServerProvider to include new methods and correct syntax errors.
  • Added AuthorizationRequired property to AlgorandTokenSettings.
  • Introduced EnvelopeResponse class for detailed response handling.
  • Corrected array initialization syntax in TokenServerProvider.
  • Enhanced AlgorandExamples.cs with better logging and settings adjustments for asset tokens.

raymens added 5 commits July 15, 2024 13:09
- Added `GetEnvelope` and `WaitForCompletionAsync` methods to `MockTokenServerProvider`.
- Introduced `WaitForCompletionAsync` in `ISubmitFacade` and its implementation in `SubmitFacade`.
- Updated `ITokenServerProvider` and `TokenServerProvider` to include new methods and correct syntax errors.
- Added `AuthorizationRequired` property to `AlgorandTokenSettings`.
- Introduced `EnvelopeResponse` class for detailed response handling.
- Corrected array initialization syntax in `TokenServerProvider`.
- Enhanced `AlgorandExamples.cs` with better logging and settings adjustments for asset tokens.
- Updated `SubmitOnAlgorandAsync` in `TokenServerProvider.cs` to include an optional `awaitResult` parameter, allowing callers to specify if they wish to wait for the submission to be fully processed. The method's documentation has been updated accordingly to reflect this new functionality.

- Added `WaitForCompletionAsync` method in the same file, designed to wait for a token operation to be fully processed. It accepts a unique Nexus identifier (`code`) and an optional `CancellationToken`, continuously checking the operation's status until it is resolved.
This commit introduces significant updates aimed at improving task management and execution control across the codebase. Key changes include the introduction of `CancellationToken` in HTTP response handling and request execution, allowing for better task cancellation and resource conservation. The `IResponseHandler` interface and its implementations, as well as the `RequestBuilder` class, have been updated to support these cancellations effectively.

Additionally, enhancements in token submission and waiting mechanisms have been implemented. The `ISubmitFacade` and `ITokenServerProvider` interfaces, along with their implementations, now support optional parameters for task cancellation and waiting for completion, offering improved control over the token submission process on Algorand.

Documentation has been improved through the use of `<inheritdoc/>` annotations, promoting cleaner code and reducing redundancy. General code improvements for consistency, including the introduction of optional parameters in various methods, have been made to enhance flexibility and efficiency.

These updates collectively contribute to a more robust and flexible codebase, enhancing control over HTTP request handling, task cancellation, and token submission processes.
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.

1 participant