@hsuite/native-connect-angular 1.0.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/README.md +48 -0
- package/USAGE_EXAMPLES.md +476 -0
- package/assets/wallets/extension.svg +7 -0
- package/assets/wallets/hashpack.svg +6 -0
- package/assets/wallets/hsuite.svg +11 -0
- package/assets/wallets/kabila.svg +11 -0
- package/assets/wallets/walletconnect.svg +13 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/coverage-summary.json +50 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +476 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +476 -0
- package/coverage/lcov-report/lib/components/account-selector/account-actions/account-actions.component.ts.html +868 -0
- package/coverage/lcov-report/lib/components/account-selector/account-actions/index.html +116 -0
- package/coverage/lcov-report/lib/components/account-selector/account-filter/account-filter.component.ts.html +1288 -0
- package/coverage/lcov-report/lib/components/account-selector/account-filter/index.html +116 -0
- package/coverage/lcov-report/lib/components/account-selector/account-formatting.service.ts.html +685 -0
- package/coverage/lcov-report/lib/components/account-selector/account-grouping.service.ts.html +766 -0
- package/coverage/lcov-report/lib/components/account-selector/account-list/account-list.component.ts.html +1495 -0
- package/coverage/lcov-report/lib/components/account-selector/account-list/index.html +116 -0
- package/coverage/lcov-report/lib/components/account-selector/account-selector.component.ts.html +1495 -0
- package/coverage/lcov-report/lib/components/account-selector/account-selector.service.ts.html +1588 -0
- package/coverage/lcov-report/lib/components/account-selector/index.html +161 -0
- package/coverage/lcov-report/lib/components/wallet-account-display/index.html +116 -0
- package/coverage/lcov-report/lib/components/wallet-account-display/wallet-account-display.component.ts.html +505 -0
- package/coverage/lcov-report/lib/components/wallet-connect-button/index.html +116 -0
- package/coverage/lcov-report/lib/components/wallet-connect-button/wallet-connect-button.component.ts.html +805 -0
- package/coverage/lcov-report/lib/components/wallet-connect-prompt/index.html +116 -0
- package/coverage/lcov-report/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts.html +409 -0
- package/coverage/lcov-report/lib/components/wallet-connected-guard/index.html +116 -0
- package/coverage/lcov-report/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts.html +304 -0
- package/coverage/lcov-report/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts.html +436 -0
- package/coverage/lcov-report/lib/components/wallet-connection-modal/connection-method-step/index.html +116 -0
- package/coverage/lcov-report/lib/components/wallet-connection-modal/index.html +116 -0
- package/coverage/lcov-report/lib/components/wallet-connection-modal/qr-pairing-step/index.html +116 -0
- package/coverage/lcov-report/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts.html +2287 -0
- package/coverage/lcov-report/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts.html +2275 -0
- package/coverage/lcov-report/lib/components/wallet-session-display/index.html +116 -0
- package/coverage/lcov-report/lib/components/wallet-session-display/wallet-session-display.component.ts.html +676 -0
- package/coverage/lcov-report/lib/components/wallet-transaction-status/index.html +116 -0
- package/coverage/lcov-report/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts.html +703 -0
- package/coverage/lcov-report/lib/directives/index.html +146 -0
- package/coverage/lcov-report/lib/directives/wallet-connected.directive.ts.html +670 -0
- package/coverage/lcov-report/lib/directives/wallet-context.directive.ts.html +547 -0
- package/coverage/lcov-report/lib/directives/wallet-events.directive.ts.html +781 -0
- package/coverage/lcov-report/lib/hsuite-wallet.module.ts.html +715 -0
- package/coverage/lcov-report/lib/index.html +116 -0
- package/coverage/lcov-report/lib/models/connection-config.model.ts.html +280 -0
- package/coverage/lcov-report/lib/models/index.html +131 -0
- package/coverage/lcov-report/lib/models/provider-types.ts.html +577 -0
- package/coverage/lcov-report/lib/providers/base-wallet-provider.ts.html +1138 -0
- package/coverage/lcov-report/lib/providers/hsuite-native/channel-client.service.ts.html +2671 -0
- package/coverage/lcov-report/lib/providers/hsuite-native/index.html +116 -0
- package/coverage/lcov-report/lib/providers/hsuite-native-provider.ts.html +2347 -0
- package/coverage/lcov-report/lib/providers/index.html +146 -0
- package/coverage/lcov-report/lib/providers/p2p-native/index.html +131 -0
- package/coverage/lcov-report/lib/providers/p2p-native/p2p-native.provider.ts.html +2254 -0
- package/coverage/lcov-report/lib/providers/p2p-native/p2p-session-manager.ts.html +2170 -0
- package/coverage/lcov-report/lib/providers/wallet-error-handler.ts.html +1132 -0
- package/coverage/lcov-report/lib/providers/walletconnect/core/index.html +176 -0
- package/coverage/lcov-report/lib/providers/walletconnect/core/session-health.ts.html +673 -0
- package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-client-manager.ts.html +1177 -0
- package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-provider.ts.html +2563 -0
- package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-session-store.ts.html +904 -0
- package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts.html +982 -0
- package/coverage/lcov-report/lib/providers/walletconnect/signers/hedera-signer.ts.html +1915 -0
- package/coverage/lcov-report/lib/providers/walletconnect/signers/index.html +146 -0
- package/coverage/lcov-report/lib/providers/walletconnect/signers/signer-factory.ts.html +445 -0
- package/coverage/lcov-report/lib/providers/walletconnect/signers/xrpl-signer.ts.html +1519 -0
- package/coverage/lcov-report/lib/services/index.html +191 -0
- package/coverage/lcov-report/lib/services/logger.service.ts.html +463 -0
- package/coverage/lcov-report/lib/services/transaction-builders/base-transaction-builder.service.ts.html +1840 -0
- package/coverage/lcov-report/lib/services/transaction-builders/hedera-amount-utils.ts.html +337 -0
- package/coverage/lcov-report/lib/services/transaction-builders/hedera-transaction-builder.service.ts.html +3940 -0
- package/coverage/lcov-report/lib/services/transaction-builders/index.html +161 -0
- package/coverage/lcov-report/lib/services/transaction-builders/xrpl-transaction-builder.service.ts.html +2581 -0
- package/coverage/lcov-report/lib/services/transaction.service.ts.html +1123 -0
- package/coverage/lcov-report/lib/services/unified-wallet.service.ts.html +2641 -0
- package/coverage/lcov-report/lib/services/wallet-context.service.ts.html +637 -0
- package/coverage/lcov-report/lib/services/wallet-event-bus.service.ts.html +643 -0
- package/coverage/lcov-report/lib/services/wallet-providers.service.ts.html +496 -0
- package/coverage/lcov-report/lib/transports/chrome-extension-transport.ts.html +823 -0
- package/coverage/lcov-report/lib/transports/index.html +116 -0
- package/coverage/lcov-report/lib/utils/index.html +116 -0
- package/coverage/lcov-report/lib/utils/ledger-icons.util.ts.html +319 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov.info +19252 -0
- package/coverage/lib/components/account-selector/account-actions/account-actions.component.ts.html +868 -0
- package/coverage/lib/components/account-selector/account-actions/index.html +116 -0
- package/coverage/lib/components/account-selector/account-filter/account-filter.component.ts.html +1288 -0
- package/coverage/lib/components/account-selector/account-filter/index.html +116 -0
- package/coverage/lib/components/account-selector/account-formatting.service.ts.html +685 -0
- package/coverage/lib/components/account-selector/account-grouping.service.ts.html +766 -0
- package/coverage/lib/components/account-selector/account-list/account-list.component.ts.html +1495 -0
- package/coverage/lib/components/account-selector/account-list/index.html +116 -0
- package/coverage/lib/components/account-selector/account-selector.component.ts.html +1495 -0
- package/coverage/lib/components/account-selector/account-selector.service.ts.html +1588 -0
- package/coverage/lib/components/account-selector/index.html +161 -0
- package/coverage/lib/components/wallet-account-display/index.html +116 -0
- package/coverage/lib/components/wallet-account-display/wallet-account-display.component.ts.html +505 -0
- package/coverage/lib/components/wallet-connect-button/index.html +116 -0
- package/coverage/lib/components/wallet-connect-button/wallet-connect-button.component.ts.html +805 -0
- package/coverage/lib/components/wallet-connect-prompt/index.html +116 -0
- package/coverage/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts.html +409 -0
- package/coverage/lib/components/wallet-connected-guard/index.html +116 -0
- package/coverage/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts.html +304 -0
- package/coverage/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts.html +436 -0
- package/coverage/lib/components/wallet-connection-modal/connection-method-step/index.html +116 -0
- package/coverage/lib/components/wallet-connection-modal/index.html +116 -0
- package/coverage/lib/components/wallet-connection-modal/qr-pairing-step/index.html +116 -0
- package/coverage/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts.html +2287 -0
- package/coverage/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts.html +2275 -0
- package/coverage/lib/components/wallet-session-display/index.html +116 -0
- package/coverage/lib/components/wallet-session-display/wallet-session-display.component.ts.html +676 -0
- package/coverage/lib/components/wallet-transaction-status/index.html +116 -0
- package/coverage/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts.html +703 -0
- package/coverage/lib/directives/index.html +146 -0
- package/coverage/lib/directives/wallet-connected.directive.ts.html +670 -0
- package/coverage/lib/directives/wallet-context.directive.ts.html +547 -0
- package/coverage/lib/directives/wallet-events.directive.ts.html +781 -0
- package/coverage/lib/hsuite-wallet.module.ts.html +715 -0
- package/coverage/lib/index.html +116 -0
- package/coverage/lib/models/connection-config.model.ts.html +280 -0
- package/coverage/lib/models/index.html +131 -0
- package/coverage/lib/models/provider-types.ts.html +577 -0
- package/coverage/lib/providers/base-wallet-provider.ts.html +1138 -0
- package/coverage/lib/providers/hsuite-native/channel-client.service.ts.html +2671 -0
- package/coverage/lib/providers/hsuite-native/index.html +116 -0
- package/coverage/lib/providers/hsuite-native-provider.ts.html +2347 -0
- package/coverage/lib/providers/index.html +146 -0
- package/coverage/lib/providers/p2p-native/index.html +131 -0
- package/coverage/lib/providers/p2p-native/p2p-native.provider.ts.html +2254 -0
- package/coverage/lib/providers/p2p-native/p2p-session-manager.ts.html +2170 -0
- package/coverage/lib/providers/wallet-error-handler.ts.html +1132 -0
- package/coverage/lib/providers/walletconnect/core/index.html +176 -0
- package/coverage/lib/providers/walletconnect/core/session-health.ts.html +673 -0
- package/coverage/lib/providers/walletconnect/core/walletconnect-client-manager.ts.html +1177 -0
- package/coverage/lib/providers/walletconnect/core/walletconnect-provider.ts.html +2563 -0
- package/coverage/lib/providers/walletconnect/core/walletconnect-session-store.ts.html +904 -0
- package/coverage/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts.html +982 -0
- package/coverage/lib/providers/walletconnect/signers/hedera-signer.ts.html +1915 -0
- package/coverage/lib/providers/walletconnect/signers/index.html +146 -0
- package/coverage/lib/providers/walletconnect/signers/signer-factory.ts.html +445 -0
- package/coverage/lib/providers/walletconnect/signers/xrpl-signer.ts.html +1519 -0
- package/coverage/lib/services/index.html +191 -0
- package/coverage/lib/services/logger.service.ts.html +463 -0
- package/coverage/lib/services/transaction-builders/base-transaction-builder.service.ts.html +1840 -0
- package/coverage/lib/services/transaction-builders/hedera-amount-utils.ts.html +337 -0
- package/coverage/lib/services/transaction-builders/hedera-transaction-builder.service.ts.html +3940 -0
- package/coverage/lib/services/transaction-builders/index.html +161 -0
- package/coverage/lib/services/transaction-builders/xrpl-transaction-builder.service.ts.html +2581 -0
- package/coverage/lib/services/transaction.service.ts.html +1123 -0
- package/coverage/lib/services/unified-wallet.service.ts.html +2641 -0
- package/coverage/lib/services/wallet-context.service.ts.html +637 -0
- package/coverage/lib/services/wallet-event-bus.service.ts.html +643 -0
- package/coverage/lib/services/wallet-providers.service.ts.html +496 -0
- package/coverage/lib/transports/chrome-extension-transport.ts.html +823 -0
- package/coverage/lib/transports/index.html +116 -0
- package/coverage/lib/utils/index.html +116 -0
- package/coverage/lib/utils/ledger-icons.util.ts.html +319 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/dist/README.md +48 -0
- package/dist/fesm2022/hsuite-native-connect-angular.mjs +14592 -0
- package/dist/fesm2022/hsuite-native-connect-angular.mjs.map +1 -0
- package/dist/index.d.ts +6949 -0
- package/examples/minimal-connect.ts +178 -0
- package/examples/multi-protocol.ts +495 -0
- package/examples/transaction-signing.ts +361 -0
- package/jest.config.json +45 -0
- package/karma.conf.js +42 -0
- package/ng-package.json +20 -0
- package/package.json +60 -0
- package/src/index.ts +203 -0
- package/src/lib/components/account-selector/account-actions/account-actions.component.ts +261 -0
- package/src/lib/components/account-selector/account-filter/account-filter.component.ts +401 -0
- package/src/lib/components/account-selector/account-formatting.service.ts +200 -0
- package/src/lib/components/account-selector/account-grouping.service.ts +227 -0
- package/src/lib/components/account-selector/account-list/account-list.component.ts +470 -0
- package/src/lib/components/account-selector/account-selector.component.html +135 -0
- package/src/lib/components/account-selector/account-selector.component.scss +2039 -0
- package/src/lib/components/account-selector/account-selector.component.ts +470 -0
- package/src/lib/components/account-selector/account-selector.service.ts +501 -0
- package/src/lib/components/wallet-account-display/wallet-account-display.component.html +34 -0
- package/src/lib/components/wallet-account-display/wallet-account-display.component.scss +99 -0
- package/src/lib/components/wallet-account-display/wallet-account-display.component.ts +140 -0
- package/src/lib/components/wallet-connect-button/wallet-connect-button.component.html +14 -0
- package/src/lib/components/wallet-connect-button/wallet-connect-button.component.scss +272 -0
- package/src/lib/components/wallet-connect-button/wallet-connect-button.component.ts +240 -0
- package/src/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.html +24 -0
- package/src/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.scss +50 -0
- package/src/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts +108 -0
- package/src/lib/components/wallet-connected-guard/wallet-connected-guard.component.html +24 -0
- package/src/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts +73 -0
- package/src/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.html +56 -0
- package/src/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.scss +218 -0
- package/src/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts +117 -0
- package/src/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.html +94 -0
- package/src/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.scss +272 -0
- package/src/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts +734 -0
- package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.html +197 -0
- package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.scss +678 -0
- package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts +730 -0
- package/src/lib/components/wallet-session-display/wallet-session-display.component.html +110 -0
- package/src/lib/components/wallet-session-display/wallet-session-display.component.scss +179 -0
- package/src/lib/components/wallet-session-display/wallet-session-display.component.ts +197 -0
- package/src/lib/components/wallet-transaction-status/wallet-transaction-status.component.html +65 -0
- package/src/lib/components/wallet-transaction-status/wallet-transaction-status.component.scss +254 -0
- package/src/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts +206 -0
- package/src/lib/directives/wallet-connected.directive.ts +195 -0
- package/src/lib/directives/wallet-context.directive.ts +154 -0
- package/src/lib/directives/wallet-events.directive.ts +232 -0
- package/src/lib/hsuite-wallet.module.ts +210 -0
- package/src/lib/models/connection-config.model.ts +65 -0
- package/src/lib/models/provider-types.ts +164 -0
- package/src/lib/models/unified-account.model.ts +76 -0
- package/src/lib/models/wallet-context.model.ts +121 -0
- package/src/lib/models/wallet-events.model.ts +158 -0
- package/src/lib/providers/base-wallet-provider.ts +351 -0
- package/src/lib/providers/hsuite-native/channel-client.service.spec.ts +73 -0
- package/src/lib/providers/hsuite-native/channel-client.service.ts +862 -0
- package/src/lib/providers/hsuite-native/index.ts +8 -0
- package/src/lib/providers/hsuite-native-provider.ts +754 -0
- package/src/lib/providers/mobile-native/mobile-native.provider.spec.ts +19 -0
- package/src/lib/providers/p2p-native/index.ts +30 -0
- package/src/lib/providers/p2p-native/p2p-native.provider.spec.ts +523 -0
- package/src/lib/providers/p2p-native/p2p-native.provider.ts +723 -0
- package/src/lib/providers/p2p-native/p2p-session-manager.ts +695 -0
- package/src/lib/providers/wallet-error-handler.ts +349 -0
- package/src/lib/providers/walletconnect/core/base-signer.interface.ts +122 -0
- package/src/lib/providers/walletconnect/core/session-health.ts +196 -0
- package/src/lib/providers/walletconnect/core/walletconnect-client-manager.ts +364 -0
- package/src/lib/providers/walletconnect/core/walletconnect-provider.integration.spec.ts +348 -0
- package/src/lib/providers/walletconnect/core/walletconnect-provider.ts +826 -0
- package/src/lib/providers/walletconnect/core/walletconnect-session-store.ts +273 -0
- package/src/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts +299 -0
- package/src/lib/providers/walletconnect/core/walletconnect-types.ts +48 -0
- package/src/lib/providers/walletconnect/index.ts +33 -0
- package/src/lib/providers/walletconnect/signers/hedera-signer.spec.ts +367 -0
- package/src/lib/providers/walletconnect/signers/hedera-signer.ts +610 -0
- package/src/lib/providers/walletconnect/signers/signer-factory.spec.ts +62 -0
- package/src/lib/providers/walletconnect/signers/signer-factory.ts +120 -0
- package/src/lib/providers/walletconnect/signers/xrpl-signer.spec.ts +296 -0
- package/src/lib/providers/walletconnect/signers/xrpl-signer.ts +478 -0
- package/src/lib/services/logger.service.ts +126 -0
- package/src/lib/services/transaction-builders/base-transaction-builder.service.ts +585 -0
- package/src/lib/services/transaction-builders/hedera-amount-utils.ts +84 -0
- package/src/lib/services/transaction-builders/hedera-transaction-builder.service.spec.ts +741 -0
- package/src/lib/services/transaction-builders/hedera-transaction-builder.service.ts +1285 -0
- package/src/lib/services/transaction-builders/index.ts +54 -0
- package/src/lib/services/transaction-builders/xrpl-transaction-builder.service.spec.ts +937 -0
- package/src/lib/services/transaction-builders/xrpl-transaction-builder.service.ts +832 -0
- package/src/lib/services/transaction.service.ts +346 -0
- package/src/lib/services/unified-wallet.service.spec.ts +1382 -0
- package/src/lib/services/unified-wallet.service.ts +852 -0
- package/src/lib/services/wallet-context.service.ts +184 -0
- package/src/lib/services/wallet-event-bus.service.ts +186 -0
- package/src/lib/services/wallet-providers.service.ts +137 -0
- package/src/lib/transports/chrome-extension-transport.ts +246 -0
- package/src/lib/utils/index.ts +14 -0
- package/src/lib/utils/ledger-icons.util.ts +78 -0
- package/test/test-setup.ts +21 -0
- package/test-setup.ts +63 -0
- package/tsconfig.build.json +11 -0
- package/tsconfig.json +29 -0
- package/tsconfig.spec.json +15 -0
- package/vitest.config.ts +48 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet Connect Prompt Component Styles
|
|
3
|
+
* @compodoc
|
|
4
|
+
* Styles for the wallet connect prompt empty state component
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
.wallet-connect-prompt {
|
|
8
|
+
max-width: 600px;
|
|
9
|
+
margin: var(--space-lg, 24px) auto;
|
|
10
|
+
text-align: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.prompt-header {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: var(--space-sm, 12px);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.prompt-icon {
|
|
21
|
+
font-size: 48px;
|
|
22
|
+
color: var(--ion-color-primary);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.prompt-message {
|
|
26
|
+
margin: var(--space-md, 16px) 0;
|
|
27
|
+
color: var(--ion-color-medium);
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
line-height: 1.6;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.prompt-button {
|
|
33
|
+
margin-top: var(--space-md, 16px);
|
|
34
|
+
|
|
35
|
+
::ng-deep ion-button {
|
|
36
|
+
margin: 0 auto;
|
|
37
|
+
display: block;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media (max-width: 576px) {
|
|
42
|
+
.wallet-connect-prompt {
|
|
43
|
+
margin: var(--space-md, 16px);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.prompt-icon {
|
|
47
|
+
font-size: 36px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
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 wallet-connect-prompt.component.ts
|
|
13
|
+
* @description Beautiful empty state component with connect button
|
|
14
|
+
*
|
|
15
|
+
* Pre-built component for showing a professional "connect wallet" prompt.
|
|
16
|
+
* Eliminates repetitive empty state boilerplate.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { Component, Input } from '@angular/core';
|
|
20
|
+
import { CommonModule } from '@angular/common';
|
|
21
|
+
import {
|
|
22
|
+
IonCard,
|
|
23
|
+
IonCardHeader,
|
|
24
|
+
IonCardTitle,
|
|
25
|
+
IonCardSubtitle,
|
|
26
|
+
IonCardContent,
|
|
27
|
+
IonIcon,
|
|
28
|
+
} from '@ionic/angular/standalone';
|
|
29
|
+
import { addIcons } from 'ionicons';
|
|
30
|
+
import { walletOutline } from 'ionicons/icons';
|
|
31
|
+
import { WalletConnectButtonComponent } from '../wallet-connect-button/wallet-connect-button.component';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Pre-built component for "connect wallet" empty state
|
|
35
|
+
*
|
|
36
|
+
* Features:
|
|
37
|
+
* - Beautiful, professional design
|
|
38
|
+
* - Integrated connect button
|
|
39
|
+
* - Customizable message
|
|
40
|
+
* - Responsive styling
|
|
41
|
+
* - Optional icon
|
|
42
|
+
*/
|
|
43
|
+
@Component({
|
|
44
|
+
selector: 'wallet-connect-prompt',
|
|
45
|
+
standalone: true,
|
|
46
|
+
imports: [
|
|
47
|
+
CommonModule,
|
|
48
|
+
IonCard,
|
|
49
|
+
IonCardHeader,
|
|
50
|
+
IonCardTitle,
|
|
51
|
+
IonCardSubtitle,
|
|
52
|
+
IonCardContent,
|
|
53
|
+
IonIcon,
|
|
54
|
+
WalletConnectButtonComponent,
|
|
55
|
+
],
|
|
56
|
+
templateUrl: './wallet-connect-prompt.component.html',
|
|
57
|
+
styleUrls: ['./wallet-connect-prompt.component.scss'],
|
|
58
|
+
})
|
|
59
|
+
export class WalletConnectPromptComponent {
|
|
60
|
+
/**
|
|
61
|
+
* Main title text
|
|
62
|
+
*/
|
|
63
|
+
@Input() title = 'Connect Your Wallet';
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Subtitle text (optional)
|
|
67
|
+
*/
|
|
68
|
+
@Input() subtitle = '';
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Message explaining why connection is needed
|
|
72
|
+
*/
|
|
73
|
+
@Input() message = 'Connect your wallet to continue';
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Whether to show the wallet icon
|
|
77
|
+
*/
|
|
78
|
+
@Input() showIcon = true;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Text for the connect button
|
|
82
|
+
*/
|
|
83
|
+
@Input() buttonText = 'Connect Wallet';
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Button size
|
|
87
|
+
*/
|
|
88
|
+
@Input() buttonSize: 'small' | 'default' | 'large' = 'default';
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Button color
|
|
92
|
+
*/
|
|
93
|
+
@Input() buttonColor = 'primary';
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Card background color
|
|
97
|
+
*/
|
|
98
|
+
@Input() cardColor: string | undefined = undefined;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* WalletConnect Project ID (optional)
|
|
102
|
+
*/
|
|
103
|
+
@Input() walletConnectProjectId: string | undefined = undefined;
|
|
104
|
+
|
|
105
|
+
constructor() {
|
|
106
|
+
addIcons({ walletOutline });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- Show content when connected -->
|
|
2
|
+
<ng-container *ngIf="isConnected()">
|
|
3
|
+
<ng-content></ng-content>
|
|
4
|
+
</ng-container>
|
|
5
|
+
|
|
6
|
+
<!-- Show empty state when not connected -->
|
|
7
|
+
<ng-container *ngIf="!isConnected()">
|
|
8
|
+
<!-- Custom empty template if provided -->
|
|
9
|
+
<ng-container *ngIf="emptyTemplate; else defaultEmpty">
|
|
10
|
+
<ng-container *ngTemplateOutlet="emptyTemplate"></ng-container>
|
|
11
|
+
</ng-container>
|
|
12
|
+
|
|
13
|
+
<!-- Default empty state: connect prompt -->
|
|
14
|
+
<ng-template #defaultEmpty>
|
|
15
|
+
<wallet-connect-prompt
|
|
16
|
+
[title]="emptyTitle"
|
|
17
|
+
[subtitle]="emptySubtitle"
|
|
18
|
+
[message]="emptyMessage"
|
|
19
|
+
[showIcon]="showIcon"
|
|
20
|
+
[walletConnectProjectId]="walletConnectProjectId"
|
|
21
|
+
/>
|
|
22
|
+
</ng-template>
|
|
23
|
+
</ng-container>
|
|
24
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
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 wallet-connected-guard.component.ts
|
|
13
|
+
* @description Component-based guard for wallet connection status
|
|
14
|
+
*
|
|
15
|
+
* Alternative to `*walletConnected` directive. Shows content only when connected,
|
|
16
|
+
* with customizable empty state.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { Component, Input, computed, inject } from '@angular/core';
|
|
20
|
+
import { CommonModule } from '@angular/common';
|
|
21
|
+
import { WalletContextService } from '../../services/wallet-context.service';
|
|
22
|
+
import { WalletConnectPromptComponent } from '../wallet-connect-prompt/wallet-connect-prompt.component';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Component-based guard for wallet connection
|
|
26
|
+
*
|
|
27
|
+
* Shows projected content when wallet is connected, otherwise shows
|
|
28
|
+
* a customizable empty state (default: connect prompt).
|
|
29
|
+
*/
|
|
30
|
+
@Component({
|
|
31
|
+
selector: 'wallet-connected-guard',
|
|
32
|
+
standalone: true,
|
|
33
|
+
imports: [CommonModule, WalletConnectPromptComponent],
|
|
34
|
+
templateUrl: './wallet-connected-guard.component.html',
|
|
35
|
+
})
|
|
36
|
+
export class WalletConnectedGuardComponent {
|
|
37
|
+
private readonly contextService = inject(WalletContextService);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Custom empty state template
|
|
41
|
+
*/
|
|
42
|
+
@Input() emptyTemplate?: any;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Title for default empty state
|
|
46
|
+
*/
|
|
47
|
+
@Input() emptyTitle = 'Connect Your Wallet';
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Subtitle for default empty state
|
|
51
|
+
*/
|
|
52
|
+
@Input() emptySubtitle = '';
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Message for default empty state
|
|
56
|
+
*/
|
|
57
|
+
@Input() emptyMessage = 'Please connect your wallet to continue';
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Whether to show icon in default empty state
|
|
61
|
+
*/
|
|
62
|
+
@Input() showIcon = true;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* WalletConnect Project ID
|
|
66
|
+
*/
|
|
67
|
+
@Input() walletConnectProjectId: string | undefined = undefined;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Computed connection status
|
|
71
|
+
*/
|
|
72
|
+
protected readonly isConnected = computed(() => this.contextService.context().isConnected);
|
|
73
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<!-- Connection Method Step -->
|
|
2
|
+
<div class="connection-method-step">
|
|
3
|
+
<div class="step-header">
|
|
4
|
+
<h3 class="step-title">Choose Connection Method</h3>
|
|
5
|
+
<p class="step-description">Select how you'd like to connect to HSuite Wallet</p>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div class="method-list">
|
|
9
|
+
<button
|
|
10
|
+
*ngFor="let method of methods; trackBy: trackByMethodId"
|
|
11
|
+
type="button"
|
|
12
|
+
class="method-card"
|
|
13
|
+
[class.selected]="selectedMethod === method.id"
|
|
14
|
+
[class.recommended]="method.recommended"
|
|
15
|
+
[class.disabled]="!method.available"
|
|
16
|
+
[disabled]="!method.available"
|
|
17
|
+
(click)="selectMethod(method)"
|
|
18
|
+
>
|
|
19
|
+
<!-- Recommended badge -->
|
|
20
|
+
<div class="recommended-badge" *ngIf="method.recommended">
|
|
21
|
+
<ion-icon name="checkmark-circle"></ion-icon>
|
|
22
|
+
<span>Recommended</span>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<!-- Icon -->
|
|
26
|
+
<div class="method-icon">
|
|
27
|
+
<ion-icon [name]="method.icon"></ion-icon>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<!-- Content -->
|
|
31
|
+
<div class="method-content">
|
|
32
|
+
<h4 class="method-name">{{ method.name }}</h4>
|
|
33
|
+
<p class="method-description">{{ method.description }}</p>
|
|
34
|
+
|
|
35
|
+
<!-- Features list -->
|
|
36
|
+
<ul class="method-features" *ngIf="method.features?.length">
|
|
37
|
+
<li *ngFor="let feature of method.features">
|
|
38
|
+
<ion-icon name="checkmark-circle"></ion-icon>
|
|
39
|
+
<span>{{ feature }}</span>
|
|
40
|
+
</li>
|
|
41
|
+
</ul>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<!-- Not available message -->
|
|
45
|
+
<div class="not-available" *ngIf="!method.available">
|
|
46
|
+
<span>Not available</span>
|
|
47
|
+
</div>
|
|
48
|
+
</button>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<!-- Mobile hint -->
|
|
52
|
+
<p class="mobile-hint" *ngIf="isMobile">
|
|
53
|
+
<ion-icon name="phone-portrait-outline"></ion-icon>
|
|
54
|
+
<span>Scan QR code with the HSuite Wallet app on your mobile device</span>
|
|
55
|
+
</p>
|
|
56
|
+
</div>
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connection Method Step Styles
|
|
3
|
+
* Uses unified --token-* and Ionic color system for theme compatibility
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
:host {
|
|
7
|
+
display: block;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.connection-method-step {
|
|
11
|
+
padding: var(--token-space-4, 16px);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// ========== Header ==========
|
|
15
|
+
|
|
16
|
+
.step-header {
|
|
17
|
+
text-align: center;
|
|
18
|
+
margin-bottom: var(--token-space-6, 24px);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.step-title {
|
|
22
|
+
margin: 0 0 var(--token-space-2, 8px);
|
|
23
|
+
font-size: var(--token-font-size-4, 18px);
|
|
24
|
+
font-weight: var(--token-font-weight-semibold, 600);
|
|
25
|
+
color: var(--ion-text-color);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.step-description {
|
|
29
|
+
margin: 0;
|
|
30
|
+
font-size: var(--token-font-size-2, 14px);
|
|
31
|
+
color: var(--ion-color-medium);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// ========== Method List ==========
|
|
35
|
+
|
|
36
|
+
.method-list {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
gap: var(--token-space-3, 12px);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// ========== Method Card ==========
|
|
43
|
+
|
|
44
|
+
.method-card {
|
|
45
|
+
position: relative;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: flex-start;
|
|
48
|
+
gap: var(--token-space-4, 16px);
|
|
49
|
+
width: 100%;
|
|
50
|
+
padding: var(--token-space-4, 16px);
|
|
51
|
+
background: var(--ion-background-color);
|
|
52
|
+
border: 2px solid var(--border-flat, var(--token-border-subtle));
|
|
53
|
+
border-radius: var(--token-radius-3, 12px);
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
text-align: left;
|
|
56
|
+
transition: all var(--token-transition-normal, 0.2s) ease;
|
|
57
|
+
|
|
58
|
+
&:hover:not(.disabled) {
|
|
59
|
+
border-color: var(--ion-color-primary-tint);
|
|
60
|
+
background: rgba(var(--ion-color-primary-rgb), 0.05);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:focus {
|
|
64
|
+
outline: none;
|
|
65
|
+
box-shadow: 0 0 0 3px rgba(var(--ion-color-primary-rgb), 0.2);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.selected {
|
|
69
|
+
border-color: var(--ion-color-primary);
|
|
70
|
+
background: rgba(var(--ion-color-primary-rgb), 0.05);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&.recommended {
|
|
74
|
+
border-color: var(--ion-color-success);
|
|
75
|
+
|
|
76
|
+
&:hover:not(.disabled) {
|
|
77
|
+
border-color: var(--ion-color-success);
|
|
78
|
+
background: rgba(var(--ion-color-success-rgb), 0.05);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&.disabled {
|
|
83
|
+
opacity: 0.5;
|
|
84
|
+
cursor: not-allowed;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// ========== Recommended Badge ==========
|
|
89
|
+
|
|
90
|
+
.recommended-badge {
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: -10px;
|
|
93
|
+
right: var(--token-space-4, 16px);
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
gap: 4px;
|
|
97
|
+
padding: 4px 8px;
|
|
98
|
+
background: var(--ion-color-success);
|
|
99
|
+
color: var(--ion-color-success-contrast);
|
|
100
|
+
font-size: 11px;
|
|
101
|
+
font-weight: var(--token-font-weight-semibold, 600);
|
|
102
|
+
text-transform: uppercase;
|
|
103
|
+
letter-spacing: 0.5px;
|
|
104
|
+
border-radius: var(--token-radius-full, 9999px);
|
|
105
|
+
|
|
106
|
+
ion-icon {
|
|
107
|
+
font-size: 12px;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ========== Method Icon ==========
|
|
112
|
+
|
|
113
|
+
.method-icon {
|
|
114
|
+
flex-shrink: 0;
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
width: 48px;
|
|
119
|
+
height: 48px;
|
|
120
|
+
background: rgba(var(--ion-color-primary-rgb), 0.1);
|
|
121
|
+
border-radius: var(--token-radius-2, 8px);
|
|
122
|
+
color: var(--ion-color-primary);
|
|
123
|
+
|
|
124
|
+
ion-icon {
|
|
125
|
+
font-size: 24px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.recommended & {
|
|
129
|
+
background: rgba(var(--ion-color-success-rgb), 0.1);
|
|
130
|
+
color: var(--ion-color-success);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// ========== Method Content ==========
|
|
135
|
+
|
|
136
|
+
.method-content {
|
|
137
|
+
flex: 1;
|
|
138
|
+
min-width: 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.method-name {
|
|
142
|
+
margin: 0 0 4px;
|
|
143
|
+
font-size: var(--token-font-size-3, 16px);
|
|
144
|
+
font-weight: var(--token-font-weight-semibold, 600);
|
|
145
|
+
color: var(--ion-text-color);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.method-description {
|
|
149
|
+
margin: 0;
|
|
150
|
+
font-size: var(--token-font-size-2, 14px);
|
|
151
|
+
color: var(--ion-color-medium);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// ========== Features List ==========
|
|
155
|
+
|
|
156
|
+
.method-features {
|
|
157
|
+
margin: var(--token-space-3, 12px) 0 0;
|
|
158
|
+
padding: 0;
|
|
159
|
+
list-style: none;
|
|
160
|
+
display: flex;
|
|
161
|
+
flex-wrap: wrap;
|
|
162
|
+
gap: var(--token-space-2, 8px);
|
|
163
|
+
|
|
164
|
+
li {
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
gap: 4px;
|
|
168
|
+
font-size: var(--token-font-size-1, 12px);
|
|
169
|
+
color: var(--ion-color-medium);
|
|
170
|
+
|
|
171
|
+
ion-icon {
|
|
172
|
+
font-size: 12px;
|
|
173
|
+
color: var(--ion-color-success);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// ========== Not Available ==========
|
|
179
|
+
|
|
180
|
+
.not-available {
|
|
181
|
+
position: absolute;
|
|
182
|
+
top: 0;
|
|
183
|
+
right: 0;
|
|
184
|
+
padding: 4px 8px;
|
|
185
|
+
background: rgba(var(--ion-color-warning-rgb), 0.1);
|
|
186
|
+
color: var(--ion-color-warning);
|
|
187
|
+
font-size: 11px;
|
|
188
|
+
font-weight: var(--token-font-weight-medium, 500);
|
|
189
|
+
border-radius: 0 var(--token-radius-3, 12px) 0 var(--token-radius-2, 6px);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// ========== Mobile Hint ==========
|
|
193
|
+
|
|
194
|
+
.mobile-hint {
|
|
195
|
+
display: flex;
|
|
196
|
+
align-items: center;
|
|
197
|
+
justify-content: center;
|
|
198
|
+
gap: var(--token-space-2, 8px);
|
|
199
|
+
margin-top: var(--token-space-6, 24px);
|
|
200
|
+
padding: var(--token-space-3, 12px);
|
|
201
|
+
background: rgba(var(--ion-color-primary-rgb), 0.1);
|
|
202
|
+
border-radius: var(--token-radius-2, 8px);
|
|
203
|
+
font-size: var(--token-font-size-2, 14px);
|
|
204
|
+
color: var(--ion-color-primary);
|
|
205
|
+
text-align: center;
|
|
206
|
+
|
|
207
|
+
ion-icon {
|
|
208
|
+
font-size: 18px;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// ========== Reduced Motion Support ==========
|
|
213
|
+
|
|
214
|
+
@media (prefers-reduced-motion: reduce) {
|
|
215
|
+
.method-card {
|
|
216
|
+
transition: none;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
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 connection-method-step.component.ts
|
|
13
|
+
* @description Connection method selection step for wallet connection wizard
|
|
14
|
+
*
|
|
15
|
+
* Displays connection method options based on platform:
|
|
16
|
+
* - Desktop: Extension (if available), PWA/Tab, QR Code (mobile)
|
|
17
|
+
* - Mobile: QR Code recommended
|
|
18
|
+
*
|
|
19
|
+
* This step appears after protocol selection when HSuite Native is chosen.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';
|
|
23
|
+
import { CommonModule } from '@angular/common';
|
|
24
|
+
import { IonIcon } from '@ionic/angular/standalone';
|
|
25
|
+
import { addIcons } from 'ionicons';
|
|
26
|
+
import {
|
|
27
|
+
extensionPuzzleOutline,
|
|
28
|
+
openOutline,
|
|
29
|
+
qrCodeOutline,
|
|
30
|
+
checkmarkCircle,
|
|
31
|
+
phonePortraitOutline,
|
|
32
|
+
} from 'ionicons/icons';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Connection method option interface
|
|
36
|
+
*/
|
|
37
|
+
export interface ConnectionMethodOption {
|
|
38
|
+
/** Unique identifier */
|
|
39
|
+
id: string;
|
|
40
|
+
/** Display name */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Short description */
|
|
43
|
+
description: string;
|
|
44
|
+
/** Ionicon name */
|
|
45
|
+
icon: string;
|
|
46
|
+
/** Whether this method is available */
|
|
47
|
+
available: boolean;
|
|
48
|
+
/** Whether this method is recommended for current platform */
|
|
49
|
+
recommended: boolean;
|
|
50
|
+
/** Optional features list */
|
|
51
|
+
features?: string[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Connection Method Step Component
|
|
56
|
+
*
|
|
57
|
+
* Allows users to select how they want to connect their wallet:
|
|
58
|
+
* - Browser Extension: Direct connection via installed extension
|
|
59
|
+
* - Web Wallet: Opens wallet in new tab/window
|
|
60
|
+
* - Mobile QR: Displays QR code for mobile wallet scanning
|
|
61
|
+
*/
|
|
62
|
+
@Component({
|
|
63
|
+
selector: 'hsuite-connection-method-step',
|
|
64
|
+
standalone: true,
|
|
65
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
66
|
+
imports: [CommonModule, IonIcon],
|
|
67
|
+
templateUrl: './connection-method-step.component.html',
|
|
68
|
+
styleUrls: ['./connection-method-step.component.scss'],
|
|
69
|
+
})
|
|
70
|
+
export class ConnectionMethodStepComponent {
|
|
71
|
+
/**
|
|
72
|
+
* Available connection method options
|
|
73
|
+
*/
|
|
74
|
+
@Input() methods: ConnectionMethodOption[] = [];
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Whether current device is mobile
|
|
78
|
+
*/
|
|
79
|
+
@Input() isMobile = false;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Currently selected method ID (for highlighting)
|
|
83
|
+
*/
|
|
84
|
+
@Input() selectedMethod: string | null = null;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Emitted when a method is selected
|
|
88
|
+
*/
|
|
89
|
+
@Output() methodSelected = new EventEmitter<string>();
|
|
90
|
+
|
|
91
|
+
constructor() {
|
|
92
|
+
addIcons({
|
|
93
|
+
extensionPuzzleOutline,
|
|
94
|
+
openOutline,
|
|
95
|
+
qrCodeOutline,
|
|
96
|
+
checkmarkCircle,
|
|
97
|
+
phonePortraitOutline,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Handle method selection
|
|
103
|
+
*/
|
|
104
|
+
selectMethod(method: ConnectionMethodOption): void {
|
|
105
|
+
if (!method.available) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
this.methodSelected.emit(method.id);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Track methods by ID for ngFor
|
|
113
|
+
*/
|
|
114
|
+
trackByMethodId(_index: number, method: ConnectionMethodOption): string {
|
|
115
|
+
return method.id;
|
|
116
|
+
}
|
|
117
|
+
}
|