Refactor SDK transaction planning modules#61
Conversation
There was a problem hiding this comment.
Code Review
This pull request modularizes the @ickb/sdk package by refactoring the monolithic sdk.ts file into a clean directory structure under src/client, src/conversion, src/estimate, src/send, and src/withdrawal. It also introduces a build configuration using api-extractor, updates package exports, and expands the test suite. Feedback is provided on sdk_error.ts to explicitly handle Date objects during JSON serialization to prevent potential runtime errors or silent data loss.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors and modularizes the SDK package by splitting the monolithic sdk.ts into specialized modules for L1 state scanning, conversion planning, maturity estimation, and transaction sending, alongside introducing ring-based withdrawal selection helpers. The review feedback highlights security concerns regarding potential information disclosure in send_and_wait.ts, suggesting that raw polling errors be sanitized to safe classifiers before being attached to transaction confirmation errors or lifecycle events to prevent leaking sensitive node URLs or credentials.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the monolithic sdk.ts file in the SDK package, splitting its functionality into modular components under client, conversion, estimate, send, and withdrawal directories. It also updates the package configuration, build scripts, and test suites to align with this new structure. The code review feedback highlights potential issues with error handling and deduplication: wrapping unexpected errors by attaching the raw error object as a cause could leak sensitive information, and using the unique helper on logical entities like ccc.Script may fail to deduplicate structurally identical instances if it relies on reference equality.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the iCKB SDK by modularizing its core architecture into smaller, specialized classes and subdirectories (such as client, conversion, estimate, send, and withdrawal). It replaces the previous ready withdrawal cleanup selection logic with a more robust ring-based withdrawal selection mechanism. Additionally, it updates the build and test configurations, including tsconfig, vitest, and package exports, and moves test files to a dedicated test directory. There are no review comments provided, so I have no feedback to offer on the review itself.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the iCKB SDK by modularizing the monolithic sdk.ts file into distinct classes and subdirectories for conversion, estimation, sending, and withdrawal logic. It also introduces a ring-based withdrawal selection algorithm and updates the test suite. The review feedback focuses on improving robustness when accessing internal collections with previously validated indices or keys (specifically in firstCkbMaturityAtOrAbove, selectByMasks, ringSegments, and selectionKey) by throwing explicit errors instead of using optional chaining, non-null assertions, or silently returning undefined.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the SDK package by modularizing the monolithic sdk.ts file into smaller, specialized modules under src/client, src/conversion, src/estimate, src/send, and src/withdrawal. It introduces structured SDK classes (IckbSdkBase, IckbSdkConversion, IckbSdkL1, and IckbSdk), adds ring-based withdrawal selection helpers, and implements a best-fit algorithm for ready deposit selection. Additionally, the build configuration, package exports, and testing suite have been updated and expanded with comprehensive tests. As there are no review comments provided, I have no feedback to address.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
LGTM Phroi %345 |
Why
The SDK facade had grown into one large module that mixed L1 state scans, conversion planning, transaction completion, send-and-wait behavior, and withdrawal selection. Splitting those concerns makes the package easier to review and gives API Extractor a stable package boundary for the SDK surface.
Changes
packages/sdk/srcmodules.testtree with targeted suites for state projection, conversion planning, send/wait lifecycle, transaction completion, and withdrawal selection.apps/botso the split SDK does not re-export bot-specific cleanup heuristics.