Skip to content

Commit

Permalink
Merge pull request #388 from secretkeylabs/release/v0.38.1
Browse files Browse the repository at this point in the history
release: v0.38.1 to main
  • Loading branch information
teebszet committed Jul 8, 2024
2 parents 423ee65 + efc0a34 commit b7a6f9b
Show file tree
Hide file tree
Showing 74 changed files with 2,406 additions and 392 deletions.
93 changes: 70 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "xverse-web-extension",
"description": "A Bitcoin wallet for Web3",
"version": "0.38.0",
"version": "0.38.1",
"private": true,
"engines": {
"node": "^18.18.2"
Expand Down Expand Up @@ -38,13 +38,14 @@
]
},
"dependencies": {
"@aryzing/superqs": "0.0.6",
"@ledgerhq/hw-transport-webusb": "^6.27.13",
"@phosphor-icons/react": "^2.0.10",
"@playwright/test": "^1.43.1",
"@react-spring/web": "^9.6.1",
"@sats-connect/core": "0.0.12",
"@sats-connect/core": "0.0.14",
"@scure/btc-signer": "1.2.1",
"@secretkeylabs/xverse-core": "17.1.0",
"@secretkeylabs/xverse-core": "17.1.1",
"@stacks/connect": "7.4.1",
"@stacks/stacks-blockchain-api-types": "6.1.1",
"@stacks/transactions": "6.13.1",
Expand All @@ -57,6 +58,7 @@
"@testing-library/user-event": "^13.5.0",
"alex-sdk": "0.1.26",
"argon2-browser": "^1.18.0",
"async-mutex": "^0.5.0",
"axios": "1.7.0",
"bignumber.js": "^9.1.0",
"bip39": "^3.0.3",
Expand Down Expand Up @@ -104,6 +106,7 @@
"superjson": "2.2.1",
"swiper": "11.0.6",
"ts-transformer-keys": "0.4.4",
"valibot": "0.33.2",
"valid-url": "^1.0.9",
"webextension-polyfill": "^0.10.0",
"zod": "3.22.4",
Expand Down
87 changes: 45 additions & 42 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PermissionsProvider } from '@components/permissionsManager';
import StartupLoadingScreen from '@components/startupLoadingScreen';
import { CheckCircle, XCircle } from '@phosphor-icons/react';
import { setXClientVersion } from '@secretkeylabs/xverse-core';
Expand Down Expand Up @@ -38,51 +39,53 @@ function App(): React.ReactNode {
<Provider store={rootStore.store}>
<PersistGate persistor={rootStore.persistor} loading={<StartupLoadingScreen />}>
<SessionGuard>
<RouterProvider router={router} />
<Toaster
position="bottom-center"
containerStyle={{ bottom: 32 }}
toastOptions={{
duration: 1500,
success: {
icon: (
<StyledIcon>
<CheckCircle size={20} weight="bold" />
</StyledIcon>
),
style: {
...Theme.typography.body_medium_m,
backgroundColor: Theme.colors.success_medium,
borderRadius: Theme.radius(2),
padding: Theme.space.s,
color: Theme.colors.elevation0,
<PermissionsProvider>
<RouterProvider router={router} />
<Toaster
position="bottom-center"
containerStyle={{ bottom: 32 }}
toastOptions={{
duration: 1500,
success: {
icon: (
<StyledIcon>
<CheckCircle size={20} weight="bold" />
</StyledIcon>
),
style: {
...Theme.typography.body_medium_m,
backgroundColor: Theme.colors.success_medium,
borderRadius: Theme.radius(2),
padding: Theme.space.s,
color: Theme.colors.elevation0,
},
},
},
error: {
icon: (
<StyledIcon>
<XCircle size={20} weight="bold" />
</StyledIcon>
),
style: {
...Theme.typography.body_medium_m,
backgroundColor: Theme.colors.danger_dark,
borderRadius: Theme.radius(2),
padding: Theme.space.s,
color: Theme.colors.white_0,
error: {
icon: (
<StyledIcon>
<XCircle size={20} weight="bold" />
</StyledIcon>
),
style: {
...Theme.typography.body_medium_m,
backgroundColor: Theme.colors.danger_dark,
borderRadius: Theme.radius(2),
padding: Theme.space.s,
color: Theme.colors.white_0,
},
},
},
blank: {
style: {
...Theme.typography.body_medium_m,
backgroundColor: Theme.colors.white_0,
borderRadius: Theme.radius(2),
padding: Theme.space.s,
color: Theme.colors.elevation0,
blank: {
style: {
...Theme.typography.body_medium_m,
backgroundColor: Theme.colors.white_0,
borderRadius: Theme.radius(2),
padding: Theme.space.s,
color: Theme.colors.elevation0,
},
},
},
}}
/>
}}
/>
</PermissionsProvider>
</SessionGuard>
</PersistGate>
</Provider>
Expand Down
1 change: 1 addition & 0 deletions src/app/components/explore/FeaturedCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import FeaturedCard, { FeaturedCardProps } from './FeaturedCard';

const CarouselContainer = styled.div`
margin-top: ${({ theme }) => theme.space.l};
margin-bottom: ${({ theme }) => theme.space.xl};
.swiper {
padding-bottom: 35px;
Expand Down
15 changes: 15 additions & 0 deletions src/app/components/permissionsManager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Permissions

A "connection request" is a request for permissions.

In the future, clients may be able to specify which permissions they're requesting. For now, there's only a single permission available: `read`ing an account. Since there's only a single permission, no arguments are required.

Permissions are granted per-account. A permissions request is processed in the context of the currently active account. In the future, we may allow changing account prior to granting permissions.

## Technical overview

Permissions store: an object containing a version, and the relationships between clients, resources and permissions. Contains "store" in the name because this object is stored as a whole with `chrome.storage.local`

A mutex is provided for environments where race-conditions could occur when mutating the permissions store.

The exports available from [`utils.ts`](./utils.ts) can be used to perform all necessary permissions operations. When using them within a reactive context such as a React application, it is necessary to construct reactive helpers to ensure the app is using the latest store data available.
2 changes: 2 additions & 0 deletions src/app/components/permissionsManager/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* eslint-disable import/prefer-default-export */
export const permissionsPersistantStoreKeyName = 'client-permissions';
Loading

0 comments on commit b7a6f9b

Please sign in to comment.