-
Notifications
You must be signed in to change notification settings - Fork 13
Delegator #311
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
base: master
Are you sure you want to change the base?
Delegator #311
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the
WalkthroughUpdated dependency source for Changes
Sequence Diagram(s)sequenceDiagram
rect rgba(220,240,255,0.5)
participant App
participant WalletProvider
participant ServiceWorkerWallet
participant DelegatorAPI
end
App->>WalletProvider: call initSvcWorkerWallet(..., delegatorUrl)
WalletProvider->>ServiceWorkerWallet: setup(..., delegatorUrl)
ServiceWorkerWallet->>DelegatorAPI: use delegatorUrl for delegation calls
DelegatorAPI-->>ServiceWorkerWallet: delegation responses
ServiceWorkerWallet-->>WalletProvider: setup complete
WalletProvider-->>App: wallet initialized
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
Deploying wallet-bitcoin with
|
| Latest commit: |
339de71
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1b526645.wallet-bitcoin.pages.dev |
| Branch Preview URL: | https://delegator.wallet-bitcoin.pages.dev |
Deploying wallet-mutinynet with
|
| Latest commit: |
339de71
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1bbdccf8.arkade-wallet.pages.dev |
| Branch Preview URL: | https://delegator.arkade-wallet.pages.dev |
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/providers/wallet.tsx (1)
234-240:delegatorUrlis not passed in the retry call.When retrying after a timeout,
delegatorUrlis not forwarded to the recursive call, causing it to fall back to the default value instead of preserving the originally provided URL.🐛 Proposed fix
return initSvcWorkerWallet({ arkServerUrl, esploraUrl, privateKey, retryCount: retryCount + 1, maxRetries, + delegatorUrl, })
🤖 Fix all issues with AI agents
In `@package.json`:
- Line 8: The package.json entry for the dependency "@arkade-os/sdk":
"github:louisinger/wallet-sdk#delegator" points to a mutable personal-branch;
replace it with a stable reference before merging by either (a) switching to the
published npm version of `@arkade-os/sdk` that contains the delegator changes
(e.g., "@arkade-os/sdk": "x.y.z"), or (b) pinning the GitHub reference to an
immutable commit SHA (e.g., "github:louisinger/wallet-sdk#<commit-sha>") and, if
possible, use the organization’s repository instead of a personal fork to ensure
reproducible builds.
In `@src/providers/wallet.tsx`:
- Line 167: The default delegatorUrl is hardcoded to Mutiny testnet; update the
code that sets delegatorUrl to derive it from the active network instead of a
fixed string: use aspInfo.network (or the same network source used for
esploraUrl) and compute the delegator base via a helper similar to
getRestApiExplorerURL (or add a getDelegatorURL(network) function) so the
delegatorUrl choice follows the network/environment and works for mainnet and
other networks.
| "dependencies": { | ||
| "@arkade-os/boltz-swap": "0.2.18", | ||
| "@arkade-os/sdk": "0.3.12", | ||
| "@arkade-os/sdk": "github:louisinger/wallet-sdk#delegator", |
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.
GitHub branch dependency is not suitable for production.
Using github:louisinger/wallet-sdk#delegator references a mutable branch in a personal fork, which:
- Makes builds non-reproducible (the branch content can change at any time)
- Creates a dependency on a personal repository rather than the organization's
- Will break if the branch is deleted or force-pushed
Before merging to master, this should be replaced with either:
- A published npm version containing the delegator changes
- A commit SHA reference for reproducibility (e.g.,
github:louisinger/wallet-sdk#<commit-sha>)
🤖 Prompt for AI Agents
In `@package.json` at line 8, The package.json entry for the dependency
"@arkade-os/sdk": "github:louisinger/wallet-sdk#delegator" points to a mutable
personal-branch; replace it with a stable reference before merging by either (a)
switching to the published npm version of `@arkade-os/sdk` that contains the
delegator changes (e.g., "@arkade-os/sdk": "x.y.z"), or (b) pinning the GitHub
reference to an immutable commit SHA (e.g.,
"github:louisinger/wallet-sdk#<commit-sha>") and, if possible, use the
organization’s repository instead of a personal fork to ensure reproducible
builds.
src/providers/wallet.tsx
Outdated
| privateKey, | ||
| retryCount = 0, | ||
| maxRetries = 5, | ||
| delegatorUrl = 'https://delegator.mutinynet.arkade.sh/', |
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.
Hardcoded delegator URL is environment-specific.
The default delegatorUrl is hardcoded to mutinynet, but the wallet supports multiple networks (the codebase has start:mainnet script and uses aspInfo.network). This URL won't work for mainnet deployments.
Consider deriving the delegator URL from the network/environment configuration, similar to how esploraUrl is derived via getRestApiExplorerURL(network).
🤖 Prompt for AI Agents
In `@src/providers/wallet.tsx` at line 167, The default delegatorUrl is hardcoded
to Mutiny testnet; update the code that sets delegatorUrl to derive it from the
active network instead of a fixed string: use aspInfo.network (or the same
network source used for esploraUrl) and compute the delegator base via a helper
similar to getRestApiExplorerURL (or add a getDelegatorURL(network) function) so
the delegatorUrl choice follows the network/environment and works for mainnet
and other networks.
Summary by CodeRabbit
Chores
Known Issue
✏️ Tip: You can customize this high-level summary in your review settings.