-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import { | ||
getNativeSegwitAccountDerivationPath, | ||
getTaprootAccountDerivationPath, | ||
} from '@leather-wallet/bitcoin'; | ||
Comment on lines
+1
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. ToolsGitHub Check: typecheck
|
||
import Transport from '@ledgerhq/hw-transport-webusb'; | ||
import { Psbt } from 'bitcoinjs-lib'; | ||
import BitcoinApp, { DefaultWalletPolicy } from 'ledger-bitcoin'; | ||
import { PartialSignature } from 'ledger-bitcoin/build/main/lib/appClient'; | ||
|
||
import { BitcoinNetworkModes } from '@shared/constants'; | ||
import { getTaprootAccountDerivationPath } from '@shared/crypto/bitcoin/p2tr-address-gen'; | ||
import { getNativeSegwitAccountDerivationPath } from '@shared/crypto/bitcoin/p2wpkh-address-gen'; | ||
|
||
import { LEDGER_APPS_MAP, promptOpenAppOnDevice } from './generic-ledger-utils'; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import { getNativeSegwitAddressIndexDerivationPath } from '@leather-wallet/bitcoin'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification The package
Analysis chainVerify the installation of Scripts executedThe 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 ToolsGitHub Check: typecheck
|
||
import type { Inscription } from '@leather-wallet/models'; | ||
import type { UtxoWithDerivationPath } from '@leather-wallet/query'; | ||
|
||
import { BitcoinNetworkModes } from '@shared/constants'; | ||
import { getNativeSegwitAddressIndexDerivationPath } from '@shared/crypto/bitcoin/p2wpkh-address-gen'; | ||
|
||
interface CreateUtxoFromInscriptionArgs { | ||
inscription: Inscription; | ||
network: BitcoinNetworkModes; | ||
accountIndex: number; | ||
inscriptionAddressIdx: number; | ||
} | ||
|
||
export function createUtxoFromInscription({ | ||
inscription, | ||
network, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { useCallback } from 'react'; | ||
|
||
import { | ||
getNativeSegwitAddressIndexDerivationPath, | ||
getTaprootAddressIndexDerivationPath, | ||
} from '@leather-wallet/bitcoin'; | ||
Comment on lines
+4
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 - import {
- getNativeSegwitAddressIndexDerivationPath,
- getTaprootAddressIndexDerivationPath,
- } from '@leather-wallet/bitcoin';
+ // Ensure the correct path or package name is used here
ToolsGitHub Check: typecheck
|
||
import { HDKey, Versions } from '@scure/bip32'; | ||
import * as btc from '@scure/btc-signer'; | ||
|
||
|
@@ -9,8 +13,6 @@ import { | |
deriveAddressIndexKeychainFromAccount, | ||
whenPaymentType, | ||
} from '@shared/crypto/bitcoin/bitcoin.utils'; | ||
import { getTaprootAddressIndexDerivationPath } from '@shared/crypto/bitcoin/p2tr-address-gen'; | ||
import { getNativeSegwitAddressIndexDerivationPath } from '@shared/crypto/bitcoin/p2wpkh-address-gen'; | ||
import { AllowedSighashTypes } from '@shared/rpc/methods/sign-psbt'; | ||
|
||
import { useBitcoinExtendedPublicKeyVersions } from './bitcoin-keychain'; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
import { PaymentTypes } from '@btckit/types'; | ||
import { | ||
getNativeSegwitAccountDerivationPath, | ||
getTaprootAccountDerivationPath, | ||
} from '@leather-wallet/bitcoin'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The module ToolsGitHub Check: typecheck
|
||
import { isNumber, isUndefined } from '@leather-wallet/utils'; | ||
import { bytesToHex } from '@noble/hashes/utils'; | ||
import * as btc from '@scure/btc-signer'; | ||
|
@@ -11,8 +15,6 @@ import { | |
getInputPaymentType, | ||
getTaprootAddress, | ||
} from '@shared/crypto/bitcoin/bitcoin.utils'; | ||
import { getTaprootAccountDerivationPath } from '@shared/crypto/bitcoin/p2tr-address-gen'; | ||
import { getNativeSegwitAccountDerivationPath } from '@shared/crypto/bitcoin/p2wpkh-address-gen'; | ||
import { | ||
BitcoinInputSigningConfig, | ||
getAssumedZeroIndexSigningConfig, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
import { useMemo } from 'react'; | ||
import { useSelector } from 'react-redux'; | ||
|
||
import { | ||
deriveNativeSegwitAccountFromRootKeychain, | ||
getNativeSegWitPaymentFromAddressIndex, | ||
getNativeSegwitAccountDerivationPath, | ||
} from '@leather-wallet/bitcoin'; | ||
Comment on lines
+5
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 - import {
- deriveNativeSegwitAccountFromRootKeychain,
- getNativeSegWitPaymentFromAddressIndex,
- getNativeSegwitAccountDerivationPath,
- } from '@leather-wallet/bitcoin';
+ // Ensure the correct path or package name is used here
ToolsGitHub Check: typecheck
|
||
import { reverseBytes } from '@leather-wallet/utils'; | ||
import { createSelector } from '@reduxjs/toolkit'; | ||
import { Psbt } from 'bitcoinjs-lib'; | ||
|
@@ -10,11 +15,6 @@ import { | |
extractAddressIndexFromPath, | ||
lookUpLedgerKeysByPath, | ||
} from '@shared/crypto/bitcoin/bitcoin.utils'; | ||
import { | ||
deriveNativeSegwitAccountFromRootKeychain, | ||
getNativeSegWitPaymentFromAddressIndex, | ||
getNativeSegwitAccountDerivationPath, | ||
} from '@shared/crypto/bitcoin/p2wpkh-address-gen'; | ||
import { BitcoinInputSigningConfig } from '@shared/crypto/bitcoin/signer-config'; | ||
import { analytics } from '@shared/utils/analytics'; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
import { useMemo } from 'react'; | ||
import { useSelector } from 'react-redux'; | ||
|
||
import { | ||
deriveTaprootAccount, | ||
getTaprootAccountDerivationPath, | ||
getTaprootPaymentFromAddressIndex, | ||
} from '@leather-wallet/bitcoin'; | ||
Comment on lines
+5
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 - import {
- deriveTaprootAccount,
- getTaprootAccountDerivationPath,
- getTaprootPaymentFromAddressIndex,
- } from '@leather-wallet/bitcoin';
+ // Ensure the correct path or package name is used here
ToolsGitHub Check: typecheck
|
||
import { createSelector } from '@reduxjs/toolkit'; | ||
import { Psbt } from 'bitcoinjs-lib'; | ||
|
||
|
@@ -10,11 +15,6 @@ import { | |
extractAddressIndexFromPath, | ||
lookUpLedgerKeysByPath, | ||
} from '@shared/crypto/bitcoin/bitcoin.utils'; | ||
import { | ||
deriveTaprootAccount, | ||
getTaprootAccountDerivationPath, | ||
getTaprootPaymentFromAddressIndex, | ||
} from '@shared/crypto/bitcoin/p2tr-address-gen'; | ||
import { BitcoinInputSigningConfig } from '@shared/crypto/bitcoin/signer-config'; | ||
|
||
import { selectCurrentNetwork, useCurrentNetwork } from '@app/store/networks/networks.selectors'; | ||
|
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.Tools
GitHub Check: typecheck