@hsuite/native-connect-angular 2.1.1 → 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/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 -54
- 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 -679
- 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 -2518
- 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 -583
- 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 -2674
- 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 -2173
- 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 -2566
- 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/hsuite-auth.interceptor.ts.html +0 -568
- package/coverage/lcov-report/lib/services/index.html +0 -221
- package/coverage/lcov-report/lib/services/logger.service.ts.html +0 -463
- package/coverage/lcov-report/lib/services/smart-session.service.ts.html +0 -1264
- package/coverage/lcov-report/lib/services/transaction-builders/active-account-source.ts.html +0 -250
- 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 -176
- 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 -131
- package/coverage/lcov-report/lib/utils/ledger-icons.util.ts.html +0 -412
- package/coverage/lcov-report/lib/utils/ledger-ui-registry.ts.html +0 -676
- 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 -20366
- 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 -679
- 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 -2518
- 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 -583
- package/coverage/lib/providers/base-wallet-provider.ts.html +0 -1138
- package/coverage/lib/providers/hsuite-native/channel-client.service.ts.html +0 -2674
- 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 -2173
- 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 -2566
- 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/hsuite-auth.interceptor.ts.html +0 -568
- package/coverage/lib/services/index.html +0 -221
- package/coverage/lib/services/logger.service.ts.html +0 -463
- package/coverage/lib/services/smart-session.service.ts.html +0 -1264
- package/coverage/lib/services/transaction-builders/active-account-source.ts.html +0 -250
- 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 -176
- 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 -131
- package/coverage/lib/utils/ledger-icons.util.ts.html +0 -412
- package/coverage/lib/utils/ledger-ui-registry.ts.html +0 -676
- 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 -229
- 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 -198
- 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 -811
- 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 -166
- package/src/lib/models/unified-account.model.ts +0 -79
- 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 -863
- 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 -696
- 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 -827
- 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/hsuite-auth.interceptor.ts +0 -159
- package/src/lib/services/logger.service.ts +0 -126
- package/src/lib/services/smart-session.service.ts +0 -378
- package/src/lib/services/transaction-builders/active-account-source.spec.ts +0 -75
- package/src/lib/services/transaction-builders/active-account-source.ts +0 -55
- 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 -55
- 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 -349
- 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 -15
- package/src/lib/utils/ledger-icons.util.ts +0 -109
- package/src/lib/utils/ledger-ui-registry.ts +0 -197
- 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
package/LICENSE
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# PolyForm Noncommercial License 1.0.0
|
|
2
|
+
|
|
3
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
4
|
+
|
|
5
|
+
## Acceptance
|
|
6
|
+
|
|
7
|
+
In order to get any license under these terms, you must agree
|
|
8
|
+
to them as both strict obligations and conditions to all
|
|
9
|
+
your licenses.
|
|
10
|
+
|
|
11
|
+
## Copyright License
|
|
12
|
+
|
|
13
|
+
The licensor grants you a copyright license for the
|
|
14
|
+
software to do everything you might do with the software
|
|
15
|
+
that would otherwise infringe the licensor's copyright
|
|
16
|
+
in it for any permitted purpose. However, you may
|
|
17
|
+
only distribute the software according to [Distribution
|
|
18
|
+
License](#distribution-license) and make changes or new works
|
|
19
|
+
based on the software according to [Changes and New Works
|
|
20
|
+
License](#changes-and-new-works-license).
|
|
21
|
+
|
|
22
|
+
## Distribution License
|
|
23
|
+
|
|
24
|
+
The licensor grants you an additional copyright license
|
|
25
|
+
to distribute copies of the software. Your license
|
|
26
|
+
to distribute covers distributing the software with
|
|
27
|
+
changes and new works permitted by [Changes and New Works
|
|
28
|
+
License](#changes-and-new-works-license).
|
|
29
|
+
|
|
30
|
+
## Notices
|
|
31
|
+
|
|
32
|
+
You must ensure that anyone who gets a copy of any part of
|
|
33
|
+
the software from you also gets a copy of these terms or the
|
|
34
|
+
URL for them above, as well as copies of any plain-text lines
|
|
35
|
+
beginning with `Required Notice:` that the licensor provided
|
|
36
|
+
with the software. For example:
|
|
37
|
+
|
|
38
|
+
> Required Notice: Copyright HSuite (https://hsuite.finance)
|
|
39
|
+
|
|
40
|
+
## Changes and New Works License
|
|
41
|
+
|
|
42
|
+
The licensor grants you an additional copyright license to
|
|
43
|
+
make changes and new works based on the software for any
|
|
44
|
+
permitted purpose.
|
|
45
|
+
|
|
46
|
+
## Patent License
|
|
47
|
+
|
|
48
|
+
The licensor grants you a patent license for the software that
|
|
49
|
+
covers patent claims the licensor can license, or becomes able
|
|
50
|
+
to license, that you would infringe by using the software.
|
|
51
|
+
|
|
52
|
+
## Noncommercial Purposes
|
|
53
|
+
|
|
54
|
+
Any noncommercial purpose is a permitted purpose.
|
|
55
|
+
|
|
56
|
+
## Personal Uses
|
|
57
|
+
|
|
58
|
+
Personal use for research, experiment, and testing for
|
|
59
|
+
the benefit of public knowledge, personal study, private
|
|
60
|
+
entertainment, hobby projects, amateur pursuits, or religious
|
|
61
|
+
observance, without any anticipated commercial application,
|
|
62
|
+
is use for a permitted purpose.
|
|
63
|
+
|
|
64
|
+
## Noncommercial Organizations
|
|
65
|
+
|
|
66
|
+
Use by any charitable organization, educational institution,
|
|
67
|
+
public research organization, public safety or health
|
|
68
|
+
organization, environmental protection organization,
|
|
69
|
+
or government institution is use for a permitted purpose
|
|
70
|
+
regardless of the source of funding or obligations resulting
|
|
71
|
+
from the funding.
|
|
72
|
+
|
|
73
|
+
## Fair Use
|
|
74
|
+
|
|
75
|
+
You may have "fair use" rights for the software under the
|
|
76
|
+
law. These terms do not limit them.
|
|
77
|
+
|
|
78
|
+
## No Other Rights
|
|
79
|
+
|
|
80
|
+
These terms do not allow you to sublicense or transfer any of
|
|
81
|
+
your licenses to anyone else, or prevent the licensor from
|
|
82
|
+
granting licenses to anyone else. These terms do not imply
|
|
83
|
+
any other licenses.
|
|
84
|
+
|
|
85
|
+
## Patent Defense
|
|
86
|
+
|
|
87
|
+
If you make any written claim that the software infringes or
|
|
88
|
+
contributes to infringement of any patent, your patent license
|
|
89
|
+
for the software granted under these terms ends immediately. If
|
|
90
|
+
your company makes such a claim, your patent license ends
|
|
91
|
+
immediately for work on behalf of your company.
|
|
92
|
+
|
|
93
|
+
## Violations
|
|
94
|
+
|
|
95
|
+
The first time you are notified in writing that you have
|
|
96
|
+
violated any of these terms, or done anything with the software
|
|
97
|
+
not covered by your licenses, your licenses can nonetheless
|
|
98
|
+
continue if you come into full compliance with these terms,
|
|
99
|
+
and take practical steps to correct past violations, within
|
|
100
|
+
32 days of receiving notice. Otherwise, all your licenses
|
|
101
|
+
end immediately.
|
|
102
|
+
|
|
103
|
+
## No Liability
|
|
104
|
+
|
|
105
|
+
***As far as the law allows, the software comes as is, without
|
|
106
|
+
any warranty or condition, and the licensor will not be liable
|
|
107
|
+
to you for any damages arising out of these terms or the use
|
|
108
|
+
or nature of the software, under any kind of legal claim.***
|
|
109
|
+
|
|
110
|
+
## Definitions
|
|
111
|
+
|
|
112
|
+
The **licensor** is the entity offering these terms, and the
|
|
113
|
+
**software** is the software the licensor makes available under
|
|
114
|
+
these terms.
|
|
115
|
+
|
|
116
|
+
**You** refers to the individual or entity agreeing to these
|
|
117
|
+
terms.
|
|
118
|
+
|
|
119
|
+
**Your company** is any legal entity, sole proprietorship,
|
|
120
|
+
or other kind of organization that you work for, plus all
|
|
121
|
+
organizations that have control over, are under the control of,
|
|
122
|
+
or are under common control with that organization. **Control**
|
|
123
|
+
means ownership of substantially all the assets of an entity,
|
|
124
|
+
or the power to direct its management and policies by vote,
|
|
125
|
+
contract, or otherwise. Control can be direct or indirect.
|
|
126
|
+
|
|
127
|
+
**Your licenses** are all the licenses granted to you for the
|
|
128
|
+
software under these terms.
|
|
129
|
+
|
|
130
|
+
**Use** means anything you do with the software requiring one
|
|
131
|
+
of your licenses.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
Required Notice: Copyright 2024-2025 HSuite (https://hsuite.finance)
|
|
136
|
+
|
|
137
|
+
## Commercial Licensing
|
|
138
|
+
|
|
139
|
+
For commercial use of HSuite Native Connect, please contact:
|
|
140
|
+
- Email: licensing@hsuite.finance
|
|
141
|
+
- Website: https://hsuite.finance/licensing
|
|
142
|
+
|
|
143
|
+
Commercial licenses are available for:
|
|
144
|
+
- Integration into commercial products
|
|
145
|
+
- Enterprise deployments
|
|
146
|
+
- Reselling or redistribution as part of commercial offerings
|
package/package.json
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hsuite/native-connect-angular",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
5
5
|
"description": "Angular integration SDK for HSuite Wallet - provides direct SDK integration without wrappers",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "dist/fesm2022/hsuite-native-connect-angular.mjs",
|
|
9
|
+
"module": "dist/fesm2022/hsuite-native-connect-angular.mjs",
|
|
10
|
+
"fesm2022": "dist/fesm2022/hsuite-native-connect-angular.mjs",
|
|
7
11
|
"types": "dist/index.d.ts",
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
12
|
+
"typings": "dist/index.d.ts",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
"./package.json": {
|
|
18
|
+
"default": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"default": "./dist/fesm2022/hsuite-native-connect-angular.mjs"
|
|
23
|
+
}
|
|
15
24
|
},
|
|
16
25
|
"peerDependencies": {
|
|
17
26
|
"@angular/common": "^20.0.0",
|
|
@@ -23,16 +32,16 @@
|
|
|
23
32
|
"dependencies": {
|
|
24
33
|
"@hashgraph/proto": "^2.25.0",
|
|
25
34
|
"@hashgraph/sdk": "^2.76.0",
|
|
26
|
-
"@hsuite/native-connect-sdk": "^2.1.1",
|
|
27
|
-
"@hsuite/native-connect-types": "^2.1.1",
|
|
28
|
-
"@hsuite/native-connect-ui": "^2.1.1",
|
|
29
35
|
"@walletconnect/modal": "^2.7.0",
|
|
30
36
|
"@walletconnect/sign-client": "^2.23.0",
|
|
31
37
|
"@walletconnect/types": "^2.23.0",
|
|
32
38
|
"qr-scanner": "^1.4.2",
|
|
33
39
|
"qrcode": "^1.5.4",
|
|
34
40
|
"tslib": "^2.6.0",
|
|
35
|
-
"xrpl": "^3.0.0"
|
|
41
|
+
"xrpl": "^3.0.0",
|
|
42
|
+
"@hsuite/native-connect-types": "2.1.0",
|
|
43
|
+
"@hsuite/native-connect-sdk": "2.1.0",
|
|
44
|
+
"@hsuite/native-connect-ui": "2.1.0"
|
|
36
45
|
},
|
|
37
46
|
"devDependencies": {
|
|
38
47
|
"@angular-devkit/build-angular": "^20.3.14",
|
|
@@ -56,5 +65,13 @@
|
|
|
56
65
|
},
|
|
57
66
|
"publishConfig": {
|
|
58
67
|
"access": "public"
|
|
68
|
+
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"build": "./node_modules/.bin/ng-packagr -p ng-package.json",
|
|
71
|
+
"clean": "rm -rf dist",
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"test:watch": "vitest --watch",
|
|
74
|
+
"test:coverage": "vitest run --coverage",
|
|
75
|
+
"docs": "compodoc -p tsconfig.json -c ../../compodoc.base.json -d dist/docs --name 'Angular SDK API' --includes docs"
|
|
59
76
|
}
|
|
60
|
-
}
|
|
77
|
+
}
|
package/USAGE_EXAMPLES.md
DELETED
|
@@ -1,476 +0,0 @@
|
|
|
1
|
-
# Angular SDK Usage Examples
|
|
2
|
-
|
|
3
|
-
This document provides complete, copy-paste ready examples for using the `@hsuite/native-connect-angular` in both module-based and standalone Angular/Ionic applications.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Table of Contents
|
|
8
|
-
|
|
9
|
-
- [Module-Based App Example](#module-based-app-example)
|
|
10
|
-
- [Standalone App Example](#standalone-app-example)
|
|
11
|
-
- [Common Usage Patterns](#common-usage-patterns)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Module-Based App Example
|
|
16
|
-
|
|
17
|
-
### Step 1: Install Package
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npm install @hsuite/native-connect-angular
|
|
21
|
-
# or
|
|
22
|
-
pnpm add @hsuite/native-connect-angular
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### Step 2: Import Module
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
// src/app/app.module.ts
|
|
29
|
-
import { NgModule } from '@angular/core';
|
|
30
|
-
import { BrowserModule } from '@angular/platform-browser';
|
|
31
|
-
import { RouteReuseStrategy } from '@angular/router';
|
|
32
|
-
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
|
33
|
-
import { HsuiteWalletModule } from '@hsuite/native-connect-angular';
|
|
34
|
-
|
|
35
|
-
import { AppComponent } from './app.component';
|
|
36
|
-
import { AppRoutingModule } from './app-routing.module';
|
|
37
|
-
|
|
38
|
-
@NgModule({
|
|
39
|
-
declarations: [AppComponent],
|
|
40
|
-
imports: [
|
|
41
|
-
BrowserModule,
|
|
42
|
-
IonicModule.forRoot(),
|
|
43
|
-
AppRoutingModule,
|
|
44
|
-
HsuiteWalletModule, // ← Add this line
|
|
45
|
-
],
|
|
46
|
-
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
|
|
47
|
-
bootstrap: [AppComponent],
|
|
48
|
-
})
|
|
49
|
-
export class AppModule {}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Step 3: Use in Components
|
|
53
|
-
|
|
54
|
-
```typescript
|
|
55
|
-
// src/app/pages/home/home.page.ts
|
|
56
|
-
import { Component } from '@angular/core';
|
|
57
|
-
import { UnifiedWalletService } from '@hsuite/native-connect-angular';
|
|
58
|
-
|
|
59
|
-
@Component({
|
|
60
|
-
selector: 'app-home',
|
|
61
|
-
templateUrl: 'home.page.html',
|
|
62
|
-
styleUrls: ['home.page.scss'],
|
|
63
|
-
})
|
|
64
|
-
export class HomePage {
|
|
65
|
-
constructor(private wallet: UnifiedWalletService) {}
|
|
66
|
-
|
|
67
|
-
async connectWallet() {
|
|
68
|
-
await this.wallet.connect('walletconnect-v2', {
|
|
69
|
-
type: 'walletconnect-v2',
|
|
70
|
-
projectId: 'YOUR_WALLETCONNECT_PROJECT_ID',
|
|
71
|
-
ledgerId: 'hedera',
|
|
72
|
-
networkId: 'hedera:testnet',
|
|
73
|
-
appName: 'My dApp',
|
|
74
|
-
appDescription: 'My awesome dApp',
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
get activeAccount() {
|
|
79
|
-
return this.wallet.activeAccount();
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
get isConnected() {
|
|
83
|
-
return this.wallet.isAnyConnected();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
```html
|
|
89
|
-
<!-- src/app/pages/home/home.page.html -->
|
|
90
|
-
<ion-header>
|
|
91
|
-
<ion-toolbar>
|
|
92
|
-
<ion-title>My dApp</ion-title>
|
|
93
|
-
</ion-toolbar>
|
|
94
|
-
</ion-header>
|
|
95
|
-
|
|
96
|
-
<ion-content class="ion-padding">
|
|
97
|
-
<h1>Welcome to My dApp</h1>
|
|
98
|
-
|
|
99
|
-
<!-- Pre-built connection button -->
|
|
100
|
-
<wallet-connect-button
|
|
101
|
-
[walletConnectProjectId]="'YOUR_WALLETCONNECT_PROJECT_ID'"
|
|
102
|
-
[appName]="'My dApp'"
|
|
103
|
-
[showSessionInfo]="true"
|
|
104
|
-
(connected)="onConnected($event)"
|
|
105
|
-
>
|
|
106
|
-
</wallet-connect-button>
|
|
107
|
-
|
|
108
|
-
<!-- Conditional content based on connection -->
|
|
109
|
-
<div *ngIf="isConnected">
|
|
110
|
-
<h2>Connected!</h2>
|
|
111
|
-
|
|
112
|
-
<!-- Display session info -->
|
|
113
|
-
<wallet-session-display [showMetadata]="true" [showTimestamps]="true"> </wallet-session-display>
|
|
114
|
-
|
|
115
|
-
<!-- Account selector for multi-wallet -->
|
|
116
|
-
<wallet-account-selector
|
|
117
|
-
[selectedAddress]="activeAccount?.address"
|
|
118
|
-
(accountChanged)="onAccountChange($event)"
|
|
119
|
-
>
|
|
120
|
-
</wallet-account-selector>
|
|
121
|
-
|
|
122
|
-
<!-- Transaction status -->
|
|
123
|
-
<wallet-transaction-status
|
|
124
|
-
[status]="txStatus"
|
|
125
|
-
[transactionId]="txId"
|
|
126
|
-
[explorerUrl]="explorerUrl"
|
|
127
|
-
>
|
|
128
|
-
</wallet-transaction-status>
|
|
129
|
-
</div>
|
|
130
|
-
|
|
131
|
-
<div *ngIf="!isConnected">
|
|
132
|
-
<p>Please connect your wallet to continue</p>
|
|
133
|
-
</div>
|
|
134
|
-
</ion-content>
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
## Standalone App Example
|
|
140
|
-
|
|
141
|
-
### Step 1: Install Package
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
npm install @hsuite/native-connect-angular
|
|
145
|
-
# or
|
|
146
|
-
pnpm add @hsuite/native-connect-angular
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Step 2: Bootstrap App (if needed)
|
|
150
|
-
|
|
151
|
-
```typescript
|
|
152
|
-
// src/main.ts
|
|
153
|
-
import { bootstrapApplication } from '@angular/platform-browser';
|
|
154
|
-
import { RouteReuseStrategy, provideRouter } from '@angular/router';
|
|
155
|
-
import { IonicRouteStrategy, provideIonicAngular } from '@ionic/angular/standalone';
|
|
156
|
-
import { routes } from './app/app.routes';
|
|
157
|
-
import { AppComponent } from './app/app.component';
|
|
158
|
-
|
|
159
|
-
bootstrapApplication(AppComponent, {
|
|
160
|
-
providers: [
|
|
161
|
-
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
|
|
162
|
-
provideIonicAngular(),
|
|
163
|
-
provideRouter(routes),
|
|
164
|
-
],
|
|
165
|
-
});
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### Step 3: Use in Components
|
|
169
|
-
|
|
170
|
-
```typescript
|
|
171
|
-
// src/app/pages/home/home.page.ts
|
|
172
|
-
import { Component, inject } from '@angular/core';
|
|
173
|
-
import { IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/angular/standalone';
|
|
174
|
-
import { CommonModule } from '@angular/common';
|
|
175
|
-
import {
|
|
176
|
-
WalletConnectButtonComponent,
|
|
177
|
-
WalletSessionDisplayComponent,
|
|
178
|
-
WalletAccountSelectorComponent,
|
|
179
|
-
WalletTransactionStatusComponent,
|
|
180
|
-
UnifiedWalletService,
|
|
181
|
-
} from '@hsuite/native-connect-angular';
|
|
182
|
-
|
|
183
|
-
@Component({
|
|
184
|
-
selector: 'app-home',
|
|
185
|
-
templateUrl: 'home.page.html',
|
|
186
|
-
styleUrls: ['home.page.scss'],
|
|
187
|
-
standalone: true,
|
|
188
|
-
imports: [
|
|
189
|
-
CommonModule,
|
|
190
|
-
IonHeader,
|
|
191
|
-
IonToolbar,
|
|
192
|
-
IonTitle,
|
|
193
|
-
IonContent,
|
|
194
|
-
// Import SDK components you need
|
|
195
|
-
WalletConnectButtonComponent,
|
|
196
|
-
WalletSessionDisplayComponent,
|
|
197
|
-
WalletAccountSelectorComponent,
|
|
198
|
-
WalletTransactionStatusComponent,
|
|
199
|
-
],
|
|
200
|
-
})
|
|
201
|
-
export class HomePage {
|
|
202
|
-
// Inject services
|
|
203
|
-
private wallet = inject(UnifiedWalletService);
|
|
204
|
-
|
|
205
|
-
// Reactive state (signals)
|
|
206
|
-
activeAccount = this.wallet.activeAccount;
|
|
207
|
-
isConnected = this.wallet.isAnyConnected;
|
|
208
|
-
|
|
209
|
-
async connectWallet() {
|
|
210
|
-
await this.wallet.connect('walletconnect-v2', {
|
|
211
|
-
type: 'walletconnect-v2',
|
|
212
|
-
projectId: 'YOUR_WALLETCONNECT_PROJECT_ID',
|
|
213
|
-
ledgerId: 'hedera',
|
|
214
|
-
networkId: 'hedera:testnet',
|
|
215
|
-
appName: 'My dApp',
|
|
216
|
-
appDescription: 'My awesome dApp',
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
onConnected(event: any) {
|
|
221
|
-
console.log('Wallet connected:', event);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
onAccountChange(account: any) {
|
|
225
|
-
console.log('Account changed:', account);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
```html
|
|
231
|
-
<!-- src/app/pages/home/home.page.html -->
|
|
232
|
-
<ion-header>
|
|
233
|
-
<ion-toolbar>
|
|
234
|
-
<ion-title>My dApp</ion-title>
|
|
235
|
-
</ion-toolbar>
|
|
236
|
-
</ion-header>
|
|
237
|
-
|
|
238
|
-
<ion-content class="ion-padding">
|
|
239
|
-
<h1>Welcome to My dApp</h1>
|
|
240
|
-
|
|
241
|
-
<!-- Pre-built connection button -->
|
|
242
|
-
<wallet-connect-button
|
|
243
|
-
[walletConnectProjectId]="'YOUR_WALLETCONNECT_PROJECT_ID'"
|
|
244
|
-
[appName]="'My dApp'"
|
|
245
|
-
[showSessionInfo]="true"
|
|
246
|
-
(connected)="onConnected($event)"
|
|
247
|
-
>
|
|
248
|
-
</wallet-connect-button>
|
|
249
|
-
|
|
250
|
-
<!-- Conditional content based on connection (using signals) -->
|
|
251
|
-
@if (isConnected()) {
|
|
252
|
-
<h2>Connected!</h2>
|
|
253
|
-
|
|
254
|
-
<!-- Display session info -->
|
|
255
|
-
<wallet-session-display [showMetadata]="true" [showTimestamps]="true"> </wallet-session-display>
|
|
256
|
-
|
|
257
|
-
<!-- Account selector for multi-wallet -->
|
|
258
|
-
<wallet-account-selector
|
|
259
|
-
[selectedAddress]="activeAccount()?.address"
|
|
260
|
-
(accountChanged)="onAccountChange($event)"
|
|
261
|
-
>
|
|
262
|
-
</wallet-account-selector>
|
|
263
|
-
} @else {
|
|
264
|
-
<p>Please connect your wallet to continue</p>
|
|
265
|
-
}
|
|
266
|
-
</ion-content>
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
---
|
|
270
|
-
|
|
271
|
-
## Common Usage Patterns
|
|
272
|
-
|
|
273
|
-
### Pattern 1: Using Directives
|
|
274
|
-
|
|
275
|
-
Both module-based and standalone apps can use SDK directives.
|
|
276
|
-
|
|
277
|
-
**Module-based:**
|
|
278
|
-
|
|
279
|
-
```html
|
|
280
|
-
<!-- Directives available automatically -->
|
|
281
|
-
<div *walletConnected; else notConnected>
|
|
282
|
-
<p>You are connected!</p>
|
|
283
|
-
</div>
|
|
284
|
-
<ng-template #notConnected>
|
|
285
|
-
<p>Please connect your wallet</p>
|
|
286
|
-
</ng-template>
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
**Standalone:**
|
|
290
|
-
|
|
291
|
-
```typescript
|
|
292
|
-
import { WalletConnectedDirective } from '@hsuite/native-connect-angular';
|
|
293
|
-
|
|
294
|
-
@Component({
|
|
295
|
-
imports: [WalletConnectedDirective],
|
|
296
|
-
// ...
|
|
297
|
-
})
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
```html
|
|
301
|
-
<div *walletConnected; else notConnected>
|
|
302
|
-
<p>You are connected!</p>
|
|
303
|
-
</div>
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
### Pattern 2: Event Subscriptions
|
|
307
|
-
|
|
308
|
-
```typescript
|
|
309
|
-
import { Component, OnInit, inject } from '@angular/core';
|
|
310
|
-
import { WalletEventBus } from '@hsuite/native-connect-angular';
|
|
311
|
-
|
|
312
|
-
export class MyComponent implements OnInit {
|
|
313
|
-
private eventBus = inject(WalletEventBus);
|
|
314
|
-
|
|
315
|
-
ngOnInit() {
|
|
316
|
-
// Subscribe to wallet events
|
|
317
|
-
this.eventBus.on('account:changed', (account) => {
|
|
318
|
-
console.log('Account changed:', account);
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
this.eventBus.on('connection:closed', (providerId) => {
|
|
322
|
-
console.log('Disconnected:', providerId);
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
### Pattern 3: Manual Connection (without button)
|
|
329
|
-
|
|
330
|
-
```typescript
|
|
331
|
-
import { Component, inject } from '@angular/core';
|
|
332
|
-
import { UnifiedWalletService } from '@hsuite/native-connect-angular';
|
|
333
|
-
|
|
334
|
-
export class MyComponent {
|
|
335
|
-
private wallet = inject(UnifiedWalletService);
|
|
336
|
-
|
|
337
|
-
async connectHsuiteNative() {
|
|
338
|
-
await this.wallet.connect('hsuite-native', {
|
|
339
|
-
type: 'hsuite-native',
|
|
340
|
-
appId: 'my-dapp',
|
|
341
|
-
appName: 'My dApp',
|
|
342
|
-
ledgerId: 'hedera',
|
|
343
|
-
networkId: 'hedera:testnet',
|
|
344
|
-
walletUrl: 'http://localhost:8100',
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
async connectWalletConnect() {
|
|
349
|
-
await this.wallet.connect('walletconnect-v2', {
|
|
350
|
-
type: 'walletconnect-v2',
|
|
351
|
-
projectId: 'YOUR_PROJECT_ID',
|
|
352
|
-
ledgerId: 'hedera',
|
|
353
|
-
networkId: 'hedera:testnet',
|
|
354
|
-
appName: 'My dApp',
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
async disconnect() {
|
|
359
|
-
await this.wallet.disconnectAll();
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
### Pattern 4: Transaction Signing
|
|
365
|
-
|
|
366
|
-
```typescript
|
|
367
|
-
import { Component, inject } from '@angular/core';
|
|
368
|
-
import { UnifiedWalletService } from '@hsuite/native-connect-angular';
|
|
369
|
-
|
|
370
|
-
export class MyComponent {
|
|
371
|
-
private wallet = inject(UnifiedWalletService);
|
|
372
|
-
|
|
373
|
-
async signTransaction() {
|
|
374
|
-
const result = await this.wallet.signTransaction({
|
|
375
|
-
ledgerId: 'hedera',
|
|
376
|
-
networkId: 'hedera:testnet',
|
|
377
|
-
accountAddress: this.wallet.activeAccount()?.address || '',
|
|
378
|
-
payload: 'base64EncodedTransaction',
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
console.log('Signed transaction:', result);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
async submitTransaction() {
|
|
385
|
-
const result = await this.wallet.submitTransaction({
|
|
386
|
-
ledgerId: 'hedera',
|
|
387
|
-
networkId: 'hedera:testnet',
|
|
388
|
-
accountAddress: this.wallet.activeAccount()?.address || '',
|
|
389
|
-
payload: 'base64EncodedTransaction',
|
|
390
|
-
});
|
|
391
|
-
|
|
392
|
-
console.log('Transaction ID:', result.transactionId);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
```
|
|
396
|
-
|
|
397
|
-
### Pattern 5: Using Wallet Context
|
|
398
|
-
|
|
399
|
-
```typescript
|
|
400
|
-
import { Component, inject } from '@angular/core';
|
|
401
|
-
import { WalletContextService } from '@hsuite/native-connect-angular';
|
|
402
|
-
|
|
403
|
-
export class MyComponent {
|
|
404
|
-
private context = inject(WalletContextService);
|
|
405
|
-
|
|
406
|
-
// Computed values
|
|
407
|
-
isConnected = this.context.isConnected;
|
|
408
|
-
hasAccounts = this.context.hasAccounts;
|
|
409
|
-
allAccounts = this.context.context().allAccounts;
|
|
410
|
-
}
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
```html
|
|
414
|
-
<ng-container *walletContext="let ctx">
|
|
415
|
-
<p>Connected: {{ ctx.isConnected }}</p>
|
|
416
|
-
<p>Active Account: {{ ctx.activeAccount?.address }}</p>
|
|
417
|
-
<p>Total Accounts: {{ ctx.allAccounts.length }}</p>
|
|
418
|
-
</ng-container>
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
---
|
|
422
|
-
|
|
423
|
-
## Quick Decision Guide
|
|
424
|
-
|
|
425
|
-
**Use Module-Based Approach if:**
|
|
426
|
-
|
|
427
|
-
- ✅ You have an existing Angular/Ionic app using NgModules
|
|
428
|
-
- ✅ You want simple one-time setup
|
|
429
|
-
- ✅ Your team is familiar with traditional Angular modules
|
|
430
|
-
|
|
431
|
-
**Use Standalone Approach if:**
|
|
432
|
-
|
|
433
|
-
- ✅ You're starting a new Angular 14+ project
|
|
434
|
-
- ✅ You want smaller bundle sizes (tree-shaking)
|
|
435
|
-
- ✅ You prefer explicit imports
|
|
436
|
-
|
|
437
|
-
**Both approaches have:**
|
|
438
|
-
|
|
439
|
-
- ✅ Same components, directives, and services
|
|
440
|
-
- ✅ Same API and functionality
|
|
441
|
-
- ✅ Full TypeScript support
|
|
442
|
-
- ✅ Comprehensive documentation
|
|
443
|
-
|
|
444
|
-
---
|
|
445
|
-
|
|
446
|
-
## Get WalletConnect Project ID
|
|
447
|
-
|
|
448
|
-
To use WalletConnect, you need a project ID:
|
|
449
|
-
|
|
450
|
-
1. Go to [https://cloud.walletconnect.com](https://cloud.walletconnect.com)
|
|
451
|
-
2. Create a free account
|
|
452
|
-
3. Create a new project
|
|
453
|
-
4. Copy your Project ID
|
|
454
|
-
5. Use it in your app:
|
|
455
|
-
|
|
456
|
-
```typescript
|
|
457
|
-
await this.wallet.connect('walletconnect-v2', {
|
|
458
|
-
projectId: 'YOUR_PROJECT_ID_HERE', // ← Paste here
|
|
459
|
-
// ...
|
|
460
|
-
});
|
|
461
|
-
```
|
|
462
|
-
|
|
463
|
-
---
|
|
464
|
-
|
|
465
|
-
## Need Help?
|
|
466
|
-
|
|
467
|
-
- 📚 [Full Documentation](../../docs/packages/angular-sdk.md)
|
|
468
|
-
- 🚀 [Quick Start Guide](../../docs/getting-started/quick-start.md)
|
|
469
|
-
- 🔍 [API Reference](../../docs/angular-sdk/api/)
|
|
470
|
-
- 💬 [GitHub Issues](https://github.com/hsuite-wallet/hsuite-native-connect/issues)
|
|
471
|
-
|
|
472
|
-
---
|
|
473
|
-
|
|
474
|
-
**Last Updated:** November 17, 2025
|
|
475
|
-
**SDK Version:** 0.0.1
|
|
476
|
-
**Status:** ✅ Production Ready
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100">
|
|
2
|
-
<circle cx="50" cy="50" r="45" fill="#6B7280"/>
|
|
3
|
-
<rect x="25" y="30" width="50" height="40" rx="4" fill="white" stroke="#4B5563" stroke-width="2"/>
|
|
4
|
-
<circle cx="50" cy="70" r="3" fill="#4B5563"/>
|
|
5
|
-
<text x="50" y="58" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#4B5563" text-anchor="middle">EXT</text>
|
|
6
|
-
</svg>
|
|
7
|
-
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100">
|
|
2
|
-
<circle cx="50" cy="50" r="45" fill="#2D3B52"/>
|
|
3
|
-
<path d="M30 40 L50 25 L70 40 L70 60 L50 75 L30 60 Z" fill="#00D4AA" stroke="white" stroke-width="2"/>
|
|
4
|
-
<text x="50" y="63" font-family="Arial, sans-serif" font-size="24" font-weight="bold" fill="white" text-anchor="middle">HP</text>
|
|
5
|
-
</svg>
|
|
6
|
-
|