Conversation
Co-authored-by: charl <charl@vanstaden.info>
…dk-flutter into cursor/build-swap-manager-in-sdk-0a9c
…dk-flutter into cursor/build-swap-manager-in-sdk-0a9c
…s, orderbook namespace, set_order) and sync types
…dk-flutter into cursor/build-swap-manager-in-sdk-0a9c
…dk-flutter into cursor/build-swap-manager-in-sdk-0a9c
…w RPC methods (lightning, orderbook, trading); reference KDF API semantics
…book, lightning requests
TODO: Refactoring and docs
* Add swap manager interface for consistent swap and orderbook operations Co-authored-by: charl <charl@vanstaden.info> * feat(rpc): expand swap-related types --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
…s/komodo_defi_rpc_methods) changes from cursor/build-swap-manager-in-sdk-0a9c relative to dev
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Caution Review failedThe pull request is closed. WalkthroughAdds new RPC request/response modules (Lightning, Orderbook, Trading), updates namespaces and method signatures, introduces numeric primitives (Fraction, MM2 Rational) and integrates them across models, expands public exports, adds new data structures, tightens JSON parsing types, adjusts existing flows (e.g., channels listing), and updates tests and example overrides. Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant Namespace as LightningMethodsNamespace
participant Request as RPC Request
participant Node as MM2 RPC Node
participant Response as Parsed Response
App->>Namespace: generateInvoice(coin, description, amountMsat?)
Namespace->>Request: Build GenerateInvoiceRequest
Request->>Node: toJson() payload
Node-->>Request: JSON result (invoice, payment_hash)
Request-->>Namespace: GenerateInvoiceResponse.parse(...)
Namespace-->>App: GenerateInvoiceResponse
sequenceDiagram
participant App
participant Namespace as OrderbookMethodsNamespace
participant Request as BestOrdersRequest
participant Node as MM2 RPC Node
App->>Namespace: bestOrders(coin, action, requestBy, excludeMine?)
Namespace->>Request: Build BestOrdersRequest
Request->>Node: toJson() with request_by
Node-->>Request: JSON orders[]
Request-->>Namespace: BestOrdersResponse.parse(...)
Namespace-->>App: BestOrdersResponse(orders)
sequenceDiagram
participant App
participant Namespace as TradingMethodsNamespace
participant Req as TradePreimageRequest
participant Node as MM2 RPC Node
participant Res as TradePreimageResponse
App->>Namespace: tradePreimage(base, rel, swapMethod, volume?, max?, price?)
Namespace->>Req: Construct request
Req->>Node: Submit RPC
Node-->>Req: fees payload (per-coin + totals)
Req-->>Namespace: parse -> TradePreimageResponse
Namespace-->>App: response with totals/fees
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120+ minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Pull Request Overview
This PR extracts specific types and RPC changes from a larger branch, focusing only on additions to komodo_defi_types and komodo_defi_rpc_methods packages. The changes introduce high-level trading/swap types and various new RPC methods, while also including some code quality improvements.
- Addition of comprehensive trading/swap types for SDK usage (order management, swap progress, etc.)
- Introduction of new RPC methods for trading, Lightning Network, and orderbook operations
- Code improvements including better type safety and cleaner syntax
Reviewed Changes
Copilot reviewed 39 out of 40 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/komodo_defi_types/lib/src/trading/swap_types.dart | New comprehensive trading types for orders, swaps, and orderbook operations |
| packages/komodo_defi_rpc_methods/lib/src/rpc_methods/trading/*.dart | New trading RPC methods (trade_preimage, recent_swaps, etc.) |
| packages/komodo_defi_rpc_methods/lib/src/rpc_methods/lightning/*.dart | New Lightning Network RPC methods |
| packages/komodo_defi_rpc_methods/lib/src/rpc_methods/orderbook/*.dart | New orderbook RPC methods |
| packages/komodo_defi_rpc_methods/pubspec.yaml | Added rational package dependency |
| Various other files | Type safety improvements and syntax cleanup |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
packages/komodo_defi_rpc_methods/lib/src/rpc_methods/trading/trade_preimage.dart
Outdated
Show resolved
Hide resolved
packages/komodo_defi_rpc_methods/lib/src/rpc_methods/trading/trade_preimage.dart
Show resolved
Hide resolved
packages/komodo_defi_rpc_methods/lib/src/rpc_methods/trading/trade_preimage.dart
Outdated
Show resolved
Hide resolved
packages/komodo_defi_rpc_methods/lib/src/rpc_methods/orderbook/best_orders.dart
Outdated
Show resolved
Hide resolved
|
Visit the preview URL for this PR (updated for commit 65df8fd): https://komodo-defi-sdk--pr191-cursor-only-types-an-tf2u4pas.web.app (expires Mon, 25 Aug 2025 12:58:46 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 7f9f5ac39928f333b6e8fcefb7138575e24ed347 |
…s call in trading RPC namespace
Co-authored-by: charl <charl@vanstaden.info>
Co-authored-by: charl <charl@vanstaden.info>
Co-authored-by: charl <charl@vanstaden.info>
…ir-dependent DEX fees and default behavior
…f06e' into cursor/only-types-and-rpc-from-0a9c # Conflicts: # packages/komodo_defi_rpc_methods/lib/src/rpc_methods/trading/trade_preimage.dart
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
1 similar comment
✅ Actions performedReview triggered.
|
This PR was created from branch
cursor/only-types-and-rpc-from-0a9c.Goal
devexcept those in:packages/komodo_defi_typespackages/komodo_defi_rpc_methodsImplementation
origin/cursor/build-swap-manager-in-sdk-0a9corigin/devNotes
PrivateKeyPolicy.fromLegacyJsonand missing password inunban_pubkeysrequest payload. Can fix here or in a follow-up.Diff is limited to the packages above.
Summary by CodeRabbit
New Features
Refactor
Chores