Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: trezor/trezor-suite
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6d70ef05ebec9a8e4494ea189ffba7c9cd290b54
Choose a base ref
..
head repository: trezor/trezor-suite
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 58fb7fe79d2d32c30a6381a3bac3e56079ba5444
Choose a head ref
Showing 314 changed files with 4,500 additions and 4,547 deletions.
37 changes: 27 additions & 10 deletions .github/workflows/release-suite-native-production.yml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ on:
PLATFORM:
type: choice
options:
- All
- iOS & Android
- iOS
- Android
- Android APK
@@ -19,8 +19,8 @@ concurrency:

jobs:
ios:
if: ${{ (github.event.inputs.PLATFORM == 'iOS' || github.event.inputs.PLATFORM == 'All') && (github.repository == 'trezor/trezor-suite' || github.repository == 'trezor/trezor-suite-private') }}
name: Build and release iOS
if: ${{ (github.event.inputs.PLATFORM == 'iOS' || github.event.inputs.PLATFORM == 'iOS & Android') && (github.repository == 'trezor/trezor-suite' || github.repository == 'trezor/trezor-suite-private') }}
name: Build and submit iOS
environment: production-suite-native
runs-on: ubuntu-latest
env:
@@ -47,8 +47,8 @@ jobs:
--message ${{ github.sha }}
working-directory: suite-native/app
android:
if: ${{ github.event.inputs.PLATFORM == 'Android' || github.event.inputs.PLATFORM == 'All' && (github.repository == 'trezor/trezor-suite' || github.repository == 'trezor/trezor-suite-private') }}
name: Build and release Android
if: ${{ github.event.inputs.PLATFORM == 'Android' || github.event.inputs.PLATFORM == 'iOS & Android' && (github.repository == 'trezor/trezor-suite' || github.repository == 'trezor/trezor-suite-private') }}
name: Build and submit Android
environment: production-suite-native
runs-on: ubuntu-latest
env:
@@ -75,8 +75,8 @@ jobs:
--message ${{ github.sha }}
working-directory: suite-native/app
androidAPK:
if: ${{ github.event.inputs.PLATFORM == 'Android APK' || github.event.inputs.PLATFORM == 'All' && (github.repository == 'trezor/trezor-suite' || github.repository == 'trezor/trezor-suite-private') }}
name: Build Android APK to GH releases
if: ${{ github.event.inputs.PLATFORM == 'Android APK' && (github.repository == 'trezor/trezor-suite' || github.repository == 'trezor/trezor-suite-private') }}
name: Build standalone Android APK and release to S3
environment: production-suite-native
runs-on: ubuntu-latest
env:
@@ -92,12 +92,29 @@ jobs:
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::538326561891:role/gh_actions_mobile_prod_deploy
aws-region: eu-central-1
- name: Install libs
run: yarn workspaces focus @suite-native/app

- name: Get Suite version
id: get_version
run: |
APP_VERSION=$(jq -r '.suiteNativeVersion' suite-native/app/package.json)
echo "app_version=$APP_VERSION" >> $GITHUB_OUTPUT
- name: Build on EAS Android
working-directory: suite-native/app
id: eas_build
run: |
BUILD_ID=$(eas build --platform android --profile productionAPK --non-interactive --message ${{ github.sha }} --wait --json | jq -r '.[0].id')
echo "BUILD_ID: $BUILD_ID"
BUILD_URL=$(eas build:view "$BUILD_ID" --json | jq -r '.artifacts.buildUrl')
echo "BUILD_URL: $BUILD_URL"
working-directory: suite-native/app
echo "build_url=$BUILD_URL" >> $GITHUB_OUTPUT
- name: Upload APK to S3
run: |
wget -O "Trezor-Suite-${{ steps.get_version.outputs.app_version }}.apk" "${{ steps.eas_build.outputs.build_url }}"
aws s3 cp "./Trezor-Suite-${{ steps.get_version.outputs.app_version }}.apk" s3://data.trezor.io/suite/releases/mobile/
2 changes: 1 addition & 1 deletion packages/blockchain-link/src/workers/baseWorker.ts
Original file line number Diff line number Diff line change
@@ -163,7 +163,7 @@ export abstract class BaseWorker<API> {
return true;
}
if (data.type === MESSAGES.DISCONNECT) {
this.disconnect();
await this.disconnect();
this.post({ id, type: RESPONSES.DISCONNECTED, payload: true });

return true;
11 changes: 4 additions & 7 deletions packages/blockchain-link/src/workers/ripple/index.ts
Original file line number Diff line number Diff line change
@@ -475,9 +475,7 @@ class RippleWorker extends BaseWorker<RippleAPI> {
}

disconnect() {
if (this.api) {
this.api.disconnect();
}
return this.api?.disconnect();
}

async messageHandler(event: { data: MessageTypes.Message }) {
@@ -508,10 +506,9 @@ class RippleWorker extends BaseWorker<RippleAPI> {
if (this.pingTimeout) {
clearTimeout(this.pingTimeout);
}
this.pingTimeout = setTimeout(
() => this.onPing(),
this.settings.pingTimeout || DEFAULT_PING_TIMEOUT,
);
this.pingTimeout = this.api?.isConnected()
? setTimeout(() => this.onPing(), this.settings.pingTimeout || DEFAULT_PING_TIMEOUT)
: undefined;
}

async onPing() {
14 changes: 7 additions & 7 deletions packages/components/src/components/Image/images.ts
Original file line number Diff line number Diff line change
@@ -21,9 +21,9 @@ export const SVG_IMAGES = {
CONNECT_DEVICE: 'connect-device.svg',
ERROR_404: 'error-404.svg',
INVITY_LOGO: 'invity-logo.svg',
COINMARKET_AVATAR: 'coinmarket-avatar.svg',
COINMARKET_SUCCESS: 'coinmarket-success.svg',
COINMARKET_WAITING: 'coinmarket-waiting.svg',
TRADING_AVATAR: 'trading-avatar.svg',
TRADING_SUCCESS: 'trading-success.svg',
TRADING_WAITING: 'trading-waiting.svg',
WARNING: 'warning.svg',
USER_FOCUS: 'user-focus.svg',
HOURGLASS: 'hourglass.svg',
@@ -56,10 +56,10 @@ export const PNG_IMAGES = {
CLOCK_2x: 'clock@2x.png',
COINS: 'coins.png',
COINS_2x: 'coins@2x.png',
COINMARKET_DCA_INVITY_APP_QR: 'coinmarket-dca-invity-app-qr.png',
COINMARKET_DCA_INVITY_APP_QR_2x: 'coinmarket-dca-invity-app-qr@2x.png',
COINMARKET_INVITY_ICON: 'coinmarket-invity-icon.png',
COINMARKET_INVITY_ICON_2x: 'coinmarket-invity-icon@2x.png',
TRADING_DCA_INVITY_APP_QR: 'trading-dca-invity-app-qr.png',
TRADING_DCA_INVITY_APP_QR_2x: 'trading-dca-invity-app-qr@2x.png',
TRADING_INVITY_ICON: 'trading-invity-icon.png',
TRADING_INVITY_ICON_2x: 'trading-invity-icon@2x.png',
ERROR: 'error.png',
ERROR_2x: 'error@2x.png',
EXTRA_INFO: 'extra-info.png',
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { Meta, StoryObj } from '@storybook/react';

import { RadioCard as RadioCardComponent, RadioCardProps } from './RadioCard';
import {
RadioCard as RadioCardComponent,
RadioCardProps,
allowedRadioCardFrameProps,
} from './RadioCard';
import { getFramePropsStory } from '../../utils/frameProps';

const meta: Meta = {
title: 'RadioCard',
@@ -12,12 +17,14 @@ export const RadioCard: StoryObj<RadioCardProps> = {
args: {
isActive: true,
children: 'Content',
...getFramePropsStory(allowedRadioCardFrameProps).args,
},
argTypes: {
isActive: {
control: {
type: 'boolean',
},
},
...getFramePropsStory(allowedRadioCardFrameProps).argTypes,
},
};
41 changes: 24 additions & 17 deletions packages/components/src/components/RadioCard/RadioCard.tsx
Original file line number Diff line number Diff line change
@@ -7,12 +7,15 @@ import { palette, borders, spacingsPx } from '@trezor/theme';
import { Card } from '../Card/Card';
import { Icon } from '../Icon/Icon';
import { Box } from '../Box/Box';
import { FrameProps } from '../../utils/frameProps';
import { FrameProps, FramePropsKeys, pickAndPrepareFrameProps } from '../../utils/frameProps';

export const allowedRadioCardFrameProps = ['margin'] as const satisfies FramePropsKeys[];
type AllowedFrameProps = Pick<FrameProps, (typeof allowedRadioCardFrameProps)[number]>;

export type RadioCardProps = {
isActive: boolean;
children: ReactNode;
};
} & AllowedFrameProps;

const BorderActive = styled.div<{ isActive: boolean }>`
pointer-events: none;
@@ -33,18 +36,22 @@ const IconWrapper = styled.div`
padding: ${spacingsPx.xxxs};
`;

export const RadioCard = ({ isActive, children, ...frameProps }: RadioCardProps & FrameProps) => (
<Box position={{ type: 'relative' }} {...frameProps}>
{isActive && (
<Box position={{ type: 'absolute', top: '-1px', right: '-1px' }} zIndex={2}>
<IconWrapper>
<Icon name="check" size="extraSmall" color={palette.lightWhiteAlpha1000} />
</IconWrapper>
</Box>
)}
<Card paddingType="small" fillType="none">
{children}
</Card>
<BorderActive isActive={isActive} />
</Box>
);
export const RadioCard = ({ isActive, children, ...rest }: RadioCardProps) => {
const frameProps = pickAndPrepareFrameProps(rest, allowedRadioCardFrameProps, false);

return (
<Box position={{ type: 'relative' }} {...frameProps}>
{isActive && (
<Box position={{ type: 'absolute', top: '-1px', right: '-1px' }} zIndex={2}>
<IconWrapper>
<Icon name="check" size="extraSmall" color={palette.lightWhiteAlpha1000} />
</IconWrapper>
</Box>
)}
<Card paddingType="small" fillType="none">
{children}
</Card>
<BorderActive isActive={isActive} />
</Box>
);
};
15 changes: 12 additions & 3 deletions packages/components/src/utils/frameProps.tsx
Original file line number Diff line number Diff line change
@@ -85,11 +85,20 @@ const getValueWithUnit = (value: string | number) =>
export const pickAndPrepareFrameProps = (
props: Record<string, any>,
allowedFrameProps: Array<FramePropsKeys>,
) =>
makePropsTransient(
allowedFrameProps.reduce((acc, item) => ({ ...acc, [item]: props[item] }), {}),
convertToTransient = true,
) => {
const selectedProps = allowedFrameProps.reduce(
(acc, item) => ({ ...acc, [item]: props[item] }),
{},
);

if (convertToTransient) {
return makePropsTransient(selectedProps);
}

return selectedProps;
};

export const withFrameProps = ({
$margin,
$padding,
5 changes: 5 additions & 0 deletions packages/connect/src/constants/errors.ts
Original file line number Diff line number Diff line change
@@ -69,6 +69,11 @@ export class TrezorError extends Error {
this.code = code;
this.message = message;
}

// Error.prototype.toString() does not include custom property `code`
toString() {
return `${this.name} (code: ${this.code}): ${this.message}`;
}
}

export const TypedError = (id: ErrorCode, message?: string) =>
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ export const selectAssetModalOptions: (
)[] = [
{
type: 'group',
label: 'TR_COINMARKET_POPULAR_CURRENCIES',
label: 'TR_TRADING_POPULAR_CURRENCIES',
},
{
type: 'currency',
@@ -165,7 +165,7 @@ export const selectAssetModalOptions: (
},
{
type: 'group',
label: 'TR_COINMARKET_OTHER_CURRENCIES',
label: 'TR_TRADING_OTHER_CURRENCIES',
},
{
type: 'currency',
@@ -219,7 +219,7 @@ export const selectAssetModalOptions: (
},
{
type: 'group',
label: 'TR_COINMARKET_NETWORK_TOKENS',
label: 'TR_TRADING_NETWORK_TOKENS',
coingeckoId: 'ethereum',
networkName: 'Ethereum',
},
@@ -324,7 +324,7 @@ export const selectAssetModalOptions: (
},
{
type: 'group',
label: 'TR_COINMARKET_NETWORK_TOKENS',
label: 'TR_TRADING_NETWORK_TOKENS',
coingeckoId: 'solana',
networkName: 'Solana',
},
@@ -374,7 +374,7 @@ export const selectAssetModalOptions: (
},
{
type: 'group',
label: 'TR_COINMARKET_NETWORK_TOKENS',
label: 'TR_TRADING_NETWORK_TOKENS',
coingeckoId: 'binance-smart-chain',
networkName: 'BNB Smart Chain',
},
@@ -424,7 +424,7 @@ export const selectAssetModalOptions: (
},
{
type: 'group',
label: 'TR_COINMARKET_NETWORK_TOKENS',
label: 'TR_TRADING_NETWORK_TOKENS',
coingeckoId: 'base',
networkName: 'Base',
},
2 changes: 1 addition & 1 deletion packages/suite-analytics/src/constants.ts
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ export enum EventType {

CoinjoinAnonymityGain = 'coinjoin/anonymity-gain',

CoinmarketConfirmTrade = 'trade/confirm-trade',
TradingConfirmTrade = 'trade/confirm-trade',

MenuGuide = 'menu/guide',
MenuNotificationsToggle = 'menu/notifications/toggle',
2 changes: 1 addition & 1 deletion packages/suite-analytics/src/types/events.ts
Original file line number Diff line number Diff line change
@@ -173,7 +173,7 @@ export type SuiteAnalyticsEvent =
};
}
| {
type: EventType.CoinmarketConfirmTrade;
type: EventType.TradingConfirmTrade;
payload: {
type: 'buy' | 'sell' | 'exchange';
};
2 changes: 2 additions & 0 deletions packages/suite-desktop-core/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -19,6 +19,8 @@ const config: PlaywrightTestConfig = {
baseURL: process.env.BASE_URL || 'http://localhost:8000/',
},
grepInvert: /@desktopOnly/,
//TODO: #16073 We are still encountering instabilities, snapshots resolution differs, tolerance does not help
ignoreSnapshots: true,
},
{
name: PlaywrightProjects.Desktop,
Loading