@bsv/expo-wallet-toolbox 0.29.0 → 0.30.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 +12 -1
- package/core/backup/appData.ts +16 -3
- package/core/backup/codec.ts +15 -2
- package/core/i18n/translations.tsx +84 -0
- package/package.json +1 -1
- package/ui/components/vault/EnrollWizard.tsx +84 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.30.0
|
|
6
|
+
|
|
7
|
+
The BSV Wallet app's last patch of the toolbox, upstreamed: a backup carries the wallet's look, and the vault chain check shows its progress and can be skipped. No native change: hosts do not rebuild. Every new prop and option is optional, so no host action is necessary.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **`appData.walletLook` and `WALLET_LOOK_KEY`.** The backup carries the host's `wallet_look` row as it is, so a restored wallet looks as it did. The toolbox never reads the value. An empty row is not carried. When two devices merge, the first device's look wins. A `walletLook` that is not a string makes the decode fail, as other malformed `appData` fields do.
|
|
12
|
+
- **Progress and "Skip" for the vault chain check.** `EnrollWizard`'s `cardGate.check` now gets a second argument, `{ onProgress, signal }`. The wizard shows a bar with a percent while the check runs, and a "Skip the check" button. A skip aborts `signal` and gives an `unknown` answer with `reason: 'skipped'`, never `clear`, so a reset still needs the loss sentence. After a skip, "Check the blockchain" runs the check again. An `unknown` answer with another reason shows that reason. A `check` that ignores the second argument works as before.
|
|
13
|
+
- **6 strings in all 14 locales:** `vault_card_progress`, `vault_card_skip`, `vault_card_skipped_title`, `vault_card_skipped_body`, `vault_card_check` and `vault_card_reason`.
|
|
14
|
+
|
|
5
15
|
## 0.29.0
|
|
6
16
|
|
|
7
17
|
The BSV Wallet app's nearby-payment changes, upstreamed from its patch of 0.27.0: a host can draw the failure screen and explain a stopped radio, a failure names its cause as a code, and 16 payment strings are reworded. No native change: hosts do not rebuild. Every new prop is optional, and the new fields are on values that the toolbox gives to the host, so no host action is necessary.
|
|
@@ -13,12 +23,13 @@ The BSV Wallet app's nearby-payment changes, upstreamed from its patch of 0.27.0
|
|
|
13
23
|
- **`NearbyFailed.declineReason`.** The payee's own decline code, when the payee refused the payment.
|
|
14
24
|
- **`NearbyFlowProps.explainRadio`, `{ label, onPress(kind) }`.** With it, each "radio stopped" notice has an (i) button that calls `onPress` with the radio that stopped. `label` is the accessibility label of the button. The button is absent when Local Network access is off, because that notice has its own Settings button. Without the prop, the notice is the same as before.
|
|
15
25
|
- **Wallet identity keys on the host values.** `recipient.identityKey` on `NearbyConfirm`, `NearbySending` and `NearbyShowCode`, `recipientKey` on `NearbyDone`, and `payerKey` on `NearbyReceived`. A host can draw the same face for the person that it draws in other screens.
|
|
26
|
+
- **Icelandic (`is`).** A full catalog, and `supportedLanguages` lists it. It merged after this entry was written, and the 0.29.0 package includes it.
|
|
16
27
|
- **14 German strings.** The German catalog lacked 13 keys, and one more value had old wording.
|
|
17
28
|
|
|
18
29
|
### Changed
|
|
19
30
|
|
|
20
31
|
- **The embedded "Scan the payer's code" control is now a button.** In the embedded payee flow it was a 13 px line of grey text. It is now the same `SecondaryButton` as in the full-screen flow. Every host that embeds `NearbyFlow` sees this.
|
|
21
|
-
- **16 payment strings are reworded, in all
|
|
32
|
+
- **16 payment strings are reworded, in all 14 locales.** No key is added, renamed or dropped. Every host sees the new copy.
|
|
22
33
|
- Outside Settings › Advanced, the copy does not name the message box. It says what occurred and what to do: `message_box_off_hint`, `message_box_unreachable`, `resend_sending`, `direct_pay_status_not_set_up_body`, `direct_pay_fallback_title`, `direct_pay_fallback_offline`, `direct_pay_fallback_link_failed`, `direct_pay_fallback_too_large`, `direct_pay_failed_offline` and `direct_pay_failed_no_message_box`.
|
|
23
34
|
- `local_pay_ble_unavailable`, `local_pay_nearby_unavailable` and `local_pay_floor_peer_bt_off` are shorter.
|
|
24
35
|
- `local_pay_root_unverified` and `local_pay_declined_root_unverified` now say what to do: the payee goes online, then the same code is scanned again.
|
package/core/backup/appData.ts
CHANGED
|
@@ -50,6 +50,12 @@ import { getIssuedDates, setIssuedDates } from '../pay/receiveHistory'
|
|
|
50
50
|
import type { AppDataSnapshot } from './codec'
|
|
51
51
|
import { mergeContacts } from './contactsBackup'
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* The app's own row for how it draws this wallet (its avatar). The toolbox never reads its
|
|
55
|
+
* value: it backs the row up and writes it back, so a restored wallet looks as it did.
|
|
56
|
+
*/
|
|
57
|
+
export const WALLET_LOOK_KEY = 'wallet_look'
|
|
58
|
+
|
|
53
59
|
export interface KVStorage {
|
|
54
60
|
getKeyValue(k: string): Promise<string | undefined>
|
|
55
61
|
setKeyValue(k: string, v: string): Promise<void>
|
|
@@ -65,6 +71,7 @@ export function isEmptyAppData(appData: AppDataSnapshot | undefined): boolean {
|
|
|
65
71
|
(appData.localpayPending === undefined &&
|
|
66
72
|
appData.peerpayOutbox === undefined &&
|
|
67
73
|
appData.contacts === undefined &&
|
|
74
|
+
appData.walletLook === undefined &&
|
|
68
75
|
(appData.receiveIssuedDates?.length ?? 0) === 0)
|
|
69
76
|
)
|
|
70
77
|
}
|
|
@@ -76,15 +83,18 @@ export function isEmptyAppData(appData: AppDataSnapshot | undefined): boolean {
|
|
|
76
83
|
* only ever rides an already-non-empty chunk.
|
|
77
84
|
*/
|
|
78
85
|
export async function captureAppDataSnapshot(storage: KVStorage): Promise<AppDataSnapshot> {
|
|
79
|
-
const [localpayPending, peerpayOutbox, receiveIssuedDates] = await Promise.all([
|
|
86
|
+
const [localpayPending, peerpayOutbox, receiveIssuedDates, walletLook] = await Promise.all([
|
|
80
87
|
storage.getKeyValue(PENDING_KEY),
|
|
81
88
|
storage.getKeyValue(OUTBOX_KEY),
|
|
82
|
-
getIssuedDates(storage)
|
|
89
|
+
getIssuedDates(storage),
|
|
90
|
+
storage.getKeyValue(WALLET_LOOK_KEY)
|
|
83
91
|
])
|
|
84
92
|
const snapshot: AppDataSnapshot = {}
|
|
85
93
|
if (localpayPending !== undefined) snapshot.localpayPending = localpayPending
|
|
86
94
|
if (peerpayOutbox !== undefined) snapshot.peerpayOutbox = peerpayOutbox
|
|
87
95
|
if (receiveIssuedDates.length > 0) snapshot.receiveIssuedDates = receiveIssuedDates
|
|
96
|
+
// an empty row is "none set": nothing to carry
|
|
97
|
+
if (walletLook) snapshot.walletLook = walletLook
|
|
88
98
|
return snapshot
|
|
89
99
|
}
|
|
90
100
|
|
|
@@ -101,6 +111,7 @@ export async function applyAppData(storage: KVStorage, snapshot: AppDataSnapshot
|
|
|
101
111
|
if (snapshot.receiveIssuedDates !== undefined && snapshot.receiveIssuedDates.length > 0) {
|
|
102
112
|
await setIssuedDates(storage, snapshot.receiveIssuedDates)
|
|
103
113
|
}
|
|
114
|
+
if (snapshot.walletLook) await storage.setKeyValue(WALLET_LOOK_KEY, snapshot.walletLook)
|
|
104
115
|
}
|
|
105
116
|
|
|
106
117
|
/** Parses a KV row's raw JSON text into an array of plain objects, never throwing — a
|
|
@@ -157,6 +168,8 @@ export function mergeAppData(a: AppDataSnapshot | undefined, b: AppDataSnapshot
|
|
|
157
168
|
? undefined
|
|
158
169
|
: [...new Set([...(a?.receiveIssuedDates ?? []), ...(b?.receiveIssuedDates ?? [])])].sort(),
|
|
159
170
|
// everyone either device knew, each as they were last changed (contactsBackup.ts)
|
|
160
|
-
contacts: mergeContacts(a?.contacts, b?.contacts)
|
|
171
|
+
contacts: mergeContacts(a?.contacts, b?.contacts),
|
|
172
|
+
// one look per wallet, not a list: the first device's (the primary, folded in first) wins
|
|
173
|
+
walletLook: a?.walletLook ?? b?.walletLook
|
|
161
174
|
}
|
|
162
175
|
}
|
package/core/backup/codec.ts
CHANGED
|
@@ -111,7 +111,10 @@ export function estimateEncodedBytes(chunk: SyncChunk): number {
|
|
|
111
111
|
export function estimateAppDataBytes(appData: AppDataSnapshot | undefined): number {
|
|
112
112
|
if (appData == null) return 0
|
|
113
113
|
let bytes =
|
|
114
|
-
(appData.localpayPending?.length ?? 0) +
|
|
114
|
+
(appData.localpayPending?.length ?? 0) +
|
|
115
|
+
(appData.peerpayOutbox?.length ?? 0) +
|
|
116
|
+
(appData.contacts?.length ?? 0) +
|
|
117
|
+
(appData.walletLook?.length ?? 0)
|
|
115
118
|
for (const d of appData.receiveIssuedDates ?? []) bytes += d.length
|
|
116
119
|
return bytes
|
|
117
120
|
}
|
|
@@ -180,6 +183,11 @@ export interface AppDataSnapshot {
|
|
|
180
183
|
receiveIssuedDates?: string[]
|
|
181
184
|
/** The contacts table, as JSON (backup/contactsBackup.ts). */
|
|
182
185
|
contacts?: string
|
|
186
|
+
/**
|
|
187
|
+
* Verbatim value of key_value_store['wallet_look']: how the app draws this wallet (its
|
|
188
|
+
* avatar), as the app's own JSON. The toolbox only carries it.
|
|
189
|
+
*/
|
|
190
|
+
walletLook?: string
|
|
183
191
|
}
|
|
184
192
|
|
|
185
193
|
/**
|
|
@@ -345,6 +353,7 @@ function decodeAppData(raw: unknown): AppDataSnapshot | undefined {
|
|
|
345
353
|
peerpayOutbox?: unknown
|
|
346
354
|
receiveIssuedDates?: unknown
|
|
347
355
|
contacts?: unknown
|
|
356
|
+
walletLook?: unknown
|
|
348
357
|
}
|
|
349
358
|
if (a.localpayPending !== undefined && typeof a.localpayPending !== 'string') {
|
|
350
359
|
throw new Error('backup appData.localpayPending is malformed')
|
|
@@ -361,11 +370,15 @@ function decodeAppData(raw: unknown): AppDataSnapshot | undefined {
|
|
|
361
370
|
if (a.contacts !== undefined && typeof a.contacts !== 'string') {
|
|
362
371
|
throw new Error('backup appData.contacts is malformed')
|
|
363
372
|
}
|
|
373
|
+
if (a.walletLook !== undefined && typeof a.walletLook !== 'string') {
|
|
374
|
+
throw new Error('backup appData.walletLook is malformed')
|
|
375
|
+
}
|
|
364
376
|
return {
|
|
365
377
|
localpayPending: a.localpayPending as string | undefined,
|
|
366
378
|
peerpayOutbox: a.peerpayOutbox as string | undefined,
|
|
367
379
|
receiveIssuedDates: a.receiveIssuedDates as string[] | undefined,
|
|
368
|
-
...(a.contacts !== undefined ? { contacts: a.contacts as string } : {})
|
|
380
|
+
...(a.contacts !== undefined ? { contacts: a.contacts as string } : {}),
|
|
381
|
+
...(a.walletLook !== undefined ? { walletLook: a.walletLook as string } : {})
|
|
369
382
|
}
|
|
370
383
|
}
|
|
371
384
|
|
|
@@ -350,6 +350,12 @@ const resources = {
|
|
|
350
350
|
vault_card_unknown_body:
|
|
351
351
|
'The key was not changed. Try again. If you reset it without checking, any vault it opens is lost for good.',
|
|
352
352
|
vault_card_retry: 'Try again',
|
|
353
|
+
vault_card_progress: '{{percent}}% checked',
|
|
354
|
+
vault_card_skip: 'Skip the check',
|
|
355
|
+
vault_card_skipped_title: 'Check skipped',
|
|
356
|
+
vault_card_skipped_body: 'The blockchain was not checked. If this key opens a vault, its funds are lost for good when you reset it.',
|
|
357
|
+
vault_card_check: 'Check the blockchain',
|
|
358
|
+
vault_card_reason: 'Reason: {{reason}}',
|
|
353
359
|
vault_card_loss_ack: 'Any funds in a vault that uses this key are lost for good if you reset it.',
|
|
354
360
|
vault_reset_unknown_ack:
|
|
355
361
|
"This device cannot confirm whether this key still secures a different profile's vault. I understand erasing it may destroy that key for good.",
|
|
@@ -1604,6 +1610,12 @@ const resources = {
|
|
|
1604
1610
|
vault_card_unknown_title: '无法检查区块链',
|
|
1605
1611
|
vault_card_unknown_body: '密钥未被更改。请重试。如果不检查就重置,它所打开的任何保险库都将永久丢失。',
|
|
1606
1612
|
vault_card_retry: '重试',
|
|
1613
|
+
vault_card_progress: '已检查 {{percent}}%',
|
|
1614
|
+
vault_card_skip: '跳过检查',
|
|
1615
|
+
vault_card_skipped_title: '已跳过检查',
|
|
1616
|
+
vault_card_skipped_body: '未检查区块链。如果此密钥可打开某个保险库,重置后其中的资金将永久丢失。',
|
|
1617
|
+
vault_card_check: '检查区块链',
|
|
1618
|
+
vault_card_reason: '原因:{{reason}}',
|
|
1607
1619
|
vault_card_loss_ack: '如果重置,使用此密钥的保险库中的任何资金都将永久丢失。',
|
|
1608
1620
|
vault_reset_unknown_ack:
|
|
1609
1621
|
'本设备无法确认这把密钥是否仍在为另一个身份的保险库提供保护。我明白抹除它可能会永久销毁那把密钥。',
|
|
@@ -2794,6 +2806,12 @@ const resources = {
|
|
|
2794
2806
|
vault_card_unknown_body:
|
|
2795
2807
|
'कुंजी में कोई बदलाव नहीं हुआ। दोबारा कोशिश करें। अगर आप जाँचे बिना इसे रीसेट करते हैं, तो इससे खुलने वाला कोई भी वॉल्ट हमेशा के लिए खो जाएगा।',
|
|
2796
2808
|
vault_card_retry: 'पुनः प्रयास',
|
|
2809
|
+
vault_card_progress: '{{percent}}% जाँचा गया',
|
|
2810
|
+
vault_card_skip: 'जाँच छोड़ें',
|
|
2811
|
+
vault_card_skipped_title: 'जाँच छोड़ी गई',
|
|
2812
|
+
vault_card_skipped_body: 'ब्लॉकचेन की जाँच नहीं हुई। यदि यह कुंजी किसी वॉल्ट को खोलती है, तो रीसेट करने पर उसकी राशि हमेशा के लिए खो जाएगी।',
|
|
2813
|
+
vault_card_check: 'ब्लॉकचेन जाँचें',
|
|
2814
|
+
vault_card_reason: 'कारण: {{reason}}',
|
|
2797
2815
|
vault_card_loss_ack:
|
|
2798
2816
|
'अगर आप इसे रीसेट करते हैं, तो इस कुंजी का उपयोग करने वाले वॉल्ट में मौजूद सारे फ़ंड हमेशा के लिए खो जाएँगे।',
|
|
2799
2817
|
vault_reset_unknown_ack:
|
|
@@ -4050,6 +4068,12 @@ const resources = {
|
|
|
4050
4068
|
vault_card_unknown_body:
|
|
4051
4069
|
'La llave no se modificó. Inténtalo de nuevo. Si la restableces sin comprobarlo, cualquier caja fuerte que abra se perderá para siempre.',
|
|
4052
4070
|
vault_card_retry: 'Reintentar',
|
|
4071
|
+
vault_card_progress: '{{percent}}% comprobado',
|
|
4072
|
+
vault_card_skip: 'Omitir la comprobación',
|
|
4073
|
+
vault_card_skipped_title: 'Comprobación omitida',
|
|
4074
|
+
vault_card_skipped_body: 'No se comprobó la blockchain. Si esta llave abre una caja fuerte, sus fondos se pierden para siempre al restablecerla.',
|
|
4075
|
+
vault_card_check: 'Comprobar la blockchain',
|
|
4076
|
+
vault_card_reason: 'Motivo: {{reason}}',
|
|
4053
4077
|
vault_card_loss_ack:
|
|
4054
4078
|
'Si la restableces, cualquier fondo de una caja fuerte que use esta llave se perderá para siempre.',
|
|
4055
4079
|
vault_reset_unknown_ack:
|
|
@@ -5333,6 +5357,12 @@ const resources = {
|
|
|
5333
5357
|
vault_card_unknown_body:
|
|
5334
5358
|
'La clé n’a pas été modifiée. Réessayez. Si vous la réinitialisez sans vérifier, tout coffre qu’elle ouvre sera perdu définitivement.',
|
|
5335
5359
|
vault_card_retry: 'Réessayer',
|
|
5360
|
+
vault_card_progress: '{{percent}} % vérifié',
|
|
5361
|
+
vault_card_skip: 'Passer la vérification',
|
|
5362
|
+
vault_card_skipped_title: 'Vérification ignorée',
|
|
5363
|
+
vault_card_skipped_body: 'La blockchain n’a pas été vérifiée. Si cette clé ouvre un coffre, ses fonds sont perdus pour toujours si vous la réinitialisez.',
|
|
5364
|
+
vault_card_check: 'Vérifier la blockchain',
|
|
5365
|
+
vault_card_reason: 'Raison : {{reason}}',
|
|
5336
5366
|
vault_card_loss_ack:
|
|
5337
5367
|
'Si vous la réinitialisez, tous les fonds d’un coffre qui utilise cette clé seront perdus définitivement.',
|
|
5338
5368
|
vault_reset_unknown_ack:
|
|
@@ -6600,6 +6630,12 @@ const resources = {
|
|
|
6600
6630
|
vault_card_unknown_body:
|
|
6601
6631
|
'لم يتم تغيير المفتاح. حاول مرة أخرى. إذا أعدت ضبطه دون فحص، فستضيع أي خزنة يفتحها إلى الأبد.',
|
|
6602
6632
|
vault_card_retry: 'إعادة المحاولة',
|
|
6633
|
+
vault_card_progress: 'تم فحص {{percent}}%',
|
|
6634
|
+
vault_card_skip: 'تخطي الفحص',
|
|
6635
|
+
vault_card_skipped_title: 'تم تخطي الفحص',
|
|
6636
|
+
vault_card_skipped_body: 'لم يتم فحص البلوكتشين. إذا كان هذا المفتاح يفتح خزنة، فستضيع أموالها نهائيًا عند إعادة تعيينه.',
|
|
6637
|
+
vault_card_check: 'فحص البلوكتشين',
|
|
6638
|
+
vault_card_reason: 'السبب: {{reason}}',
|
|
6603
6639
|
vault_card_loss_ack: 'ستضيع إلى الأبد أي أموال في خزنة تستخدم هذا المفتاح إذا أعدت ضبطه.',
|
|
6604
6640
|
vault_reset_unknown_ack:
|
|
6605
6641
|
'لا يمكن لهذا الجهاز التأكد مما إذا كان هذا المفتاح لا يزال يؤمّن خزنة ملف شخصي آخر. أفهم أن محوه قد يدمّر ذلك المفتاح نهائيًا.',
|
|
@@ -7824,6 +7860,12 @@ const resources = {
|
|
|
7824
7860
|
vault_card_unknown_body:
|
|
7825
7861
|
'A chave não foi alterada. Tente novamente. Se a repuser sem verificar, qualquer cofre que ela abra será perdido para sempre.',
|
|
7826
7862
|
vault_card_retry: 'Tentar novamente',
|
|
7863
|
+
vault_card_progress: '{{percent}}% verificado',
|
|
7864
|
+
vault_card_skip: 'Pular a verificação',
|
|
7865
|
+
vault_card_skipped_title: 'Verificação pulada',
|
|
7866
|
+
vault_card_skipped_body: 'A blockchain não foi verificada. Se esta chave abre um cofre, os fundos dele serão perdidos para sempre ao redefini-la.',
|
|
7867
|
+
vault_card_check: 'Verificar a blockchain',
|
|
7868
|
+
vault_card_reason: 'Motivo: {{reason}}',
|
|
7827
7869
|
vault_card_loss_ack: 'Se repuser esta chave, qualquer fundo num cofre que a use será perdido para sempre.',
|
|
7828
7870
|
vault_reset_unknown_ack:
|
|
7829
7871
|
'Este dispositivo não pode confirmar se esta chave ainda protege o cofre de outro perfil. Compreendo que apagá-la pode destruir essa chave para sempre.',
|
|
@@ -9096,6 +9138,12 @@ const resources = {
|
|
|
9096
9138
|
vault_card_unknown_body:
|
|
9097
9139
|
'কী পরিবর্তন করা হয়নি। আবার চেষ্টা করুন। যাচাই না করে রিসেট করলে এই কী যে ভল্ট খোলে তা চিরতরে হারিয়ে যাবে।',
|
|
9098
9140
|
vault_card_retry: 'পুনরায় চেষ্টা',
|
|
9141
|
+
vault_card_progress: '{{percent}}% যাচাই হয়েছে',
|
|
9142
|
+
vault_card_skip: 'যাচাই বাদ দিন',
|
|
9143
|
+
vault_card_skipped_title: 'যাচাই বাদ দেওয়া হয়েছে',
|
|
9144
|
+
vault_card_skipped_body: 'ব্লকচেইন যাচাই করা হয়নি। এই কী কোনো ভল্ট খুললে, রিসেট করলে তার অর্থ চিরতরে হারিয়ে যাবে।',
|
|
9145
|
+
vault_card_check: 'ব্লকচেইন যাচাই করুন',
|
|
9146
|
+
vault_card_reason: 'কারণ: {{reason}}',
|
|
9099
9147
|
vault_card_loss_ack: 'রিসেট করলে এই কী ব্যবহার করা ভল্টের সব ফান্ড চিরতরে হারিয়ে যাবে।',
|
|
9100
9148
|
vault_reset_unknown_ack:
|
|
9101
9149
|
'এই ডিভাইসটি নিশ্চিত করতে পারে না যে এই কীটি অন্য কোনো প্রোফাইলের ভল্ট এখনও সুরক্ষিত করছে কিনা। আমি বুঝেছি এটি মুছে ফেললে ওই কী চিরতরে নষ্ট হতে পারে।',
|
|
@@ -10345,6 +10393,12 @@ const resources = {
|
|
|
10345
10393
|
vault_card_unknown_body:
|
|
10346
10394
|
'Ключ не изменён. Повторите попытку. Если сбросить его без проверки, любое хранилище, которое он открывает, будет потеряно безвозвратно.',
|
|
10347
10395
|
vault_card_retry: 'Повторить',
|
|
10396
|
+
vault_card_progress: 'Проверено {{percent}}%',
|
|
10397
|
+
vault_card_skip: 'Пропустить проверку',
|
|
10398
|
+
vault_card_skipped_title: 'Проверка пропущена',
|
|
10399
|
+
vault_card_skipped_body: 'Блокчейн не проверен. Если этот ключ открывает хранилище, его средства будут потеряны навсегда после сброса.',
|
|
10400
|
+
vault_card_check: 'Проверить блокчейн',
|
|
10401
|
+
vault_card_reason: 'Причина: {{reason}}',
|
|
10348
10402
|
vault_card_loss_ack:
|
|
10349
10403
|
'Если сбросить ключ, все средства в хранилище, использующем этот ключ, будут потеряны безвозвратно.',
|
|
10350
10404
|
vault_reset_unknown_ack:
|
|
@@ -11611,6 +11665,12 @@ const resources = {
|
|
|
11611
11665
|
vault_card_unknown_body:
|
|
11612
11666
|
'Kunci tidak diubah. Coba lagi. Jika Anda menyetel ulang tanpa memeriksa, brankas apa pun yang dibukanya hilang selamanya.',
|
|
11613
11667
|
vault_card_retry: 'Coba lagi',
|
|
11668
|
+
vault_card_progress: '{{percent}}% diperiksa',
|
|
11669
|
+
vault_card_skip: 'Lewati pemeriksaan',
|
|
11670
|
+
vault_card_skipped_title: 'Pemeriksaan dilewati',
|
|
11671
|
+
vault_card_skipped_body: 'Blockchain tidak diperiksa. Jika kunci ini membuka brankas, dananya hilang selamanya saat kunci direset.',
|
|
11672
|
+
vault_card_check: 'Periksa blockchain',
|
|
11673
|
+
vault_card_reason: 'Alasan: {{reason}}',
|
|
11614
11674
|
vault_card_loss_ack:
|
|
11615
11675
|
'Dana apa pun di brankas yang memakai kunci ini hilang selamanya jika Anda menyetel ulangnya.',
|
|
11616
11676
|
vault_reset_unknown_ack:
|
|
@@ -12883,6 +12943,12 @@ const resources = {
|
|
|
12883
12943
|
vault_card_unknown_body:
|
|
12884
12944
|
'鍵は変更されていません。もう一度お試しください。確認せずにリセットすると、この鍵で開く保管庫は永久に失われます。',
|
|
12885
12945
|
vault_card_retry: '再試行',
|
|
12946
|
+
vault_card_progress: '{{percent}}% 確認済み',
|
|
12947
|
+
vault_card_skip: '確認をスキップ',
|
|
12948
|
+
vault_card_skipped_title: '確認をスキップしました',
|
|
12949
|
+
vault_card_skipped_body: 'ブロックチェーンは確認されていません。この鍵で開く保管庫がある場合、リセットするとその資金は永久に失われます。',
|
|
12950
|
+
vault_card_check: 'ブロックチェーンを確認',
|
|
12951
|
+
vault_card_reason: '理由: {{reason}}',
|
|
12886
12952
|
vault_card_loss_ack: 'この鍵を使う保管庫の資金は、リセットすると永久に失われます。',
|
|
12887
12953
|
vault_reset_unknown_ack:
|
|
12888
12954
|
'このデバイスでは、このキーが別のプロファイルの保管庫を保護しているかどうかを確認できません。消去するとその鍵が永久に失われる可能性があることを理解しました。',
|
|
@@ -14155,6 +14221,12 @@ const resources = {
|
|
|
14155
14221
|
vault_card_unknown_body:
|
|
14156
14222
|
'Klucz nie został zmieniony. Spróbuj ponownie. Jeśli zresetujesz go bez sprawdzenia, każdy sejf, który otwiera, przepadnie na zawsze.',
|
|
14157
14223
|
vault_card_retry: 'Spróbuj ponownie',
|
|
14224
|
+
vault_card_progress: 'Sprawdzono {{percent}}%',
|
|
14225
|
+
vault_card_skip: 'Pomiń sprawdzanie',
|
|
14226
|
+
vault_card_skipped_title: 'Pominięto sprawdzanie',
|
|
14227
|
+
vault_card_skipped_body: 'Blockchain nie został sprawdzony. Jeśli ten klucz otwiera sejf, jego środki przepadną na zawsze po zresetowaniu klucza.',
|
|
14228
|
+
vault_card_check: 'Sprawdź blockchain',
|
|
14229
|
+
vault_card_reason: 'Powód: {{reason}}',
|
|
14158
14230
|
vault_card_loss_ack:
|
|
14159
14231
|
'Jeśli zresetujesz ten klucz, wszystkie środki w sejfie używającym tego klucza przepadną na zawsze.',
|
|
14160
14232
|
vault_reset_unknown_ack:
|
|
@@ -15448,6 +15520,12 @@ const resources = {
|
|
|
15448
15520
|
vault_card_unknown_body:
|
|
15449
15521
|
'Der Schlüssel wurde nicht verändert. Versuch es erneut. Wenn du ihn ohne Prüfung zurücksetzt, ist jeder Tresor, den er öffnet, endgültig verloren.',
|
|
15450
15522
|
vault_card_retry: 'Erneut versuchen',
|
|
15523
|
+
vault_card_progress: '{{percent}} % geprüft',
|
|
15524
|
+
vault_card_skip: 'Prüfung überspringen',
|
|
15525
|
+
vault_card_skipped_title: 'Prüfung übersprungen',
|
|
15526
|
+
vault_card_skipped_body: 'Die Blockchain wurde nicht geprüft. Wenn dieser Schlüssel einen Tresor öffnet, ist dessen Guthaben beim Zurücksetzen endgültig verloren.',
|
|
15527
|
+
vault_card_check: 'Blockchain prüfen',
|
|
15528
|
+
vault_card_reason: 'Grund: {{reason}}',
|
|
15451
15529
|
vault_card_loss_ack:
|
|
15452
15530
|
'Alle Guthaben in einem Tresor, der diesen Schlüssel nutzt, sind endgültig verloren, wenn du ihn zurücksetzt.',
|
|
15453
15531
|
vault_reset_unknown_ack:
|
|
@@ -16718,6 +16796,12 @@ const resources = {
|
|
|
16718
16796
|
vault_card_unknown_body:
|
|
16719
16797
|
'Lyklinum var ekki breytt. Reyndu aftur. Ef þú endurstillir hann án þess að athuga glatast öll öryggishólf sem hann opnar fyrir fullt og allt.',
|
|
16720
16798
|
vault_card_retry: 'Reyna aftur',
|
|
16799
|
+
vault_card_progress: '{{percent}}% athugað',
|
|
16800
|
+
vault_card_skip: 'Sleppa athuguninni',
|
|
16801
|
+
vault_card_skipped_title: 'Athugun sleppt',
|
|
16802
|
+
vault_card_skipped_body: 'Blokkarkeðjan var ekki athuguð. Ef þessi lykill opnar öryggishólf glatast féð í því fyrir fullt og allt þegar þú endurstillir hann.',
|
|
16803
|
+
vault_card_check: 'Athuga blokkarkeðjuna',
|
|
16804
|
+
vault_card_reason: 'Ástæða: {{reason}}',
|
|
16721
16805
|
vault_card_loss_ack:
|
|
16722
16806
|
'Ef þú endurstillir þennan lykil glatast allt fé í öryggishólfi sem notar hann fyrir fullt og allt.',
|
|
16723
16807
|
vault_reset_unknown_ack:
|
package/package.json
CHANGED
|
@@ -314,7 +314,17 @@ export interface EnrollWizardProps {
|
|
|
314
314
|
* tell whether the card opens a vault: it treats that as "unknown" and a reset needs the affirmation.
|
|
315
315
|
*/
|
|
316
316
|
cardGate?: {
|
|
317
|
-
|
|
317
|
+
/**
|
|
318
|
+
* `onProgress` gets how far the scan is (0 to 1) after each place it checks. `signal` is aborted when the
|
|
319
|
+
* person skips the check or the page closes: the check then ends soon, and its answer is ignored.
|
|
320
|
+
*/
|
|
321
|
+
check: (
|
|
322
|
+
serial: string,
|
|
323
|
+
options?: {
|
|
324
|
+
onProgress?: (progress: { checked: number; fraction: number }) => void
|
|
325
|
+
signal?: AbortSignal
|
|
326
|
+
}
|
|
327
|
+
) => Promise<VaultCardFunds>
|
|
318
328
|
args: (
|
|
319
329
|
result: VaultCardFunds | null,
|
|
320
330
|
affirmed: boolean
|
|
@@ -400,6 +410,10 @@ export const EnrollWizard: React.FC<EnrollWizardProps> = ({
|
|
|
400
410
|
/** The chain check for the card on the reset page or the slot-occupied page. null while it runs. */
|
|
401
411
|
const [cardCheck, setCardCheck] = useState<VaultCardFunds | null>(null)
|
|
402
412
|
const [checkRound, setCheckRound] = useState(0)
|
|
413
|
+
/** How far the running check is, 0 to 1. null before the scan reports, or with no cardGate. */
|
|
414
|
+
const [cardProgress, setCardProgress] = useState<number | null>(null)
|
|
415
|
+
/** The running check: `skipCardCheck` stops it and drops its answer. */
|
|
416
|
+
const cardRunRef = useRef<{ live: boolean; stop: () => void } | null>(null)
|
|
403
417
|
/** "Any funds in a vault that uses this key are lost for good if you reset it." */
|
|
404
418
|
const [lossAck, setLossAck] = useState(false)
|
|
405
419
|
/** A write (finalizeEnrollment / addVaultKey) is in flight. */
|
|
@@ -458,23 +472,43 @@ export const EnrollWizard: React.FC<EnrollWizardProps> = ({
|
|
|
458
472
|
sub === 'reset' || (sub === 'error' && keyError?.code === 'slot-occupied') ? keyError?.resetSerial : undefined
|
|
459
473
|
useEffect(() => {
|
|
460
474
|
setCardCheck(null)
|
|
475
|
+
setCardProgress(null)
|
|
461
476
|
// a new check starts: the sentence ticked for an earlier result is not carried over to this one
|
|
462
477
|
setLossAck(false)
|
|
463
478
|
if (!gateSerial) return
|
|
464
|
-
let live = true
|
|
465
479
|
const unknown = (reason: string): VaultCardFunds => ({ kind: 'unknown', serial: gateSerial, reason, problems: 0 })
|
|
466
480
|
if (!cardGate) {
|
|
467
481
|
setCardCheck(unknown('no-check'))
|
|
468
482
|
return
|
|
469
483
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
484
|
+
const controller = new AbortController()
|
|
485
|
+
const run = { live: true, stop: () => controller.abort() }
|
|
486
|
+
cardRunRef.current = run
|
|
487
|
+
cardGate
|
|
488
|
+
.check(gateSerial, {
|
|
489
|
+
onProgress: progress => run.live && setCardProgress(progress.fraction),
|
|
490
|
+
signal: controller.signal
|
|
491
|
+
})
|
|
492
|
+
.then(
|
|
493
|
+
result => run.live && setCardCheck(result),
|
|
494
|
+
() => run.live && setCardCheck(unknown('check-failed'))
|
|
495
|
+
)
|
|
474
496
|
return () => {
|
|
475
|
-
|
|
497
|
+
// the page closed or a new check started: this scan stops sending requests, and its answer is dropped
|
|
498
|
+
run.live = false
|
|
499
|
+
run.stop()
|
|
500
|
+
if (cardRunRef.current === run) cardRunRef.current = null
|
|
476
501
|
}
|
|
477
502
|
}, [gateSerial, cardGate, checkRound])
|
|
503
|
+
/** The person does not wait for the check. The answer is "unknown": a reset still needs the loss sentence. */
|
|
504
|
+
const skipCardCheck = () => {
|
|
505
|
+
const run = cardRunRef.current
|
|
506
|
+
if (run) {
|
|
507
|
+
run.live = false
|
|
508
|
+
run.stop()
|
|
509
|
+
}
|
|
510
|
+
if (gateSerial) setCardCheck({ kind: 'unknown', serial: gateSerial, reason: 'skipped', problems: 0 })
|
|
511
|
+
}
|
|
478
512
|
/** What resetPivApplication takes, or null while the card may not be reset or replaced. */
|
|
479
513
|
const gateArgs: { fundsClearance: VaultResetClearance } | { acknowledgeFundsLoss: true } | null = cardGate
|
|
480
514
|
? cardGate.args(cardCheck, lossAck)
|
|
@@ -1149,7 +1183,27 @@ export const EnrollWizard: React.FC<EnrollWizardProps> = ({
|
|
|
1149
1183
|
const cardGateBlock = (
|
|
1150
1184
|
<>
|
|
1151
1185
|
{cardCheck === null && (
|
|
1152
|
-
|
|
1186
|
+
<>
|
|
1187
|
+
<BalancedText style={[styles.p, { color: colors.textSecondary }]}>{t('vault_card_checking')}</BalancedText>
|
|
1188
|
+
{(() => {
|
|
1189
|
+
const percent = Math.floor((cardProgress ?? 0) * 100)
|
|
1190
|
+
return (
|
|
1191
|
+
<View
|
|
1192
|
+
style={styles.progress}
|
|
1193
|
+
accessibilityRole="progressbar"
|
|
1194
|
+
accessibilityValue={{ min: 0, max: 100, now: percent }}
|
|
1195
|
+
>
|
|
1196
|
+
<View style={[styles.progressTrack, { backgroundColor: colors.backgroundSecondary }]}>
|
|
1197
|
+
<View style={[styles.progressFill, { backgroundColor: colors.accent, width: `${percent}%` }]} />
|
|
1198
|
+
</View>
|
|
1199
|
+
<Text style={[styles.progressLabel, { color: colors.textSecondary }]}>
|
|
1200
|
+
{t('vault_card_progress', { percent })}
|
|
1201
|
+
</Text>
|
|
1202
|
+
</View>
|
|
1203
|
+
)
|
|
1204
|
+
})()}
|
|
1205
|
+
<ActionButton label={t('vault_card_skip')} variant="outline" onPress={skipCardCheck} />
|
|
1206
|
+
</>
|
|
1153
1207
|
)}
|
|
1154
1208
|
{cardCheck?.kind === 'funds' && (
|
|
1155
1209
|
<>
|
|
@@ -1162,10 +1216,30 @@ export const EnrollWizard: React.FC<EnrollWizardProps> = ({
|
|
|
1162
1216
|
)}
|
|
1163
1217
|
</>
|
|
1164
1218
|
)}
|
|
1165
|
-
{cardCheck?.kind === 'unknown' && (
|
|
1219
|
+
{cardCheck?.kind === 'unknown' && cardCheck.reason === 'skipped' && (
|
|
1220
|
+
<>
|
|
1221
|
+
<Text style={[styles.h1, { color: colors.textPrimary }]}>{t('vault_card_skipped_title')}</Text>
|
|
1222
|
+
<BalancedText style={[styles.p, { color: colors.textSecondary }]}>
|
|
1223
|
+
{t('vault_card_skipped_body')}
|
|
1224
|
+
</BalancedText>
|
|
1225
|
+
<ActionButton
|
|
1226
|
+
label={t('vault_card_check')}
|
|
1227
|
+
variant="outline"
|
|
1228
|
+
onPress={() => setCheckRound(round => round + 1)}
|
|
1229
|
+
/>
|
|
1230
|
+
</>
|
|
1231
|
+
)}
|
|
1232
|
+
{cardCheck?.kind === 'unknown' && cardCheck.reason !== 'skipped' && (
|
|
1166
1233
|
<>
|
|
1167
1234
|
<Text style={[styles.h1, { color: colors.textPrimary }]}>{t('vault_card_unknown_title')}</Text>
|
|
1168
|
-
<BalancedText style={[styles.p, { color: colors.textSecondary }]}>
|
|
1235
|
+
<BalancedText style={[styles.p, { color: colors.textSecondary }]}>
|
|
1236
|
+
{t('vault_card_unknown_body')}
|
|
1237
|
+
</BalancedText>
|
|
1238
|
+
{cardCheck.reason !== 'no-check' && (
|
|
1239
|
+
<Text style={[styles.warn, { color: colors.textTertiary }]}>
|
|
1240
|
+
{t('vault_card_reason', { reason: cardCheck.reason })}
|
|
1241
|
+
</Text>
|
|
1242
|
+
)}
|
|
1169
1243
|
{cardGate && (
|
|
1170
1244
|
<ActionButton
|
|
1171
1245
|
label={t('vault_card_retry')}
|