@hsuite/native-connect-angular 2.1.0 → 2.1.2
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/LICENSE +146 -0
- package/dist/fesm2022/hsuite-native-connect-angular.mjs +854 -308
- package/dist/fesm2022/hsuite-native-connect-angular.mjs.map +1 -1
- package/dist/index.d.ts +456 -30
- package/package.json +30 -13
- package/USAGE_EXAMPLES.md +0 -476
- package/assets/wallets/extension.svg +0 -7
- package/assets/wallets/hashpack.svg +0 -6
- package/assets/wallets/hsuite.svg +0 -11
- package/assets/wallets/kabila.svg +0 -11
- package/assets/wallets/walletconnect.svg +0 -13
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/coverage-summary.json +0 -50
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -476
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -476
- package/coverage/lcov-report/lib/components/account-selector/account-actions/account-actions.component.ts.html +0 -868
- package/coverage/lcov-report/lib/components/account-selector/account-actions/index.html +0 -116
- package/coverage/lcov-report/lib/components/account-selector/account-filter/account-filter.component.ts.html +0 -1288
- package/coverage/lcov-report/lib/components/account-selector/account-filter/index.html +0 -116
- package/coverage/lcov-report/lib/components/account-selector/account-formatting.service.ts.html +0 -685
- package/coverage/lcov-report/lib/components/account-selector/account-grouping.service.ts.html +0 -766
- package/coverage/lcov-report/lib/components/account-selector/account-list/account-list.component.ts.html +0 -1495
- package/coverage/lcov-report/lib/components/account-selector/account-list/index.html +0 -116
- package/coverage/lcov-report/lib/components/account-selector/account-selector.component.ts.html +0 -1495
- package/coverage/lcov-report/lib/components/account-selector/account-selector.service.ts.html +0 -1588
- package/coverage/lcov-report/lib/components/account-selector/index.html +0 -161
- package/coverage/lcov-report/lib/components/wallet-account-display/index.html +0 -116
- package/coverage/lcov-report/lib/components/wallet-account-display/wallet-account-display.component.ts.html +0 -505
- package/coverage/lcov-report/lib/components/wallet-connect-button/index.html +0 -116
- package/coverage/lcov-report/lib/components/wallet-connect-button/wallet-connect-button.component.ts.html +0 -829
- package/coverage/lcov-report/lib/components/wallet-connect-prompt/index.html +0 -116
- package/coverage/lcov-report/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts.html +0 -409
- package/coverage/lcov-report/lib/components/wallet-connected-guard/index.html +0 -116
- package/coverage/lcov-report/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts.html +0 -304
- package/coverage/lcov-report/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts.html +0 -436
- package/coverage/lcov-report/lib/components/wallet-connection-modal/connection-method-step/index.html +0 -116
- package/coverage/lcov-report/lib/components/wallet-connection-modal/index.html +0 -116
- package/coverage/lcov-report/lib/components/wallet-connection-modal/qr-pairing-step/index.html +0 -116
- package/coverage/lcov-report/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts.html +0 -2287
- package/coverage/lcov-report/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts.html +0 -2470
- package/coverage/lcov-report/lib/components/wallet-session-display/index.html +0 -116
- package/coverage/lcov-report/lib/components/wallet-session-display/wallet-session-display.component.ts.html +0 -676
- package/coverage/lcov-report/lib/components/wallet-transaction-status/index.html +0 -116
- package/coverage/lcov-report/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts.html +0 -703
- package/coverage/lcov-report/lib/directives/index.html +0 -146
- package/coverage/lcov-report/lib/directives/wallet-connected.directive.ts.html +0 -670
- package/coverage/lcov-report/lib/directives/wallet-context.directive.ts.html +0 -547
- package/coverage/lcov-report/lib/directives/wallet-events.directive.ts.html +0 -781
- package/coverage/lcov-report/lib/hsuite-wallet.module.ts.html +0 -715
- package/coverage/lcov-report/lib/index.html +0 -116
- package/coverage/lcov-report/lib/models/connection-config.model.ts.html +0 -280
- package/coverage/lcov-report/lib/models/index.html +0 -131
- package/coverage/lcov-report/lib/models/provider-types.ts.html +0 -577
- package/coverage/lcov-report/lib/providers/base-wallet-provider.ts.html +0 -1138
- package/coverage/lcov-report/lib/providers/hsuite-native/channel-client.service.ts.html +0 -2671
- package/coverage/lcov-report/lib/providers/hsuite-native/index.html +0 -116
- package/coverage/lcov-report/lib/providers/hsuite-native-provider.ts.html +0 -2347
- package/coverage/lcov-report/lib/providers/index.html +0 -146
- package/coverage/lcov-report/lib/providers/p2p-native/index.html +0 -131
- package/coverage/lcov-report/lib/providers/p2p-native/p2p-native.provider.ts.html +0 -2254
- package/coverage/lcov-report/lib/providers/p2p-native/p2p-session-manager.ts.html +0 -2170
- package/coverage/lcov-report/lib/providers/wallet-error-handler.ts.html +0 -1132
- package/coverage/lcov-report/lib/providers/walletconnect/core/index.html +0 -176
- package/coverage/lcov-report/lib/providers/walletconnect/core/session-health.ts.html +0 -673
- package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-client-manager.ts.html +0 -1177
- package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-provider.ts.html +0 -2563
- package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-session-store.ts.html +0 -904
- package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts.html +0 -982
- package/coverage/lcov-report/lib/providers/walletconnect/signers/hedera-signer.ts.html +0 -1915
- package/coverage/lcov-report/lib/providers/walletconnect/signers/index.html +0 -146
- package/coverage/lcov-report/lib/providers/walletconnect/signers/signer-factory.ts.html +0 -445
- package/coverage/lcov-report/lib/providers/walletconnect/signers/xrpl-signer.ts.html +0 -1519
- package/coverage/lcov-report/lib/services/index.html +0 -191
- package/coverage/lcov-report/lib/services/logger.service.ts.html +0 -463
- package/coverage/lcov-report/lib/services/transaction-builders/base-transaction-builder.service.ts.html +0 -1840
- package/coverage/lcov-report/lib/services/transaction-builders/hedera-amount-utils.ts.html +0 -337
- package/coverage/lcov-report/lib/services/transaction-builders/hedera-transaction-builder.service.ts.html +0 -3940
- package/coverage/lcov-report/lib/services/transaction-builders/index.html +0 -161
- package/coverage/lcov-report/lib/services/transaction-builders/xrpl-transaction-builder.service.ts.html +0 -2581
- package/coverage/lcov-report/lib/services/transaction.service.ts.html +0 -1120
- package/coverage/lcov-report/lib/services/unified-wallet.service.ts.html +0 -2638
- package/coverage/lcov-report/lib/services/wallet-context.service.ts.html +0 -637
- package/coverage/lcov-report/lib/services/wallet-event-bus.service.ts.html +0 -643
- package/coverage/lcov-report/lib/services/wallet-providers.service.ts.html +0 -493
- package/coverage/lcov-report/lib/transports/chrome-extension-transport.ts.html +0 -823
- package/coverage/lcov-report/lib/transports/index.html +0 -116
- package/coverage/lcov-report/lib/utils/index.html +0 -116
- package/coverage/lcov-report/lib/utils/ledger-icons.util.ts.html +0 -319
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov.info +0 -18695
- package/coverage/lib/components/account-selector/account-actions/account-actions.component.ts.html +0 -868
- package/coverage/lib/components/account-selector/account-actions/index.html +0 -116
- package/coverage/lib/components/account-selector/account-filter/account-filter.component.ts.html +0 -1288
- package/coverage/lib/components/account-selector/account-filter/index.html +0 -116
- package/coverage/lib/components/account-selector/account-formatting.service.ts.html +0 -685
- package/coverage/lib/components/account-selector/account-grouping.service.ts.html +0 -766
- package/coverage/lib/components/account-selector/account-list/account-list.component.ts.html +0 -1495
- package/coverage/lib/components/account-selector/account-list/index.html +0 -116
- package/coverage/lib/components/account-selector/account-selector.component.ts.html +0 -1495
- package/coverage/lib/components/account-selector/account-selector.service.ts.html +0 -1588
- package/coverage/lib/components/account-selector/index.html +0 -161
- package/coverage/lib/components/wallet-account-display/index.html +0 -116
- package/coverage/lib/components/wallet-account-display/wallet-account-display.component.ts.html +0 -505
- package/coverage/lib/components/wallet-connect-button/index.html +0 -116
- package/coverage/lib/components/wallet-connect-button/wallet-connect-button.component.ts.html +0 -829
- package/coverage/lib/components/wallet-connect-prompt/index.html +0 -116
- package/coverage/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts.html +0 -409
- package/coverage/lib/components/wallet-connected-guard/index.html +0 -116
- package/coverage/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts.html +0 -304
- package/coverage/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts.html +0 -436
- package/coverage/lib/components/wallet-connection-modal/connection-method-step/index.html +0 -116
- package/coverage/lib/components/wallet-connection-modal/index.html +0 -116
- package/coverage/lib/components/wallet-connection-modal/qr-pairing-step/index.html +0 -116
- package/coverage/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts.html +0 -2287
- package/coverage/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts.html +0 -2470
- package/coverage/lib/components/wallet-session-display/index.html +0 -116
- package/coverage/lib/components/wallet-session-display/wallet-session-display.component.ts.html +0 -676
- package/coverage/lib/components/wallet-transaction-status/index.html +0 -116
- package/coverage/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts.html +0 -703
- package/coverage/lib/directives/index.html +0 -146
- package/coverage/lib/directives/wallet-connected.directive.ts.html +0 -670
- package/coverage/lib/directives/wallet-context.directive.ts.html +0 -547
- package/coverage/lib/directives/wallet-events.directive.ts.html +0 -781
- package/coverage/lib/hsuite-wallet.module.ts.html +0 -715
- package/coverage/lib/index.html +0 -116
- package/coverage/lib/models/connection-config.model.ts.html +0 -280
- package/coverage/lib/models/index.html +0 -131
- package/coverage/lib/models/provider-types.ts.html +0 -577
- package/coverage/lib/providers/base-wallet-provider.ts.html +0 -1138
- package/coverage/lib/providers/hsuite-native/channel-client.service.ts.html +0 -2671
- package/coverage/lib/providers/hsuite-native/index.html +0 -116
- package/coverage/lib/providers/hsuite-native-provider.ts.html +0 -2347
- package/coverage/lib/providers/index.html +0 -146
- package/coverage/lib/providers/p2p-native/index.html +0 -131
- package/coverage/lib/providers/p2p-native/p2p-native.provider.ts.html +0 -2254
- package/coverage/lib/providers/p2p-native/p2p-session-manager.ts.html +0 -2170
- package/coverage/lib/providers/wallet-error-handler.ts.html +0 -1132
- package/coverage/lib/providers/walletconnect/core/index.html +0 -176
- package/coverage/lib/providers/walletconnect/core/session-health.ts.html +0 -673
- package/coverage/lib/providers/walletconnect/core/walletconnect-client-manager.ts.html +0 -1177
- package/coverage/lib/providers/walletconnect/core/walletconnect-provider.ts.html +0 -2563
- package/coverage/lib/providers/walletconnect/core/walletconnect-session-store.ts.html +0 -904
- package/coverage/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts.html +0 -982
- package/coverage/lib/providers/walletconnect/signers/hedera-signer.ts.html +0 -1915
- package/coverage/lib/providers/walletconnect/signers/index.html +0 -146
- package/coverage/lib/providers/walletconnect/signers/signer-factory.ts.html +0 -445
- package/coverage/lib/providers/walletconnect/signers/xrpl-signer.ts.html +0 -1519
- package/coverage/lib/services/index.html +0 -191
- package/coverage/lib/services/logger.service.ts.html +0 -463
- package/coverage/lib/services/transaction-builders/base-transaction-builder.service.ts.html +0 -1840
- package/coverage/lib/services/transaction-builders/hedera-amount-utils.ts.html +0 -337
- package/coverage/lib/services/transaction-builders/hedera-transaction-builder.service.ts.html +0 -3940
- package/coverage/lib/services/transaction-builders/index.html +0 -161
- package/coverage/lib/services/transaction-builders/xrpl-transaction-builder.service.ts.html +0 -2581
- package/coverage/lib/services/transaction.service.ts.html +0 -1120
- package/coverage/lib/services/unified-wallet.service.ts.html +0 -2638
- package/coverage/lib/services/wallet-context.service.ts.html +0 -637
- package/coverage/lib/services/wallet-event-bus.service.ts.html +0 -643
- package/coverage/lib/services/wallet-providers.service.ts.html +0 -493
- package/coverage/lib/transports/chrome-extension-transport.ts.html +0 -823
- package/coverage/lib/transports/index.html +0 -116
- package/coverage/lib/utils/index.html +0 -116
- package/coverage/lib/utils/ledger-icons.util.ts.html +0 -319
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -210
- package/examples/minimal-connect.ts +0 -178
- package/examples/multi-protocol.ts +0 -495
- package/examples/transaction-signing.ts +0 -361
- package/jest.config.json +0 -45
- package/karma.conf.js +0 -42
- package/ng-package.json +0 -20
- package/src/index.ts +0 -203
- package/src/lib/components/account-selector/account-actions/account-actions.component.ts +0 -261
- package/src/lib/components/account-selector/account-filter/account-filter.component.ts +0 -401
- package/src/lib/components/account-selector/account-formatting.service.ts +0 -200
- package/src/lib/components/account-selector/account-grouping.service.ts +0 -227
- package/src/lib/components/account-selector/account-list/account-list.component.ts +0 -470
- package/src/lib/components/account-selector/account-selector.component.html +0 -135
- package/src/lib/components/account-selector/account-selector.component.scss +0 -2039
- package/src/lib/components/account-selector/account-selector.component.ts +0 -470
- package/src/lib/components/account-selector/account-selector.service.ts +0 -501
- package/src/lib/components/wallet-account-display/wallet-account-display.component.html +0 -34
- package/src/lib/components/wallet-account-display/wallet-account-display.component.scss +0 -99
- package/src/lib/components/wallet-account-display/wallet-account-display.component.ts +0 -140
- package/src/lib/components/wallet-connect-button/wallet-connect-button.component.html +0 -14
- package/src/lib/components/wallet-connect-button/wallet-connect-button.component.scss +0 -272
- package/src/lib/components/wallet-connect-button/wallet-connect-button.component.spec.ts +0 -89
- package/src/lib/components/wallet-connect-button/wallet-connect-button.component.ts +0 -248
- package/src/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.html +0 -24
- package/src/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.scss +0 -50
- package/src/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts +0 -108
- package/src/lib/components/wallet-connected-guard/wallet-connected-guard.component.html +0 -24
- package/src/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts +0 -73
- package/src/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.html +0 -56
- package/src/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.scss +0 -218
- package/src/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts +0 -117
- package/src/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.html +0 -94
- package/src/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.scss +0 -272
- package/src/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts +0 -734
- package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.html +0 -192
- package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.scss +0 -678
- package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.spec.ts +0 -173
- package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts +0 -795
- package/src/lib/components/wallet-session-display/wallet-session-display.component.html +0 -110
- package/src/lib/components/wallet-session-display/wallet-session-display.component.scss +0 -179
- package/src/lib/components/wallet-session-display/wallet-session-display.component.ts +0 -197
- package/src/lib/components/wallet-transaction-status/wallet-transaction-status.component.html +0 -65
- package/src/lib/components/wallet-transaction-status/wallet-transaction-status.component.scss +0 -254
- package/src/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts +0 -206
- package/src/lib/directives/wallet-connected.directive.ts +0 -195
- package/src/lib/directives/wallet-context.directive.ts +0 -154
- package/src/lib/directives/wallet-events.directive.ts +0 -232
- package/src/lib/hsuite-wallet.module.ts +0 -210
- package/src/lib/models/connection-config.model.ts +0 -65
- package/src/lib/models/provider-types.ts +0 -164
- package/src/lib/models/unified-account.model.ts +0 -76
- package/src/lib/models/wallet-context.model.ts +0 -121
- package/src/lib/models/wallet-events.model.ts +0 -158
- package/src/lib/providers/base-wallet-provider.ts +0 -351
- package/src/lib/providers/hsuite-native/channel-client.service.spec.ts +0 -73
- package/src/lib/providers/hsuite-native/channel-client.service.ts +0 -862
- package/src/lib/providers/hsuite-native/index.ts +0 -8
- package/src/lib/providers/hsuite-native-provider.ts +0 -754
- package/src/lib/providers/mobile-native/mobile-native.provider.spec.ts +0 -19
- package/src/lib/providers/p2p-native/index.ts +0 -30
- package/src/lib/providers/p2p-native/p2p-native.provider.spec.ts +0 -523
- package/src/lib/providers/p2p-native/p2p-native.provider.ts +0 -723
- package/src/lib/providers/p2p-native/p2p-session-manager.ts +0 -695
- package/src/lib/providers/wallet-error-handler.ts +0 -349
- package/src/lib/providers/walletconnect/core/base-signer.interface.ts +0 -122
- package/src/lib/providers/walletconnect/core/session-health.ts +0 -196
- package/src/lib/providers/walletconnect/core/walletconnect-client-manager.ts +0 -364
- package/src/lib/providers/walletconnect/core/walletconnect-provider.integration.spec.ts +0 -348
- package/src/lib/providers/walletconnect/core/walletconnect-provider.ts +0 -826
- package/src/lib/providers/walletconnect/core/walletconnect-session-store.ts +0 -273
- package/src/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts +0 -299
- package/src/lib/providers/walletconnect/core/walletconnect-types.ts +0 -48
- package/src/lib/providers/walletconnect/index.ts +0 -33
- package/src/lib/providers/walletconnect/signers/hedera-signer.spec.ts +0 -367
- package/src/lib/providers/walletconnect/signers/hedera-signer.ts +0 -610
- package/src/lib/providers/walletconnect/signers/signer-factory.spec.ts +0 -62
- package/src/lib/providers/walletconnect/signers/signer-factory.ts +0 -120
- package/src/lib/providers/walletconnect/signers/xrpl-signer.spec.ts +0 -296
- package/src/lib/providers/walletconnect/signers/xrpl-signer.ts +0 -478
- package/src/lib/services/logger.service.ts +0 -126
- package/src/lib/services/transaction-builders/base-transaction-builder.service.ts +0 -585
- package/src/lib/services/transaction-builders/hedera-amount-utils.ts +0 -84
- package/src/lib/services/transaction-builders/hedera-transaction-builder.service.spec.ts +0 -741
- package/src/lib/services/transaction-builders/hedera-transaction-builder.service.ts +0 -1285
- package/src/lib/services/transaction-builders/index.ts +0 -54
- package/src/lib/services/transaction-builders/xrpl-transaction-builder.service.spec.ts +0 -937
- package/src/lib/services/transaction-builders/xrpl-transaction-builder.service.ts +0 -832
- package/src/lib/services/transaction.service.ts +0 -345
- package/src/lib/services/unified-wallet.service.spec.ts +0 -1382
- package/src/lib/services/unified-wallet.service.ts +0 -851
- package/src/lib/services/wallet-context.service.ts +0 -184
- package/src/lib/services/wallet-event-bus.service.ts +0 -186
- package/src/lib/services/wallet-providers.service.ts +0 -136
- package/src/lib/transports/chrome-extension-transport.ts +0 -246
- package/src/lib/utils/index.ts +0 -14
- package/src/lib/utils/ledger-icons.util.ts +0 -78
- package/test/test-setup.ts +0 -21
- package/test-setup.ts +0 -63
- package/tsconfig.build.json +0 -11
- package/tsconfig.json +0 -29
- package/tsconfig.spec.json +0 -15
- package/vitest.config.ts +0 -48
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HSuite Native Connect
|
|
3
|
-
* Copyright 2024-2025 HSuite (https://hsuite.finance)
|
|
4
|
-
*
|
|
5
|
-
* SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
|
|
6
|
-
*
|
|
7
|
-
* This file is part of HSuite Native Connect. For commercial licensing,
|
|
8
|
-
* visit https://hsuite.finance/licensing
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @file account-actions.component.ts
|
|
13
|
-
* @description Action buttons component for account selector
|
|
14
|
-
*
|
|
15
|
-
* Provides action buttons for account management including disconnect all,
|
|
16
|
-
* add account, and connect wallet actions.
|
|
17
|
-
* Extracted from AccountSelectorComponent for better maintainability.
|
|
18
|
-
*
|
|
19
|
-
* **Features:**
|
|
20
|
-
* - Disconnect all wallets button
|
|
21
|
-
* - Add account button
|
|
22
|
-
* - Connect wallet button (inline mode)
|
|
23
|
-
* - Loading state support
|
|
24
|
-
* - Confirmation dialogs integration
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
import {
|
|
28
|
-
Component,
|
|
29
|
-
EventEmitter,
|
|
30
|
-
Input,
|
|
31
|
-
Output,
|
|
32
|
-
ChangeDetectionStrategy,
|
|
33
|
-
ViewEncapsulation,
|
|
34
|
-
} from '@angular/core';
|
|
35
|
-
import { CommonModule } from '@angular/common';
|
|
36
|
-
import { IonButton, IonIcon } from '@ionic/angular/standalone';
|
|
37
|
-
import { addIcons } from 'ionicons';
|
|
38
|
-
import { linkOutline, addCircleOutline, addOutline } from 'ionicons/icons';
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @component AccountActionsComponent
|
|
42
|
-
* Action buttons for account management.
|
|
43
|
-
*/
|
|
44
|
-
@Component({
|
|
45
|
-
selector: 'wallet-account-actions',
|
|
46
|
-
standalone: true,
|
|
47
|
-
imports: [CommonModule, IonButton, IonIcon],
|
|
48
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
49
|
-
encapsulation: ViewEncapsulation.None,
|
|
50
|
-
template: `
|
|
51
|
-
<!-- Modal Footer Actions -->
|
|
52
|
-
<ng-container *ngIf="mode === 'modal'">
|
|
53
|
-
<div class="modal-footer">
|
|
54
|
-
<ion-button
|
|
55
|
-
class="footer-btn"
|
|
56
|
-
fill="outline"
|
|
57
|
-
color="danger"
|
|
58
|
-
size="small"
|
|
59
|
-
(click)="onDisconnectAll()"
|
|
60
|
-
[disabled]="isLoading || !hasAccounts"
|
|
61
|
-
>
|
|
62
|
-
<ion-icon slot="start" name="link-outline" style="transform: rotate(45deg);"></ion-icon>
|
|
63
|
-
Disconnect All
|
|
64
|
-
</ion-button>
|
|
65
|
-
<ion-button
|
|
66
|
-
class="footer-btn"
|
|
67
|
-
color="primary"
|
|
68
|
-
size="small"
|
|
69
|
-
(click)="onAddAccount()"
|
|
70
|
-
[disabled]="isLoading"
|
|
71
|
-
>
|
|
72
|
-
<ion-icon slot="start" name="add-circle-outline"></ion-icon>
|
|
73
|
-
Add Account
|
|
74
|
-
</ion-button>
|
|
75
|
-
</div>
|
|
76
|
-
</ng-container>
|
|
77
|
-
|
|
78
|
-
<!-- Inline Connect Button -->
|
|
79
|
-
<ng-container *ngIf="mode === 'inline'">
|
|
80
|
-
<ion-button
|
|
81
|
-
class="connect-wallet-btn"
|
|
82
|
-
expand="block"
|
|
83
|
-
fill="outline"
|
|
84
|
-
color="primary"
|
|
85
|
-
(click)="onConnectWallet()"
|
|
86
|
-
>
|
|
87
|
-
<ion-icon slot="start" name="add-outline"></ion-icon>
|
|
88
|
-
Connect wallet
|
|
89
|
-
</ion-button>
|
|
90
|
-
</ng-container>
|
|
91
|
-
`,
|
|
92
|
-
styles: [
|
|
93
|
-
`
|
|
94
|
-
:host {
|
|
95
|
-
display: block;
|
|
96
|
-
width: 100%;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/* Modal Footer */
|
|
100
|
-
.modal-footer {
|
|
101
|
-
display: flex;
|
|
102
|
-
gap: var(--account-selector-spacing-sm, 8px);
|
|
103
|
-
padding: var(--account-selector-spacing-md, 12px) var(--account-selector-spacing-lg, 16px);
|
|
104
|
-
background: var(--account-selector-footer-bg, rgba(var(--ion-color-light-rgb), 0.05));
|
|
105
|
-
border-top: 1px solid
|
|
106
|
-
var(--account-selector-border-color, rgba(var(--ion-color-light-rgb), 0.1));
|
|
107
|
-
flex-shrink: 0;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.footer-btn {
|
|
111
|
-
margin: 0;
|
|
112
|
-
flex: 1;
|
|
113
|
-
--border-radius: var(--account-selector-item-border-radius, 10px);
|
|
114
|
-
font-weight: var(--account-selector-font-weight-semibold, 600);
|
|
115
|
-
font-size: var(--account-selector-font-size-sm, 12px);
|
|
116
|
-
height: var(--account-selector-button-height, 36px);
|
|
117
|
-
cursor: pointer;
|
|
118
|
-
pointer-events: auto;
|
|
119
|
-
transition: all var(--account-selector-transition-fast, 0.15s) ease;
|
|
120
|
-
|
|
121
|
-
ion-icon {
|
|
122
|
-
font-size: var(--account-selector-spacing-lg, 16px);
|
|
123
|
-
color: inherit;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
&:hover:not(:disabled) {
|
|
127
|
-
transform: translateY(-1px);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
&:active:not(:disabled) {
|
|
131
|
-
transform: translateY(0);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
&[color='danger'] {
|
|
135
|
-
--background: rgba(var(--ion-color-danger-rgb), 0.1);
|
|
136
|
-
--border-color: rgba(var(--ion-color-danger-rgb), 0.3);
|
|
137
|
-
--color: var(--ion-color-danger);
|
|
138
|
-
|
|
139
|
-
&:hover:not(:disabled) {
|
|
140
|
-
--background: rgba(var(--ion-color-danger-rgb), 0.15);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/* Connect Wallet Button (Inline) */
|
|
146
|
-
.connect-wallet-btn {
|
|
147
|
-
margin-top: var(--account-selector-spacing-lg, 16px);
|
|
148
|
-
--border-radius: var(--account-selector-content-border-radius, 12px);
|
|
149
|
-
font-weight: var(--account-selector-font-weight-semibold, 600);
|
|
150
|
-
--border-width: 1px;
|
|
151
|
-
--border-style: solid;
|
|
152
|
-
--border-color: var(
|
|
153
|
-
--account-selector-add-account-border,
|
|
154
|
-
rgba(var(--ion-color-primary-rgb), 0.3)
|
|
155
|
-
);
|
|
156
|
-
min-height: var(--account-selector-button-height-lg, 44px);
|
|
157
|
-
transition: all var(--account-selector-transition-normal, 0.2s) ease;
|
|
158
|
-
|
|
159
|
-
&:hover:not(:disabled) {
|
|
160
|
-
--background: var(
|
|
161
|
-
--account-selector-add-account-bg-hover,
|
|
162
|
-
rgba(var(--ion-color-primary-rgb), 0.1)
|
|
163
|
-
);
|
|
164
|
-
--border-color: rgba(var(--ion-color-primary-rgb), 0.4);
|
|
165
|
-
transform: translateY(-1px);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
&:active:not(:disabled) {
|
|
169
|
-
transform: scale(0.98);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
ion-icon {
|
|
173
|
-
font-size: var(--account-selector-icon-size, 18px);
|
|
174
|
-
color: inherit;
|
|
175
|
-
transition: transform var(--account-selector-transition-fast, 0.15s) ease;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
&:hover:not(:disabled) ion-icon {
|
|
179
|
-
transform: scale(1.1);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/* Responsive styles */
|
|
184
|
-
@media (max-width: 480px) {
|
|
185
|
-
.modal-footer {
|
|
186
|
-
padding: 10px 12px;
|
|
187
|
-
gap: 6px;
|
|
188
|
-
|
|
189
|
-
.footer-btn {
|
|
190
|
-
font-size: 11px;
|
|
191
|
-
height: 32px;
|
|
192
|
-
|
|
193
|
-
ion-icon {
|
|
194
|
-
font-size: 14px;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
`,
|
|
200
|
-
],
|
|
201
|
-
})
|
|
202
|
-
export class AccountActionsComponent {
|
|
203
|
-
/**
|
|
204
|
-
* Action mode: 'modal' for modal footer, 'inline' for connect button
|
|
205
|
-
*/
|
|
206
|
-
@Input() mode: 'modal' | 'inline' = 'modal';
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Loading state
|
|
210
|
-
*/
|
|
211
|
-
@Input() isLoading = false;
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Whether there are connected accounts
|
|
215
|
-
*/
|
|
216
|
-
@Input() hasAccounts = false;
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Emitted when "Disconnect All" is clicked
|
|
220
|
-
*/
|
|
221
|
-
@Output() disconnectAllRequested = new EventEmitter<void>();
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Emitted when "Add Account" is clicked
|
|
225
|
-
*/
|
|
226
|
-
@Output() addAccountRequested = new EventEmitter<void>();
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Emitted when "Connect Wallet" is clicked (inline mode)
|
|
230
|
-
*/
|
|
231
|
-
@Output() connectWalletRequested = new EventEmitter<void>();
|
|
232
|
-
|
|
233
|
-
constructor() {
|
|
234
|
-
addIcons({
|
|
235
|
-
linkOutline,
|
|
236
|
-
addCircleOutline,
|
|
237
|
-
addOutline,
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Handle disconnect all button click
|
|
243
|
-
*/
|
|
244
|
-
protected onDisconnectAll(): void {
|
|
245
|
-
this.disconnectAllRequested.emit();
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Handle add account button click
|
|
250
|
-
*/
|
|
251
|
-
protected onAddAccount(): void {
|
|
252
|
-
this.addAccountRequested.emit();
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Handle connect wallet button click
|
|
257
|
-
*/
|
|
258
|
-
protected onConnectWallet(): void {
|
|
259
|
-
this.connectWalletRequested.emit();
|
|
260
|
-
}
|
|
261
|
-
}
|
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HSuite Native Connect
|
|
3
|
-
* Copyright 2024-2025 HSuite (https://hsuite.finance)
|
|
4
|
-
*
|
|
5
|
-
* SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
|
|
6
|
-
*
|
|
7
|
-
* This file is part of HSuite Native Connect. For commercial licensing,
|
|
8
|
-
* visit https://hsuite.finance/licensing
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @file account-filter.component.ts
|
|
13
|
-
* @description Compact header and filtering component for account selector
|
|
14
|
-
*
|
|
15
|
-
* Provides compact header display with account preview and collapse/expand
|
|
16
|
-
* functionality. Extracted from AccountSelectorComponent for better maintainability.
|
|
17
|
-
*
|
|
18
|
-
* **Features:**
|
|
19
|
-
* - Compact header with active account preview
|
|
20
|
-
* - Collapsible account list toggle
|
|
21
|
-
* - Network and wallet badges
|
|
22
|
-
* - Multiple size variants (default, navbar, small)
|
|
23
|
-
* - Multiple format options (label-count, address-count, etc.)
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
import {
|
|
27
|
-
Component,
|
|
28
|
-
EventEmitter,
|
|
29
|
-
Input,
|
|
30
|
-
Output,
|
|
31
|
-
inject,
|
|
32
|
-
ChangeDetectionStrategy,
|
|
33
|
-
ViewEncapsulation,
|
|
34
|
-
} from '@angular/core';
|
|
35
|
-
import { CommonModule } from '@angular/common';
|
|
36
|
-
import { IonBadge, IonIcon } from '@ionic/angular/standalone';
|
|
37
|
-
import { addIcons } from 'ionicons';
|
|
38
|
-
import { chevronDownOutline } from 'ionicons/icons';
|
|
39
|
-
import { AccountFormattingService } from '../account-formatting.service';
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Format options for compact header display
|
|
43
|
-
*/
|
|
44
|
-
export type CompactHeaderFormat =
|
|
45
|
-
| 'label-count'
|
|
46
|
-
| 'address-count'
|
|
47
|
-
| 'count-only'
|
|
48
|
-
| 'label-only'
|
|
49
|
-
| 'address-only';
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Size variants for compact header
|
|
53
|
-
*/
|
|
54
|
-
export type CompactHeaderSize = 'default' | 'navbar' | 'small';
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Active account data for display
|
|
58
|
-
*/
|
|
59
|
-
export interface ActiveAccountData {
|
|
60
|
-
address: string;
|
|
61
|
-
networkId: string;
|
|
62
|
-
label?: string;
|
|
63
|
-
providerType?: string;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @component AccountFilterComponent
|
|
68
|
-
* Compact header with active account preview and collapse toggle.
|
|
69
|
-
*/
|
|
70
|
-
@Component({
|
|
71
|
-
selector: 'wallet-account-filter',
|
|
72
|
-
standalone: true,
|
|
73
|
-
imports: [CommonModule, IonBadge, IonIcon],
|
|
74
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
75
|
-
encapsulation: ViewEncapsulation.None,
|
|
76
|
-
template: `
|
|
77
|
-
<!-- Custom Header Text (optional) -->
|
|
78
|
-
<div *ngIf="customHeaderText" class="custom-header-text">
|
|
79
|
-
{{ customHeaderText }}
|
|
80
|
-
</div>
|
|
81
|
-
|
|
82
|
-
<!-- Compact Header -->
|
|
83
|
-
<div
|
|
84
|
-
class="compact-header"
|
|
85
|
-
[class.navbar-size]="headerSize === 'navbar'"
|
|
86
|
-
[class.small-size]="headerSize === 'small'"
|
|
87
|
-
role="button"
|
|
88
|
-
tabindex="0"
|
|
89
|
-
[attr.aria-expanded]="!isCollapsed"
|
|
90
|
-
[attr.aria-label]="getAriaLabel()"
|
|
91
|
-
(click)="onToggle()"
|
|
92
|
-
(keydown.enter)="onToggle()"
|
|
93
|
-
(keydown.space)="$event.preventDefault(); onToggle()"
|
|
94
|
-
>
|
|
95
|
-
<!-- Account Preview -->
|
|
96
|
-
<div class="account-preview">
|
|
97
|
-
<span class="account-address-compact">{{ getActiveAddress() }}</span>
|
|
98
|
-
<ion-badge [color]="getActiveNetworkColor()" size="small" class="network-badge-compact">
|
|
99
|
-
{{ getActiveNetworkType() }}
|
|
100
|
-
</ion-badge>
|
|
101
|
-
<img [src]="walletLogoSrc" [alt]="'Wallet logo'" class="wallet-logo-compact" />
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
<!-- Account Count Badge -->
|
|
105
|
-
<ion-badge color="primary" class="account-count-badge">
|
|
106
|
-
{{ totalAccountCount }}
|
|
107
|
-
</ion-badge>
|
|
108
|
-
|
|
109
|
-
<!-- Expand/Collapse Icon -->
|
|
110
|
-
<ion-icon
|
|
111
|
-
*ngIf="collapsible"
|
|
112
|
-
name="chevron-down-outline"
|
|
113
|
-
class="toggle-icon"
|
|
114
|
-
[class.expanded]="!isCollapsed"
|
|
115
|
-
>
|
|
116
|
-
</ion-icon>
|
|
117
|
-
</div>
|
|
118
|
-
`,
|
|
119
|
-
styles: [
|
|
120
|
-
`
|
|
121
|
-
:host {
|
|
122
|
-
display: block;
|
|
123
|
-
width: 100%;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/* Custom Header Text */
|
|
127
|
-
.custom-header-text {
|
|
128
|
-
font-size: var(--account-selector-font-size-sm, 12px);
|
|
129
|
-
font-weight: var(--account-selector-font-weight-medium, 500);
|
|
130
|
-
color: var(--account-selector-text-secondary, var(--ion-color-medium));
|
|
131
|
-
margin-bottom: var(--account-selector-spacing-sm, 8px);
|
|
132
|
-
padding: 0 var(--account-selector-spacing-xs, 4px);
|
|
133
|
-
text-transform: uppercase;
|
|
134
|
-
letter-spacing: 0.5px;
|
|
135
|
-
line-height: var(--account-selector-line-height-normal, 1.5);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/* Compact Header */
|
|
139
|
-
.compact-header {
|
|
140
|
-
display: flex;
|
|
141
|
-
align-items: center;
|
|
142
|
-
gap: var(--account-selector-spacing-md, 12px);
|
|
143
|
-
padding: var(--account-selector-spacing-md, 12px) var(--account-selector-spacing-lg, 16px);
|
|
144
|
-
background: var(--account-selector-item-bg, rgba(var(--ion-color-light-rgb), 0.05));
|
|
145
|
-
border: 1px solid
|
|
146
|
-
var(--account-selector-border-color, rgba(var(--ion-color-light-rgb), 0.1));
|
|
147
|
-
border-radius: var(--account-selector-content-border-radius, 12px);
|
|
148
|
-
cursor: pointer;
|
|
149
|
-
transition: all var(--account-selector-transition-normal, 0.2s) ease;
|
|
150
|
-
user-select: none;
|
|
151
|
-
min-height: var(--account-selector-touch-target-min, 44px);
|
|
152
|
-
margin-bottom: var(--account-selector-spacing-md, 12px);
|
|
153
|
-
box-shadow:
|
|
154
|
-
var(--account-selector-shadow-inset, var(--shadow-inset)),
|
|
155
|
-
var(--account-selector-shadow-sm, var(--shadow-sm));
|
|
156
|
-
|
|
157
|
-
&:hover {
|
|
158
|
-
background: var(--account-selector-item-bg-hover, rgba(var(--ion-color-light-rgb), 0.08));
|
|
159
|
-
border-color: var(
|
|
160
|
-
--account-selector-border-color-hover,
|
|
161
|
-
rgba(var(--ion-color-light-rgb), 0.2)
|
|
162
|
-
);
|
|
163
|
-
transform: translateY(-1px);
|
|
164
|
-
box-shadow:
|
|
165
|
-
var(--account-selector-shadow-inset, var(--shadow-inset)),
|
|
166
|
-
var(--account-selector-shadow-md, var(--shadow-md));
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
&:active {
|
|
170
|
-
transform: scale(0.98);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
&:focus {
|
|
174
|
-
outline: 2px solid var(--account-selector-border-color-focus, var(--ion-color-primary));
|
|
175
|
-
outline-offset: 2px;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/* Navbar size variant */
|
|
179
|
-
&.navbar-size {
|
|
180
|
-
padding: 8px 12px;
|
|
181
|
-
min-height: 40px;
|
|
182
|
-
border-radius: 10px;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/* Small size variant */
|
|
186
|
-
&.small-size {
|
|
187
|
-
padding: 6px 10px;
|
|
188
|
-
min-height: 36px;
|
|
189
|
-
border-radius: 8px;
|
|
190
|
-
gap: 10px;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/* Account Preview Section */
|
|
195
|
-
.account-preview {
|
|
196
|
-
display: flex;
|
|
197
|
-
align-items: center;
|
|
198
|
-
gap: var(--account-selector-spacing-sm, 8px);
|
|
199
|
-
flex: 1;
|
|
200
|
-
min-width: 0;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.account-address-compact {
|
|
204
|
-
font-size: var(--account-selector-font-size-sm, 13px);
|
|
205
|
-
font-weight: var(--account-selector-font-weight-semibold, 600);
|
|
206
|
-
color: var(--account-selector-text-primary, var(--ion-text-color));
|
|
207
|
-
font-family: var(--ion-font-family-monospace, 'Courier New', monospace);
|
|
208
|
-
line-height: var(--account-selector-line-height-normal, 1.5);
|
|
209
|
-
overflow: hidden;
|
|
210
|
-
text-overflow: ellipsis;
|
|
211
|
-
white-space: nowrap;
|
|
212
|
-
flex-shrink: 1;
|
|
213
|
-
transition: color var(--account-selector-transition-fast, 0.15s) ease;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.network-badge-compact {
|
|
217
|
-
font-size: var(--account-selector-badge-font-size, 10px);
|
|
218
|
-
font-weight: var(--account-selector-font-weight-semibold, 600);
|
|
219
|
-
padding: var(--account-selector-badge-padding, 3px 7px);
|
|
220
|
-
border-radius: var(--account-selector-badge-border-radius, 6px);
|
|
221
|
-
flex-shrink: 0;
|
|
222
|
-
line-height: var(--account-selector-line-height-tight, 1.2);
|
|
223
|
-
transition: transform var(--account-selector-transition-fast, 0.15s) ease;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.wallet-logo-compact {
|
|
227
|
-
width: var(--account-selector-logo-size-sm, 20px);
|
|
228
|
-
height: var(--account-selector-logo-size-sm, 20px);
|
|
229
|
-
border-radius: var(--account-selector-logo-border-radius, 4px);
|
|
230
|
-
flex-shrink: 0;
|
|
231
|
-
box-shadow: var(--account-selector-logo-shadow, var(--shadow-sm));
|
|
232
|
-
transition: transform var(--account-selector-transition-fast, 0.15s) ease;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.account-count-badge {
|
|
236
|
-
font-size: var(--account-selector-font-size-xs, 11px);
|
|
237
|
-
font-weight: var(--account-selector-font-weight-semibold, 600);
|
|
238
|
-
padding: var(--account-selector-badge-padding, 3px 8px);
|
|
239
|
-
border-radius: var(--account-selector-badge-border-radius, 6px);
|
|
240
|
-
flex-shrink: 0;
|
|
241
|
-
line-height: var(--account-selector-line-height-tight, 1.2);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.toggle-icon {
|
|
245
|
-
font-size: var(--account-selector-icon-size, 20px);
|
|
246
|
-
color: var(--account-selector-text-secondary, var(--ion-color-medium));
|
|
247
|
-
transition: transform var(--account-selector-transition-slow, 0.3s)
|
|
248
|
-
cubic-bezier(0.4, 0, 0.2, 1);
|
|
249
|
-
flex-shrink: 0;
|
|
250
|
-
|
|
251
|
-
&.expanded {
|
|
252
|
-
transform: rotate(180deg);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/* Hover effects */
|
|
257
|
-
.compact-header:hover {
|
|
258
|
-
.network-badge-compact,
|
|
259
|
-
.wallet-logo-compact {
|
|
260
|
-
transform: scale(1.05);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.toggle-icon {
|
|
264
|
-
color: var(--account-selector-text-on-primary, var(--ion-color-primary));
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
`,
|
|
268
|
-
],
|
|
269
|
-
})
|
|
270
|
-
export class AccountFilterComponent {
|
|
271
|
-
protected readonly formatting = inject(AccountFormattingService);
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* Active account data for display
|
|
275
|
-
*/
|
|
276
|
-
@Input() activeAccount: ActiveAccountData | null = null;
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Total number of connected accounts
|
|
280
|
-
*/
|
|
281
|
-
@Input() totalAccountCount = 0;
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Whether the account list is collapsed
|
|
285
|
-
*/
|
|
286
|
-
@Input() isCollapsed = false;
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Whether collapse/expand is enabled
|
|
290
|
-
*/
|
|
291
|
-
@Input() collapsible = true;
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Custom header text (e.g., "Connected with", "Using wallet")
|
|
295
|
-
*/
|
|
296
|
-
@Input() customHeaderText?: string;
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Format for compact header display
|
|
300
|
-
*/
|
|
301
|
-
@Input() headerFormat: CompactHeaderFormat = 'label-count';
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Size variant for compact header
|
|
305
|
-
*/
|
|
306
|
-
@Input() headerSize: CompactHeaderSize = 'default';
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Wallet logo source URL
|
|
310
|
-
*/
|
|
311
|
-
@Input() walletLogoSrc = 'assets/wallets/hsuite.svg';
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Emitted when collapse toggle is clicked
|
|
315
|
-
*/
|
|
316
|
-
@Output() toggleCollapseEvent = new EventEmitter<void>();
|
|
317
|
-
|
|
318
|
-
constructor() {
|
|
319
|
-
addIcons({ chevronDownOutline });
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Handle toggle click
|
|
324
|
-
*/
|
|
325
|
-
protected onToggle(): void {
|
|
326
|
-
if (this.collapsible) {
|
|
327
|
-
this.toggleCollapseEvent.emit();
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Get active account address (truncated)
|
|
333
|
-
*/
|
|
334
|
-
protected getActiveAddress(): string {
|
|
335
|
-
if (!this.activeAccount?.address) return 'No account';
|
|
336
|
-
return this.formatting.truncateAddress(this.activeAccount.address);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Get active account network type
|
|
341
|
-
*/
|
|
342
|
-
protected getActiveNetworkType(): string {
|
|
343
|
-
if (!this.activeAccount?.networkId) return '';
|
|
344
|
-
return this.formatting.formatNetwork(this.activeAccount.networkId);
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Get active account network color
|
|
349
|
-
*/
|
|
350
|
-
protected getActiveNetworkColor(): string {
|
|
351
|
-
if (!this.activeAccount?.networkId) return 'medium';
|
|
352
|
-
return this.formatting.getNetworkColor(this.activeAccount.networkId);
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* Get primary text based on format
|
|
357
|
-
*/
|
|
358
|
-
protected getPrimaryText(): string {
|
|
359
|
-
switch (this.headerFormat) {
|
|
360
|
-
case 'label-count':
|
|
361
|
-
case 'label-only':
|
|
362
|
-
return this.activeAccount?.label || 'No Account';
|
|
363
|
-
|
|
364
|
-
case 'address-count':
|
|
365
|
-
case 'address-only':
|
|
366
|
-
return this.activeAccount
|
|
367
|
-
? this.formatting.truncateAddress(this.activeAccount.address)
|
|
368
|
-
: 'No Account';
|
|
369
|
-
|
|
370
|
-
case 'count-only': {
|
|
371
|
-
const count = this.totalAccountCount;
|
|
372
|
-
return count === 1 ? '1 wallet connected' : `${count} wallets connected`;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
default:
|
|
376
|
-
return 'Select Account';
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Get secondary text based on format
|
|
382
|
-
*/
|
|
383
|
-
protected getSecondaryText(): string | null {
|
|
384
|
-
if (this.headerFormat === 'label-count' || this.headerFormat === 'address-count') {
|
|
385
|
-
const count = this.totalAccountCount;
|
|
386
|
-
return count === 1 ? '1 account' : `${count} accounts`;
|
|
387
|
-
}
|
|
388
|
-
return null;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Get ARIA label for accessibility
|
|
393
|
-
*/
|
|
394
|
-
protected getAriaLabel(): string {
|
|
395
|
-
const label = this.activeAccount?.label || 'No account';
|
|
396
|
-
const count = this.totalAccountCount;
|
|
397
|
-
const collapsed = this.isCollapsed;
|
|
398
|
-
|
|
399
|
-
return `${label}, ${count} account${count !== 1 ? 's' : ''} connected. ${collapsed ? 'Click to expand' : 'Click to collapse'} account list.`;
|
|
400
|
-
}
|
|
401
|
-
}
|