Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- added: Nym (NYM) wallet support
- added: opBNB (BNB) support
- added: Register SwapKit V3 as a separate exchange plugin
- added: Warning card on send scene when Nym mixnet is active and transaction is loading
- changed: Manage tokens scene saves changes on explicit save instead of live toggling
- changed: Unify split wallet scene titles and add chain-specific descriptions for EVM and UTXO splits
- fixed: Missing 2-factor approve / deny scene on login
Expand Down
25 changes: 25 additions & 0 deletions src/components/scenes/SendScene2.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { abs, add, div, gte, lt, lte, mul, sub } from 'biggystring'
import { asMaybe } from 'cleaners'
import {
asMaybeInsufficientFundsError,
asMaybeNoAmountSpecifiedError,
Expand Down Expand Up @@ -100,6 +101,7 @@ import type {
ExchangedFlipInputAmounts,
ExchangeFlipInputFields
} from '../themed/ExchangedFlipInput2'
import { asPrivateNetworkingSetting } from '../themed/MaybePrivateNetworkingSetting'
import { PinDots } from '../themed/PinDots'
import { SafeSlider } from '../themed/SafeSlider'
import { SendFromFioRows } from '../themed/SendFromFioRows'
Expand Down Expand Up @@ -280,6 +282,10 @@ const SendComponent = (props: Props): React.ReactElement => {
const coreWallet = currencyWallets[walletId]
const { pluginId, memoOptions = [] } = coreWallet.currencyInfo

const userSettings = useWatch(coreWallet.currencyConfig, 'userSettings')
const isNymActive =
asMaybe(asPrivateNetworkingSetting)(userSettings)?.networkPrivacy === 'nym'

// Initialize `spendInfo` from route params, including possible memos
const [spendInfo, setSpendInfo] = useState<EdgeSpendInfo>(() => {
if (initSpendInfo == null) return { tokenId: null, spendTargets: [{}] }
Expand Down Expand Up @@ -1166,6 +1172,24 @@ const SendComponent = (props: Props): React.ReactElement => {
)
}

const renderNymWarning = (): React.ReactElement | null => {
if (!isNymActive || !processingAmountChanged) return null

return (
<EdgeAnim
enter={{ type: 'fadeInUp', distance: 60 }}
exit={{ type: 'fadeOutDown' }}
>
<AlertCardUi4
type="warning"
title={lstrings.settings_nym_mixnet_warning_title}
body={lstrings.settings_nym_mixnet_warning_body}
marginRem={0.5}
/>
</EdgeAnim>
)
}

const recordFioObtData = async (
spendTarget: EdgeSpendTarget,
currencyCode: string,
Expand Down Expand Up @@ -1780,6 +1804,7 @@ const SendComponent = (props: Props): React.ReactElement => {
{renderScamWarning()}
</EdgeAnim>
{renderPendingTransactionWarning()}
{renderNymWarning()}
{renderError()}
{sliderTopNode}
</StyledKeyboardAwareScrollView>
Expand Down
2 changes: 2 additions & 0 deletions src/locales/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,8 @@ const strings = {
settings_network_privacy_nym_mixnet: 'Nym Mixnet',
settings_privacy_settings: 'Privacy Settings',
settings_nym_mixnet_title: 'Nym Mixnet',
settings_nym_mixnet_warning_title: 'Nym mixnet on',
settings_nym_mixnet_warning_body: `Protecting your privacy\u2014transaction can take a minute or longer before it's ready to broadcast.`,
settings_nym_mixnet_description:
'The Nym mixnet encrypts and routes your internet traffic through a decentralized network of nodes to obfuscate your data and IP address. Note that use of the mixnet may slow down network traffic and delay accurate balances and transactions. Select which services to use with the mixnet:',
settings_hours: 'Hour(s)',
Expand Down
2 changes: 2 additions & 0 deletions src/locales/strings/enUS.json
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@
"settings_network_privacy_nym_mixnet": "Nym Mixnet",
"settings_privacy_settings": "Privacy Settings",
"settings_nym_mixnet_title": "Nym Mixnet",
"settings_nym_mixnet_warning_title": "Nym mixnet on",
"settings_nym_mixnet_warning_body": "Protecting your privacy—transaction can take a minute or longer before it's ready to broadcast.",
"settings_nym_mixnet_description": "The Nym mixnet encrypts and routes your internet traffic through a decentralized network of nodes to obfuscate your data and IP address. Note that use of the mixnet may slow down network traffic and delay accurate balances and transactions. Select which services to use with the mixnet:",
"settings_hours": "Hour(s)",
"settings_minutes": "Minute(s)",
Expand Down
Loading