From 9f24e5ad73d742631cfb82fae6d3fceb326a7067 Mon Sep 17 00:00:00 2001 From: mikesposito Date: Fri, 4 Sep 2026 18:36:03 +0200 Subject: [PATCH] feat(stellar): use `resolveOrigin` shared util --- packages/stellar-wallet-snap/CHANGELOG.md | 2 + packages/stellar-wallet-snap/locales/en.json | 6 ++ packages/stellar-wallet-snap/messages.json | 6 ++ .../src/handlers/keyring/signAuthEntry.ts | 1 + .../src/handlers/keyring/signMessage.ts | 1 + .../src/handlers/keyring/signTransaction.ts | 1 + .../src/ui/confirmation/api.ts | 6 ++ .../ui/confirmation/components/OriginRow.tsx | 64 +++++++++++++++++ .../src/ui/confirmation/controller.tsx | 23 +++++-- .../src/ui/confirmation/utils.test.ts | 68 ------------------- .../src/ui/confirmation/utils.ts | 48 ------------- .../ConfirmSendTransaction.tsx | 22 ++---- .../ConfirmSignAuthEntry.tsx | 24 +++---- .../ConfirmSignChangeTrustOptIn.tsx | 22 ++---- .../ConfirmSignChangeTrustOptOut.tsx | 22 ++---- .../ConfirmSignMessage/ConfirmSignMessage.tsx | 24 +++---- .../ConfirmSignTransaction.tsx | 22 ++---- 17 files changed, 148 insertions(+), 214 deletions(-) create mode 100644 packages/stellar-wallet-snap/src/ui/confirmation/components/OriginRow.tsx diff --git a/packages/stellar-wallet-snap/CHANGELOG.md b/packages/stellar-wallet-snap/CHANGELOG.md index 06ce9dd52..46f7805fb 100644 --- a/packages/stellar-wallet-snap/CHANGELOG.md +++ b/packages/stellar-wallet-snap/CHANGELOG.md @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Show the dapp URL reported in `originMetadata` in the "Request from" row of the confirmations, marked "Not verified", and keep hiding the row when there is nothing verifiable or self-reported to show. The self-reported URL is display-only and never reaches the security alerts API, which keeps reporting non-URL origins as in-app +- Stop labelling the literal `wallet-connect` origin as "WalletConnect"; the clients now pass a per-session channel id instead - Display transaction error message in ChangeTrustOpt and ConfirmSend confirmation dialogs ([#220](https://github.com/MetaMask/internal-snaps/pull/220)) - Skip destination validation in `onAmountInput` ([#220](https://github.com/MetaMask/internal-snaps/pull/220)) - `createValidatedSendTransaction` now throws `InvalidAssetForCreateAccountException` instead of `AccountNotActivatedException` when sending a non-native asset to an unfunded destination ([#185](https://github.com/MetaMask/internal-snaps/pull/185)) diff --git a/packages/stellar-wallet-snap/locales/en.json b/packages/stellar-wallet-snap/locales/en.json index 8240eff10..f26648f17 100644 --- a/packages/stellar-wallet-snap/locales/en.json +++ b/packages/stellar-wallet-snap/locales/en.json @@ -22,6 +22,12 @@ "confirmation.origin.tooltip": { "message": "This is the site asking for your confirmation." }, + "confirmation.origin.unverified": { + "message": "Not verified" + }, + "confirmation.origin.unverified.tooltip": { + "message": "This site is reported by the app that sent the request. MetaMask can't verify it." + }, "confirmation.from": { "message": "From" }, diff --git a/packages/stellar-wallet-snap/messages.json b/packages/stellar-wallet-snap/messages.json index 70ccd2e49..a5015e764 100644 --- a/packages/stellar-wallet-snap/messages.json +++ b/packages/stellar-wallet-snap/messages.json @@ -20,6 +20,12 @@ "confirmation.origin.tooltip": { "message": "This is the site asking for your confirmation." }, + "confirmation.origin.unverified": { + "message": "Not verified" + }, + "confirmation.origin.unverified.tooltip": { + "message": "This site is reported by the app that sent the request. MetaMask can't verify it." + }, "confirmation.from": { "message": "From" }, diff --git a/packages/stellar-wallet-snap/src/handlers/keyring/signAuthEntry.ts b/packages/stellar-wallet-snap/src/handlers/keyring/signAuthEntry.ts index 158f307ad..438a0328a 100644 --- a/packages/stellar-wallet-snap/src/handlers/keyring/signAuthEntry.ts +++ b/packages/stellar-wallet-snap/src/handlers/keyring/signAuthEntry.ts @@ -110,6 +110,7 @@ export class SignAuthEntryHandler extends BaseSep43KeyringHandler< readableAuthEntry, }, origin: request.origin, + originMetadata: request.originMetadata, interfaceKey: ConfirmationInterfaceKey.SignAuthEntry, })) === true ); diff --git a/packages/stellar-wallet-snap/src/handlers/keyring/signMessage.ts b/packages/stellar-wallet-snap/src/handlers/keyring/signMessage.ts index 96c7890ee..f4841d25c 100644 --- a/packages/stellar-wallet-snap/src/handlers/keyring/signMessage.ts +++ b/packages/stellar-wallet-snap/src/handlers/keyring/signMessage.ts @@ -93,6 +93,7 @@ export class SignMessageHandler extends BaseSep43KeyringHandler< message, }, origin: request.origin, + originMetadata: request.originMetadata, interfaceKey: ConfirmationInterfaceKey.SignMessage, })) === true ); diff --git a/packages/stellar-wallet-snap/src/handlers/keyring/signTransaction.ts b/packages/stellar-wallet-snap/src/handlers/keyring/signTransaction.ts index 3d43cd893..53376590e 100644 --- a/packages/stellar-wallet-snap/src/handlers/keyring/signTransaction.ts +++ b/packages/stellar-wallet-snap/src/handlers/keyring/signTransaction.ts @@ -121,6 +121,7 @@ export class SignTransactionHandler extends BaseSep43KeyringHandler< (await this.#confirmationUIController.renderConfirmationDialog({ scope: request.scope, origin: request.origin, + originMetadata: request.originMetadata, interfaceKey: ConfirmationInterfaceKey.SignTransaction, fee: readableTransaction.feeStroops, renderContext: { diff --git a/packages/stellar-wallet-snap/src/ui/confirmation/api.ts b/packages/stellar-wallet-snap/src/ui/confirmation/api.ts index 6dbb6f9ed..76615286e 100644 --- a/packages/stellar-wallet-snap/src/ui/confirmation/api.ts +++ b/packages/stellar-wallet-snap/src/ui/confirmation/api.ts @@ -141,6 +141,12 @@ export type ConfirmationBaseProps = Partial & { scope: KnownCaip2ChainId; networkImage: string | null; origin: string; + /** + * True when `origin` was reported by the requester over a transport that + * cannot prove it (WalletConnect, SDK), so the UI must frame it as + * unverified. See `resolveOrigin` in `@metamask/snap-networks-utils`. + */ + isSelfReportedOrigin?: boolean; feeData?: FeeData; // Locale key for the validation banner subtitle. When omitted, the banner // falls back to `confirmation.txnError.generic`. diff --git a/packages/stellar-wallet-snap/src/ui/confirmation/components/OriginRow.tsx b/packages/stellar-wallet-snap/src/ui/confirmation/components/OriginRow.tsx new file mode 100644 index 000000000..94a1397d1 --- /dev/null +++ b/packages/stellar-wallet-snap/src/ui/confirmation/components/OriginRow.tsx @@ -0,0 +1,64 @@ +import type { ComponentOrElement } from '@metamask/snaps-sdk'; +import { Box, Icon, Text as SnapText, Tooltip } from '@metamask/snaps-sdk/jsx'; + +import { i18n } from '../../../utils'; + +export type OriginRowProps = { + /** Hostname to display. The row is not rendered when empty. */ + origin: string; + /** Whether the hostname was reported by the requester and can't be verified. */ + isSelfReported?: boolean; + locale: string; +}; + +/** + * The "Request from" row of a confirmation. + * + * A self-reported origin is displayed with an explicit "not verified" marker: + * it comes from the requesting app over a transport that cannot prove it, so + * showing it bare would imply a verification we never made. + * + * @param props - The component props. + * @param props.origin - Hostname to display, or an empty string to render nothing. + * @param props.isSelfReported - Whether the hostname is unverifiable. + * @param props.locale - The locale used for the labels. + * @returns The origin row, or `null` when there is nothing to display. + */ +export const OriginRow = ({ + origin, + isSelfReported = false, + locale, +}: OriginRowProps): ComponentOrElement | null => { + if (!origin) { + return null; + } + + const translate = i18n(locale); + + return ( + + + + {translate('confirmation.origin')} + + + + + + + {origin} + {isSelfReported ? ( + + {translate('confirmation.origin.unverified')} + + ) : null} + + + ); +}; diff --git a/packages/stellar-wallet-snap/src/ui/confirmation/controller.tsx b/packages/stellar-wallet-snap/src/ui/confirmation/controller.tsx index b83e35109..614563e36 100644 --- a/packages/stellar-wallet-snap/src/ui/confirmation/controller.tsx +++ b/packages/stellar-wallet-snap/src/ui/confirmation/controller.tsx @@ -1,3 +1,5 @@ +import type { SelfReportedOriginMetadata } from '@metamask/snap-networks-utils'; +import { resolveOrigin } from '@metamask/snap-networks-utils'; import type { DialogResult } from '@metamask/snaps-sdk'; import type { KnownCaip2ChainId } from '../../api'; @@ -26,11 +28,7 @@ import { import { xlmIcon } from '../images'; import { ConfirmationInterfaceKey, FetchStatus } from './api'; import type { ContextWithPrices } from './api'; -import { - formatFeeData, - formatOrigin, - getPreferencesWithFallback, -} from './utils'; +import { formatFeeData, getPreferencesWithFallback } from './utils'; import { renderConfirmationView } from './views/render'; import type { ConfirmationViewProps } from './views/render'; @@ -61,6 +59,8 @@ type RenderConfirmationDialogCommon = { scope: KnownCaip2ChainId; renderContext: Props; origin?: string; + /** Metadata for origins the client could not verify (WalletConnect, SDK). */ + originMetadata?: SelfReportedOriginMetadata | null; renderOptions?: ConfirmationRenderOptions; securityScanRequest?: Omit; transactionValidationRequest?: TransactionValidationRequest; @@ -126,8 +126,18 @@ export class ConfirmationUXController { scope, renderContext, origin = METAMASK_ORIGIN, + originMetadata, fee, } = params; + + // `origin` is only displayable when it is verifiable or self-reported; a + // WalletConnect channel id has nothing to show. A self-reported origin is + // display-only: it never reaches the security scan below, which keeps + // receiving the raw origin (non-URLs are reported as in-app). + const { displayOrigin, isSelfReported } = resolveOrigin( + origin, + originMetadata, + ); const renderOptions = { ...this.#defaultRenderOptions, ...params.renderOptions, @@ -204,7 +214,8 @@ export class ConfirmationUXController { preferences, locale: preferences.locale as Locale, networkImage: xlmIcon, - origin: formatOrigin(origin), + origin: displayOrigin ?? '', + isSelfReportedOrigin: isSelfReported, currency: preferences.currency, scope, feeData: fee ? formatFeeData(scope, fee) : {}, diff --git a/packages/stellar-wallet-snap/src/ui/confirmation/utils.test.ts b/packages/stellar-wallet-snap/src/ui/confirmation/utils.test.ts index ad6ea8f32..1401e2cf4 100644 --- a/packages/stellar-wallet-snap/src/ui/confirmation/utils.test.ts +++ b/packages/stellar-wallet-snap/src/ui/confirmation/utils.test.ts @@ -10,7 +10,6 @@ import { ConfirmationBanner, getParam, isFetchInProgress, - formatOrigin, isLocalTransactionValidationFailed, isRemoteTransactionScanLoading, requiresMaliciousAcknowledgement, @@ -44,73 +43,6 @@ describe('confirmation utils', () => { ); }); - describe('formatOrigin', () => { - it.each([ - { - testcase: '"Unknown" for an undefined origin', - input: undefined, - expected: 'Unknown', - }, - { - testcase: '"Unknown" for an empty origin', - input: '', - expected: 'Unknown', - }, - { - testcase: '"MetaMask" for the internal metamask origin', - input: 'metamask', - expected: 'MetaMask', - }, - { - testcase: '"WalletConnect" for the wallet-connect origin', - input: 'wallet-connect', - expected: 'WalletConnect', - }, - { - testcase: 'known origins case-insensitively for metamask', - input: 'MetaMask', - expected: 'MetaMask', - }, - { - testcase: 'known origins case-insensitively for wallet-connect', - input: 'Wallet-Connect', - expected: 'WalletConnect', - }, - { - testcase: 'the hostname for an https URL', - input: 'https://example.com', - expected: 'example.com', - }, - { - testcase: 'the hostname for an https URL with path and query', - input: 'https://app.example.com/path?q=1', - expected: 'app.example.com', - }, - { - testcase: 'the hostname for an http URL', - input: 'http://example.com', - expected: 'example.com', - }, - { - testcase: 'an empty string for a non-URL string', - input: '1234abcd-channel-id', - expected: '', - }, - { - testcase: 'an empty string for a non-http URL', - input: 'ftp://example.com', - expected: '', - }, - { - testcase: 'an empty string for an invalid value', - input: 'not a url', - expected: '', - }, - ])('returns $expected for $testcase', ({ input, expected }) => { - expect(formatOrigin(input)).toStrictEqual(expected); - }); - }); - describe('isRemoteTransactionScanLoading', () => { it('disables confirm while scan is fetching', () => { expect( diff --git a/packages/stellar-wallet-snap/src/ui/confirmation/utils.ts b/packages/stellar-wallet-snap/src/ui/confirmation/utils.ts index 612254f2e..63a3b2f86 100644 --- a/packages/stellar-wallet-snap/src/ui/confirmation/utils.ts +++ b/packages/stellar-wallet-snap/src/ui/confirmation/utils.ts @@ -36,54 +36,6 @@ export function getNetworkName(scope: KnownCaip2ChainId): string { return NetworkName[scope] ?? 'Unknown'; } -/** - * Display labels for known, non-URL origins, keyed by their lowercased raw value. - * Lets us show a friendly name for the internal MetaMask origin and WalletConnect - * channels instead of an empty/hidden origin row. - */ -const KNOWN_ORIGIN_LABELS: Record = { - metamask: 'MetaMask', - 'wallet-connect': 'WalletConnect', -}; - -/** - * Formats an origin for display purposes. - * - * @param origin - The origin string to format (e.g., 'metamask', 'https://example.com'). - * @returns The formatted origin string. `'Unknown'` for undefined/empty origins, a - * friendly label for known origins (e.g. `'MetaMask'`, `'WalletConnect'`), the - * hostname for http(s) URLs, or an empty string for any other value (e.g. a - * WalletConnect channelId or a non-http URL) so the UI hides the origin row. - */ -export function formatOrigin(origin: string | undefined): string { - if (!origin) { - return 'Unknown'; - } - - const knownLabel = KNOWN_ORIGIN_LABELS[origin.toLowerCase()]; - if (knownLabel) { - return knownLabel; - } - - // Try to extract hostname from URL - try { - const url = new URL(origin); - return isHttpOrHttpsUrl(url) ? url.hostname : ''; - } catch { - return ''; - } -} - -/** - * Checks whether a parsed URL uses an HTTP(S) protocol. - * - * @param url - The parsed URL to check. - * @returns Whether the URL uses HTTP or HTTPS. - */ -function isHttpOrHttpsUrl(url: URL): boolean { - return url.protocol === 'http:' || url.protocol === 'https:'; -} - /** * Gets the locale from the preferences. * diff --git a/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSendTransaction/ConfirmSendTransaction.tsx b/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSendTransaction/ConfirmSendTransaction.tsx index e9ec81ff5..cf53ca4a0 100644 --- a/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSendTransaction/ConfirmSendTransaction.tsx +++ b/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSendTransaction/ConfirmSendTransaction.tsx @@ -4,11 +4,9 @@ import { Box, Container, Heading, - Icon, Link, Section, Text as SnapText, - Tooltip, } from '@metamask/snaps-sdk/jsx'; import type { StellarKeyringAccount } from '../../../../services/account'; @@ -27,6 +25,7 @@ import { FeeRow, } from '../../components'; import { NetworkRow } from '../../components/Network'; +import { OriginRow } from '../../components/OriginRow'; import { getAccountExplorerUrl, getAccountName, @@ -51,6 +50,7 @@ export const ConfirmSendTransaction = ({ feeData, tokenPrices, origin, + isSelfReportedOrigin, preferences, tokenPricesFetchStatus = FetchStatus.Initial, scan, @@ -92,19 +92,11 @@ export const ConfirmSendTransaction = ({ />
- {origin ? ( - - - - {t('confirmation.origin')} - - - - - - {origin} - - ) : null} + {/* From */} diff --git a/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignAuthEntry/ConfirmSignAuthEntry.tsx b/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignAuthEntry/ConfirmSignAuthEntry.tsx index a86c90de7..626aa8877 100644 --- a/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignAuthEntry/ConfirmSignAuthEntry.tsx +++ b/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignAuthEntry/ConfirmSignAuthEntry.tsx @@ -7,10 +7,8 @@ import { Container, Footer, Heading, - Icon, Section, Text as SnapText, - Tooltip, } from '@metamask/snaps-sdk/jsx'; import type { ReadableAuthEntry } from '../../../../handlers/keyring/signAuthEntry'; @@ -20,12 +18,13 @@ import { i18n } from '../../../../utils'; import type { ConfirmationBaseProps } from '../../api'; import { Authorizations } from '../../components/Authorizations'; import { NetworkRow } from '../../components/Network'; +import { OriginRow } from '../../components/OriginRow'; import { getAccountName } from '../../utils'; import { ConfirmSignAuthEntryFormNames } from './events'; export type ConfirmSignAuthEntryProps = Pick< ConfirmationBaseProps, - 'scope' | 'locale' | 'networkImage' | 'origin' + 'scope' | 'locale' | 'networkImage' | 'origin' | 'isSelfReportedOrigin' > & { readableAuthEntry: ReadableAuthEntry; account: StellarKeyringAccount; @@ -38,6 +37,7 @@ export const ConfirmSignAuthEntry = ({ locale, networkImage, origin, + isSelfReportedOrigin, }: ConfirmSignAuthEntryProps): ComponentOrElement => { const translate = i18n(locale); const { address } = account; @@ -61,19 +61,11 @@ export const ConfirmSignAuthEntry = ({
- {origin ? ( - - - - {translate('confirmation.origin')} - - - - - - {origin} - - ) : null} + {translate('confirmation.account')} diff --git a/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignChangeTrustOptIn/ConfirmSignChangeTrustOptIn.tsx b/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignChangeTrustOptIn/ConfirmSignChangeTrustOptIn.tsx index dd261523f..4df8ec760 100644 --- a/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignChangeTrustOptIn/ConfirmSignChangeTrustOptIn.tsx +++ b/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignChangeTrustOptIn/ConfirmSignChangeTrustOptIn.tsx @@ -4,10 +4,8 @@ import { Box, Container, Heading, - Icon, Section, Text as SnapText, - Tooltip, } from '@metamask/snaps-sdk/jsx'; import { parseCaipAssetType } from '@metamask/utils'; @@ -29,6 +27,7 @@ import { FeeRow, } from '../../components'; import { NetworkRow } from '../../components/Network'; +import { OriginRow } from '../../components/OriginRow'; import { getAccountName, getClassicAssetExplorerUrl, @@ -53,6 +52,7 @@ export const ConfirmSignChangeTrustOptIn = ({ feeData, tokenPrices, origin, + isSelfReportedOrigin, preferences, tokenPricesFetchStatus = FetchStatus.Initial, scan, @@ -92,19 +92,11 @@ export const ConfirmSignChangeTrustOptIn = ({
- {origin ? ( - - - - {t('confirmation.origin')} - - - - - - {origin} - - ) : null} + {/* From */} diff --git a/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignChangeTrustOptOut/ConfirmSignChangeTrustOptOut.tsx b/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignChangeTrustOptOut/ConfirmSignChangeTrustOptOut.tsx index 291ea524e..7c31c181a 100644 --- a/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignChangeTrustOptOut/ConfirmSignChangeTrustOptOut.tsx +++ b/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignChangeTrustOptOut/ConfirmSignChangeTrustOptOut.tsx @@ -4,10 +4,8 @@ import { Box, Container, Heading, - Icon, Section, Text as SnapText, - Tooltip, } from '@metamask/snaps-sdk/jsx'; import { parseCaipAssetType } from '@metamask/utils'; @@ -29,6 +27,7 @@ import { FeeRow, } from '../../components'; import { NetworkRow } from '../../components/Network'; +import { OriginRow } from '../../components/OriginRow'; import { getAccountName, getClassicAssetExplorerUrl, @@ -53,6 +52,7 @@ export const ConfirmSignChangeTrustOptOut = ({ feeData, tokenPrices, origin, + isSelfReportedOrigin, preferences, tokenPricesFetchStatus = FetchStatus.Initial, scan, @@ -92,19 +92,11 @@ export const ConfirmSignChangeTrustOptOut = ({
- {origin ? ( - - - - {t('confirmation.origin')} - - - - - - {origin} - - ) : null} + {/* From */} diff --git a/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/ConfirmSignMessage.tsx b/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/ConfirmSignMessage.tsx index 2efd26f30..dbf089656 100644 --- a/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/ConfirmSignMessage.tsx +++ b/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignMessage/ConfirmSignMessage.tsx @@ -6,10 +6,8 @@ import { Container, Footer, Heading, - Icon, Section, Text as SnapText, - Tooltip, } from '@metamask/snaps-sdk/jsx'; import type { StellarKeyringAccount } from '../../../../services/account'; @@ -17,12 +15,13 @@ import type { Locale } from '../../../../utils'; import { i18n } from '../../../../utils'; import type { ConfirmationBaseProps } from '../../api'; import { NetworkRow } from '../../components/Network'; +import { OriginRow } from '../../components/OriginRow'; import { getAccountName } from '../../utils'; import { ConfirmSignMessageFormNames } from './events'; export type ConfirmSignMessageProps = Pick< ConfirmationBaseProps, - 'scope' | 'locale' | 'networkImage' | 'origin' + 'scope' | 'locale' | 'networkImage' | 'origin' | 'isSelfReportedOrigin' > & { message: string; account: StellarKeyringAccount; @@ -35,6 +34,7 @@ export const ConfirmSignMessage = ({ locale, networkImage, origin, + isSelfReportedOrigin, }: ConfirmSignMessageProps): ComponentOrElement => { const translate = i18n(locale); const { address } = account; @@ -59,19 +59,11 @@ export const ConfirmSignMessage = ({
- {origin ? ( - - - - {translate('confirmation.origin')} - - - - - - {origin} - - ) : null} + {translate('confirmation.account')} diff --git a/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.tsx b/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.tsx index b84e2c9e1..a692ee109 100644 --- a/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.tsx +++ b/packages/stellar-wallet-snap/src/ui/confirmation/views/ConfirmSignTransaction/ConfirmSignTransaction.tsx @@ -4,10 +4,8 @@ import { Box, Container, Heading, - Icon, Section, Text as SnapText, - Tooltip, Divider, Copyable, } from '@metamask/snaps-sdk/jsx'; @@ -33,6 +31,7 @@ import { FeeRow } from '../../components/Fee'; import { InvocationSummary } from '../../components/InvocationSummary'; import { JsonParamsSummary } from '../../components/JsonParamsSummary'; import { NetworkRow } from '../../components/Network'; +import { OriginRow } from '../../components/OriginRow'; import { TransactionAlert } from '../../components/TransactionAlert'; import { getAccountName, @@ -202,6 +201,7 @@ export const ConfirmSignTransaction = ({ locale, networkImage, origin, + isSelfReportedOrigin, preferences, feeData, tokenPrices, @@ -246,19 +246,11 @@ export const ConfirmSignTransaction = ({ ) : null}
- {origin ? ( - - - - {t('confirmation.origin')} - - - - - - {origin} - - ) : null} + {t('confirmation.account')}