@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,361 +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 transaction-signing.ts
|
|
13
|
-
* @description Example of signing and submitting transactions using the Angular SDK
|
|
14
|
-
*
|
|
15
|
-
* This example demonstrates:
|
|
16
|
-
* - Building Hedera transactions with @hashgraph/sdk
|
|
17
|
-
* - Serializing transactions for wallet signing
|
|
18
|
-
* - Using the TransactionService for simplified signing
|
|
19
|
-
* - Handling transaction results
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import { Component, inject, signal, computed } from '@angular/core';
|
|
23
|
-
import { UnifiedWalletService, TransactionService } from '@hsuite/native-connect-angular';
|
|
24
|
-
import { TransferTransaction, Hbar, AccountId, Client } from '@hashgraph/sdk';
|
|
25
|
-
|
|
26
|
-
@Component({
|
|
27
|
-
selector: 'app-transaction-signing',
|
|
28
|
-
template: `
|
|
29
|
-
<div class="tx-demo">
|
|
30
|
-
<h2>Transaction Signing Demo</h2>
|
|
31
|
-
|
|
32
|
-
<!-- Connection Required -->
|
|
33
|
-
@if (!isConnected()) {
|
|
34
|
-
<p class="warning">Please connect your wallet first.</p>
|
|
35
|
-
} @else {
|
|
36
|
-
<div class="tx-form">
|
|
37
|
-
<h3>Send HBAR</h3>
|
|
38
|
-
|
|
39
|
-
<div class="form-group">
|
|
40
|
-
<label>From (Your Account)</label>
|
|
41
|
-
<input type="text" [value]="activeAccount()?.address" disabled />
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<div class="form-group">
|
|
45
|
-
<label>To (Recipient)</label>
|
|
46
|
-
<input
|
|
47
|
-
type="text"
|
|
48
|
-
[value]="recipient()"
|
|
49
|
-
(input)="updateRecipient($event)"
|
|
50
|
-
placeholder="0.0.12345"
|
|
51
|
-
/>
|
|
52
|
-
</div>
|
|
53
|
-
|
|
54
|
-
<div class="form-group">
|
|
55
|
-
<label>Amount (HBAR)</label>
|
|
56
|
-
<input
|
|
57
|
-
type="number"
|
|
58
|
-
[value]="amount()"
|
|
59
|
-
(input)="updateAmount($event)"
|
|
60
|
-
placeholder="1.0"
|
|
61
|
-
step="0.1"
|
|
62
|
-
min="0.01"
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<!-- Sign Only -->
|
|
67
|
-
<button (click)="signOnly()" [disabled]="isProcessing() || !canSubmit()">
|
|
68
|
-
Sign Transaction
|
|
69
|
-
</button>
|
|
70
|
-
|
|
71
|
-
<!-- Sign and Submit -->
|
|
72
|
-
<button
|
|
73
|
-
(click)="signAndSubmit()"
|
|
74
|
-
[disabled]="isProcessing() || !canSubmit()"
|
|
75
|
-
class="primary"
|
|
76
|
-
>
|
|
77
|
-
Sign & Submit
|
|
78
|
-
</button>
|
|
79
|
-
|
|
80
|
-
<!-- Processing Indicator -->
|
|
81
|
-
@if (isProcessing()) {
|
|
82
|
-
<div class="processing">
|
|
83
|
-
<span class="spinner"></span>
|
|
84
|
-
Processing transaction...
|
|
85
|
-
</div>
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
<!-- Result Display -->
|
|
89
|
-
@if (lastResult()) {
|
|
90
|
-
<div class="result success">
|
|
91
|
-
<h4>Transaction Complete!</h4>
|
|
92
|
-
<p>Transaction ID: {{ getTransactionId() }}</p>
|
|
93
|
-
</div>
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
<!-- Error Display -->
|
|
97
|
-
@if (lastError()) {
|
|
98
|
-
<div class="result error">
|
|
99
|
-
<h4>Transaction Failed</h4>
|
|
100
|
-
<p>{{ lastError()?.message }}</p>
|
|
101
|
-
</div>
|
|
102
|
-
}
|
|
103
|
-
</div>
|
|
104
|
-
}
|
|
105
|
-
</div>
|
|
106
|
-
`,
|
|
107
|
-
styles: [
|
|
108
|
-
`
|
|
109
|
-
.tx-demo {
|
|
110
|
-
padding: 20px;
|
|
111
|
-
max-width: 500px;
|
|
112
|
-
margin: 0 auto;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.warning {
|
|
116
|
-
color: var(--ion-color-warning, orange);
|
|
117
|
-
padding: 16px;
|
|
118
|
-
background: var(--ion-color-warning-tint, #fff3e0);
|
|
119
|
-
border-radius: 8px;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.tx-form {
|
|
123
|
-
margin-top: 20px;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.form-group {
|
|
127
|
-
margin-bottom: 16px;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.form-group label {
|
|
131
|
-
display: block;
|
|
132
|
-
margin-bottom: 4px;
|
|
133
|
-
font-weight: 500;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.form-group input {
|
|
137
|
-
width: 100%;
|
|
138
|
-
padding: 12px;
|
|
139
|
-
border: 1px solid var(--ion-color-medium, #ccc);
|
|
140
|
-
border-radius: 8px;
|
|
141
|
-
font-size: 16px;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
button {
|
|
145
|
-
padding: 12px 24px;
|
|
146
|
-
margin-right: 12px;
|
|
147
|
-
margin-top: 12px;
|
|
148
|
-
font-size: 16px;
|
|
149
|
-
cursor: pointer;
|
|
150
|
-
background: var(--ion-color-secondary, #6c757d);
|
|
151
|
-
color: white;
|
|
152
|
-
border: none;
|
|
153
|
-
border-radius: 8px;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
button.primary {
|
|
157
|
-
background: var(--ion-color-primary, #3880ff);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
button:disabled {
|
|
161
|
-
opacity: 0.5;
|
|
162
|
-
cursor: not-allowed;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.processing {
|
|
166
|
-
margin-top: 16px;
|
|
167
|
-
padding: 16px;
|
|
168
|
-
background: var(--ion-color-light, #f4f4f4);
|
|
169
|
-
border-radius: 8px;
|
|
170
|
-
display: flex;
|
|
171
|
-
align-items: center;
|
|
172
|
-
gap: 12px;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.spinner {
|
|
176
|
-
width: 20px;
|
|
177
|
-
height: 20px;
|
|
178
|
-
border: 2px solid var(--ion-color-primary, #3880ff);
|
|
179
|
-
border-top-color: transparent;
|
|
180
|
-
border-radius: 50%;
|
|
181
|
-
animation: spin 1s linear infinite;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
@keyframes spin {
|
|
185
|
-
to {
|
|
186
|
-
transform: rotate(360deg);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.result {
|
|
191
|
-
margin-top: 16px;
|
|
192
|
-
padding: 16px;
|
|
193
|
-
border-radius: 8px;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.result.success {
|
|
197
|
-
background: var(--ion-color-success-tint, #e8f5e9);
|
|
198
|
-
color: var(--ion-color-success, green);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.result.error {
|
|
202
|
-
background: var(--ion-color-danger-tint, #ffebee);
|
|
203
|
-
color: var(--ion-color-danger, red);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.result h4 {
|
|
207
|
-
margin: 0 0 8px;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.result p {
|
|
211
|
-
margin: 0;
|
|
212
|
-
font-family: monospace;
|
|
213
|
-
}
|
|
214
|
-
`,
|
|
215
|
-
],
|
|
216
|
-
})
|
|
217
|
-
export class TransactionSigningComponent {
|
|
218
|
-
private readonly wallet = inject(UnifiedWalletService);
|
|
219
|
-
private readonly txService = inject(TransactionService);
|
|
220
|
-
|
|
221
|
-
// Form state
|
|
222
|
-
readonly recipient = signal('');
|
|
223
|
-
readonly amount = signal(1.0);
|
|
224
|
-
|
|
225
|
-
// Wallet state
|
|
226
|
-
readonly isConnected = this.wallet.isConnected;
|
|
227
|
-
readonly activeAccount = this.wallet.activeAccount;
|
|
228
|
-
|
|
229
|
-
// Transaction state
|
|
230
|
-
readonly isProcessing = this.txService.isProcessing;
|
|
231
|
-
readonly lastResult = this.txService.lastResult;
|
|
232
|
-
readonly lastError = this.txService.lastError;
|
|
233
|
-
|
|
234
|
-
// Form validation
|
|
235
|
-
readonly canSubmit = computed(() => {
|
|
236
|
-
const account = this.activeAccount();
|
|
237
|
-
const recipient = this.recipient();
|
|
238
|
-
const amount = this.amount();
|
|
239
|
-
|
|
240
|
-
return account && recipient && recipient.startsWith('0.0.') && amount > 0;
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
updateRecipient(event: Event): void {
|
|
244
|
-
const value = (event.target as HTMLInputElement).value;
|
|
245
|
-
this.recipient.set(value);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
updateAmount(event: Event): void {
|
|
249
|
-
const value = parseFloat((event.target as HTMLInputElement).value) || 0;
|
|
250
|
-
this.amount.set(value);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
getTransactionId(): string {
|
|
254
|
-
const result = this.lastResult() as { transactionId?: string } | null;
|
|
255
|
-
return result?.transactionId || 'N/A';
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Build a Hedera transfer transaction and serialize it
|
|
260
|
-
*
|
|
261
|
-
* This is the standard pattern for building transactions:
|
|
262
|
-
* 1. Create the transaction using Hashgraph SDK
|
|
263
|
-
* 2. Freeze it with a client (to set node accounts)
|
|
264
|
-
* 3. Serialize to bytes
|
|
265
|
-
* 4. Encode as base64 for the wallet
|
|
266
|
-
*/
|
|
267
|
-
private async buildTransaction(): Promise<string> {
|
|
268
|
-
const from = this.activeAccount();
|
|
269
|
-
if (!from) throw new Error('No active account');
|
|
270
|
-
|
|
271
|
-
const to = this.recipient();
|
|
272
|
-
const hbarAmount = this.amount();
|
|
273
|
-
|
|
274
|
-
// Create transfer transaction
|
|
275
|
-
const transaction = new TransferTransaction()
|
|
276
|
-
.addHbarTransfer(AccountId.fromString(from.address), new Hbar(-hbarAmount))
|
|
277
|
-
.addHbarTransfer(AccountId.fromString(to), new Hbar(hbarAmount));
|
|
278
|
-
|
|
279
|
-
// Get network from account
|
|
280
|
-
const network = from.networkId?.split(':')[1] || 'testnet';
|
|
281
|
-
const client = network === 'mainnet' ? Client.forMainnet() : Client.forTestnet();
|
|
282
|
-
|
|
283
|
-
// Freeze the transaction (sets node account IDs)
|
|
284
|
-
const frozen = await transaction.freezeWith(client);
|
|
285
|
-
|
|
286
|
-
// Serialize to bytes
|
|
287
|
-
const bytes = frozen.toBytes();
|
|
288
|
-
|
|
289
|
-
// Encode as base64
|
|
290
|
-
return this.uint8ArrayToBase64(bytes);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Sign the transaction only (without submitting)
|
|
295
|
-
*
|
|
296
|
-
* Use this when you want to:
|
|
297
|
-
* - Collect multiple signatures
|
|
298
|
-
* - Submit the transaction yourself
|
|
299
|
-
* - Store the signed transaction for later
|
|
300
|
-
*/
|
|
301
|
-
async signOnly(): Promise<void> {
|
|
302
|
-
try {
|
|
303
|
-
const payload = await this.buildTransaction();
|
|
304
|
-
const result = await this.txService.signTransaction(payload);
|
|
305
|
-
console.log('Transaction signed:', result);
|
|
306
|
-
} catch (error) {
|
|
307
|
-
console.error('Sign failed:', error);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* Sign and submit the transaction in one step
|
|
313
|
-
*
|
|
314
|
-
* This is the recommended approach for simple transactions.
|
|
315
|
-
* The wallet will sign the transaction and submit it to the network.
|
|
316
|
-
*/
|
|
317
|
-
async signAndSubmit(): Promise<void> {
|
|
318
|
-
try {
|
|
319
|
-
const payload = await this.buildTransaction();
|
|
320
|
-
const result = await this.txService.signAndSubmit(payload);
|
|
321
|
-
console.log('Transaction submitted:', result);
|
|
322
|
-
} catch (error) {
|
|
323
|
-
console.error('Submit failed:', error);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* Convert Uint8Array to base64 string
|
|
329
|
-
*/
|
|
330
|
-
private uint8ArrayToBase64(bytes: Uint8Array): string {
|
|
331
|
-
let binary = '';
|
|
332
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
333
|
-
binary += String.fromCharCode(bytes[i]);
|
|
334
|
-
}
|
|
335
|
-
return btoa(binary);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Key Points:
|
|
341
|
-
*
|
|
342
|
-
* 1. TRANSACTION BUILDING:
|
|
343
|
-
* - Use @hashgraph/sdk to build transactions
|
|
344
|
-
* - Freeze with appropriate client (testnet/mainnet)
|
|
345
|
-
* - Serialize to bytes and encode as base64
|
|
346
|
-
*
|
|
347
|
-
* 2. SIGNING OPTIONS:
|
|
348
|
-
* - signTransaction(): Sign only, return signed bytes
|
|
349
|
-
* - signAndSubmit(): Sign and submit in one wallet prompt
|
|
350
|
-
* - signAndSubmit is preferred for better UX (one prompt)
|
|
351
|
-
*
|
|
352
|
-
* 3. TRANSACTION SERVICE:
|
|
353
|
-
* - Provides reactive state (isProcessing, lastResult, lastError)
|
|
354
|
-
* - Automatically shows toast notifications
|
|
355
|
-
* - Handles error propagation
|
|
356
|
-
*
|
|
357
|
-
* 4. ERROR HANDLING:
|
|
358
|
-
* - Wrap in try/catch
|
|
359
|
-
* - Check lastError signal for UI display
|
|
360
|
-
* - Log errors for debugging
|
|
361
|
-
*/
|
package/jest.config.json
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"displayName": "angular-sdk",
|
|
3
|
-
"preset": "../../jest.preset.js",
|
|
4
|
-
"setupFilesAfterEnv": ["<rootDir>/test-setup.ts"],
|
|
5
|
-
"globals": {},
|
|
6
|
-
"coverageDirectory": "../../coverage/packages/angular-sdk",
|
|
7
|
-
"transform": {
|
|
8
|
-
"^.+\\.(ts|mts|js|html)$": [
|
|
9
|
-
"jest-preset-angular",
|
|
10
|
-
{
|
|
11
|
-
"tsconfig": "<rootDir>/tsconfig.spec.json",
|
|
12
|
-
"stringifyContentPathRegex": "\\.(html|svg)$"
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
"transformIgnorePatterns": ["node_modules/(?!.*\\.mjs$)"],
|
|
17
|
-
"snapshotSerializers": [
|
|
18
|
-
"jest-preset-angular/build/serializers/no-ng-attributes",
|
|
19
|
-
"jest-preset-angular/build/serializers/ng-snapshot",
|
|
20
|
-
"jest-preset-angular/build/serializers/html-comment"
|
|
21
|
-
],
|
|
22
|
-
"testMatch": [
|
|
23
|
-
"<rootDir>/**/__tests__/**/*.[jt]s?(x)",
|
|
24
|
-
"<rootDir>/**/*(*.)@(spec|test).[jt]s?(x)"
|
|
25
|
-
],
|
|
26
|
-
"collectCoverageFrom": [
|
|
27
|
-
"src/**/*.ts",
|
|
28
|
-
"!src/**/*.spec.ts",
|
|
29
|
-
"!src/**/*.d.ts",
|
|
30
|
-
"!src/index.ts",
|
|
31
|
-
"!src/test-setup.ts"
|
|
32
|
-
],
|
|
33
|
-
"coverageThreshold": {
|
|
34
|
-
"global": {
|
|
35
|
-
"branches": 80,
|
|
36
|
-
"functions": 80,
|
|
37
|
-
"lines": 80,
|
|
38
|
-
"statements": 80
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
"moduleNameMapper": {
|
|
42
|
-
"^@hsuite/native-connect-angular$": "<rootDir>/src/index.ts",
|
|
43
|
-
"^@hsuite/native-connect-angular/(.*)$": "<rootDir>/src/$1"
|
|
44
|
-
}
|
|
45
|
-
}
|
package/karma.conf.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// Karma configuration file, see link for more information
|
|
2
|
-
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
-
|
|
4
|
-
module.exports = function (config) {
|
|
5
|
-
config.set({
|
|
6
|
-
basePath: '',
|
|
7
|
-
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
-
plugins: [
|
|
9
|
-
require('karma-jasmine'),
|
|
10
|
-
require('karma-chrome-launcher'),
|
|
11
|
-
require('karma-jasmine-html-reporter'),
|
|
12
|
-
require('karma-coverage'),
|
|
13
|
-
require('@angular-devkit/build-angular/plugins/karma')
|
|
14
|
-
],
|
|
15
|
-
client: {
|
|
16
|
-
jasmine: {
|
|
17
|
-
// you can add configuration options for Jasmine here
|
|
18
|
-
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
|
19
|
-
// for example, you can disable the random execution with `random: false`
|
|
20
|
-
// or set a specific seed with `seed: 4321`
|
|
21
|
-
},
|
|
22
|
-
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
23
|
-
},
|
|
24
|
-
jasmineHtmlReporter: {
|
|
25
|
-
suppressAll: true // removes the duplicated traces
|
|
26
|
-
},
|
|
27
|
-
coverageReporter: {
|
|
28
|
-
dir: require('path').join(__dirname, './coverage'),
|
|
29
|
-
subdir: '.',
|
|
30
|
-
reporters: [
|
|
31
|
-
{ type: 'html' },
|
|
32
|
-
{ type: 'text-summary' },
|
|
33
|
-
{ type: 'lcovonly' }
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
reporters: ['progress', 'kjhtml'],
|
|
37
|
-
browsers: ['ChromeHeadless'],
|
|
38
|
-
restartOnFileChange: true,
|
|
39
|
-
singleRun: true
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
|
package/ng-package.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "node_modules/ng-packagr/ng-package.json",
|
|
3
|
-
"dest": "./dist",
|
|
4
|
-
"lib": {
|
|
5
|
-
"entryFile": "src/index.ts"
|
|
6
|
-
},
|
|
7
|
-
"allowedNonPeerDependencies": [
|
|
8
|
-
"@hashgraph/proto",
|
|
9
|
-
"@hashgraph/sdk",
|
|
10
|
-
"@walletconnect/modal",
|
|
11
|
-
"@walletconnect/sign-client",
|
|
12
|
-
"@walletconnect/types",
|
|
13
|
-
"qrcode",
|
|
14
|
-
"qr-scanner",
|
|
15
|
-
"@hsuite/native-connect-sdk",
|
|
16
|
-
"@hsuite/native-connect-types",
|
|
17
|
-
"@hsuite/native-connect-ui",
|
|
18
|
-
"xrpl"
|
|
19
|
-
]
|
|
20
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,203 +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 Public API surface of @hsuite/native-connect-angular package.
|
|
13
|
-
*
|
|
14
|
-
* @module @hsuite/native-connect-angular
|
|
15
|
-
*
|
|
16
|
-
* @description
|
|
17
|
-
* Angular integration SDK for HSuite Wallet. This package provides a complete
|
|
18
|
-
* solution for integrating wallet connectivity into Angular applications, supporting
|
|
19
|
-
* multiple blockchain protocols including Hedera and XRPL.
|
|
20
|
-
*
|
|
21
|
-
* **Key Features:**
|
|
22
|
-
* - Multi-protocol wallet support (HSuite Native, WalletConnect v2, P2P Native)
|
|
23
|
-
* - Reactive Angular signals for state management
|
|
24
|
-
* - Pre-built UI components for common wallet interactions
|
|
25
|
-
* - Transaction builders for Hedera and XRPL
|
|
26
|
-
* - Structural directives for declarative wallet state access
|
|
27
|
-
* - Event bus for wallet lifecycle events
|
|
28
|
-
*
|
|
29
|
-
* **Architecture:**
|
|
30
|
-
* ```
|
|
31
|
-
* ┌─────────────────────────────────────────────────────────────┐
|
|
32
|
-
* │ UnifiedWalletService │
|
|
33
|
-
* │ (Central orchestrator for multi-protocol wallet access) │
|
|
34
|
-
* └────────────────────────────┬────────────────────────────────┘
|
|
35
|
-
* │
|
|
36
|
-
* ┌──────────────────┬┴────────────────────┐
|
|
37
|
-
* │ │ │
|
|
38
|
-
* HsuiteNativeProvider WalletConnectV2Provider P2PNativeProvider
|
|
39
|
-
* │ │ │
|
|
40
|
-
* └──────────────────┴──────────────────────┘
|
|
41
|
-
* │
|
|
42
|
-
* BaseWalletProvider
|
|
43
|
-
* (common interface)
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* @Component({
|
|
47
|
-
* standalone: true,
|
|
48
|
-
* imports: [WalletConnectButtonComponent],
|
|
49
|
-
* template: `
|
|
50
|
-
* <wallet-connect-button
|
|
51
|
-
* [walletConnectProjectId]="'your-project-id'"
|
|
52
|
-
* (connected)="onConnect($event)">
|
|
53
|
-
* </wallet-connect-button>
|
|
54
|
-
* `
|
|
55
|
-
* })
|
|
56
|
-
* export class MyComponent {
|
|
57
|
-
* wallet = inject(UnifiedWalletService);
|
|
58
|
-
*
|
|
59
|
-
* onConnect(event: any) {
|
|
60
|
-
* console.log('Connected:', this.wallet.activeAccount());
|
|
61
|
-
* }
|
|
62
|
-
* }
|
|
63
|
-
* ```
|
|
64
|
-
*
|
|
65
|
-
* @NgModule({
|
|
66
|
-
* imports: [HsuiteWalletModule],
|
|
67
|
-
* })
|
|
68
|
-
* export class AppModule {}
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
|
|
72
|
-
// NgModule (for module-based apps)
|
|
73
|
-
export { HsuiteWalletModule } from './lib/hsuite-wallet.module';
|
|
74
|
-
|
|
75
|
-
// Services
|
|
76
|
-
export * from './lib/services/unified-wallet.service';
|
|
77
|
-
export { WalletEventBus } from './lib/services/wallet-event-bus.service';
|
|
78
|
-
export { WalletContextService } from './lib/services/wallet-context.service';
|
|
79
|
-
export { TransactionService } from './lib/services/transaction.service';
|
|
80
|
-
export { LoggerService } from './lib/services/logger.service';
|
|
81
|
-
|
|
82
|
-
// Transaction Builders (for dApps to construct transactions)
|
|
83
|
-
export {
|
|
84
|
-
HederaTransactionBuilderService,
|
|
85
|
-
XrplTransactionBuilderService,
|
|
86
|
-
scaleHederaAmountToBaseUnits,
|
|
87
|
-
} from './lib/services/transaction-builders';
|
|
88
|
-
|
|
89
|
-
// Transaction builder types (for dApps)
|
|
90
|
-
export type {
|
|
91
|
-
BatchInnerTransactionType,
|
|
92
|
-
BatchInnerTransaction,
|
|
93
|
-
HederaKeyConfig,
|
|
94
|
-
TopicCreateOptions,
|
|
95
|
-
TokenCreateOptions,
|
|
96
|
-
AccountCreateOptions,
|
|
97
|
-
} from './lib/services/transaction-builders';
|
|
98
|
-
|
|
99
|
-
// Transports
|
|
100
|
-
export {
|
|
101
|
-
ChromeExtensionTransport,
|
|
102
|
-
isExtensionInstalled,
|
|
103
|
-
getExtensionVersion,
|
|
104
|
-
} from './lib/transports/chrome-extension-transport';
|
|
105
|
-
export type { ChromeExtensionTransportOptions } from './lib/transports/chrome-extension-transport';
|
|
106
|
-
|
|
107
|
-
// UI Components
|
|
108
|
-
export * from './lib/components/wallet-connect-button/wallet-connect-button.component';
|
|
109
|
-
export * from './lib/components/wallet-session-display/wallet-session-display.component';
|
|
110
|
-
export * from './lib/components/wallet-transaction-status/wallet-transaction-status.component';
|
|
111
|
-
export * from './lib/components/account-selector/account-selector.component';
|
|
112
|
-
export {
|
|
113
|
-
AccountListComponent,
|
|
114
|
-
AccountItem,
|
|
115
|
-
LedgerGroup,
|
|
116
|
-
} from './lib/components/account-selector/account-list/account-list.component';
|
|
117
|
-
export {
|
|
118
|
-
AccountFilterComponent,
|
|
119
|
-
CompactHeaderFormat,
|
|
120
|
-
CompactHeaderSize,
|
|
121
|
-
ActiveAccountData,
|
|
122
|
-
} from './lib/components/account-selector/account-filter/account-filter.component';
|
|
123
|
-
export { AccountActionsComponent } from './lib/components/account-selector/account-actions/account-actions.component';
|
|
124
|
-
export {
|
|
125
|
-
AccountSelectorService,
|
|
126
|
-
SelectedAccountData,
|
|
127
|
-
} from './lib/components/account-selector/account-selector.service';
|
|
128
|
-
export { AccountFormattingService } from './lib/components/account-selector/account-formatting.service';
|
|
129
|
-
export {
|
|
130
|
-
AccountGroupingService,
|
|
131
|
-
AccountGroupingMode,
|
|
132
|
-
NetworkGroup,
|
|
133
|
-
ProtocolGroup,
|
|
134
|
-
} from './lib/components/account-selector/account-grouping.service';
|
|
135
|
-
export { WalletConnectionModalComponent } from './lib/components/wallet-connection-modal/wallet-connection-modal.component';
|
|
136
|
-
export { WalletAccountDisplayComponent } from './lib/components/wallet-account-display/wallet-account-display.component';
|
|
137
|
-
export { WalletConnectPromptComponent } from './lib/components/wallet-connect-prompt/wallet-connect-prompt.component';
|
|
138
|
-
export { WalletConnectedGuardComponent } from './lib/components/wallet-connected-guard/wallet-connected-guard.component';
|
|
139
|
-
|
|
140
|
-
// Directives
|
|
141
|
-
export { WalletContextDirective } from './lib/directives/wallet-context.directive';
|
|
142
|
-
export { WalletConnectedDirective } from './lib/directives/wallet-connected.directive';
|
|
143
|
-
export { WalletEventsDirective } from './lib/directives/wallet-events.directive';
|
|
144
|
-
|
|
145
|
-
// Multi-Protocol Support - Models
|
|
146
|
-
export * from './lib/models/provider-types';
|
|
147
|
-
export * from './lib/models/unified-account.model';
|
|
148
|
-
export * from './lib/models/wallet-events.model';
|
|
149
|
-
export * from './lib/models/wallet-context.model';
|
|
150
|
-
export type { ConnectionConfig } from './lib/models/connection-config.model';
|
|
151
|
-
export {
|
|
152
|
-
isHsuiteNativeConfig,
|
|
153
|
-
isWalletConnectV2Config,
|
|
154
|
-
} from './lib/models/connection-config.model';
|
|
155
|
-
|
|
156
|
-
// Multi-Protocol Support - Providers
|
|
157
|
-
export * from './lib/providers/base-wallet-provider';
|
|
158
|
-
export * from './lib/providers/hsuite-native-provider';
|
|
159
|
-
export * from './lib/providers/walletconnect';
|
|
160
|
-
export { WalletConnectV2Provider } from './lib/providers/walletconnect/core/walletconnect-provider';
|
|
161
|
-
export {
|
|
162
|
-
provideWalletErrorHandler,
|
|
163
|
-
WalletErrorHandler,
|
|
164
|
-
} from './lib/providers/wallet-error-handler';
|
|
165
|
-
export type { WalletErrorHandlerConfig } from './lib/providers/wallet-error-handler';
|
|
166
|
-
|
|
167
|
-
// P2P Native Provider (for QR code pairing)
|
|
168
|
-
export * from './lib/providers/p2p-native';
|
|
169
|
-
|
|
170
|
-
// === Unified Channel Protocol (v2) ===
|
|
171
|
-
// New simplified protocol replacing the session/transport stack
|
|
172
|
-
export { ChannelClientService } from './lib/providers/hsuite-native/channel-client.service';
|
|
173
|
-
export type { ChannelConnectConfig } from './lib/providers/hsuite-native/channel-client.service';
|
|
174
|
-
|
|
175
|
-
// Re-export channel types from native-wallet-sdk for convenience
|
|
176
|
-
export type {
|
|
177
|
-
ChannelInvite,
|
|
178
|
-
ChannelMessage,
|
|
179
|
-
ChannelState,
|
|
180
|
-
ChannelType,
|
|
181
|
-
ChannelAccount,
|
|
182
|
-
TransportState,
|
|
183
|
-
MessageType,
|
|
184
|
-
} from '@hsuite/native-connect-sdk';
|
|
185
|
-
|
|
186
|
-
// Re-export types from native-wallet-sdk for convenience
|
|
187
|
-
export type {
|
|
188
|
-
RpcRequest,
|
|
189
|
-
RpcResponse,
|
|
190
|
-
RpcEnvelope,
|
|
191
|
-
SessionApproval,
|
|
192
|
-
} from '@hsuite/native-connect-types';
|
|
193
|
-
|
|
194
|
-
// Utilities
|
|
195
|
-
export {
|
|
196
|
-
getLedgerIcon,
|
|
197
|
-
getLedgerColor,
|
|
198
|
-
getLedgerName,
|
|
199
|
-
getTokenIcon,
|
|
200
|
-
DEFAULT_LEDGER_ICONS,
|
|
201
|
-
LEDGER_COLORS,
|
|
202
|
-
LEDGER_NAMES,
|
|
203
|
-
} from './lib/utils';
|