Skip to content
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

Release/fund config #4579

Merged
merged 35 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c3c7bd1
chore: post-release merge back
kyranjamie Nov 17, 2023
99fb117
refactor: remove stacks ui
fbwoolf Oct 31, 2023
a6588dc
fix: account circle numbers and delete unused code
edgarkhanzadian Nov 17, 2023
83c4d04
fix: skip bitcoin contract tests
Nov 20, 2023
6b75267
fix: provider name in tests
Nov 20, 2023
3ad4b06
fix: axios get request for config
Nov 20, 2023
b035f20
fix: qr code
Nov 17, 2023
870574a
feat: extended add-network page with the option to add bitcoin networ…
Polybius93 Oct 12, 2023
be8b040
chore: remove patch file
kyranjamie Nov 16, 2023
c8724b4
fix: fixed previously saved network loading
Polybius93 Nov 21, 2023
2807b50
chore: update panda
pete-watters Nov 17, 2023
954e707
fix: psbt bare utxo signing
fbwoolf Jul 25, 2023
c44a7bb
chore: remove unneeded parent button, closes #4550
pete-watters Nov 22, 2023
b387903
chore: use tokens for border radius
pete-watters Nov 22, 2023
800fa3e
chore: update font and color for receive asset
pete-watters Nov 22, 2023
0742719
feat: updated dlc-tools package, modified accept bitcoin contract rpc…
Polybius93 Nov 21, 2023
0b47dea
fix: sign out and close all tabs on create wallet, closes #4517
pete-watters Nov 22, 2023
fbc6580
chore: migrate icons
pete-watters Nov 20, 2023
91403d7
refactor: icon tokens
Nov 21, 2023
98f5ddf
chore: fix type errors
pete-watters Nov 22, 2023
1fa4e6c
refactor: remove remaining old icon libraries
Nov 22, 2023
c86f2ab
chore: update readme
kyranjamie Nov 24, 2023
0095ebc
fix: minor ui bugs
fbwoolf Nov 24, 2023
8d61e93
fix: give more margin to Continue button in extension mode, closes #4423
pete-watters Nov 27, 2023
31ddc89
fix: align heading text left, closes #4423
pete-watters Nov 27, 2023
8dbfefe
fix(popup): avatar circle on stacks transactions
edgarkhanzadian Nov 27, 2023
e9da651
fix: mark ui bugs
fbwoolf Nov 27, 2023
b7a34a9
fix: filter network dust amounts when sending all
kyranjamie Nov 16, 2023
8a81f58
feat: support bitcoin ledger, closes #2893
kyranjamie Jul 27, 2023
97854b0
chore: remove bitcoinjs-lib from inscription send
kyranjamie Nov 28, 2023
222a854
fix: allow users to click input when populated, closes #4582
pete-watters Nov 28, 2023
cddf09b
fix: remove not working onFocusborder, to be fixed in #4583
pete-watters Nov 28, 2023
3f5718c
fix: bitcoin fees tx size calc
fbwoolf Nov 27, 2023
41fef37
fix: add background state for ledger connect modal
kyranjamie Nov 28, 2023
e284fae
test: removing babel
kyranjamie Nov 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 8 additions & 7 deletions .dependency-cruiser.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ module.exports = {
from: { path: '^src/app/features/.*' },
to: { path: '^src/app/pages/.*' },
},
{
name: 'only-allow-react-icons-fi',
comment: 'Ensure only icons from `fi` group are allowed',
severity: 'error',
from: { path: '^src' },
to: { path: 'react-icons.*', pathNot: 'react-icons/fi' },
},
// TODO: Replace in future with new icon library
// {
// name: 'only-allow-react-icons-fi',
// comment: 'Ensure only icons from `fi` group are allowed',
// severity: 'error',
// from: { path: '^src' },
// to: { path: 'react-icons.*', pathNot: 'react-icons/fi' },
// },
{
name: 'no-using-pino-directly',
comment: 'Enforce use of Pino logging library via @logger wrapper',
Expand Down
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"prettier.documentSelectors": ["src/**/*.{ts,tsx}", "*.{js,json}"],
"vitest.include": ["src/**/*.spec.ts"],
"githubPullRequests.ignoredPullRequestBranches": ["dev"],
"editor.folding": false
"githubPullRequests.ignoredPullRequestBranches": ["dev"]
}
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

Leather is the most popular and trusted wallet for apps built on Bitcoin. Connect to apps and manage assets secured by Bitcoin and Bitcoin L2s with battle-tested wallet for the Stacks blockchain.

To integrate this wallet into your app, we recommend [@stacks/connect](https://github.com/hirosystems/connect).

[📚 See Leather Developer Documentation →](https://leather.gitbook.io/developers/home/welcome)

[📩 Join the mailing list for updates →](https://forms.gle/sdZPu2jbX1AeQ8Fi9)
Expand Down
22 changes: 7 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"dependencies": {
"@bitcoinerlab/secp256k1": "1.0.2",
"@coinbase/cbpay-js": "1.0.2",
"@dlc-link/dlc-tools": "1.0.4",
"@dlc-link/dlc-tools": "1.0.7",
"@fungible-systems/zone-file": "2.0.0",
"@hirosystems/token-metadata-api-client": "1.1.0",
"@ledgerhq/hw-transport-webusb": "6.27.19",
Expand Down Expand Up @@ -153,10 +153,6 @@
"@stacks/rpc-client": "1.0.3",
"@stacks/storage": "6.9.0",
"@stacks/transactions": "6.9.0",
"@stacks/ui": "7.10.0",
"@stacks/ui-core": "7.3.0",
"@stacks/ui-theme": "7.5.0",
"@stacks/ui-utils": "7.5.0",
"@stacks/wallet-sdk": "6.9.0",
"@stitches/react": "1.2.8",
"@styled-system/theme-get": "5.1.2",
Expand Down Expand Up @@ -197,12 +193,12 @@
"limiter": "2.1.0",
"lodash.get": "4.4.2",
"lodash.uniqby": "4.7.0",
"mdi-react": "9.2.0",
"micro-packed": "0.3.2",
"object-hash": "3.0.0",
"observable-hooks": "4.2.3",
"pino": "8.15.4",
"postcss-preset-env": "9.1.4",
"prism-react-renderer": "2.2.0",
"prismjs": "1.29.0",
"promise-memoize": "1.2.1",
"punycode": "2.3.0",
Expand All @@ -213,7 +209,6 @@
"react-dom-confetti": "0.2.0",
"react-head": "3.4.2",
"react-hot-toast": "2.4.1",
"react-icons": "4.10.1",
"react-intersection-observer": "9.5.2",
"react-lottie": "1.2.3",
"react-redux": "8.1.3",
Expand All @@ -235,13 +230,10 @@
},
"devDependencies": {
"@actions/core": "1.10.1",
"@babel/core": "7.23.0",
"@babel/preset-react": "7.22.15",
"@babel/preset-typescript": "7.23.0",
"@btckit/types": "0.0.19",
"@leather-wallet/prettier-config": "0.0.1",
"@ls-lint/ls-lint": "2.1.0",
"@pandacss/dev": "0.17.0",
"@pandacss/dev": "0.18.3",
"@playwright/test": "1.38.1",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
"@redux-devtools/cli": "3.0.2",
Expand Down Expand Up @@ -277,7 +269,6 @@
"@typescript-eslint/parser": "6.7.4",
"@vitest/coverage-istanbul": "0.34.6",
"audit-ci": "6.6.1",
"babel-loader": "9.1.3",
"base64-loader": "1.0.0",
"bip32": "4.0.0",
"blns": "2.0.4",
Expand All @@ -292,7 +283,7 @@
"deepmerge": "4.3.1",
"dependency-cruiser": "14.1.1",
"dotenv-webpack": "8.0.1",
"esbuild": "0.19.4",
"esbuild": "0.19.7",
"esbuild-loader": "4.0.2",
"eslint-plugin-deprecation": "2.0.0",
"eslint-plugin-react": "7.33.2",
Expand Down Expand Up @@ -320,14 +311,15 @@
"vm-browserify": "1.1.2",
"web-ext": "7.8.0",
"web-ext-submit": "7.8.0",
"webpack": "5.88.2",
"webpack-bundle-analyzer": "4.9.1",
"webpack": "5.89.0",
"webpack-bundle-analyzer": "4.10.1",
"webpack-cli": "5.1.4",
"webpack-dev-server": "4.15.1",
"webpack-hot-middleware": "2.25.4",
"webpack-shell-plugin": "0.5.0"
},
"resolutions": {
"nanoid": "3.3.4",
"socket.io-parser": "4.2.4",
"**/**/bn.js": "5.2.1"
},
Expand Down
6 changes: 4 additions & 2 deletions public/assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@

@font-face {
font-family: 'Fira Code';
src: url('/assets/fonts/fira-code/woff2/FiraCode-Light.woff2') format('woff2'),
src:
url('/assets/fonts/fira-code/woff2/FiraCode-Light.woff2') format('woff2'),
url('/assets/fonts/fira-code/woff/FiraCode-Light.woff') format('woff');
font-weight: 300;
font-style: normal;
}

@font-face {
font-family: 'Fira Code';
src: url('/assets/fonts/fira-code/woff2/FiraCode-Regular.woff2') format('woff2'),
src:
url('/assets/fonts/fira-code/woff2/FiraCode-Regular.woff2') format('woff2'),
url('/assets/fonts/fira-code/woff/FiraCode-Regular.woff') format('woff');
font-weight: 400;
font-style: normal;
Expand Down
Binary file removed public/assets/images/bitcoin-stamp.png
Binary file not shown.
Binary file added public/assets/images/stamps-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 0 additions & 8 deletions public/assets/images/wallet-type-ledger.svg

This file was deleted.

11 changes: 5 additions & 6 deletions src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import { Suspense } from 'react';
import { Provider as ReduxProvider } from 'react-redux';

import { radixBaseCSS } from '@radix-ui/themes/styles.css';
import { ThemeProvider } from '@stacks/ui';
import { QueryClientProvider } from '@tanstack/react-query';
import { styled } from 'leather-styles/jsx';
import { PersistGate } from 'redux-persist/integration/react';

import { queryClient } from '@app/common/persistence';
import { theme } from '@app/common/theme';
import { FullPageLoadingSpinner } from '@app/components/loading-spinner';
import { Devtools } from '@app/features/devtool/devtools';
import { AppErrorBoundary } from '@app/features/errors/app-error-boundary';
Expand All @@ -26,8 +25,8 @@ export function App() {
<PersistGate loading={<FullPageLoadingSpinner />} persistor={persistor}>
<HeadProvider />
{/* TODO: this works but investigate importing radixBaseCSS in panda layer config */}
<ThemeProvider theme={theme} css={radixBaseCSS}>
<ThemeSwitcherProvider>
<ThemeSwitcherProvider>
<styled.div css={radixBaseCSS}>
<QueryClientProvider client={queryClient}>
<Suspense fallback={<FullPageLoadingSpinner />}>
<AppErrorBoundary>
Expand All @@ -36,8 +35,8 @@ export function App() {
{reactQueryDevToolsEnabled && <Devtools />}
</Suspense>
</QueryClientProvider>
</ThemeSwitcherProvider>
</ThemeProvider>
</styled.div>
</ThemeSwitcherProvider>
</PersistGate>
</ReduxProvider>
);
Expand Down
35 changes: 6 additions & 29 deletions src/app/common/authentication/use-finish-auth-request.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useCallback } from 'react';

import { bytesToHex } from '@stacks/common';
import {
createWalletGaiaConfig,
getOrCreateWalletConfig,
Expand All @@ -16,13 +15,13 @@ import { useAuthRequestParams } from '@app/common/hooks/auth/use-auth-request-pa
import { useOnboardingState } from '@app/common/hooks/auth/use-onboarding-state';
import { useKeyActions } from '@app/common/hooks/use-key-actions';
import { useWalletType } from '@app/common/use-wallet-type';
import { useNativeSegwitNetworkSigners } from '@app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks';
import { useTaprootNetworkSigners } from '@app/store/accounts/blockchain/bitcoin/taproot-account.hooks';
import {
useLegacyStacksWallet,
useStacksAccounts,
} from '@app/store/accounts/blockchain/stacks/stacks-account.hooks';

import { useGetLegacyAuthBitcoinAddresses } from './use-legacy-auth-bitcoin-addresses';

export function useFinishAuthRequest() {
const { decodedAuthRequest, authRequest, appIcon, appName } = useOnboardingState();
const keyActions = useKeyActions();
Expand All @@ -36,8 +35,7 @@ export function useFinishAuthRequest() {
// TODO: It would be good to separate out finishing auth by the wallet vs an app
// so that the additional data we provide apps can be removed from our onboarding.
// Currently, these create errors unless early returns are used in the keychain code.
const deriveAllNativeSegWitNetworkSigners = useNativeSegwitNetworkSigners();
const deriveAllTaprootNetworkSigners = useTaprootNetworkSigners();
const getLegacyAuthBitcoinData = useGetLegacyAuthBitcoinAddresses();

return useCallback(
async (accountIndex: number) => {
Expand Down Expand Up @@ -75,35 +73,15 @@ export function useFinishAuthRequest() {
},
});

const taprootAccount = deriveAllTaprootNetworkSigners(accountIndex);
const nativeSegwitAccount = deriveAllNativeSegWitNetworkSigners(accountIndex);

const authResponse = await makeAuthResponse({
gaiaHubUrl: gaiaUrl,
appDomain: appURL.origin,
transitPublicKey: decodedAuthRequest.public_keys[0],
scopes: decodedAuthRequest.scopes,
account: account,
additionalData: {
btcAddress: {
p2tr: {
mainnet: taprootAccount.mainnet.payment.address,
testnet: taprootAccount.testnet.payment.address,
regtest: taprootAccount.regtest.payment.address,
signet: taprootAccount.signet.payment.address,
},
p2wpkh: {
mainnet: nativeSegwitAccount.mainnet.payment.address,
testnet: nativeSegwitAccount.testnet.payment.address,
regtest: nativeSegwitAccount.regtest.payment.address,
signet: nativeSegwitAccount.signet.payment.address,
},
},
btcPublicKey: {
p2tr: bytesToHex(taprootAccount.mainnet.keychain.publicKey!),
p2wpkh: bytesToHex(nativeSegwitAccount.mainnet.keychain.publicKey!),
},
walletProvider: 'hiro-wallet',
...getLegacyAuthBitcoinData(accountIndex),
walletProvider: 'leather',
},
});
keyActions.switchAccount(accountIndex);
Expand All @@ -127,8 +105,7 @@ export function useFinishAuthRequest() {
wallet,
appIcon,
appName,
deriveAllTaprootNetworkSigners,
deriveAllNativeSegWitNetworkSigners,
getLegacyAuthBitcoinData,
keyActions,
]
);
Expand Down
35 changes: 35 additions & 0 deletions src/app/common/authentication/use-legacy-auth-bitcoin-addresses.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { bytesToHex } from '@noble/hashes/utils';

import { useNativeSegwitNetworkSigners } from '@app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks';
import { useTaprootNetworkSigners } from '@app/store/accounts/blockchain/bitcoin/taproot-account.hooks';

export function useGetLegacyAuthBitcoinAddresses() {
const deriveAllNativeSegWitNetworkSigners = useNativeSegwitNetworkSigners();
const deriveAllTaprootNetworkSigners = useTaprootNetworkSigners();

return (accountIndex: number) => {
const taprootAccount = deriveAllTaprootNetworkSigners(accountIndex);
const nativeSegwitAccount = deriveAllNativeSegWitNetworkSigners(accountIndex);

return {
btcAddress: {
p2tr: {
mainnet: taprootAccount?.mainnet?.payment.address,
testnet: taprootAccount?.testnet?.payment.address,
regtest: taprootAccount?.regtest?.payment.address,
signet: taprootAccount?.signet?.payment.address,
},
p2wpkh: {
mainnet: nativeSegwitAccount?.mainnet?.payment.address,
testnet: nativeSegwitAccount?.testnet?.payment.address,
regtest: nativeSegwitAccount?.regtest?.payment.address,
signet: nativeSegwitAccount?.signet?.payment.address,
},
},
btcPublicKey: {
p2tr: bytesToHex(taprootAccount?.mainnet?.keychain.publicKey!),
p2wpkh: bytesToHex(nativeSegwitAccount?.mainnet?.keychain.publicKey!),
},
};
};
}
47 changes: 0 additions & 47 deletions src/app/common/hooks/account/use-account-gradient.ts

This file was deleted.

Loading
Loading