-
Notifications
You must be signed in to change notification settings - Fork 17
Update to latest arkd, renaming and TSDoc #108
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
Conversation
## Walkthrough
This update introduces broad refactoring and documentation improvements across the codebase. Key changes include renaming the `InMemoryKey` class to `SingleKey`, replacing all references accordingly, and updating transaction graph types from `TxGraph`/`TxGraphChunk` to `TxTree`/`TxTreeNode`. Several type and interface names are updated for clarity, and detailed JSDoc comments are added throughout. Coin selection logic is now implemented locally in wallet modules. The documentation build and deployment process is enhanced with new scripts and a GitHub Actions workflow.
## Changes
| Files/Groups | Change Summary |
|--------------------------------------------------------------|---------------|
| `src/identity/singleKey.ts`, `README.md`, `examples/`, `test/`, `src/wallet/serviceWorker/`, `src/index.ts` | Renamed `InMemoryKey` class to `SingleKey` and updated all references, imports, and usage examples. |
| `src/tree/txTree.ts`, `src/tree/signingSession.ts`, `src/tree/validation.ts`, `src/providers/ark.ts`, `src/index.ts`, `test/e2e/indexer.test.ts` | Renamed transaction graph types from `TxGraph`/`TxGraphChunk` to `TxTree`/`TxTreeNode` throughout code, tests, and exports. |
| `src/wallet/onchain.ts`, `src/wallet/wallet.ts`, `src/utils/coinselect.ts` | Removed external coin selection utility; implemented local `selectCoins` and `selectVirtualCoins` functions in wallet modules. |
| `src/wallet/index.ts`, `src/wallet/wallet.ts`, `src/utils/transactionHistory.ts`, `test/e2e/ark.test.ts` | Changed virtual coin state `"pending"` to `"preconfirmed"` and renamed `redeemTxid` to `arkTxid` in types, logic, and tests. |
| `src/providers/indexer.ts`, `src/index.ts` | Updated and exported new types/interfaces (`PaginationOptions`, `SubscriptionResponse`), removed deprecated methods, and adjusted provider method signatures. |
| `src/arknote/index.ts`, `src/script/tapscript.ts`, `src/script/vhtlc.ts`, `src/bip322/index.ts`, `src/utils/arkTransaction.ts`, `src/wallet/onchain.ts`, `src/wallet/wallet.ts`, `src/providers/ark.ts`, `src/wallet/index.ts`, `src/wallet/serviceWorker/wallet.ts` | Added or expanded JSDoc comments for classes, interfaces, functions, and usage examples. |
| `src/wallet/serviceWorker/worker.ts`, `src/wallet/serviceWorker/wallet.ts` | Updated to use `SingleKey` for identity management and adjusted destructuring variable names. |
| `src/utils/coinselect.ts` | Deleted file; coin selection is now implemented locally in wallet modules. |
| `.github/workflows/tsdoc.yml`, `typedoc.json`, `package.json`, `.gitignore` | Added documentation build scripts, TypeDoc config, GitHub Actions workflow for docs deployment, and ignored `docs/` in git. |
| `server.Dockerfile` | Changed default Docker build branch from `next-version` to `master`. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant User
participant Wallet
participant SingleKey
participant IndexerProvider
participant ArkProvider
User->>Wallet: Initialize (with SingleKey)
Wallet->>SingleKey: Generate or load key
User->>Wallet: Request transaction
Wallet->>IndexerProvider: Fetch VTXOs, scripts, etc.
Wallet->>ArkProvider: Submit Ark transaction
ArkProvider-->>Wallet: Return transaction notification
Wallet-->>User: Return transaction resultPossibly related PRs
Suggested reviewers
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
src/providers/indexer.ts(2 hunks)src/utils/transactionHistory.ts(6 hunks)src/wallet/index.ts(2 hunks)src/wallet/serviceWorker/worker.ts(2 hunks)src/wallet/wallet.ts(9 hunks)test/e2e/ark.test.ts(3 hunks)
🧰 Additional context used
🧠 Learnings (2)
test/e2e/ark.test.ts (1)
Learnt from: louisinger
PR: arkade-os/ts-sdk#115
File: src/wallet/wallet.ts:821-822
Timestamp: 2025-07-07T17:02:26.667Z
Learning: In the Ark SDK, the Transaction.addOutputAddress() method from @scure/btc-signer already validates the output address format internally, so explicit validation before calling this method is redundant.
src/wallet/serviceWorker/worker.ts (1)
Learnt from: louisinger
PR: arkade-os/ts-sdk#115
File: src/wallet/wallet.ts:821-822
Timestamp: 2025-07-07T17:02:26.667Z
Learning: In the Ark SDK, the Transaction.addOutputAddress() method from @scure/btc-signer already validates the output address format internally, so explicit validation before calling this method is redundant.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
🔇 Additional comments (20)
test/e2e/ark.test.ts (2)
194-199: LGTM! Terminology update properly reflected in test assertions.The test correctly validates the new "preconfirmed" virtual coin state instead of the old "pending" state.
304-305: LGTM! Transaction key property name updated consistently.The test assertions correctly reference the renamed "arkTxid" property instead of "redeemTxid", maintaining consistency with the interface changes.
Also applies to: 317-317
src/providers/indexer.ts (2)
565-565: LGTM! Virtual coin state mapping updated correctly.The convertVtxo function properly maps preconfirmed vtxos to the new "preconfirmed" state instead of "pending".
595-595: LGTM! Transaction key property renamed consistently.The convertTransaction function correctly assigns the virtualTxid to the renamed "arkTxid" property, maintaining consistency with the interface changes.
src/wallet/serviceWorker/worker.ts (2)
371-371: LGTM! Balance calculation updated for new state terminology.The condition correctly checks for "preconfirmed" state instead of "pending" in the balance calculation, maintaining the same logic with updated terminology.
513-513: LGTM! Property destructuring handles terminology change with backward compatibility.The destructuring correctly handles the property rename from "roundsToIgnore" to "commitmentsToIgnore" while maintaining backward compatibility through aliasing.
src/wallet/index.ts (2)
54-54: LGTM! VirtualStatus interface updated for new state terminology.The interface correctly defines "preconfirmed" as a valid state instead of "pending", providing the foundation for consistent terminology across the codebase.
85-85: LGTM! TxKey interface property renamed consistently.The interface correctly defines "arkTxid" instead of "redeemTxid", ensuring type safety for the renamed property across all implementations.
src/wallet/wallet.ts (5)
188-188: Terminology update correctly applied.The state check has been properly updated from "pending" to "preconfirmed" as part of the renaming effort.
259-260: Variable renaming consistently applied.The parameter and variable names have been properly updated from
roundsToIgnoretocommitmentsToIgnorethroughout the method chain.Also applies to: 277-277
297-297: Consistent variable renaming in getBoardingTxs method.All references to the variable have been properly updated from
roundsToIgnoretocommitmentsToIgnore, maintaining consistency across declaration, usage, and return.Also applies to: 302-302, 313-313, 365-365
325-325: State assignment logic updated.The virtual status state assignment has been updated to use "settled" instead of "pending", which aligns with the new terminology.
346-346: Property name updated in transaction key.The property has been correctly renamed from
redeemTxidtoarkTxidas part of the terminology update.src/utils/transactionHistory.ts (7)
10-10: State check correctly updated.The early return condition has been properly updated to check for "preconfirmed" instead of "pending".
44-44: Filter condition updated with new terminology.The state comparison in the filter has been correctly changed from "pending" to "preconfirmed".
76-76: Parameter name consistently updated.The parameter has been properly renamed from
boardingRoundstoboardingBatchTxids, maintaining consistency with the rest of the codebase changes.
87-87: State checks and variable usage updated consistently.Both the state comparison and the set membership check have been correctly updated to use the new terminology ("preconfirmed" and
boardingBatchTxids).Also applies to: 90-90
113-113: Transaction key property names updated.The
TxKeyobject properties have been correctly renamed fromredeemTxidtoarkTxidin both the initialization and assignment.Also applies to: 117-117
115-116: State logic correctly updated.Both the settled calculation and the conditional check have been properly updated to use "preconfirmed" instead of "pending", maintaining the original logic.
171-171: Consistent terminology in second transaction loop.The property naming and state checks in the second loop have been correctly updated to match the changes in the first loop, ensuring consistency throughout the function.
Also applies to: 173-174
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/wallet/onchain.ts (1)
116-121: Fix misleading comment.The comment mentions "prioritizing those closer to expiry" but the implementation actually prioritizes larger coins first (line 130). The current implementation follows a standard "largest first" coin selection strategy.
-/** - * Select coins to reach a target amount, prioritizing those closer to expiry - * @param coins List of coins to select from - * @param targetAmount Target amount to reach in satoshis - * @returns Selected coins and change amount, or null if insufficient funds - */ +/** + * Select coins to reach a target amount, prioritizing larger coins first + * @param coins List of coins to select from + * @param targetAmount Target amount to reach in satoshis + * @returns Selected coins and change amount, or null if insufficient funds + */
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
src/index.ts(4 hunks)src/providers/ark.ts(2 hunks)src/script/tapscript.ts(1 hunks)src/tree/signingSession.ts(7 hunks)src/tree/txTree.ts(6 hunks)src/tree/validation.ts(3 hunks)src/utils/coinselect.ts(0 hunks)src/utils/transactionHistory.ts(5 hunks)src/wallet/onchain.ts(1 hunks)src/wallet/wallet.ts(16 hunks)test/e2e/indexer.test.ts(6 hunks)
💤 Files with no reviewable changes (1)
- src/utils/coinselect.ts
✅ Files skipped from review due to trivial changes (5)
- src/script/tapscript.ts
- src/providers/ark.ts
- src/tree/validation.ts
- src/tree/signingSession.ts
- src/tree/txTree.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/utils/transactionHistory.ts
- src/wallet/wallet.ts
🧰 Additional context used
🧠 Learnings (1)
src/wallet/onchain.ts (1)
Learnt from: louisinger
PR: arkade-os/ts-sdk#115
File: src/wallet/onchain.ts:180-187
Timestamp: 2025-07-07T17:02:12.075Z
Learning: In the OnchainWallet.bumpP2A method in src/wallet/onchain.ts, the return statement in the finally block is intentional. The method is designed to always return the transaction hex strings even if broadcasting fails, allowing callers to handle the transactions as needed.
🧬 Code Graph Analysis (2)
src/wallet/onchain.ts (1)
src/wallet/index.ts (1)
Coin(64-67)
test/e2e/indexer.test.ts (1)
src/tree/txTree.ts (3)
TxTreeChunk(6-12)TxTree(19-225)leaves(169-179)
🔇 Additional comments (9)
src/wallet/onchain.ts (1)
122-157: LGTM! Clean coin selection implementation.The implementation follows a standard "largest first" coin selection strategy, which is efficient and commonly used. The logic correctly handles insufficient funds and calculates change.
src/index.ts (4)
26-26: LGTM! Consistent import renaming.The import change from
TxGraph/TxGraphChunktoTxTree/TxTreeChunkaligns with the PR objective of renaming terminology.
43-47: LGTM! Updated import source.The import source change from
./utils/psbtto./utils/arkTransactionis consistent with the refactoring mentioned in the AI summary.
141-143: LGTM! Consistent export renaming.The export changes from
TxGraphtoTxTreemaintain consistency with the import changes and align with the PR objective.
183-185: LGTM! Consistent type export renaming.The type export changes from
TxGraphChunktoTxTreeChunkcomplete the consistent renaming throughout the module.test/e2e/indexer.test.ts (4)
7-8: LGTM! Consistent test import updates.The import changes from
TxGraph/TxGraphChunktoTxTree/TxTreeChunkalign with the main codebase renaming.
354-354: LGTM! Updated variable type.The type change from
TxGraphChunk[]toTxTreeChunk[]is consistent with the interface changes.
370-374: LGTM! Updated class instantiation and method calls.The changes from
TxGraph.create()toTxTree.create()and the subsequent method calls maintain the same test logic while using the new class interface.
412-434: LGTM! Consistent test updates in second test case.The variable type changes and method calls in the second test case are consistent with the first test case and maintain the same test logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/tsdoc.yml (1)
33-48: Strip trailing whitespace and add terminal newlineTrailing spaces (lines 37, 43, 48, 79) and the missing newline at EOF trip YAML-lint and clutter diffs.
A quick sweep with your editor’s “trim trailing whitespace on save” plus adding a final empty line fixes it.Also applies to: 79-79, 107-107
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/tsdoc.yml(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: louisinger
PR: arkade-os/ts-sdk#115
File: src/wallet/onchain.ts:180-187
Timestamp: 2025-07-07T17:02:12.316Z
Learning: In the OnchainWallet.bumpP2A method in src/wallet/onchain.ts, the return statement in the finally block is intentional. The method is designed to always return the transaction hex strings even if broadcasting fails, allowing callers to handle the transactions as needed.
🪛 actionlint (1.7.7)
.github/workflows/tsdoc.yml
50-50: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
97-97: the runner of "actions/configure-pages@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
107-107: the runner of "actions/deploy-pages@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 YAMLlint (1.37.1)
.github/workflows/tsdoc.yml
[error] 37-37: trailing spaces
(trailing-spaces)
[error] 43-43: trailing spaces
(trailing-spaces)
[error] 48-48: trailing spaces
(trailing-spaces)
[error] 79-79: trailing spaces
(trailing-spaces)
[error] 107-107: no new line character at the end of file
(new-line-at-end-of-file)
[error] 107-107: trailing spaces
(trailing-spaces)
🔇 Additional comments (1)
.github/workflows/tsdoc.yml (1)
68-74: Wildcard insource_dirmay be mis-interpreted by the TSDoc Action
erikyo/tsdoc-actionexpects a directory, not a shell-expanded pattern.
Unless the action explicitly handles globs, use the directory root:- source_dir: ./src/* + source_dir: ./srcVerify locally or in a dry-run to ensure all entry points are picked up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/tsdoc.yml (1)
50-56: Cache action bumped tov4– nice catch
The previous compatibility warning is resolved.
🧹 Nitpick comments (1)
.github/workflows/tsdoc.yml (1)
37-48: Trim trailing whitespace & add newline at EOFYAML linters flag these lines for trailing spaces (37, 43, 48, 78) and a missing newline at EOF (100).
While harmless, CI jobs that enforceyamllintwill fail.- node-version: '20'␠ + node-version: '20' @@ - version: 8␠ + version: 8 @@ - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV␠ + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV @@ - cp -r ./docs-temp/* ${{ steps.version.outputs.path }}/␠ + cp -r ./docs-temp/* ${{ steps.version.outputs.path }}/ @@ - uses: actions/deploy-pages@v4 ␠ + uses: actions/deploy-pages@v4 +Also applies to: 78-80, 100-100
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/tsdoc.yml(1 hunks)test/e2e/ark.test.ts(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- test/e2e/ark.test.ts
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: louisinger
PR: arkade-os/ts-sdk#115
File: src/wallet/onchain.ts:180-187
Timestamp: 2025-07-07T17:02:12.316Z
Learning: In the OnchainWallet.bumpP2A method in src/wallet/onchain.ts, the return statement in the finally block is intentional. The method is designed to always return the transaction hex strings even if broadcasting fails, allowing callers to handle the transactions as needed.
🪛 YAMLlint (1.37.1)
.github/workflows/tsdoc.yml
[error] 37-37: trailing spaces
(trailing-spaces)
[error] 43-43: trailing spaces
(trailing-spaces)
[error] 48-48: trailing spaces
(trailing-spaces)
[error] 78-78: trailing spaces
(trailing-spaces)
[error] 100-100: no new line character at the end of file
(new-line-at-end-of-file)
[error] 100-100: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: louisinger <41042567+louisinger@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
.github/workflows/tsdoc.yml (3)
37-37: Strip trailing whitespace & add missing newline
YAMLlintis already flagging these lines for trailing spaces and a missing
newline at EOF. They are harmless at runtime but still fail linting and make
future diffs noisy.- node-version: '20'␠ + node-version: '20' @@ - with:␠ + with: @@ - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV␠ + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV @@ - cp -r ./docs-temp/* ${{ steps.version.outputs.path }}/␠ + cp -r ./docs-temp/* ${{ steps.version.outputs.path }}/ @@ - uses: actions/deploy-pages@v4 ␠ + uses: actions/deploy-pages@v4 +Also applies to: 43-43, 48-48, 78-78, 105-105
74-78: Remove the temporarydocs-tempdirectory after copy
docs-tempis left behind in the workspace; it’s not part of the artifact, but
it doubles the disk usage for large docs and slows the upload step (runner
needs to scan the entire workspace for.git). A one-liner keeps things
tidy:- cp -r ./docs-temp/* ${{ steps.version.outputs.path }}/ + cp -r ./docs-temp/* ${{ steps.version.outputs.path }}/ + rm -rf ./docs-temp
49-56: Consider usingsetup-node’s built-in pnpm cacheSince you’re already on
actions/setup-node@v4, you can drop the two
extra steps (Get pnpm store directory+Setup pnpm cache) and let the
action handle caching transparently:- - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'pnpm' + cache-dependency-path: '**/pnpm-lock.yaml'Fewer steps, same cache hit rate.
(If you have a reason to keep the manual cache, feel free to ignore.)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/tsdoc.yml(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: louisinger
PR: arkade-os/ts-sdk#115
File: src/wallet/onchain.ts:180-187
Timestamp: 2025-07-07T17:02:12.316Z
Learning: In the OnchainWallet.bumpP2A method in src/wallet/onchain.ts, the return statement in the finally block is intentional. The method is designed to always return the transaction hex strings even if broadcasting fails, allowing callers to handle the transactions as needed.
🪛 YAMLlint (1.37.1)
.github/workflows/tsdoc.yml
[error] 37-37: trailing spaces
(trailing-spaces)
[error] 43-43: trailing spaces
(trailing-spaces)
[error] 48-48: trailing spaces
(trailing-spaces)
[error] 78-78: trailing spaces
(trailing-spaces)
[error] 105-105: no new line character at the end of file
(new-line-at-end-of-file)
[error] 105-105: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.github/workflows/tsdoc.yml (1)
44-56: Leveragesetup-node’s built-in pnpm cache instead of custom steps
actions/setup-node@v4supports native pnpm caching viacache: "pnpm".
Using it removes three explicit steps (store-dir discovery, env export, explicit cache) and shortens the YAML.- - name: Install pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - name: Setup pnpm cache - uses: actions/cache@v4 - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'pnpm' + + - name: Install pnpm + run: corepack enable && corepack prepare pnpm@8 --activateThis keeps caching coverage while simplifying maintenance.
(Feel free to keep the existing approach if you prefer explicit control.)src/providers/indexer.ts (1)
88-96: Consider adding TSDoc comments for the new interface.The
SubscriptionResponseinterface structure looks good. Since this PR includes TSDoc improvements, consider documenting the purpose of each field, especially the optional ones.+/** + * Response structure for subscription updates + */ export interface SubscriptionResponse { + /** Transaction ID associated with the subscription update */ txid?: string; + /** Scripts being monitored in this subscription */ scripts: string[]; + /** New virtual coins created in this update */ newVtxos: VirtualCoin[]; + /** Virtual coins that were spent in this update */ spentVtxos: VirtualCoin[]; + /** Raw transaction data */ tx?: string; + /** Checkpoint transactions mapping */ checkpointTxs?: Record<string, { txid: string; tx: string }>; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/tsdoc.yml(1 hunks)server.Dockerfile(1 hunks)src/providers/indexer.ts(7 hunks)test/e2e/indexer.test.ts(7 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- test/e2e/indexer.test.ts
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/providers/indexer.ts (2)
src/index.ts (2)
PaginationOptions(234-234)VirtualCoin(197-197)src/wallet/index.ts (1)
VirtualCoin(77-83)
🪛 YAMLlint (1.37.1)
.github/workflows/tsdoc.yml
[error] 37-37: trailing spaces
(trailing-spaces)
[error] 43-43: trailing spaces
(trailing-spaces)
[error] 48-48: trailing spaces
(trailing-spaces)
[error] 73-73: no new line character at the end of file
(new-line-at-end-of-file)
[error] 73-73: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
🔇 Additional comments (7)
server.Dockerfile (1)
7-7: LGTM!The default branch change from
next-versiontomasteraligns with the PR's broader renaming objectives.src/providers/indexer.ts (6)
3-6: LGTM!Exporting
PaginationOptionsis appropriate since it's part of the public API and also exported fromsrc/index.ts.
118-121: LGTM!The updated return type using
AsyncIterableIterator<SubscriptionResponse>provides better type safety and clarity for API consumers.
351-362: LGTM!The yielded object correctly implements the
SubscriptionResponseinterface with all required and optional fields properly mapped from the server response.
449-461: Good improvement to query parameter handling!Using multi-collection format (multiple parameters with the same name) is more robust than comma-separated values, especially if the values could potentially contain commas.
544-548: LGTM!The state terminology update from
"pending"to"preconfirmed"correctly aligns with the PR's renaming objectives and matches theisPreconfirmedboolean flag.
574-578: LGTM!The property rename from
redeemTxidtoarkTxidis consistent with the PR's terminology updates throughout the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
README.md (2)
15-19: Align example wording with the new class nameThe inline comment still says “Create a new in-memory key” which comes from the old
InMemoryKeywording. While technically correct (it is still an in-memory key), calling it out explicitly as SingleKey avoids any chance of readers thinking the old type still exists.-// Create a new in-memory key (or use an external signer) +// Create a new SingleKey instance (in-memory) – or use an external signer
363-363: Minor grammar tweak for smoother readingInsert a comma after the back-ticked class to separate the apposition.
-The SDK provides a default implementation of the `Identity` interface: `SingleKey` for managing private keys in memory: +The SDK provides a default implementation of the `Identity` interface: `SingleKey`, for managing private keys in memory:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
README.md(2 hunks)src/index.ts(9 hunks)test/e2e/ark.test.ts(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- test/e2e/ark.test.ts
- src/index.ts
🧰 Additional context used
🪛 LanguageTool
README.md
[grammar] ~363-~363: There might be a mistake here.
Context: ...SingleKey` for managing private keys in memory: typescript class SingleKey { static fromPrivateKey(privateKey: Uint8Array): SingleKey; static fromHex(privateKeyHex: string): SingleKey; } ## Development ### Requirements -...
(QB_NEW_EN_OTHER)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
🔇 Additional comments (1)
README.md (1)
366-368: Snippet looks correctThe updated static factory signatures match the new
SingleKeyclass and are consistent with previous behaviour.
* add arknote tests * refactor arknote to v7 * make hrp a optional constructor variable * refactor tests to test hrp * update ci to work next-version branch * add arknote integration test (#75) * BIP322 Intents (#77) * BIP322 intent * also return message in the intents methods * new round flow (#78) setup test to target next-version branch hotfix note in registerInputsForNextRound fix signingSession.ts * nit: better test instructions (#82) * nit: better test instructions * fix ci * Intent registration (#80) * new round flow setup test to target next-version branch hotfix note in registerInputsForNextRound fix signingSession.ts * use BIP0322 to register intent * ArkNote implements ExtendedCoin * allow all sighash types * remove registerOutputsForNextRound API * offchain transaction w/ checkpoints (#84) * new round flow setup test to target next-version branch hotfix note in registerInputsForNextRound fix signingSession.ts * use BIP0322 to register intent * implement checkpoints * update examples * fix register message * fix tx history (#89) * Support recoverable vtxos (#88) * support recoverable vtxos * update ci.yml * fixes * update e2e test * Drop explorer for indexer (#83) * drop explorer for indexer * remove console.log * fix on returned vtxos * Update src/providers/ark.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: João Bordalo <bordalix@users.noreply.github.com> * separates indexer to own provider * private method createSubscription * implements all methods on indexer provider * remove console.logs * fix build error * add opts to indexer methods * remove not needed export * remove getRound() from ark provider * cleanup ProtoTypes in ark provider * fix export of RestIndexerProvider * refactor indexer to use namespace * adds type guards * fixes * new test * Merge branch 'next-version' into drop_explorer_for_indexer * remove console.log * use paginationOptions * more tests * bug fix * activate tx history test * forfeit address * make methods name lowercase * update endpoints * move indexer tests to indexer.test.ts * update to latest APIs * freeze test on commit deca5ef4699037dcc38a320e50478fc3eae957ec * lint * new util functions to create vtxos * fixes with content-type * new subscribeForScripts test * fix tests --------- Signed-off-by: João Bordalo <bordalix@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: louisinger <louis@vulpem.com> * support for subdust vtxo in ark tx (#98) * add checkpointTapLeafScript in VirtualTxInput (#101) * Rework ark psbt fields (#105) * rework ark psbt fields * use constant as key.type * fix decode * TxGraph, new address and pub/sub (#100) * add tx graph, remove tx tree class * fix signingSession.ts and txGraph.ts * new address encoding * compatibilty with arkd next-version * rename and move unilateral exit e2e test * update examples * update README.md * update README.md * add e2e test case * update index.ts * fixes indexer.go * cleaning validation.go * renaming tests * Remove onchain wallet from `Wallet`, add `OnchainWallet` class (#102) * add OnchainWallet class * "send" --> "sendBitcoin" * update WalletBalance * fix src/index.ts * fix ark.test.ts * update README * remove network from WalletConfig * test on 783ba19512f0ddf87962a558576acc9389d0bd7e arkd * fix serviceWorker/wallet.ts * cleaning * update WalletBalance * get dust amount from server * remove getAddressInfo * getAddress & getBoardingAddress * update README * update tests * update test/e2e/utils.ts * Update to latest next-version arkd (#112) * update to latest next-version arkd * add more e2e indexer tests * server.Dockerfile: test on next-version * skip failing tests * ServiceWorkerWallet implements Identity (#114) * ServiceWorkerWallet implements Identity * fix error message * fix tests after arkd v0.7 (#118) * Unilateral exit v7 (#115) * add AnchorBumper interface and rework exit (renamed "unroll") * unilareral exit v7 * update README * Update src/wallet/wallet.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: louisinger <41042567+louisinger@users.noreply.github.com> * Update src/wallet/wallet.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: louisinger <41042567+louisinger@users.noreply.github.com> * fix selectcoins * Revert "fix selectcoins" This reverts commit 9a52311. * cleaning coinselect.ts * clean * remove hardcoded 600 sats, add "forceChange" boolean in selectCoins * handle undefined getFeeRate * use blocks/tip endpoint * Unroll namespace * Update src/wallet/unroll.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: louisinger <41042567+louisinger@users.noreply.github.com> * Update src/wallet/unroll.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: louisinger <41042567+louisinger@users.noreply.github.com> * ark.test.ts: switch case * add compleUnroll function, remove it from Wallet interface --------- Signed-off-by: louisinger <41042567+louisinger@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * add Ramps class (#119) * Update README.md Signed-off-by: Marco Argentieri <3596602+tiero@users.noreply.github.com> * Update to latest arkd, renaming and TSDoc (#108) * renaming * remove unused imports * update names, JSDocs * update index.ts * remove unused dev deps * remove "lint-staged" * add "arkade" keyword to pkg.json * TSDoc * add TSDoc generation * add tsdoc.yml workflow * remove upload * use pnpm docs:build * fix * trigger TSDoc deploy on next-version and master push * Update .github/workflows/tsdoc.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: louisinger <41042567+louisinger@users.noreply.github.com> * update to master (v0.7.0-rc2) * update tsdoc.yml * rename "chunk" to "node" * rename InMemoryKey -> SingleKey --------- Signed-off-by: louisinger <41042567+louisinger@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * tsdoc.yml: trigger on version tag * update README.md * add Wallet.NotifyIncomingFunds method (#95) * new notifyIncomingFunds method on onchain provider * track multi addresses * ignore error * new util function faucetOnchain() * new wallet method notifyIncomingFunds() * tests: make sure there was a notification * Uses built in WebSocket instead of isomorphic-ws Adds new stopFunc() in callback for notifyIncomingFunds New tests on the WebSocket * remove console.log * polyfill WebSocket for github tests * Update src/providers/onchain.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: João Bordalo <bordalix@users.noreply.github.com> * new waitForIncomingFunds() func * fix readme * Update src/wallet/wallet.ts Co-authored-by: louisinger <41042567+louisinger@users.noreply.github.com> Signed-off-by: João Bordalo <bordalix@users.noreply.github.com> * Update src/wallet/wallet.ts Co-authored-by: louisinger <41042567+louisinger@users.noreply.github.com> Signed-off-by: João Bordalo <bordalix@users.noreply.github.com> * make waitForIncomingFunds a utils function * Update src/providers/onchain.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: João Bordalo <bordalix@users.noreply.github.com> * Update test/e2e/ark.test.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: João Bordalo <bordalix@users.noreply.github.com> * update src/utils/waitForIncomingFunds.ts * lint * update readme * Handle missing outputs gracefully instead of throwing errors * Fix variable naming and incorrect property access. * Improve WebSocket URL construction robustness * fix test * fix test * refactor notifyIncomingFunds to return stopFunc * refactor esplora tests * Update README.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: João Bordalo <bordalix@users.noreply.github.com> * Update src/utils/waitForIncomingFunds.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: João Bordalo <bordalix@users.noreply.github.com> * Fix the infinite loop that prevents the method from returning * fix docker files * fix docker-compose.yml * add VERSION to dockerfile * skip "should redeem a note" test * fix note test * remove watchAddresses test * remove "ws" devDeps * remove testing purpose only interface parameter * do not export unused types * Update src/providers/onchain.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: louisinger <41042567+louisinger@users.noreply.github.com> * remove setup-polyfill * fix * fallback to polling if WebSocket not available * fix test * fix test * update README * add SubscriptionResponse to index.ts exports * remove MockWebSocket * remove extra blanck line * revert vitest.config.ts --------- Signed-off-by: João Bordalo <bordalix@users.noreply.github.com> Signed-off-by: louisinger <41042567+louisinger@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: louisinger <41042567+louisinger@users.noreply.github.com> Co-authored-by: louisinger <louis@vulpem.com> * add tsdoc comments (#120) * handle FetchTimeout in new streaming functions * remove duplicated code * CI: run down to delete dev env * freeze test on v0.7.0 tag * update examples * Dockerfiles: use tag to checkout v0.7.0 * remove useless docker env vars * rename virtualTx -> arkTx * fix capture ark logs in CI * add sleep to indexer.test.ts * arkade wallet hotfix --------- Signed-off-by: João Bordalo <bordalix@users.noreply.github.com> Signed-off-by: louisinger <41042567+louisinger@users.noreply.github.com> Signed-off-by: Marco Argentieri <3596602+tiero@users.noreply.github.com> Co-authored-by: João Bordalo <bordalix@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Marco Argentieri <3596602+tiero@users.noreply.github.com>
This PR is renaming fields to new terminology #69
@Kukks please review
Summary by CodeRabbit
New Features
Refactor
InMemoryKeytoSingleKeythroughout the codebase and documentation.TxGraph/TxGraphChunkwithTxTree/TxTreeNodefor transaction structure representation."pending"to"preconfirmed".redeemTxidtoarkTxid.SingleKey.Documentation
Chores
.gitignoreentry for documentation output.master.