-
Notifications
You must be signed in to change notification settings - Fork 149
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
refactor: upgrade @noble/*
& @scure/*
packages
#5488
Conversation
Warning Rate limit exceeded@kyranjamie has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 14 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe updates primarily involve version changes and reorganizing imports across various files. Key modifications include updating package versions in Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
1c5b34d
to
ad2d924
Compare
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.
🚀
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: 10
Outside diff range and nitpick comments (1)
src/shared/crypto/bitcoin/bitcoin.utils.ts (1)
Line range hint
145-145
: Remove the unnecessary type constraint on the generic function.- export function whenPaymentType<T extends unknown>(mode: PaymentType | BtcSignerLibPaymentTypeIdentifer) { + export function whenPaymentType<T>(mode: PaymentType | BtcSignerLibPaymentTypeIdentifer) {Tools
GitHub Check: typecheck
[failure] 7-7:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!pnpm-lock.yaml
Files selected for processing (20)
- package.json (3 hunks)
- src/app/common/psbt/requests.ts (1 hunks)
- src/app/components/loaders/bitcoin-account-loader.tsx (1 hunks)
- src/app/components/loaders/current-bitcoin-signer-loader.tsx (1 hunks)
- src/app/features/ledger/flows/request-bitcoin-keys/request-bitcoin-keys.utils.ts (1 hunks)
- src/app/features/ledger/utils/bitcoin-ledger-utils.ts (1 hunks)
- src/app/features/psbt-signer/hooks/use-parsed-inputs.tsx (2 hunks)
- src/app/features/psbt-signer/hooks/use-parsed-outputs.tsx (2 hunks)
- src/app/features/psbt-signer/hooks/use-psbt-details.tsx (2 hunks)
- src/app/features/psbt-signer/hooks/use-psbt-signer.tsx (3 hunks)
- src/app/pages/send/ordinal-inscription/components/create-utxo-from-inscription.ts (1 hunks)
- src/app/query/bitcoin/ordinals/brc20/brc20-tokens.hooks.ts (2 hunks)
- src/app/store/accounts/blockchain/bitcoin/bitcoin-signer.ts (1 hunks)
- src/app/store/accounts/blockchain/bitcoin/bitcoin.hooks.ts (1 hunks)
- src/app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks.ts (1 hunks)
- src/app/store/accounts/blockchain/bitcoin/taproot-account.hooks.ts (1 hunks)
- src/shared/crypto/bitcoin/bitcoin.utils.ts (4 hunks)
- src/shared/crypto/bitcoin/signer-config.spec.ts (1 hunks)
- src/shared/crypto/bitcoin/signer-config.ts (1 hunks)
- src/shared/rpc/methods/sign-psbt.ts (2 hunks)
Files skipped from review due to trivial changes (1)
- src/app/query/bitcoin/ordinals/brc20/brc20-tokens.hooks.ts
Additional context used
GitHub Check: typecheck
src/app/pages/send/ordinal-inscription/components/create-utxo-from-inscription.ts
[failure] 1-1:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.src/shared/crypto/bitcoin/signer-config.ts
[failure] 6-6:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.src/shared/crypto/bitcoin/signer-config.spec.ts
[failure] 9-9:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.src/app/features/ledger/utils/bitcoin-ledger-utils.ts
[failure] 9-9:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.src/app/features/ledger/flows/request-bitcoin-keys/request-bitcoin-keys.utils.ts
[failure] 6-6:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.src/app/store/accounts/blockchain/bitcoin/taproot-account.hooks.ts
[failure] 11-11:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.src/app/store/accounts/blockchain/bitcoin/bitcoin-signer.ts
[failure] 9-9:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.src/app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks.ts
[failure] 11-11:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.src/shared/crypto/bitcoin/bitcoin.utils.ts
[failure] 7-7:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.src/app/store/accounts/blockchain/bitcoin/bitcoin.hooks.ts
[failure] 10-10:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
Biome
src/shared/crypto/bitcoin/bitcoin.utils.ts
[error] 145-145: Constraining a type parameter to any or unknown is useless. (lint/complexity/noUselessTypeConstraint)
All types are subtypes of any and unknown.
Safe fix: Remove the constraint.
Additional comments not posted (20)
src/app/common/psbt/requests.ts (2)
3-3
: Updated import path aligns with the new package structure.
11-11
: Type update inSignPsbtArgs
is consistent with the new import paths and ensures type consistency.src/app/components/loaders/current-bitcoin-signer-loader.tsx (1)
1-1
: Updated import path aligns with the new package structure.src/app/pages/send/ordinal-inscription/components/create-utxo-from-inscription.ts (1)
1-1
: Updated import path aligns with the new package structure.Tools
GitHub Check: typecheck
[failure] 1-1:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.src/app/features/psbt-signer/hooks/use-psbt-signer.tsx (2)
6-6
: Updated import paths align with the new package structure.
16-16
: Type update inRawPsbt
is consistent with the new import paths and ensures type consistency.src/shared/rpc/methods/sign-psbt.ts (3)
1-1
: Updated imports to align with new package versions and structures.Also applies to: 5-9
22-22
: UpdatedAllowedSighashTypes
to include types from both updated packages.
25-32
: UpdatedallSighashTypes
constants to align with the new type definitions.src/app/components/loaders/bitcoin-account-loader.tsx (1)
1-1
: Updated import path forP2Ret
to reflect new module structure.src/app/features/psbt-signer/hooks/use-parsed-outputs.tsx (1)
4-4
: Updated import path forTransactionOutput
to reflect new module structure.src/app/features/psbt-signer/hooks/use-psbt-details.tsx (2)
3-3
: Updated import paths align with the new package structure.
17-19
: Updated type definitions forinputs
andoutputs
enhance type safety and consistency.src/app/features/psbt-signer/hooks/use-parsed-inputs.tsx (2)
6-6
: Updated import path forTransactionInput
aligns with the new package structure.
27-27
: Updated type definition forinputs
enhances type safety and consistency.src/shared/crypto/bitcoin/bitcoin.utils.ts (2)
5-5
: Updated import paths to be more specific, aligning with the new package structure.
100-100
: Refactored functions to use the updatedTransactionInput
andTransactionOutput
types. Ensure that all dependent modules and functions are updated to handle these new types correctly.Also applies to: 111-111, 253-253, 260-260, 266-266
src/app/store/accounts/blockchain/bitcoin/bitcoin.hooks.ts (1)
7-10
: Updated import paths to be more specific, aligning with the new package structure.Tools
GitHub Check: typecheck
[failure] 10-10:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.package.json (2)
257-259
: Added new package@leather-wallet/panda-preset
. Ensure it is used appropriately in the project and integrated correctly.
Line range hint
138-162
: Updated package versions to align with the latest releases. Ensure that all dependencies are compatible and that there are no breaking changes in the updated versions.
import { | ||
getNativeSegwitAddressIndexDerivationPath, | ||
getTaprootAddressIndexDerivationPath, | ||
} from '@leather-wallet/bitcoin'; |
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.
Updated import paths for derivation path functions. However, there is a static analysis failure indicating a missing module.
Please verify the existence and correct installation of the @leather-wallet/bitcoin
module.
Tools
GitHub Check: typecheck
[failure] 6-6:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
import { hexToBytes } from '@noble/hashes/utils'; | ||
import { HDKey, Versions } from '@scure/bip32'; | ||
import * as btc from '@scure/btc-signer'; | ||
import type { TransactionInput, TransactionOutput } from '@scure/btc-signer/psbt'; | ||
|
||
import { getTaprootPayment } from '@leather-wallet/bitcoin'; |
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.
The module @leather-wallet/bitcoin
cannot be found. Ensure the package is correctly installed and included in package.json
.
Tools
GitHub Check: typecheck
[failure] 7-7:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
import { | ||
getNativeSegwitAccountDerivationPath, | ||
getTaprootAccountDerivationPath, | ||
} from '@leather-wallet/bitcoin'; |
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.
The module @leather-wallet/bitcoin
cannot be found. Ensure the package is correctly installed and included in package.json
.
Tools
GitHub Check: typecheck
[failure] 10-10:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
import { | ||
getNativeSegwitAccountDerivationPath, | ||
getTaprootAccountDerivationPath, | ||
} from '@leather-wallet/bitcoin'; |
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.
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
Please verify the existence of the module and ensure that its type declarations are correctly configured.
Tools
GitHub Check: typecheck
[failure] 9-9:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
import { | ||
getNativeSegwitAccountDerivationPath, | ||
getTaprootAccountDerivationPath, | ||
} from '@leather-wallet/bitcoin'; |
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.
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
Please verify the existence of the module and ensure that its type declarations are correctly configured.
Tools
GitHub Check: typecheck
[failure] 9-9:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
getNativeSegwitAccountDerivationPath, | ||
getTaprootAccountDerivationPath, | ||
} from '@leather-wallet/bitcoin'; |
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.
Update import paths to ensure they are correctly resolved.
The static analysis tool reports that the module @leather-wallet/bitcoin
cannot be found. This could be due to the module not being installed or incorrect path configurations. Please ensure that the package is correctly installed and the paths are correctly set in the TypeScript configuration.
- import {
- getNativeSegwitAccountDerivationPath,
- getTaprootAccountDerivationPath,
- } from '@leather-wallet/bitcoin';
+ // Ensure the correct path or package name is used here
Committable suggestion was skipped due to low confidence.
Tools
GitHub Check: typecheck
[failure] 6-6:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
deriveTaprootAccount, | ||
getTaprootAccountDerivationPath, | ||
getTaprootPaymentFromAddressIndex, | ||
} from '@leather-wallet/bitcoin'; |
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.
Update import paths to ensure they are correctly resolved.
The static analysis tool reports that the module @leather-wallet/bitcoin
cannot be found. This could be due to the module not being installed or incorrect path configurations. Please ensure that the package is correctly installed and the paths are correctly set in the TypeScript configuration.
- import {
- deriveTaprootAccount,
- getTaprootAccountDerivationPath,
- getTaprootPaymentFromAddressIndex,
- } from '@leather-wallet/bitcoin';
+ // Ensure the correct path or package name is used here
Committable suggestion was skipped due to low confidence.
Tools
GitHub Check: typecheck
[failure] 11-11:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
getNativeSegwitAddressIndexDerivationPath, | ||
getTaprootAddressIndexDerivationPath, | ||
} from '@leather-wallet/bitcoin'; |
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.
Update import paths to ensure they are correctly resolved.
The static analysis tool reports that the module @leather-wallet/bitcoin
cannot be found. This could be due to the module not being installed or incorrect path configurations. Please ensure that the package is correctly installed and the paths are correctly set in the TypeScript configuration.
- import {
- getNativeSegwitAddressIndexDerivationPath,
- getTaprootAddressIndexDerivationPath,
- } from '@leather-wallet/bitcoin';
+ // Ensure the correct path or package name is used here
Committable suggestion was skipped due to low confidence.
Tools
GitHub Check: typecheck
[failure] 9-9:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
deriveNativeSegwitAccountFromRootKeychain, | ||
getNativeSegWitPaymentFromAddressIndex, | ||
getNativeSegwitAccountDerivationPath, | ||
} from '@leather-wallet/bitcoin'; |
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.
Update import paths to ensure they are correctly resolved.
The static analysis tool reports that the module @leather-wallet/bitcoin
cannot be found. This could be due to the module not being installed or incorrect path configurations. Please ensure that the package is correctly installed and the paths are correctly set in the TypeScript configuration.
- import {
- deriveNativeSegwitAccountFromRootKeychain,
- getNativeSegWitPaymentFromAddressIndex,
- getNativeSegwitAccountDerivationPath,
- } from '@leather-wallet/bitcoin';
+ // Ensure the correct path or package name is used here
Committable suggestion was skipped due to low confidence.
Tools
GitHub Check: typecheck
[failure] 11-11:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
@@ -1,16 +1,15 @@ | |||
import { getNativeSegwitAddressIndexDerivationPath } from '@leather-wallet/bitcoin'; |
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.
Tip
Codebase Verification
The package @leather-wallet/bitcoin
is listed in package.json
but is missing from node_modules
. Please ensure that the package is installed by running npm install
. After installation, verify that the type declarations are present in the package directory.
- Ensure
@leather-wallet/bitcoin
is installed. - Verify the presence of type declarations in
node_modules/@leather-wallet/bitcoin
.
Analysis chain
Verify the installation of @leather-wallet/bitcoin
and ensure that its type declarations are available.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the package `@leather-wallet/bitcoin` is installed and if its type declarations are present.
# Test: Search for the package in node_modules and its type declarations.
if [ -d "node_modules/@leather-wallet/bitcoin" ] && [ -f "node_modules/@leather-wallet/bitcoin/index.d.ts" ]; then
echo "Package and type declarations are present."
else
echo "Package or type declarations are missing."
fi
Length of output: 142
Script:
#!/bin/bash
# Check if the package `@leather-wallet/bitcoin` is listed in package.json
if grep -q '"@leather-wallet/bitcoin"' package.json; then
echo "Package is listed in package.json."
else
echo "Package is not listed in package.json."
fi
# List the contents of the package directory to check for type declarations
if [ -d "node_modules/@leather-wallet/bitcoin" ]; then
echo "Contents of node_modules/@leather-wallet/bitcoin:"
ls -l node_modules/@leather-wallet/bitcoin
else
echo "Package directory is missing in node_modules."
fi
Length of output: 280
Script:
#!/bin/bash
# Attempt to install the missing package
npm install
# Check the installation logs for any errors related to `@leather-wallet/bitcoin`
if grep -i '@leather-wallet/bitcoin' npm-debug.log; then
echo "Errors related to @leather-wallet/bitcoin found in npm-debug.log."
else
echo "No errors related to @leather-wallet/bitcoin found in npm-debug.log."
fi
# Verify if the package directory is now present in node_modules
if [ -d "node_modules/@leather-wallet/bitcoin" ]; then
echo "Package directory is now present in node_modules."
else
echo "Package directory is still missing in node_modules."
fi
Length of output: 489
Tools
GitHub Check: typecheck
[failure] 1-1:
Cannot find module '@leather-wallet/bitcoin' or its corresponding type declarations.
6661d71
to
abcacc1
Compare
abcacc1
to
c4682c3
Compare
Next I'll migrate over all the bitcoin code
Summary by CodeRabbit
New Features
@leather-wallet/panda-preset
version0.2.0
.Bug Fixes
Refactor
Chores