Skip to content

Commit

Permalink
Merge branch 'dev' into feat/use-radix-tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarkhanzadian committed Jan 16, 2024
2 parents eba1865 + 0930968 commit c5e9ac5
Show file tree
Hide file tree
Showing 66 changed files with 222 additions and 533 deletions.
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## [6.23.0](https://github.com/leather-wallet/extension/compare/v6.22.0...v6.23.0) (2024-01-16)


### Features

* improve error handling in ledger, surface incorrect app error ([5bff514](https://github.com/leather-wallet/extension/commit/5bff514db064ce145b52d72eadc8bbf6d24e519b))
* prompt user to open the app ([f672bec](https://github.com/leather-wallet/extension/commit/f672becf668fe2f67b2a55c02e3d6dfdad55ccd4))


### Bug Fixes

* add remote config to recover feature ([84a10dc](https://github.com/leather-wallet/extension/commit/84a10dcc2d84fc3c1ac17c16dae7e2c67415f03c))
* duplicate keys error ([77dc018](https://github.com/leather-wallet/extension/commit/77dc018286402c3f2ff7de369d92840d91bba602))
* lint for deps ([42179de](https://github.com/leather-wallet/extension/commit/42179de5e4bf82cfe821bc0e1d080cad7a7e7eed))
* remove fee title in increase fee form ([0de3900](https://github.com/leather-wallet/extension/commit/0de39009995aca8e6b809c759e9005f09b8ff970))
* track error codes ([227f6ee](https://github.com/leather-wallet/extension/commit/227f6ee10b06f420e4061551a284202ff5c059fe))
* **ui:** rebuild tabs with radix primitives, ref [#4309](https://github.com/leather-wallet/extension/issues/4309) ([3b0488e](https://github.com/leather-wallet/extension/commit/3b0488e7ba694216f92013c13e9d7a0cb7880e80))
* unused exports ([3fff31d](https://github.com/leather-wallet/extension/commit/3fff31d783722aa96131897105d18307289b4127))


### Internal

* add improved sentry perf tracking ([8b96e9a](https://github.com/leather-wallet/extension/commit/8b96e9a4fbc7262026bee545186694e2e2565733))
* check instance of error before passing it to checkLockedDeviceError ([e342642](https://github.com/leather-wallet/extension/commit/e3426422e535601d5ae7d38d49b1e8c6f58cc4f5))
* post-release merge back ([2eaa09f](https://github.com/leather-wallet/extension/commit/2eaa09f7797e01f358a78d96f7498851270f1199))
* quit app ourselves instead of prompting user to do it ([35c2ff1](https://github.com/leather-wallet/extension/commit/35c2ff13a87c4b35037fdbadc5e9dd0b4a8cdb15))
* remove unneeded radix styles ([6808536](https://github.com/leather-wallet/extension/commit/6808536ee67df8ba27a55539a00ab83e1548c998))
* reuse getAppAndVersion from bitcoin app instance method ([e894808](https://github.com/leather-wallet/extension/commit/e8948085fa176dde7960212ce97d962604de2128))
* select and dropdown, ref [#4798](https://github.com/leather-wallet/extension/issues/4798) ([a82457d](https://github.com/leather-wallet/extension/commit/a82457d8f04e94b696fe4b54edbd8981f311c353))
* token radii and keyframe, ref [#4637](https://github.com/leather-wallet/extension/issues/4637) ([e67b61d](https://github.com/leather-wallet/extension/commit/e67b61d5c27cd4129415aa63e1fa49e30efdb5ae))
* update panda ([2418a1c](https://github.com/leather-wallet/extension/commit/2418a1c9cb4a1310b588c673a76f7aa549ad35d2))

## [6.22.0](https://github.com/leather-wallet/extension/compare/v6.21.2...v6.22.0) (2024-01-09)


Expand Down
3 changes: 2 additions & 1 deletion config/wallet-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,6 @@
"integrationEnabled": true,
"mainnetApiUrl": "https://api2.ordinalsbot.com",
"signetApiUrl": "https://signet.ordinalsbot.com"
}
},
"recoverUninscribedTaprootUtxosFeatureEnabled": false
}
4 changes: 4 additions & 0 deletions config/wallet-config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@
"mainnetApiUrl": { "type": "string" },
"signetApiUrl": { "type": "string" }
}
},
"recoverUninscribedTaprootUtxosFeatureEnabled": {
"type": "boolean",
"description": "Determines whether or not the recover uninscribed taproot utxos feature is enabled"
}
},
"$defs": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@leather-wallet/extension",
"description": "Leather is a browser extension for interacting with Stacks apps",
"private": true,
"version": "6.22.0",
"version": "6.23.0",
"author": {
"name": "Leather Wallet LLC"
},
Expand Down Expand Up @@ -130,7 +130,7 @@
"@coinbase/cbpay-js": "1.0.2",
"@dlc-link/dlc-tools": "1.1.1",
"@fungible-systems/zone-file": "2.0.0",
"@hirosystems/token-metadata-api-client": "1.1.0",
"@hirosystems/token-metadata-api-client": "1.2.0",
"@leather-wallet/tokens": "0.0.4",
"@ledgerhq/hw-transport-webusb": "6.27.19",
"@noble/hashes": "1.3.2",
Expand Down
42 changes: 22 additions & 20 deletions src/app/common/api/fetch-wrapper.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
import axios from 'axios';

import { analytics } from '@shared/utils/analytics';

const leatherHeaders: HeadersInit = {
'x-leather-version': VERSION,
};

function isErrorCode(statusCode: number) {
return statusCode >= 400;
}

function trackApiError(url: string, statusCode: number) {
void analytics.track('api_error', { origin: new URL(url).origin, statusCode, url });
}

/**
* @deprecated Use `axios` directly instead
* @deprecated Use `axios` directly instead. Fetch only needed for interation
* with generated stacks blockchain api library
*/
export function wrappedFetch(input: RequestInfo, init: RequestInit = {}) {
export async function wrappedFetch(input: RequestInfo, init: RequestInit = {}) {
const initHeaders = init.headers || {};
// eslint-disable-next-line no-restricted-globals
return fetch(input, {
credentials: 'omit',
const resp = await fetch(input, {
...init,
credentials: 'omit',
headers: { ...initHeaders, ...leatherHeaders },
});
if (isErrorCode(resp.status)) trackApiError(resp.url, resp.status);
return resp;
}

export async function fetchWithTimeout(
input: RequestInfo,
init: RequestInit & { timeout?: number } = {}
) {
const { timeout = 8000, ...options } = init;

const controller = new AbortController();
const id = setTimeout(() => controller.abort(), timeout);

const response = await wrappedFetch(input, {
...options,
signal: controller.signal,
});
clearTimeout(id);

axios.interceptors.response.use(response => {
if (isErrorCode(response.status)) trackApiError(response.config.url ?? '', response.status);
return response;
}
});
161 changes: 0 additions & 161 deletions src/app/common/utils/figma-theme.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/components/account/account-list-item-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function AccountListItemLayout(props: AccountListItemLayoutProps) {
onClick={onSelectAccount}
{...rest}
>
<Flag align="middle" img={avatar} spacing="space.04" width="100%" mr="space.04">
<Flag align="middle" img={avatar} spacing="space.04" width="100%" mx="space.04">
<Stack gap="space.01">
<HStack alignItems="center" justifyContent="space-between">
<HStack alignItems="center" gap="space.02">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ export function FeesListItem({
return (
<styled.button
_hover={{ background: 'accent.component-background-hover' }}
border={isSelected ? '4px solid' : '1px solid'}
borderColor="accent.action-primary-default"
borderRadius="lg"
// #4476 TODO add tokens for boxShadow
border={isSelected ? 'focus' : 'default'}
borderRadius="xs"
boxShadow="0px 1px 2px rgba(0, 0, 0, 0.04)"
data-testid={SharedComponentsSelectors.FeesListItem}
px="space.04"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function ChooseAssetContainer({ children }: HasChildren) {
return whenPageMode({
full: (
<Flex
borderRadius={['unset', '16px']}
borderRadius={['unset', 'lg']}
height="fit-content"
maxWidth={['100%', 'centeredPageFullWidth']}
minWidth={['100%', 'centeredPageFullWidth']}
Expand Down
17 changes: 2 additions & 15 deletions src/app/components/event-card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Box, HStack, Stack, styled } from 'leather-styles/jsx';

import { EllipsesHorizontalIcon } from '@app/ui/components/icons/ellipses-h-icon';
import { Caption } from '@app/ui/components/typography/caption';

import { TxAssetItem } from './tx-asset-item';
Expand All @@ -17,19 +16,13 @@ interface EventCardProps {
title: string;
}
export function EventCard(props: EventCardProps): React.JSX.Element {
const { actions, amount, icon, isLast, left, message, right, ticker, title } = props;
const { amount, icon, isLast, left, message, right, ticker, title } = props;

return (
<>
<Stack gap="space.05" p="space.05">
<HStack alignItems="center" justifyContent="space-between" position="relative">
<styled.span textStyle="label.01">{title}</styled.span>
{/* TODO: What does this do? */}
{actions && (
<styled.button width="24px" position="absolute" right={0} type="button">
<EllipsesHorizontalIcon />
</styled.button>
)}
</HStack>
<TxAssetItem iconString={icon} amount={amount} ticker={ticker} />
{left || right ? (
Expand All @@ -40,13 +33,7 @@ export function EventCard(props: EventCardProps): React.JSX.Element {
) : null}
</Stack>
{message && (
<Box
p="space.05"
borderTop="1px solid"
borderColor="accent.border-default"
borderBottom={!isLast ? '4px solid' : 'unset'}
borderBottomColor="accent.border-default"
>
<Box p="space.05" borderTop="default" borderBottom={!isLast ? 'active' : 'unset'}>
<Caption>{message}</Caption>
</Box>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function FeeEstimateItem({
<LeatherButton
_hover={{
bg: isVisible ? 'accent.component-background-hover' : 'accent.background-primary',
borderRadius: '8px',
borderRadius: 'xs',
color: 'accent.text-primary',
}}
alignItems="center"
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/info-card/info-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function InfoCardRow({ title, value, titleAdditionalElement, ...props }:
return (
<HStack alignItems="start" fontSize="14px" justifyContent="space-between" {...props}>
<Flex alignItems="center">
<styled.span textStyle="body.02" color="accent.text-subdued">
<styled.span color="accent.text-subdued" mr="space.01" textStyle="body.02">
{title}
</styled.span>
{titleAdditionalElement && titleAdditionalElement}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function InscriptionPreviewCard({
<Flag
align="middle"
border={hideBorder ? 'unset' : 'default'}
borderRadius={hideBorder ? 'unset' : '10px'}
borderRadius={hideBorder ? 'unset' : 'sm'}
img={image}
p={hideBorder ? 'unset' : 'space.04'}
spacing="space.04"
Expand Down
Loading

0 comments on commit c5e9ac5

Please sign in to comment.