feat(core): add webhook events, custom asset pair pricing, configurable operation timeouts, and wallet adapter integration tests - #347
Merged
Conversation
Sorokit#198) - Add webhook support for transaction events with HMAC-SHA256 signing and retry logic - Add custom asset pair trading logic with multi-hop pricing support - Add configurable request timeouts per operation with sensible defaults and global override - Create integration tests for Freighter and Lobstr wallet adapters - Add MSW setup for mocking wallet responses in tests - Add timeoutMs parameter to 20+ public SDK functions - Define per-operation timeout defaults in src/shared/config.ts - Add global timeout override in createSorokitClient() - Write comprehensive tests for webhook, asset pair, and timeout functionality
|
@Johnsmichael150 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR enhances the Sorokit SDK by introducing webhook support for transaction lifecycle events, configurable per-operation request timeouts, custom asset pair pricing utilities, and a comprehensive integration test suite for supported wallet adapters.
These improvements increase the SDK's flexibility, reliability, and developer experience while strengthening test coverage for critical components.
Related Issues
What's Changed
🔔 Transaction Webhook Support (#208)
Problem
Applications currently have to poll the SDK to determine whether a transaction has been submitted, confirmed, or failed.
Solution
Added webhook registration support for transaction lifecycle events.
New API:
Supported events:
submittedconfirmedfailedFeatures include:
Result
Files
src/transaction/*💱 Custom Asset Pair Pricing (#209)
Problem
The SDK lacked built-in utilities for working with custom asset pairs and pricing routes across decentralized exchange liquidity pools.
Solution
Added helper utilities for creating asset pairs and retrieving market prices.
New APIs:
createAssetPair(asset1, asset2)getPairPrice(pair, amount)Capabilities include:
Result
Files
⏱️ Configurable Request Timeouts (#207)
Problem
A single global timeout was applied to every SDK operation, despite different operations having very different latency requirements.
Solution
Introduced configurable timeout settings throughout the SDK.
Enhancements include:
timeoutMsparameter on public APIscreateSorokitClient()Examples:
Result
Files
src/shared/config.ts🧪 Wallet Adapter Integration Tests (#198)
Problem
Wallet adapter functionality lacked comprehensive integration testing across supported wallet providers and failure scenarios.
Solution
Added a dedicated integration test suite covering supported wallet adapters.
Coverage includes:
Freighter
Ledger
Additional scenarios:
The suite uses mocked wallet interactions and avoids communication with production wallet services.
Result
Files
src/tests/integration/Testing
Verified that:
Benefits
Developer Experience
Security
Reliability
Maintainability
Acceptance Criteria
#198
#207
timeoutMsparameter added to public APIs.createSorokitClient().#208
registerWebhook(event, url, secret)implemented.submitted,confirmed, andfailedevents.#209
createAssetPair()helper added.getPairPrice()implemented.