From 063603e0d5055bf7f70618043a30b74b3fa1d6ac Mon Sep 17 00:00:00 2001 From: Nazar Usov Date: Wed, 3 Apr 2024 15:21:15 +0300 Subject: [PATCH 1/6] Update translations text --- html_source/src/assets/i18n/af.json | 2 +- html_source/src/assets/i18n/ar.json | 2 +- html_source/src/assets/i18n/ca.json | 2 +- html_source/src/assets/i18n/cs.json | 2 +- html_source/src/assets/i18n/da.json | 2 +- html_source/src/assets/i18n/de.json | 2 +- html_source/src/assets/i18n/el.json | 2 +- html_source/src/assets/i18n/en.json | 2 +- html_source/src/assets/i18n/es.json | 2 +- html_source/src/assets/i18n/fi.json | 2 +- html_source/src/assets/i18n/fr.json | 2 +- html_source/src/assets/i18n/he.json | 2 +- html_source/src/assets/i18n/hu.json | 2 +- html_source/src/assets/i18n/id.json | 2 +- html_source/src/assets/i18n/it.json | 2 +- html_source/src/assets/i18n/ja.json | 2 +- html_source/src/assets/i18n/ko.json | 2 +- html_source/src/assets/i18n/nl.json | 2 +- html_source/src/assets/i18n/no.json | 2 +- html_source/src/assets/i18n/pl.json | 2 +- html_source/src/assets/i18n/pt.json | 2 +- html_source/src/assets/i18n/ro.json | 2 +- html_source/src/assets/i18n/ru.json | 2 +- html_source/src/assets/i18n/sr.json | 2 +- html_source/src/assets/i18n/sv.json | 2 +- html_source/src/assets/i18n/tr.json | 2 +- html_source/src/assets/i18n/uk.json | 2 +- html_source/src/assets/i18n/vi.json | 2 +- html_source/src/assets/i18n/zh.json | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/html_source/src/assets/i18n/af.json b/html_source/src/assets/i18n/af.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/af.json +++ b/html_source/src/assets/i18n/af.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/ar.json b/html_source/src/assets/i18n/ar.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/ar.json +++ b/html_source/src/assets/i18n/ar.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/ca.json b/html_source/src/assets/i18n/ca.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/ca.json +++ b/html_source/src/assets/i18n/ca.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/cs.json b/html_source/src/assets/i18n/cs.json index 194b7862..5d930ef0 100644 --- a/html_source/src/assets/i18n/cs.json +++ b/html_source/src/assets/i18n/cs.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/da.json b/html_source/src/assets/i18n/da.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/da.json +++ b/html_source/src/assets/i18n/da.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/de.json b/html_source/src/assets/i18n/de.json index a2b10d82..059149bc 100644 --- a/html_source/src/assets/i18n/de.json +++ b/html_source/src/assets/i18n/de.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset-ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Benutzerdefiniertes Token hinzufügen" }, diff --git a/html_source/src/assets/i18n/el.json b/html_source/src/assets/i18n/el.json index 89ba1b3a..1a42f395 100644 --- a/html_source/src/assets/i18n/el.json +++ b/html_source/src/assets/i18n/el.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/en.json b/html_source/src/assets/i18n/en.json index 3c61c79b..40d125f1 100644 --- a/html_source/src/assets/i18n/en.json +++ b/html_source/src/assets/i18n/en.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/es.json b/html_source/src/assets/i18n/es.json index 50a2b88f..889ae377 100644 --- a/html_source/src/assets/i18n/es.json +++ b/html_source/src/assets/i18n/es.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/fi.json b/html_source/src/assets/i18n/fi.json index babecb5c..c8554bfe 100644 --- a/html_source/src/assets/i18n/fi.json +++ b/html_source/src/assets/i18n/fi.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/fr.json b/html_source/src/assets/i18n/fr.json index ce1818a2..0451f0ef 100644 --- a/html_source/src/assets/i18n/fr.json +++ b/html_source/src/assets/i18n/fr.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Identifiant de l'élément", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Ajouter un jeton personnalisé" }, diff --git a/html_source/src/assets/i18n/he.json b/html_source/src/assets/i18n/he.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/he.json +++ b/html_source/src/assets/i18n/he.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/hu.json b/html_source/src/assets/i18n/hu.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/hu.json +++ b/html_source/src/assets/i18n/hu.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/id.json b/html_source/src/assets/i18n/id.json index dd12a22e..abf24315 100644 --- a/html_source/src/assets/i18n/id.json +++ b/html_source/src/assets/i18n/id.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "ID Aset", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Tambahkan Token Khusus" }, diff --git a/html_source/src/assets/i18n/it.json b/html_source/src/assets/i18n/it.json index 5d81d356..1cad9fb7 100644 --- a/html_source/src/assets/i18n/it.json +++ b/html_source/src/assets/i18n/it.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "ID risorsa", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Aggiungi token personalizzato" }, diff --git a/html_source/src/assets/i18n/ja.json b/html_source/src/assets/i18n/ja.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/ja.json +++ b/html_source/src/assets/i18n/ja.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/ko.json b/html_source/src/assets/i18n/ko.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/ko.json +++ b/html_source/src/assets/i18n/ko.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/nl.json b/html_source/src/assets/i18n/nl.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/nl.json +++ b/html_source/src/assets/i18n/nl.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/no.json b/html_source/src/assets/i18n/no.json index babecb5c..c8554bfe 100644 --- a/html_source/src/assets/i18n/no.json +++ b/html_source/src/assets/i18n/no.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/pl.json b/html_source/src/assets/i18n/pl.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/pl.json +++ b/html_source/src/assets/i18n/pl.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/pt.json b/html_source/src/assets/i18n/pt.json index 509f9485..356933a2 100644 --- a/html_source/src/assets/i18n/pt.json +++ b/html_source/src/assets/i18n/pt.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "ID do recurso", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Adicionar token personalizado" }, diff --git a/html_source/src/assets/i18n/ro.json b/html_source/src/assets/i18n/ro.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/ro.json +++ b/html_source/src/assets/i18n/ro.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/ru.json b/html_source/src/assets/i18n/ru.json index 51cd0231..c211a452 100644 --- a/html_source/src/assets/i18n/ru.json +++ b/html_source/src/assets/i18n/ru.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/sr.json b/html_source/src/assets/i18n/sr.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/sr.json +++ b/html_source/src/assets/i18n/sr.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/sv.json b/html_source/src/assets/i18n/sv.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/sv.json +++ b/html_source/src/assets/i18n/sv.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/tr.json b/html_source/src/assets/i18n/tr.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/tr.json +++ b/html_source/src/assets/i18n/tr.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/uk.json b/html_source/src/assets/i18n/uk.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/uk.json +++ b/html_source/src/assets/i18n/uk.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/vi.json b/html_source/src/assets/i18n/vi.json index 4c1582a9..1d297b7d 100644 --- a/html_source/src/assets/i18n/vi.json +++ b/html_source/src/assets/i18n/vi.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, diff --git a/html_source/src/assets/i18n/zh.json b/html_source/src/assets/i18n/zh.json index a41919b2..99d03997 100644 --- a/html_source/src/assets/i18n/zh.json +++ b/html_source/src/assets/i18n/zh.json @@ -803,7 +803,7 @@ "MODAL_ADD_CUSTOM_TOKEN": { "FIELD_TITLE": "Asset ID", "FORM_ERRORS": { - "ERROR1": "Invalid asset ID" + "ERROR1": "Invalid Asset ID" }, "TITLE": "Add Custom Token" }, From 5a63d7ce31a5bf3ede1d326579dab0c8f01942a2 Mon Sep 17 00:00:00 2001 From: Nazar Usov Date: Wed, 3 Apr 2024 15:48:17 +0300 Subject: [PATCH 2/6] Fix style for "Confirm proposal" --- html_source/src/app/api/models/swap.model.ts | 20 ++++++++----------- .../confirm-swap/confirm-swap.component.html | 14 +++++++------ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/html_source/src/app/api/models/swap.model.ts b/html_source/src/app/api/models/swap.model.ts index cc90a09d..8d3beab1 100644 --- a/html_source/src/app/api/models/swap.model.ts +++ b/html_source/src/app/api/models/swap.model.ts @@ -2,16 +2,12 @@ export interface ProposalDetails { expiration_time: number; fee_paid_by_a: number; mixins: number; - to_initiator: [ - { - amount: number | string; - asset_id: string; - } - ]; - to_finalizer: [ - { - amount: number | string; - asset_id: string; - } - ]; + to_initiator: { + amount: number | string; + asset_id: string; + }[]; + to_finalizer: { + amount: number | string; + asset_id: string; + }[]; } diff --git a/html_source/src/app/pages/wallet/tabs/swap/pages/confirm-swap/confirm-swap.component.html b/html_source/src/app/pages/wallet/tabs/swap/pages/confirm-swap/confirm-swap.component.html index c41fb8cc..d4845bbd 100644 --- a/html_source/src/app/pages/wallet/tabs/swap/pages/confirm-swap/confirm-swap.component.html +++ b/html_source/src/app/pages/wallet/tabs/swap/pages/confirm-swap/confirm-swap.component.html @@ -22,9 +22,9 @@
{{ 'CONFIRM_SWAP.FORM.TABLE.LABELS.LABEL1' | translate }}
-
- {{ item.amount | intToMoney }} - {{ (item.asset_id | getAssetInfo)?.ticker || '???' }} + +
+

{{ item.amount | intToMoney }} {{ (item.asset_id | getAssetInfo)?.ticker || '???' }}

@@ -34,9 +34,11 @@
{{ 'CONFIRM_SWAP.FORM.TABLE.LABELS.LABEL2' | translate }}
-
- {{ item.amount | intToMoney }} - {{ (item.asset_id | getAssetInfo)?.ticker || '???' }} +
+

+ {{ item.amount | intToMoney }} + {{ (item.asset_id | getAssetInfo)?.ticker || '???' }} +

From 99687f651510967433bfbccec2ba5a431ee33fea Mon Sep 17 00:00:00 2001 From: Nazar Usov Date: Thu, 4 Apr 2024 11:41:16 +0300 Subject: [PATCH 3/6] Migrate --- html_source/src/app/api/models/rpc.models.ts | 13 ++++ .../src/app/api/models/wallet.model.ts | 1 + html_source/src/app/app.component.ts | 2 +- .../tabs/send/modals/wallet-modals.module.ts | 3 +- .../src/app/pages/wallet/wallet.module.ts | 4 ++ .../migrate-wallet-to-zarcanum.component.html | 25 +++++++ .../migrate-wallet-to-zarcanum.component.scss | 10 +++ .../migrate-wallet-to-zarcanum.component.ts | 49 +++++++++++++ .../success-sweep-bare-outs.component.html | 70 +++++++++++++++++++ .../success-sweep-bare-outs.component.scss | 0 .../success-sweep-bare-outs.component.ts | 23 ++++++ .../pages/wallet/wallet/wallet.component.ts | 66 ++++++++++++++++- html_source/src/app/parts/data/constants.ts | 1 + .../scss/components/_migrate-alert.scss | 21 ++++++ .../src/assets/scss/components/index.scss | 1 + .../src/assets/scss/helpers/_padding.scss | 6 ++ 16 files changed, 290 insertions(+), 5 deletions(-) create mode 100644 html_source/src/app/api/models/rpc.models.ts create mode 100644 html_source/src/app/pages/wallet/wallet/modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component.html create mode 100644 html_source/src/app/pages/wallet/wallet/modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component.scss create mode 100644 html_source/src/app/pages/wallet/wallet/modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component.ts create mode 100644 html_source/src/app/pages/wallet/wallet/modals/success-sweep-bare-outs/success-sweep-bare-outs.component.html create mode 100644 html_source/src/app/pages/wallet/wallet/modals/success-sweep-bare-outs/success-sweep-bare-outs.component.scss create mode 100644 html_source/src/app/pages/wallet/wallet/modals/success-sweep-bare-outs/success-sweep-bare-outs.component.ts create mode 100644 html_source/src/assets/scss/components/_migrate-alert.scss diff --git a/html_source/src/app/api/models/rpc.models.ts b/html_source/src/app/api/models/rpc.models.ts new file mode 100644 index 00000000..92553e87 --- /dev/null +++ b/html_source/src/app/api/models/rpc.models.ts @@ -0,0 +1,13 @@ +export interface GetBareOutsStats { + expected_total_fee: number; + total_amount: number; + total_bare_outs: number; + txs_count: number; +} + +export interface SweepBareOuts { + amount_swept: number; + bare_outs_swept: number; + fee_spent: number; + txs_sent: number; +} diff --git a/html_source/src/app/api/models/wallet.model.ts b/html_source/src/app/api/models/wallet.model.ts index f6da2c3c..da07a13d 100644 --- a/html_source/src/app/api/models/wallet.model.ts +++ b/html_source/src/app/api/models/wallet.model.ts @@ -102,6 +102,7 @@ export class Wallet { is_watch_only: boolean; exclude_mining_txs: boolean; alias_available: boolean; + has_bare_unspent_outputs = false; alias?: Partial; wakeAlias?: boolean; diff --git a/html_source/src/app/app.component.ts b/html_source/src/app/app.component.ts index a2d2d813..94b366f8 100644 --- a/html_source/src/app/app.component.ts +++ b/html_source/src/app/app.component.ts @@ -13,7 +13,6 @@ import { takeUntil } from 'rxjs/operators'; import { paths, pathsChildrenAuth } from './pages/paths'; import { hasOwnProperty } from '@parts/functions/hasOwnProperty'; import { Dialog } from '@angular/cdk/dialog'; -import { ParamsCallRpc } from '@api/models/call_rpc.model'; import { ZanoLoadersService } from '@parts/services/zano-loaders.service'; @Component({ @@ -184,6 +183,7 @@ export class AppComponent implements OnInit, OnDestroy { wallet.balances = data.balances; wallet.mined_total = data.minied_total; wallet.alias_available = data.is_alias_operations_available; + wallet.has_bare_unspent_outputs = data.has_bare_unspent_outputs ?? false; }); } }); diff --git a/html_source/src/app/pages/wallet/tabs/send/modals/wallet-modals.module.ts b/html_source/src/app/pages/wallet/tabs/send/modals/wallet-modals.module.ts index 1eb6946e..0296b1ba 100644 --- a/html_source/src/app/pages/wallet/tabs/send/modals/wallet-modals.module.ts +++ b/html_source/src/app/pages/wallet/tabs/send/modals/wallet-modals.module.ts @@ -6,10 +6,11 @@ import { FlexLayoutModule } from '@angular/flex-layout'; import { TranslateModule } from '@ngx-translate/core'; import { ReactiveFormsModule } from '@angular/forms'; import { GetAssetInfoPipe } from '@parts/pipes'; +import { CopyButtonComponent } from '@parts/components/copy-button.component'; @NgModule({ declarations: [SendModalComponent, SendDetailsModalComponent], - imports: [CommonModule, TranslateModule, FlexLayoutModule, ReactiveFormsModule, GetAssetInfoPipe], + imports: [CommonModule, TranslateModule, FlexLayoutModule, ReactiveFormsModule, GetAssetInfoPipe, CopyButtonComponent], exports: [SendModalComponent, SendDetailsModalComponent], }) export class WalletModalsModule {} diff --git a/html_source/src/app/pages/wallet/wallet.module.ts b/html_source/src/app/pages/wallet/wallet.module.ts index 78217b41..8930646e 100644 --- a/html_source/src/app/pages/wallet/wallet.module.ts +++ b/html_source/src/app/pages/wallet/wallet.module.ts @@ -37,6 +37,8 @@ import { BreadcrumbsComponent } from '@parts/components/breadcrumbs/breadcrumbs. import { BackButtonComponent } from '@parts/components/back-button/back-button.component'; import { WalletModalsModule } from './tabs/send/modals/wallet-modals.module'; import { GetAssetInfoPipe } from '@parts/pipes/get-asset-info.pipe'; +import { MigrateWalletToZarcanumComponent } from './wallet/modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component'; +import { SuccessSweepBareOutsComponent } from './wallet/modals/success-sweep-bare-outs/success-sweep-bare-outs.component'; @NgModule({ declarations: [ @@ -48,6 +50,8 @@ import { GetAssetInfoPipe } from '@parts/pipes/get-asset-info.pipe'; ReceiveComponent, ExportImportComponent, SendComponent, + MigrateWalletToZarcanumComponent, + SuccessSweepBareOutsComponent, ], imports: [ CommonModule, diff --git a/html_source/src/app/pages/wallet/wallet/modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component.html b/html_source/src/app/pages/wallet/wallet/modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component.html new file mode 100644 index 00000000..0017c295 --- /dev/null +++ b/html_source/src/app/pages/wallet/wallet/modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component.html @@ -0,0 +1,25 @@ +
+
+

+ {{ 'Migrate wallet to Zarcanum' | translate }} +

+ +
+

There are {{ dialogData.total_bare_outs }} outputs with total amount of {{ + dialogData.total_amount | intToMoney }} ZANO.

+

+ + {{ 'What does it mean?' | translate }} +

+
+

They can be converted in {{ dialogData.txs_count }} transactions with total fee = {{ + dialogData.expected_total_fee | intToMoney }}.

+
+ +
+ +
+
+
diff --git a/html_source/src/app/pages/wallet/wallet/modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component.scss b/html_source/src/app/pages/wallet/wallet/modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component.scss new file mode 100644 index 00000000..a133dedc --- /dev/null +++ b/html_source/src/app/pages/wallet/wallet/modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component.scss @@ -0,0 +1,10 @@ +.details { + padding: 0 2rem; + border-radius: 0.8rem; + border: 1px solid #33426E; + + hr { + border: none; + border-bottom: 1px solid #ffffff10; + } +} diff --git a/html_source/src/app/pages/wallet/wallet/modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component.ts b/html_source/src/app/pages/wallet/wallet/modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component.ts new file mode 100644 index 00000000..f8b3b03d --- /dev/null +++ b/html_source/src/app/pages/wallet/wallet/modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component.ts @@ -0,0 +1,49 @@ +import { Component, inject } from '@angular/core'; +import { GetBareOutsStats, SweepBareOuts } from '@api/models/rpc.models'; +import { Dialog, DIALOG_DATA, DialogConfig, DialogRef } from '@angular/cdk/dialog'; +import { BackendService } from '@api/services/backend.service'; +import { VariablesService } from '@parts/services/variables.service'; +import { ParamsCallRpc } from '@api/models/call_rpc.model'; +import { ModalService } from '@parts/services/modal.service'; +import { SuccessSweepBareOutsComponent } from '../success-sweep-bare-outs/success-sweep-bare-outs.component'; +import { ScrollStrategy, ScrollStrategyOptions } from '@angular/cdk/overlay'; + +@Component({ + selector: 'app-migrate-wallet-to-zarcanum', + templateUrl: './migrate-wallet-to-zarcanum.component.html', + styleUrls: ['./migrate-wallet-to-zarcanum.component.scss'] +}) +export class MigrateWalletToZarcanumComponent { + readonly dialogData: GetBareOutsStats = inject(DIALOG_DATA); + private readonly _scrollStrategyOptions: ScrollStrategyOptions = inject(ScrollStrategyOptions); + private readonly _scrollStrategyNoop: ScrollStrategy = this._scrollStrategyOptions.noop(); + private readonly _dialog = inject(Dialog); + private readonly _dialogRef = inject(DialogRef); + private readonly _backendService = inject(BackendService); + private readonly _variableService = inject(VariablesService); + private readonly _modalService = inject(ModalService); + migrate(): void { + const { currentWallet: { wallet_id } } = this._variableService; + const params: ParamsCallRpc = { id: 0, jsonrpc: '2.0', method: 'sweep_bare_outs', params: {} }; + this._backendService.call_wallet_rpc([wallet_id, params], (status, response_data) => { + if (response_data?.result) { + const data = response_data.result; + + const dialogConfig: DialogConfig = { + maxWidth: '90vw', + width: '540px', + scrollStrategy: this._scrollStrategyNoop, + data + }; + + this._dialog.open(SuccessSweepBareOutsComponent, dialogConfig); + } else { + const message = response_data.error; + this._modalService.prepareModal('error', message); + } + + this._dialogRef.close(); + }); + } + +} diff --git a/html_source/src/app/pages/wallet/wallet/modals/success-sweep-bare-outs/success-sweep-bare-outs.component.html b/html_source/src/app/pages/wallet/wallet/modals/success-sweep-bare-outs/success-sweep-bare-outs.component.html new file mode 100644 index 00000000..eb9e4303 --- /dev/null +++ b/html_source/src/app/pages/wallet/wallet/modals/success-sweep-bare-outs/success-sweep-bare-outs.component.html @@ -0,0 +1,70 @@ + diff --git a/html_source/src/app/pages/wallet/wallet/modals/success-sweep-bare-outs/success-sweep-bare-outs.component.scss b/html_source/src/app/pages/wallet/wallet/modals/success-sweep-bare-outs/success-sweep-bare-outs.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/html_source/src/app/pages/wallet/wallet/modals/success-sweep-bare-outs/success-sweep-bare-outs.component.ts b/html_source/src/app/pages/wallet/wallet/modals/success-sweep-bare-outs/success-sweep-bare-outs.component.ts new file mode 100644 index 00000000..0900ef6a --- /dev/null +++ b/html_source/src/app/pages/wallet/wallet/modals/success-sweep-bare-outs/success-sweep-bare-outs.component.ts @@ -0,0 +1,23 @@ +import { Component, inject, OnInit } from '@angular/core'; +import { SweepBareOuts } from '@api/models/rpc.models'; +import { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog'; +import { BehaviorSubject } from 'rxjs'; + +@Component({ + selector: 'app-success-sweep-bare-outs', + templateUrl: './success-sweep-bare-outs.component.html', + styleUrls: ['./success-sweep-bare-outs.component.scss'] +}) +export class SuccessSweepBareOutsComponent { + readonly dialogData: SweepBareOuts = inject(DIALOG_DATA); + private readonly _dialogRef = inject(DialogRef); + stateDetails$ = new BehaviorSubject(false); + + toggleDetails(): void { + this.stateDetails$.next(!this.stateDetails$.value); + } + + close(): void { + this._dialogRef.close(); + } +} diff --git a/html_source/src/app/pages/wallet/wallet/wallet.component.ts b/html_source/src/app/pages/wallet/wallet/wallet.component.ts index 4f8e7ee5..89487ae2 100644 --- a/html_source/src/app/pages/wallet/wallet/wallet.component.ts +++ b/html_source/src/app/pages/wallet/wallet/wallet.component.ts @@ -21,6 +21,14 @@ import { Router, RouterEvent } from '@angular/router'; +import { ZARCANUM_MIGRATION } from '@parts/data/constants'; +import { + MigrateWalletToZarcanumComponent +} from './modals/migrate-wallet-to-zarcanum/migrate-wallet-to-zarcanum.component'; +import { ScrollStrategy, ScrollStrategyOptions } from '@angular/cdk/overlay'; +import { ParamsCallRpc } from '@api/models/call_rpc.model'; +import { ModalService } from '@parts/services/modal.service'; +import { GetBareOutsStats } from '@api/models/rpc.models'; interface Tab { id: string; @@ -99,7 +107,7 @@ const objTabs: { [key in TabNameKeys]: Tab } = { template: `
-
+

@@ -132,7 +140,7 @@ const objTabs: { [key in TabNameKeys]: Tab } = { variablesService.currentWallet.alias_available " > - @@ -178,6 +186,20 @@ const objTabs: { [key in TabNameKeys]: Tab } = {

+ +
+
+ + +
+

Your wallet contains pre-zarcanum outputs

+

+ + {{ 'More Details' | translate }} +

+
+
+