@bsv/expo-wallet-toolbox 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +292 -0
- package/README.md +0 -1
- package/assets/sounds/vault-deposit.wav +0 -0
- package/assets/sounds/vault-withdraw.wav +0 -0
- package/core/config.tsx +9 -1
- package/core/context/VaultContext.tsx +8 -11
- package/core/context/WalletConnectionContext.tsx +137 -52
- package/core/context/WalletContext.tsx +409 -20
- package/core/hooks/useConfirmationSound.ts +14 -8
- package/core/i18n/translations.tsx +3368 -952
- package/core/index.ts +97 -14
- package/core/localpay/build.ts +674 -37
- package/core/localpay/codec.ts +68 -5
- package/core/localpay/pending.ts +240 -22
- package/core/localpay/settlementAck.ts +149 -0
- package/core/localpay/types.ts +14 -1
- package/core/localpay/verify.ts +118 -69
- package/core/mandala/abortGuard.ts +134 -0
- package/core/mandala/basketMigration.ts +166 -0
- package/core/mandala/bundle.ts +244 -0
- package/core/mandala/createRuntime.ts +2437 -0
- package/core/mandala/drain.ts +670 -0
- package/core/mandala/permissionModule.ts +642 -0
- package/core/mandala/resendTransfer.ts +175 -0
- package/core/mandala/runtime.ts +357 -0
- package/core/mandala/settlementStore.ts +412 -0
- package/core/mandala/types.ts +290 -0
- package/core/offline/cancelParked.ts +94 -1
- package/core/offline/payerHold.ts +152 -12
- package/core/offline/tokenFrames.ts +197 -0
- package/core/parsePeerPayURI.ts +70 -17
- package/core/pay/rails/address.ts +51 -3
- package/core/pay/rails/handle.ts +88 -9
- package/core/pay/rails/index.ts +16 -6
- package/core/pay/rails/nearby.ts +114 -4
- package/core/services/capWalletArgs.ts +8 -9
- package/core/services/externalOrigin.ts +39 -0
- package/core/services/vault/VaultKeyService.ts +912 -251
- package/core/services/vault/ceremony.ts +435 -367
- package/core/services/vault/ceremonyHost.ts +27 -21
- package/core/services/vault/devMock.ts +30 -7
- package/core/services/vault/driver.ts +95 -41
- package/core/services/vault/guard.ts +514 -56
- package/core/services/vault/hardwareLease.ts +22 -0
- package/core/services/vault/mockYubiKey.ts +258 -90
- package/core/services/vault/pivReset.ts +145 -0
- package/core/services/vault/r1comb.ts +976 -0
- package/core/services/vault/session.ts +93 -26
- package/core/services/vault/transfers.ts +2617 -747
- package/core/services/vault/types.ts +100 -43
- package/core/services/vault/vaultStore.ts +991 -74
- package/core/services/walletConnectionValidation.ts +293 -0
- package/core/storage/StorageExpoSQLite.ts +382 -56
- package/core/storage/dbImage.ts +48 -0
- package/core/storage/methods/findSql.ts +0 -54
- package/core/storage/methods/listOutputsSql.ts +7 -3
- package/core/storage/methods/offlineActions.ts +15 -0
- package/core/storage/methods/processOfflineActions.ts +263 -6
- package/core/storage/methods/walletBalanceSql.ts +16 -4
- package/core/storage/schema/createTables.ts +123 -0
- package/core/storage/sqlUpdateValue.ts +24 -0
- package/core/toolboxConfig.ts +112 -1
- package/core/walletRepair/runWalletCheck.ts +19 -2
- package/package.json +25 -24
- package/ui/components/QRScanner.tsx +1 -1
- package/ui/components/pay/AdmissionNotice.tsx +99 -0
- package/ui/components/pay/AssetPicker.tsx +184 -0
- package/ui/components/pay/AvailableBalance.tsx +33 -2
- package/ui/components/pay/HandleReceive.tsx +213 -50
- package/ui/components/pay/NearbyFlow.tsx +616 -69
- package/ui/components/pay/PayForm.tsx +73 -8
- package/ui/components/pay/PaymentSuccessOverlay.tsx +43 -2
- package/ui/components/pay/RecipientField.tsx +49 -4
- package/ui/components/pay/RequestHub.tsx +68 -8
- package/ui/components/pay/ResultBanner.tsx +41 -4
- package/ui/components/pay/UniversalSend.tsx +534 -30
- package/ui/components/pay/tokenSendCopy.ts +116 -0
- package/ui/components/pay/useRecipientInput.ts +36 -7
- package/ui/components/ui/PermissionSheet.tsx +65 -4
- package/ui/components/ui/Sheet.tsx +9 -2
- package/ui/components/vault/EnrollWizard.tsx +1432 -488
- package/ui/components/vault/KeyChooser.tsx +96 -0
- package/ui/components/vault/VaultCeremonySheet.tsx +107 -43
- package/ui/components/vault/vaultErrorCopy.ts +145 -0
- package/ui/components/wallet/ActivityRow.tsx +101 -17
- package/ui/components/wallet/AmountInput.tsx +77 -25
- package/ui/components/wallet/AssetAmount.tsx +95 -0
- package/ui/components/wallet/AssetSwitcherDropdown.tsx +261 -0
- package/ui/components/wallet/tokenEviction.ts +65 -0
- package/ui/hooks/useExportWalletData.ts +39 -0
- package/ui/hooks/useMandala.ts +303 -0
- package/ui/hooks/useVaultBalance.ts +105 -7
- package/ui/hooks/useVaultCoverage.ts +52 -0
- package/ui/importDatabases.ts +7 -3
- package/ui/index.ts +50 -7
- package/ui/screens/ConnectionsScreen.tsx +46 -29
- package/ui/screens/PairScreen.tsx +12 -12
- package/ui/screens/PayScreen.tsx +130 -10
- package/ui/screens/SettingsScreen.tsx +18 -9
- package/ui/screens/VaultScreen.tsx +925 -171
- package/ui/screens/VaultTransferScreen.tsx +376 -123
- package/ui/screens/WalletCheckScreen.tsx +10 -1
- package/ui/screens/WalletConfigScreen.tsx +38 -16
- package/ui/screens/WalletHomeScreen.tsx +417 -86
- package/ui/screens/homeBadges.ts +9 -1
- package/ui/screens/tokenRowTitle.ts +68 -0
- package/ui/tokenFormat.ts +108 -0
- package/ui/tokenSeen.ts +75 -0
- package/ui/tokenStatus.ts +79 -0
- package/assets/sounds/vault-close.wav +0 -0
- package/assets/sounds/vault-open.wav +0 -0
- package/core/services/vault/k1.ts +0 -75
- package/core/services/vault/sealing.ts +0 -84
- package/core/services/vault/vaultDerivation.ts +0 -152
- package/core/services/vault/vaultPassphrase.ts +0 -287
- package/ui/components/vault/PassphraseField.tsx +0 -306
- package/ui/components/vault/PhraseBackupSheet.tsx +0 -227
- package/ui/screens/VaultRecoverScreen.tsx +0 -226
|
@@ -30,6 +30,11 @@ import { PeerPayClient, type IncomingPayment } from '@bsv/message-box-client'
|
|
|
30
30
|
import { type DisplayableIdentity } from '@bsv/sdk'
|
|
31
31
|
|
|
32
32
|
import ResultBanner from './ResultBanner'
|
|
33
|
+
import AdmissionNotice from './AdmissionNotice'
|
|
34
|
+
import { ConsequenceNote } from './PayForm'
|
|
35
|
+
import { useMandala } from '../../hooks/useMandala'
|
|
36
|
+
import { formatTokenAmountWithUnit } from '../../tokenFormat'
|
|
37
|
+
import { SEEN_ASSETS_KEY, markSeen, readSeen } from '../../tokenSeen'
|
|
33
38
|
import ReceivedOverlay from './PaymentSuccessOverlay'
|
|
34
39
|
import { useMessageBoxConfig } from './MessageBoxConfig'
|
|
35
40
|
import AmountDisplay from '../wallet/AmountDisplay'
|
|
@@ -347,10 +352,52 @@ function AttentionRow({
|
|
|
347
352
|
)
|
|
348
353
|
}
|
|
349
354
|
|
|
355
|
+
export interface HandleReceiveProps {
|
|
356
|
+
/** Satoshis the code asks for. Never set while an asset is selected. */
|
|
357
|
+
initialSats?: number
|
|
358
|
+
/**
|
|
359
|
+
* The asset this request is denominated in, when one is selected. The link
|
|
360
|
+
* then names it — `asset=<genesis outpoint>` — and carries the figure, if
|
|
361
|
+
* any, as `amount=` in that asset's base units, never as `sats=`: a satoshi
|
|
362
|
+
* figure emitted while the payee was thinking in USDX would be read by the
|
|
363
|
+
* payer's wallet as satoshis, a unit-confusion money lie.
|
|
364
|
+
*/
|
|
365
|
+
asset?: { assetId: string; ticker: string; issuerName?: string } | null
|
|
366
|
+
/** The figure the code asks for, in the asset's base units. Absent for an open request. */
|
|
367
|
+
requestedBaseUnits?: number
|
|
368
|
+
/** The same figure, in the asset's own units, already formatted for the screen. */
|
|
369
|
+
requestedAmountText?: string
|
|
370
|
+
/**
|
|
371
|
+
* The runtime's plain reason this wallet cannot be paid in the selected
|
|
372
|
+
* asset, or null. When present the payment code is withheld entirely — see
|
|
373
|
+
* AdmissionNotice: a code that manufactures a refusal inside someone else's
|
|
374
|
+
* app, attributed to nothing, is the error-prevention failure this avoids.
|
|
375
|
+
*/
|
|
376
|
+
admissionRefusal?: string | null
|
|
377
|
+
/**
|
|
378
|
+
* The selected asset's own registered MessageBox host (`useAssetStatus`,
|
|
379
|
+
* asked by the caller — this screen stays prop-driven for the same reason
|
|
380
|
+
* `RequestHub` is). Compared against this device's OWN configured host
|
|
381
|
+
* (`useMessageBoxConfig`, read locally): a mismatch means a payer sending
|
|
382
|
+
* this asset over the handle rail may deliver to a box this wallet is not
|
|
383
|
+
* listening on.
|
|
384
|
+
*/
|
|
385
|
+
assetMessageBoxUrl?: string | null
|
|
386
|
+
/** Switch the request back to BSV, from inside the admission notice. */
|
|
387
|
+
onBsvInstead?: () => void
|
|
388
|
+
dismissTo?: DismissTarget
|
|
389
|
+
}
|
|
390
|
+
|
|
350
391
|
export default function HandleReceive({
|
|
351
392
|
initialSats,
|
|
393
|
+
asset = null,
|
|
394
|
+
requestedBaseUnits,
|
|
395
|
+
requestedAmountText,
|
|
396
|
+
admissionRefusal,
|
|
397
|
+
assetMessageBoxUrl = null,
|
|
398
|
+
onBsvInstead,
|
|
352
399
|
dismissTo = '/'
|
|
353
|
-
}:
|
|
400
|
+
}: HandleReceiveProps = {}) {
|
|
354
401
|
const { t } = useTranslation()
|
|
355
402
|
const { colors } = useTheme()
|
|
356
403
|
const Ionicons = loadIonicons()
|
|
@@ -361,6 +408,7 @@ export default function HandleReceive({
|
|
|
361
408
|
const online = useOnline()
|
|
362
409
|
|
|
363
410
|
const [identityKey, setIdentityKey] = useState('')
|
|
411
|
+
const mandala = useMandala()
|
|
364
412
|
const [identityError, setIdentityError] = useState(false)
|
|
365
413
|
const [copied, setCopied] = useState(false)
|
|
366
414
|
const { messageBoxUrl } = useMessageBoxConfig(t)
|
|
@@ -377,6 +425,17 @@ export default function HandleReceive({
|
|
|
377
425
|
* pass; cleared only by the overlay's Done.
|
|
378
426
|
*/
|
|
379
427
|
const [received, setReceived] = useState<{ amount: number; count: number } | null>(null)
|
|
428
|
+
/**
|
|
429
|
+
* A token payment that arrived while this screen was in front. Money arriving
|
|
430
|
+
* gets a screen, never a toast — the one thing a payee must not be unsure
|
|
431
|
+
* about is whether it landed — and the screen says, in the same breath, that
|
|
432
|
+
* the issuer has not confirmed it yet when that is true.
|
|
433
|
+
*/
|
|
434
|
+
const [tokenReceived, setTokenReceived] = useState<{
|
|
435
|
+
amountText: string
|
|
436
|
+
statusNote?: string
|
|
437
|
+
firstHoldNote?: string
|
|
438
|
+
} | null>(null)
|
|
380
439
|
|
|
381
440
|
/** Payments the wallet has failed to credit, keyed by message id. */
|
|
382
441
|
const [attempts, setAttempts] = useState<Record<string, InboxAttempt>>({})
|
|
@@ -439,7 +498,17 @@ export default function HandleReceive({
|
|
|
439
498
|
// BRC-125 with this app's url extension: the payer learns where to deliver
|
|
440
499
|
// without an overlay lookup. Omitted when no server is configured, since
|
|
441
500
|
// there is then nowhere to point them.
|
|
442
|
-
|
|
501
|
+
// In asset mode the link names the asset and its base-unit figure (or no
|
|
502
|
+
// figure, for an open request); `peerPayLinkFor` never emits `sats` beside
|
|
503
|
+
// them, and omits any non-positive figure in either mode.
|
|
504
|
+
const link = identityKey
|
|
505
|
+
? peerPayLinkFor(
|
|
506
|
+
identityKey,
|
|
507
|
+
asset ? undefined : initialSats,
|
|
508
|
+
isConfigured ? messageBoxUrl : undefined,
|
|
509
|
+
asset ? { assetId: asset.assetId, baseUnits: requestedBaseUnits } : undefined
|
|
510
|
+
)
|
|
511
|
+
: ''
|
|
443
512
|
|
|
444
513
|
const handleCopy = useCallback(() => {
|
|
445
514
|
if (!identityKey) return
|
|
@@ -561,6 +630,44 @@ export default function HandleReceive({
|
|
|
561
630
|
fetchRef.current = fetchPayments
|
|
562
631
|
}, [fetchPayments])
|
|
563
632
|
|
|
633
|
+
/**
|
|
634
|
+
* One pass over the Mandala inbox, and the arrival screen if it credited
|
|
635
|
+
* anything. The figure comes from the runtime's own activity — never from the
|
|
636
|
+
* message body — so what is shown is what was actually written to the wallet.
|
|
637
|
+
*/
|
|
638
|
+
const tokenTick = useCallback(async () => {
|
|
639
|
+
const runtime = mandala.runtime
|
|
640
|
+
if (!runtime) return
|
|
641
|
+
try {
|
|
642
|
+
const { credited } = await runtime.receiveFromInbox()
|
|
643
|
+
if (credited <= 0) return
|
|
644
|
+
const rows = await runtime.activity(credited)
|
|
645
|
+
const arrival = rows.find(r => r.role === 'received')
|
|
646
|
+
if (!arrival) return
|
|
647
|
+
const issuer = arrival.asset.issuerName || t('token_issuer_fallback')
|
|
648
|
+
const seen = await readSeen(SEEN_ASSETS_KEY)
|
|
649
|
+
const firstHold = !seen.includes(arrival.asset.assetId)
|
|
650
|
+
if (firstHold) await markSeen(SEEN_ASSETS_KEY, arrival.asset.assetId)
|
|
651
|
+
setTokenReceived({
|
|
652
|
+
amountText: formatTokenAmountWithUnit(arrival.baseUnits, arrival.asset, { showPlus: true }) ?? '',
|
|
653
|
+
// Credited and spendable, and not yet confirmed — both true, and the
|
|
654
|
+
// receipt says both rather than claiming a settlement nobody has.
|
|
655
|
+
statusNote: arrival.status === 'settled' ? undefined : t('local_pay_token_not_cleared', { issuer }),
|
|
656
|
+
// Disclosure at the one moment the user is definitely looking.
|
|
657
|
+
firstHoldNote: firstHold
|
|
658
|
+
? t('token_first_hold', { ticker: arrival.asset.ticker, issuer })
|
|
659
|
+
: undefined
|
|
660
|
+
})
|
|
661
|
+
} catch {
|
|
662
|
+
// A drain that could not run is not news on this screen: the monitor task
|
|
663
|
+
// and the next tick both retry, and the inbox rows below still render.
|
|
664
|
+
}
|
|
665
|
+
}, [mandala.runtime, t])
|
|
666
|
+
const tokenTickRef = useRef(tokenTick)
|
|
667
|
+
useEffect(() => {
|
|
668
|
+
tokenTickRef.current = tokenTick
|
|
669
|
+
}, [tokenTick])
|
|
670
|
+
|
|
564
671
|
// ── Poll the inbox ──
|
|
565
672
|
//
|
|
566
673
|
// A payment arrives whenever the sender's wallet delivers it and MessageBox has
|
|
@@ -577,6 +684,11 @@ export default function HandleReceive({
|
|
|
577
684
|
if (cancelled || !focusedRef.current) return
|
|
578
685
|
if (AppState.currentState !== 'active') return
|
|
579
686
|
void fetchRef.current({ silent: true })
|
|
687
|
+
// The token inbox is a SIBLING drain, not a widened one: Mandala delivers
|
|
688
|
+
// to its own message box and the two never meet. Same 5s focused tick,
|
|
689
|
+
// because a payee standing in front of this screen expects both kinds of
|
|
690
|
+
// money to appear on their own.
|
|
691
|
+
void tokenTickRef.current()
|
|
580
692
|
}
|
|
581
693
|
|
|
582
694
|
const interval = setInterval(tick, INBOX_POLL_MS)
|
|
@@ -665,6 +777,21 @@ export default function HandleReceive({
|
|
|
665
777
|
|
|
666
778
|
const damagedIds = useMemo(() => new Set(damaged.map(d => d.messageId)), [damaged])
|
|
667
779
|
|
|
780
|
+
/**
|
|
781
|
+
* Can this wallet actually be paid in the selected asset?
|
|
782
|
+
*
|
|
783
|
+
* Asked with this wallet's OWN identity key, because that is what a payer
|
|
784
|
+
* would be paying: the answer the payer's wallet would give, computed here,
|
|
785
|
+
* before a code that could never work is shown. `undefined` from the caller
|
|
786
|
+
* means "ask the runtime"; an explicit `null` means "already checked, fine".
|
|
787
|
+
*/
|
|
788
|
+
const admission =
|
|
789
|
+
admissionRefusal !== undefined
|
|
790
|
+
? admissionRefusal
|
|
791
|
+
: asset && mandala.runtime && identityKey
|
|
792
|
+
? mandala.runtime.recipientRefusal(identityKey)
|
|
793
|
+
: null
|
|
794
|
+
|
|
668
795
|
/**
|
|
669
796
|
* The rows worth showing: payments the wallet has given up on, environmental
|
|
670
797
|
* failures still waiting on the network, plus inbox bodies that never parsed
|
|
@@ -686,58 +813,83 @@ export default function HandleReceive({
|
|
|
686
813
|
{/* Your handle. The QR is the focal element — it is the thing physically
|
|
687
814
|
held up to another device. */}
|
|
688
815
|
{/* The figure the code asks for, as its price. Only when one was named. */}
|
|
689
|
-
{
|
|
690
|
-
<Text style={[styles.requestedAmount, { color: colors.textPrimary }]}>
|
|
691
|
-
|
|
692
|
-
|
|
816
|
+
{requestedAmountText ? (
|
|
817
|
+
<Text style={[styles.requestedAmount, { color: colors.textPrimary }]}>{requestedAmountText}</Text>
|
|
818
|
+
) : (
|
|
819
|
+
initialSats !== undefined &&
|
|
820
|
+
initialSats > 0 && (
|
|
821
|
+
<Text style={[styles.requestedAmount, { color: colors.textPrimary }]}>
|
|
822
|
+
<AmountDisplay>{initialSats}</AmountDisplay>
|
|
823
|
+
</Text>
|
|
824
|
+
)
|
|
693
825
|
)}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
826
|
+
{/* This device may not be listening where a payer's handle-rail send
|
|
827
|
+
would actually deliver. Advisory: the code below still works for
|
|
828
|
+
every OTHER rail, and the mismatch may resolve itself (a Settings
|
|
829
|
+
change, a fresh registry read) before anyone acts on it. */}
|
|
830
|
+
{asset &&
|
|
831
|
+
!admission &&
|
|
832
|
+
!!assetMessageBoxUrl &&
|
|
833
|
+
isConfigured &&
|
|
834
|
+
assetMessageBoxUrl !== messageBoxUrl && <ConsequenceNote textKey="token_messagebox_mismatch" />}
|
|
835
|
+
{admission && asset ? (
|
|
836
|
+
<AdmissionNotice
|
|
837
|
+
ticker={asset.ticker}
|
|
838
|
+
issuerName={asset.issuerName}
|
|
839
|
+
reason={admission}
|
|
840
|
+
onBsvInstead={() => onBsvInstead?.()}
|
|
841
|
+
/>
|
|
842
|
+
) : (
|
|
843
|
+
<>
|
|
844
|
+
<View style={styles.qrHero}>
|
|
845
|
+
{identityKey ? (
|
|
846
|
+
<View style={styles.qrPlate}>
|
|
847
|
+
<QRCode value={link} size={240} color="#000" backgroundColor="#fff" />
|
|
848
|
+
</View>
|
|
849
|
+
) : identityError ? (
|
|
850
|
+
<View style={styles.identityError}>
|
|
851
|
+
<Text style={[styles.identityErrorText, { color: colors.error }]}>{t('unknown_error')}</Text>
|
|
852
|
+
<PressableScale
|
|
853
|
+
onPress={() => void loadIdentityKey()}
|
|
854
|
+
haptic="tap"
|
|
855
|
+
style={styles.identityRetry}
|
|
856
|
+
accessibilityRole="button"
|
|
857
|
+
accessibilityLabel={t('activity_load_retry')}
|
|
858
|
+
>
|
|
859
|
+
<Text style={[styles.identityRetryLabel, { color: colors.accent }]}>{t('activity_load_retry')}</Text>
|
|
860
|
+
</PressableScale>
|
|
861
|
+
</View>
|
|
862
|
+
) : (
|
|
863
|
+
<ActivityIndicator size="large" color={colors.textSecondary} />
|
|
864
|
+
)}
|
|
711
865
|
</View>
|
|
712
|
-
) : (
|
|
713
|
-
<ActivityIndicator size="large" color={colors.textSecondary} />
|
|
714
|
-
)}
|
|
715
|
-
</View>
|
|
716
866
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
</Text>
|
|
720
|
-
|
|
721
|
-
<View style={styles.actionRow}>
|
|
722
|
-
<TouchableOpacity onPress={handleCopy} style={[styles.action, { backgroundColor: colors.fillTertiary }]}>
|
|
723
|
-
<Ionicons
|
|
724
|
-
name={copied ? 'checkmark' : 'copy-outline'}
|
|
725
|
-
size={18}
|
|
726
|
-
color={copied ? colors.success : colors.textSecondary}
|
|
727
|
-
/>
|
|
728
|
-
<Text style={[styles.actionText, { color: copied ? colors.success : colors.textSecondary }]}>
|
|
729
|
-
{copied ? t('copied') : t('pay_copy')}
|
|
867
|
+
<Text style={[styles.keyText, { color: colors.textSecondary }]} numberOfLines={1} ellipsizeMode="middle">
|
|
868
|
+
{identityKey}
|
|
730
869
|
</Text>
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
870
|
+
|
|
871
|
+
<View style={styles.actionRow}>
|
|
872
|
+
<TouchableOpacity onPress={handleCopy} style={[styles.action, { backgroundColor: colors.fillTertiary }]}>
|
|
873
|
+
<Ionicons
|
|
874
|
+
name={copied ? 'checkmark' : 'copy-outline'}
|
|
875
|
+
size={18}
|
|
876
|
+
color={copied ? colors.success : colors.textSecondary}
|
|
877
|
+
/>
|
|
878
|
+
<Text style={[styles.actionText, { color: copied ? colors.success : colors.textSecondary }]}>
|
|
879
|
+
{copied ? t('copied') : t('pay_copy')}
|
|
880
|
+
</Text>
|
|
881
|
+
</TouchableOpacity>
|
|
882
|
+
<TouchableOpacity
|
|
883
|
+
onPress={handleShare}
|
|
884
|
+
disabled={!link}
|
|
885
|
+
style={[styles.action, { backgroundColor: colors.fillTertiary, opacity: link ? 1 : 0.5 }]}
|
|
886
|
+
>
|
|
887
|
+
<Ionicons name="share-outline" size={18} color={colors.textSecondary} />
|
|
888
|
+
<Text style={[styles.actionText, { color: colors.textSecondary }]}>{t('pay_share_link')}</Text>
|
|
889
|
+
</TouchableOpacity>
|
|
890
|
+
</View>
|
|
891
|
+
</>
|
|
892
|
+
)}
|
|
741
893
|
|
|
742
894
|
{/* Only the payments the wallet gave up on. Everything else was credited
|
|
743
895
|
the moment it was seen, so there is nothing here to accept. */}
|
|
@@ -765,6 +917,17 @@ export default function HandleReceive({
|
|
|
765
917
|
dismissTo={dismissTo}
|
|
766
918
|
/>
|
|
767
919
|
)}
|
|
920
|
+
|
|
921
|
+
{tokenReceived && (
|
|
922
|
+
<ReceivedOverlay
|
|
923
|
+
amount={0}
|
|
924
|
+
amountText={tokenReceived.amountText}
|
|
925
|
+
statusNote={tokenReceived.statusNote}
|
|
926
|
+
firstHoldNote={tokenReceived.firstHoldNote}
|
|
927
|
+
onDismiss={() => setTokenReceived(null)}
|
|
928
|
+
dismissTo={dismissTo}
|
|
929
|
+
/>
|
|
930
|
+
)}
|
|
768
931
|
</ScrollView>
|
|
769
932
|
)
|
|
770
933
|
}
|