@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.
Files changed (287) hide show
  1. package/LICENSE +146 -0
  2. package/package.json +30 -13
  3. package/USAGE_EXAMPLES.md +0 -476
  4. package/assets/wallets/extension.svg +0 -7
  5. package/assets/wallets/hashpack.svg +0 -6
  6. package/assets/wallets/hsuite.svg +0 -11
  7. package/assets/wallets/kabila.svg +0 -11
  8. package/assets/wallets/walletconnect.svg +0 -13
  9. package/coverage/base.css +0 -224
  10. package/coverage/block-navigation.js +0 -87
  11. package/coverage/coverage-summary.json +0 -54
  12. package/coverage/favicon.png +0 -0
  13. package/coverage/index.html +0 -476
  14. package/coverage/lcov-report/base.css +0 -224
  15. package/coverage/lcov-report/block-navigation.js +0 -87
  16. package/coverage/lcov-report/favicon.png +0 -0
  17. package/coverage/lcov-report/index.html +0 -476
  18. package/coverage/lcov-report/lib/components/account-selector/account-actions/account-actions.component.ts.html +0 -868
  19. package/coverage/lcov-report/lib/components/account-selector/account-actions/index.html +0 -116
  20. package/coverage/lcov-report/lib/components/account-selector/account-filter/account-filter.component.ts.html +0 -1288
  21. package/coverage/lcov-report/lib/components/account-selector/account-filter/index.html +0 -116
  22. package/coverage/lcov-report/lib/components/account-selector/account-formatting.service.ts.html +0 -679
  23. package/coverage/lcov-report/lib/components/account-selector/account-grouping.service.ts.html +0 -766
  24. package/coverage/lcov-report/lib/components/account-selector/account-list/account-list.component.ts.html +0 -1495
  25. package/coverage/lcov-report/lib/components/account-selector/account-list/index.html +0 -116
  26. package/coverage/lcov-report/lib/components/account-selector/account-selector.component.ts.html +0 -1495
  27. package/coverage/lcov-report/lib/components/account-selector/account-selector.service.ts.html +0 -1588
  28. package/coverage/lcov-report/lib/components/account-selector/index.html +0 -161
  29. package/coverage/lcov-report/lib/components/wallet-account-display/index.html +0 -116
  30. package/coverage/lcov-report/lib/components/wallet-account-display/wallet-account-display.component.ts.html +0 -505
  31. package/coverage/lcov-report/lib/components/wallet-connect-button/index.html +0 -116
  32. package/coverage/lcov-report/lib/components/wallet-connect-button/wallet-connect-button.component.ts.html +0 -829
  33. package/coverage/lcov-report/lib/components/wallet-connect-prompt/index.html +0 -116
  34. package/coverage/lcov-report/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts.html +0 -409
  35. package/coverage/lcov-report/lib/components/wallet-connected-guard/index.html +0 -116
  36. package/coverage/lcov-report/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts.html +0 -304
  37. package/coverage/lcov-report/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts.html +0 -436
  38. package/coverage/lcov-report/lib/components/wallet-connection-modal/connection-method-step/index.html +0 -116
  39. package/coverage/lcov-report/lib/components/wallet-connection-modal/index.html +0 -116
  40. package/coverage/lcov-report/lib/components/wallet-connection-modal/qr-pairing-step/index.html +0 -116
  41. package/coverage/lcov-report/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts.html +0 -2287
  42. package/coverage/lcov-report/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts.html +0 -2518
  43. package/coverage/lcov-report/lib/components/wallet-session-display/index.html +0 -116
  44. package/coverage/lcov-report/lib/components/wallet-session-display/wallet-session-display.component.ts.html +0 -676
  45. package/coverage/lcov-report/lib/components/wallet-transaction-status/index.html +0 -116
  46. package/coverage/lcov-report/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts.html +0 -703
  47. package/coverage/lcov-report/lib/directives/index.html +0 -146
  48. package/coverage/lcov-report/lib/directives/wallet-connected.directive.ts.html +0 -670
  49. package/coverage/lcov-report/lib/directives/wallet-context.directive.ts.html +0 -547
  50. package/coverage/lcov-report/lib/directives/wallet-events.directive.ts.html +0 -781
  51. package/coverage/lcov-report/lib/hsuite-wallet.module.ts.html +0 -715
  52. package/coverage/lcov-report/lib/index.html +0 -116
  53. package/coverage/lcov-report/lib/models/connection-config.model.ts.html +0 -280
  54. package/coverage/lcov-report/lib/models/index.html +0 -131
  55. package/coverage/lcov-report/lib/models/provider-types.ts.html +0 -583
  56. package/coverage/lcov-report/lib/providers/base-wallet-provider.ts.html +0 -1138
  57. package/coverage/lcov-report/lib/providers/hsuite-native/channel-client.service.ts.html +0 -2674
  58. package/coverage/lcov-report/lib/providers/hsuite-native/index.html +0 -116
  59. package/coverage/lcov-report/lib/providers/hsuite-native-provider.ts.html +0 -2347
  60. package/coverage/lcov-report/lib/providers/index.html +0 -146
  61. package/coverage/lcov-report/lib/providers/p2p-native/index.html +0 -131
  62. package/coverage/lcov-report/lib/providers/p2p-native/p2p-native.provider.ts.html +0 -2254
  63. package/coverage/lcov-report/lib/providers/p2p-native/p2p-session-manager.ts.html +0 -2173
  64. package/coverage/lcov-report/lib/providers/wallet-error-handler.ts.html +0 -1132
  65. package/coverage/lcov-report/lib/providers/walletconnect/core/index.html +0 -176
  66. package/coverage/lcov-report/lib/providers/walletconnect/core/session-health.ts.html +0 -673
  67. package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-client-manager.ts.html +0 -1177
  68. package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-provider.ts.html +0 -2566
  69. package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-session-store.ts.html +0 -904
  70. package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts.html +0 -982
  71. package/coverage/lcov-report/lib/providers/walletconnect/signers/hedera-signer.ts.html +0 -1915
  72. package/coverage/lcov-report/lib/providers/walletconnect/signers/index.html +0 -146
  73. package/coverage/lcov-report/lib/providers/walletconnect/signers/signer-factory.ts.html +0 -445
  74. package/coverage/lcov-report/lib/providers/walletconnect/signers/xrpl-signer.ts.html +0 -1519
  75. package/coverage/lcov-report/lib/services/hsuite-auth.interceptor.ts.html +0 -568
  76. package/coverage/lcov-report/lib/services/index.html +0 -221
  77. package/coverage/lcov-report/lib/services/logger.service.ts.html +0 -463
  78. package/coverage/lcov-report/lib/services/smart-session.service.ts.html +0 -1264
  79. package/coverage/lcov-report/lib/services/transaction-builders/active-account-source.ts.html +0 -250
  80. package/coverage/lcov-report/lib/services/transaction-builders/base-transaction-builder.service.ts.html +0 -1840
  81. package/coverage/lcov-report/lib/services/transaction-builders/hedera-amount-utils.ts.html +0 -337
  82. package/coverage/lcov-report/lib/services/transaction-builders/hedera-transaction-builder.service.ts.html +0 -3940
  83. package/coverage/lcov-report/lib/services/transaction-builders/index.html +0 -176
  84. package/coverage/lcov-report/lib/services/transaction-builders/xrpl-transaction-builder.service.ts.html +0 -2581
  85. package/coverage/lcov-report/lib/services/transaction.service.ts.html +0 -1120
  86. package/coverage/lcov-report/lib/services/unified-wallet.service.ts.html +0 -2638
  87. package/coverage/lcov-report/lib/services/wallet-context.service.ts.html +0 -637
  88. package/coverage/lcov-report/lib/services/wallet-event-bus.service.ts.html +0 -643
  89. package/coverage/lcov-report/lib/services/wallet-providers.service.ts.html +0 -493
  90. package/coverage/lcov-report/lib/transports/chrome-extension-transport.ts.html +0 -823
  91. package/coverage/lcov-report/lib/transports/index.html +0 -116
  92. package/coverage/lcov-report/lib/utils/index.html +0 -131
  93. package/coverage/lcov-report/lib/utils/ledger-icons.util.ts.html +0 -412
  94. package/coverage/lcov-report/lib/utils/ledger-ui-registry.ts.html +0 -676
  95. package/coverage/lcov-report/prettify.css +0 -1
  96. package/coverage/lcov-report/prettify.js +0 -2
  97. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  98. package/coverage/lcov-report/sorter.js +0 -210
  99. package/coverage/lcov.info +0 -20366
  100. package/coverage/lib/components/account-selector/account-actions/account-actions.component.ts.html +0 -868
  101. package/coverage/lib/components/account-selector/account-actions/index.html +0 -116
  102. package/coverage/lib/components/account-selector/account-filter/account-filter.component.ts.html +0 -1288
  103. package/coverage/lib/components/account-selector/account-filter/index.html +0 -116
  104. package/coverage/lib/components/account-selector/account-formatting.service.ts.html +0 -679
  105. package/coverage/lib/components/account-selector/account-grouping.service.ts.html +0 -766
  106. package/coverage/lib/components/account-selector/account-list/account-list.component.ts.html +0 -1495
  107. package/coverage/lib/components/account-selector/account-list/index.html +0 -116
  108. package/coverage/lib/components/account-selector/account-selector.component.ts.html +0 -1495
  109. package/coverage/lib/components/account-selector/account-selector.service.ts.html +0 -1588
  110. package/coverage/lib/components/account-selector/index.html +0 -161
  111. package/coverage/lib/components/wallet-account-display/index.html +0 -116
  112. package/coverage/lib/components/wallet-account-display/wallet-account-display.component.ts.html +0 -505
  113. package/coverage/lib/components/wallet-connect-button/index.html +0 -116
  114. package/coverage/lib/components/wallet-connect-button/wallet-connect-button.component.ts.html +0 -829
  115. package/coverage/lib/components/wallet-connect-prompt/index.html +0 -116
  116. package/coverage/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts.html +0 -409
  117. package/coverage/lib/components/wallet-connected-guard/index.html +0 -116
  118. package/coverage/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts.html +0 -304
  119. package/coverage/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts.html +0 -436
  120. package/coverage/lib/components/wallet-connection-modal/connection-method-step/index.html +0 -116
  121. package/coverage/lib/components/wallet-connection-modal/index.html +0 -116
  122. package/coverage/lib/components/wallet-connection-modal/qr-pairing-step/index.html +0 -116
  123. package/coverage/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts.html +0 -2287
  124. package/coverage/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts.html +0 -2518
  125. package/coverage/lib/components/wallet-session-display/index.html +0 -116
  126. package/coverage/lib/components/wallet-session-display/wallet-session-display.component.ts.html +0 -676
  127. package/coverage/lib/components/wallet-transaction-status/index.html +0 -116
  128. package/coverage/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts.html +0 -703
  129. package/coverage/lib/directives/index.html +0 -146
  130. package/coverage/lib/directives/wallet-connected.directive.ts.html +0 -670
  131. package/coverage/lib/directives/wallet-context.directive.ts.html +0 -547
  132. package/coverage/lib/directives/wallet-events.directive.ts.html +0 -781
  133. package/coverage/lib/hsuite-wallet.module.ts.html +0 -715
  134. package/coverage/lib/index.html +0 -116
  135. package/coverage/lib/models/connection-config.model.ts.html +0 -280
  136. package/coverage/lib/models/index.html +0 -131
  137. package/coverage/lib/models/provider-types.ts.html +0 -583
  138. package/coverage/lib/providers/base-wallet-provider.ts.html +0 -1138
  139. package/coverage/lib/providers/hsuite-native/channel-client.service.ts.html +0 -2674
  140. package/coverage/lib/providers/hsuite-native/index.html +0 -116
  141. package/coverage/lib/providers/hsuite-native-provider.ts.html +0 -2347
  142. package/coverage/lib/providers/index.html +0 -146
  143. package/coverage/lib/providers/p2p-native/index.html +0 -131
  144. package/coverage/lib/providers/p2p-native/p2p-native.provider.ts.html +0 -2254
  145. package/coverage/lib/providers/p2p-native/p2p-session-manager.ts.html +0 -2173
  146. package/coverage/lib/providers/wallet-error-handler.ts.html +0 -1132
  147. package/coverage/lib/providers/walletconnect/core/index.html +0 -176
  148. package/coverage/lib/providers/walletconnect/core/session-health.ts.html +0 -673
  149. package/coverage/lib/providers/walletconnect/core/walletconnect-client-manager.ts.html +0 -1177
  150. package/coverage/lib/providers/walletconnect/core/walletconnect-provider.ts.html +0 -2566
  151. package/coverage/lib/providers/walletconnect/core/walletconnect-session-store.ts.html +0 -904
  152. package/coverage/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts.html +0 -982
  153. package/coverage/lib/providers/walletconnect/signers/hedera-signer.ts.html +0 -1915
  154. package/coverage/lib/providers/walletconnect/signers/index.html +0 -146
  155. package/coverage/lib/providers/walletconnect/signers/signer-factory.ts.html +0 -445
  156. package/coverage/lib/providers/walletconnect/signers/xrpl-signer.ts.html +0 -1519
  157. package/coverage/lib/services/hsuite-auth.interceptor.ts.html +0 -568
  158. package/coverage/lib/services/index.html +0 -221
  159. package/coverage/lib/services/logger.service.ts.html +0 -463
  160. package/coverage/lib/services/smart-session.service.ts.html +0 -1264
  161. package/coverage/lib/services/transaction-builders/active-account-source.ts.html +0 -250
  162. package/coverage/lib/services/transaction-builders/base-transaction-builder.service.ts.html +0 -1840
  163. package/coverage/lib/services/transaction-builders/hedera-amount-utils.ts.html +0 -337
  164. package/coverage/lib/services/transaction-builders/hedera-transaction-builder.service.ts.html +0 -3940
  165. package/coverage/lib/services/transaction-builders/index.html +0 -176
  166. package/coverage/lib/services/transaction-builders/xrpl-transaction-builder.service.ts.html +0 -2581
  167. package/coverage/lib/services/transaction.service.ts.html +0 -1120
  168. package/coverage/lib/services/unified-wallet.service.ts.html +0 -2638
  169. package/coverage/lib/services/wallet-context.service.ts.html +0 -637
  170. package/coverage/lib/services/wallet-event-bus.service.ts.html +0 -643
  171. package/coverage/lib/services/wallet-providers.service.ts.html +0 -493
  172. package/coverage/lib/transports/chrome-extension-transport.ts.html +0 -823
  173. package/coverage/lib/transports/index.html +0 -116
  174. package/coverage/lib/utils/index.html +0 -131
  175. package/coverage/lib/utils/ledger-icons.util.ts.html +0 -412
  176. package/coverage/lib/utils/ledger-ui-registry.ts.html +0 -676
  177. package/coverage/prettify.css +0 -1
  178. package/coverage/prettify.js +0 -2
  179. package/coverage/sort-arrow-sprite.png +0 -0
  180. package/coverage/sorter.js +0 -210
  181. package/examples/minimal-connect.ts +0 -178
  182. package/examples/multi-protocol.ts +0 -495
  183. package/examples/transaction-signing.ts +0 -361
  184. package/jest.config.json +0 -45
  185. package/karma.conf.js +0 -42
  186. package/ng-package.json +0 -20
  187. package/src/index.ts +0 -229
  188. package/src/lib/components/account-selector/account-actions/account-actions.component.ts +0 -261
  189. package/src/lib/components/account-selector/account-filter/account-filter.component.ts +0 -401
  190. package/src/lib/components/account-selector/account-formatting.service.ts +0 -198
  191. package/src/lib/components/account-selector/account-grouping.service.ts +0 -227
  192. package/src/lib/components/account-selector/account-list/account-list.component.ts +0 -470
  193. package/src/lib/components/account-selector/account-selector.component.html +0 -135
  194. package/src/lib/components/account-selector/account-selector.component.scss +0 -2039
  195. package/src/lib/components/account-selector/account-selector.component.ts +0 -470
  196. package/src/lib/components/account-selector/account-selector.service.ts +0 -501
  197. package/src/lib/components/wallet-account-display/wallet-account-display.component.html +0 -34
  198. package/src/lib/components/wallet-account-display/wallet-account-display.component.scss +0 -99
  199. package/src/lib/components/wallet-account-display/wallet-account-display.component.ts +0 -140
  200. package/src/lib/components/wallet-connect-button/wallet-connect-button.component.html +0 -14
  201. package/src/lib/components/wallet-connect-button/wallet-connect-button.component.scss +0 -272
  202. package/src/lib/components/wallet-connect-button/wallet-connect-button.component.spec.ts +0 -89
  203. package/src/lib/components/wallet-connect-button/wallet-connect-button.component.ts +0 -248
  204. package/src/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.html +0 -24
  205. package/src/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.scss +0 -50
  206. package/src/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts +0 -108
  207. package/src/lib/components/wallet-connected-guard/wallet-connected-guard.component.html +0 -24
  208. package/src/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts +0 -73
  209. package/src/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.html +0 -56
  210. package/src/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.scss +0 -218
  211. package/src/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts +0 -117
  212. package/src/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.html +0 -94
  213. package/src/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.scss +0 -272
  214. package/src/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts +0 -734
  215. package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.html +0 -192
  216. package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.scss +0 -678
  217. package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.spec.ts +0 -173
  218. package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts +0 -811
  219. package/src/lib/components/wallet-session-display/wallet-session-display.component.html +0 -110
  220. package/src/lib/components/wallet-session-display/wallet-session-display.component.scss +0 -179
  221. package/src/lib/components/wallet-session-display/wallet-session-display.component.ts +0 -197
  222. package/src/lib/components/wallet-transaction-status/wallet-transaction-status.component.html +0 -65
  223. package/src/lib/components/wallet-transaction-status/wallet-transaction-status.component.scss +0 -254
  224. package/src/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts +0 -206
  225. package/src/lib/directives/wallet-connected.directive.ts +0 -195
  226. package/src/lib/directives/wallet-context.directive.ts +0 -154
  227. package/src/lib/directives/wallet-events.directive.ts +0 -232
  228. package/src/lib/hsuite-wallet.module.ts +0 -210
  229. package/src/lib/models/connection-config.model.ts +0 -65
  230. package/src/lib/models/provider-types.ts +0 -166
  231. package/src/lib/models/unified-account.model.ts +0 -79
  232. package/src/lib/models/wallet-context.model.ts +0 -121
  233. package/src/lib/models/wallet-events.model.ts +0 -158
  234. package/src/lib/providers/base-wallet-provider.ts +0 -351
  235. package/src/lib/providers/hsuite-native/channel-client.service.spec.ts +0 -73
  236. package/src/lib/providers/hsuite-native/channel-client.service.ts +0 -863
  237. package/src/lib/providers/hsuite-native/index.ts +0 -8
  238. package/src/lib/providers/hsuite-native-provider.ts +0 -754
  239. package/src/lib/providers/mobile-native/mobile-native.provider.spec.ts +0 -19
  240. package/src/lib/providers/p2p-native/index.ts +0 -30
  241. package/src/lib/providers/p2p-native/p2p-native.provider.spec.ts +0 -523
  242. package/src/lib/providers/p2p-native/p2p-native.provider.ts +0 -723
  243. package/src/lib/providers/p2p-native/p2p-session-manager.ts +0 -696
  244. package/src/lib/providers/wallet-error-handler.ts +0 -349
  245. package/src/lib/providers/walletconnect/core/base-signer.interface.ts +0 -122
  246. package/src/lib/providers/walletconnect/core/session-health.ts +0 -196
  247. package/src/lib/providers/walletconnect/core/walletconnect-client-manager.ts +0 -364
  248. package/src/lib/providers/walletconnect/core/walletconnect-provider.integration.spec.ts +0 -348
  249. package/src/lib/providers/walletconnect/core/walletconnect-provider.ts +0 -827
  250. package/src/lib/providers/walletconnect/core/walletconnect-session-store.ts +0 -273
  251. package/src/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts +0 -299
  252. package/src/lib/providers/walletconnect/core/walletconnect-types.ts +0 -48
  253. package/src/lib/providers/walletconnect/index.ts +0 -33
  254. package/src/lib/providers/walletconnect/signers/hedera-signer.spec.ts +0 -367
  255. package/src/lib/providers/walletconnect/signers/hedera-signer.ts +0 -610
  256. package/src/lib/providers/walletconnect/signers/signer-factory.spec.ts +0 -62
  257. package/src/lib/providers/walletconnect/signers/signer-factory.ts +0 -120
  258. package/src/lib/providers/walletconnect/signers/xrpl-signer.spec.ts +0 -296
  259. package/src/lib/providers/walletconnect/signers/xrpl-signer.ts +0 -478
  260. package/src/lib/services/hsuite-auth.interceptor.ts +0 -159
  261. package/src/lib/services/logger.service.ts +0 -126
  262. package/src/lib/services/smart-session.service.ts +0 -378
  263. package/src/lib/services/transaction-builders/active-account-source.spec.ts +0 -75
  264. package/src/lib/services/transaction-builders/active-account-source.ts +0 -55
  265. package/src/lib/services/transaction-builders/base-transaction-builder.service.ts +0 -585
  266. package/src/lib/services/transaction-builders/hedera-amount-utils.ts +0 -84
  267. package/src/lib/services/transaction-builders/hedera-transaction-builder.service.spec.ts +0 -741
  268. package/src/lib/services/transaction-builders/hedera-transaction-builder.service.ts +0 -1285
  269. package/src/lib/services/transaction-builders/index.ts +0 -55
  270. package/src/lib/services/transaction-builders/xrpl-transaction-builder.service.spec.ts +0 -937
  271. package/src/lib/services/transaction-builders/xrpl-transaction-builder.service.ts +0 -832
  272. package/src/lib/services/transaction.service.ts +0 -349
  273. package/src/lib/services/unified-wallet.service.spec.ts +0 -1382
  274. package/src/lib/services/unified-wallet.service.ts +0 -851
  275. package/src/lib/services/wallet-context.service.ts +0 -184
  276. package/src/lib/services/wallet-event-bus.service.ts +0 -186
  277. package/src/lib/services/wallet-providers.service.ts +0 -136
  278. package/src/lib/transports/chrome-extension-transport.ts +0 -246
  279. package/src/lib/utils/index.ts +0 -15
  280. package/src/lib/utils/ledger-icons.util.ts +0 -109
  281. package/src/lib/utils/ledger-ui-registry.ts +0 -197
  282. package/test/test-setup.ts +0 -21
  283. package/test-setup.ts +0 -63
  284. package/tsconfig.build.json +0 -11
  285. package/tsconfig.json +0 -29
  286. package/tsconfig.spec.json +0 -15
  287. package/vitest.config.ts +0 -48
@@ -1,126 +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 Angular Logger Service for dependency injection.
13
- *
14
- * @module services/logger
15
- *
16
- * @description
17
- * LoggerService wraps the SDK's logger for Angular dependency injection, providing
18
- * a consistent logging interface throughout Angular applications. It enables
19
- * scoped logging with component/service names, production mode filtering, and
20
- * consistent log formatting.
21
- *
22
- * **Key Features:**
23
- * - Scoped loggers for easy filtering and tracing
24
- * - Production-aware log level filtering
25
- * - Consistent formatting across all components
26
- * - Context objects for structured logging
27
- *
28
- * **Log Levels:**
29
- * - `debug` - Detailed debugging information (filtered in production)
30
- * - `info` - General informational messages
31
- * - `warn` - Warning conditions that may need attention
32
- * - `error` - Error conditions requiring action
33
- */
34
-
35
- import { Injectable } from '@angular/core';
36
- import { getLogger, Logger } from '@hsuite/native-connect-sdk';
37
-
38
- /**
39
- * Angular Logger Service that wraps the SDK's logger for dependency injection.
40
- *
41
- * @service LoggerService
42
- *
43
- * @description
44
- * Provides scoped logger instances for components and services. All logs go through
45
- * the SDK's configurable logging infrastructure, which supports production mode
46
- * filtering and scope-based log levels.
47
- *
48
- * **Best Practices:**
49
- * - Create scoped loggers at the class level for consistent scope names
50
- * - Use structured context objects for machine-readable logs
51
- * - Use appropriate log levels (debug for dev, info for operations, error for failures)
52
- *
53
- * @providedIn root
54
- */
55
- @Injectable({ providedIn: 'root' })
56
- export class LoggerService {
57
- private readonly rootLogger: Logger = getLogger();
58
-
59
- /**
60
- * Returns a scoped logger instance.
61
- *
62
- * Scoped loggers prefix all messages with the scope name,
63
- * making it easier to filter and trace logs.
64
- *
65
- * @param scope The scope for the logger (e.g., 'AppComponent', 'WalletService').
66
- * @returns A scoped Logger instance
67
- */
68
- scoped(scope: string): Logger {
69
- return this.rootLogger.scoped?.(scope) ?? this.rootLogger;
70
- }
71
-
72
- /**
73
- * Returns the root logger instance.
74
- *
75
- * Use sparingly - prefer scoped() for component/service logging.
76
- *
77
- * @returns The root Logger instance
78
- */
79
- getRootLogger(): Logger {
80
- return this.rootLogger;
81
- }
82
-
83
- /**
84
- * Log a debug message using the root logger.
85
- * Convenience method for one-off logs.
86
- *
87
- * @param message Log message
88
- * @param context Optional context object
89
- */
90
- debug(message: string, context?: Record<string, unknown>): void {
91
- this.rootLogger.debug(message, context);
92
- }
93
-
94
- /**
95
- * Log an info message using the root logger.
96
- * Convenience method for one-off logs.
97
- *
98
- * @param message Log message
99
- * @param context Optional context object
100
- */
101
- info(message: string, context?: Record<string, unknown>): void {
102
- this.rootLogger.info(message, context);
103
- }
104
-
105
- /**
106
- * Log a warning message using the root logger.
107
- * Convenience method for one-off logs.
108
- *
109
- * @param message Log message
110
- * @param context Optional context object
111
- */
112
- warn(message: string, context?: Record<string, unknown>): void {
113
- this.rootLogger.warn(message, context);
114
- }
115
-
116
- /**
117
- * Log an error message using the root logger.
118
- * Convenience method for one-off logs.
119
- *
120
- * @param message Log message
121
- * @param context Optional context object
122
- */
123
- error(message: string, context?: Record<string, unknown>): void {
124
- this.rootLogger.error(message, context);
125
- }
126
- }
@@ -1,378 +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 Smart-host customer session helper.
13
- *
14
- * @module services/smart-session
15
- *
16
- * @description
17
- * SmartSessionService automates the smart-host authentication handshake for
18
- * HSuite dApps. It discovers the host's `appId`, requests a challenge, signs it
19
- * with the active wallet account, and exchanges the signed challenge for a
20
- * short-lived bearer token.
21
- *
22
- * **Typical flow:**
23
- * ```typescript
24
- * const session = inject(SmartSessionService);
25
- * await session.login();
26
- * const bearer = session.getBearer();
27
- * ```
28
- *
29
- * The service also exposes {@link withSession} for automatic 401 recovery:
30
- * operations that fail with HTTP 401 are retried once after a fresh login.
31
- */
32
-
33
- import { HttpClient } from '@angular/common/http';
34
- import { Injectable, inject, InjectionToken } from '@angular/core';
35
- import { getLogger } from '@hsuite/native-connect-sdk';
36
- import { firstValueFrom } from 'rxjs';
37
-
38
- import type { SignMessageResult } from '../providers/base-wallet-provider';
39
-
40
- import { TransactionService } from './transaction.service';
41
- import { UnifiedWalletService } from './unified-wallet.service';
42
-
43
- const logger = getLogger().scoped?.('SmartSessionService') ?? getLogger();
44
-
45
- /**
46
- * Configuration token for {@link SmartSessionService}.
47
- */
48
- export const SMART_SESSION_CONFIG = new InjectionToken<SmartSessionConfig>('SMART_SESSION_CONFIG', {
49
- factory: () => ({}),
50
- });
51
-
52
- /**
53
- * Configuration for the smart-host session handshake.
54
- */
55
- export interface SmartSessionConfig {
56
- /**
57
- * Base URL for the smart-host API.
58
- * @default '' (relative to the current origin)
59
- */
60
- baseUrl?: string;
61
-
62
- /**
63
- * Health endpoint used to discover the host `appId`.
64
- * @default '/api/health'
65
- */
66
- healthEndpoint?: string;
67
-
68
- /**
69
- * Challenge endpoint used to obtain a message to sign.
70
- * @default '/api/auth/challenge'
71
- */
72
- challengeEndpoint?: string;
73
-
74
- /**
75
- * Verify endpoint used to exchange the signed challenge for a bearer token.
76
- * @default '/api/auth/verify'
77
- */
78
- verifyEndpoint?: string;
79
-
80
- /**
81
- * sessionStorage key used to persist the session token and expiry.
82
- * @default 'hsuite.smart-session'
83
- */
84
- storageKey?: string;
85
- }
86
-
87
- /**
88
- * Health response shape expected from the smart host.
89
- */
90
- export interface SmartHostHealth {
91
- appId: string;
92
- [key: string]: unknown;
93
- }
94
-
95
- /**
96
- * Challenge response shape expected from the smart host.
97
- */
98
- export interface SmartHostChallenge {
99
- challenge: string;
100
- [key: string]: unknown;
101
- }
102
-
103
- /**
104
- * Verify request payload sent to the smart host.
105
- */
106
- export interface SmartHostVerifyRequest {
107
- appId: string;
108
- accountAddress: string;
109
- publicKey?: string;
110
- signature: string;
111
- algorithm?: string;
112
- message: string;
113
- caipChainId?: string;
114
- ledgerId?: string;
115
- networkId?: string;
116
- }
117
-
118
- /**
119
- * Verify response shape expected from the smart host.
120
- */
121
- export interface SmartHostVerifyResponse {
122
- bearer: string;
123
- expiresAt?: number;
124
- expiresIn?: number;
125
- [key: string]: unknown;
126
- }
127
-
128
- /**
129
- * Persisted smart session.
130
- */
131
- interface StoredSession {
132
- bearer: string;
133
- expiresAt: number;
134
- }
135
-
136
- /**
137
- * Smart-host customer session helper.
138
- *
139
- * @service SmartSessionService
140
- *
141
- * @description
142
- * Encapsulates the full challenge → sign → verify → store JWT flow required by
143
- * HSuite smart hosts. The service is intentionally thin: it delegates signing to
144
- * {@link TransactionService} and relies on standard Angular `HttpClient` for the
145
- * host HTTP calls.
146
- *
147
- * @providedIn root
148
- */
149
- @Injectable({ providedIn: 'root' })
150
- export class SmartSessionService {
151
- private readonly http = inject(HttpClient);
152
- private readonly walletService = inject(UnifiedWalletService);
153
- private readonly transactionService = inject(TransactionService);
154
- private readonly config = inject(SMART_SESSION_CONFIG);
155
-
156
- private get baseUrl(): string {
157
- return this.config.baseUrl ?? '';
158
- }
159
-
160
- private get healthEndpoint(): string {
161
- return this.config.healthEndpoint ?? '/api/health';
162
- }
163
-
164
- private get challengeEndpoint(): string {
165
- return this.config.challengeEndpoint ?? '/api/auth/challenge';
166
- }
167
-
168
- private get verifyEndpoint(): string {
169
- return this.config.verifyEndpoint ?? '/api/auth/verify';
170
- }
171
-
172
- private get storageKey(): string {
173
- return this.config.storageKey ?? 'hsuite.smart-session';
174
- }
175
-
176
- /**
177
- * Returns the currently stored bearer token, or `null` if there is no session.
178
- *
179
- * @returns Bearer token string or null
180
- */
181
- getBearer(): string | null {
182
- const stored = this.readStoredSession();
183
- return stored && stored.expiresAt > Date.now() ? stored.bearer : null;
184
- }
185
-
186
- /**
187
- * Checks whether a non-expired session is available.
188
- *
189
- * @returns true if logged in and the bearer has not expired
190
- */
191
- isLoggedIn(): boolean {
192
- return this.getBearer() !== null;
193
- }
194
-
195
- /**
196
- * Performs the full smart-host login handshake.
197
- *
198
- * @description
199
- * 1. Discovers `appId` from the health endpoint.
200
- * 2. Fetches a challenge from the challenge endpoint.
201
- * 3. Signs the challenge with the active wallet account.
202
- * 4. Exchanges the signed challenge for a bearer token.
203
- * 5. Stores the bearer and expiry in `sessionStorage`.
204
- *
205
- * @returns The verify response from the host
206
- *
207
- * @throws {Error} If no active account is available
208
- * @throws {Error} If the health endpoint does not return an `appId`
209
- * @throws {Error} If the challenge endpoint does not return a `challenge`
210
- * @throws {Error} If the verify call fails
211
- */
212
- async login(): Promise<SmartHostVerifyResponse> {
213
- const account = this.walletService.activeAccount();
214
- if (!account) {
215
- throw new Error('No active account');
216
- }
217
-
218
- logger.info('Starting smart-host login handshake', {
219
- accountAddress: account.address,
220
- });
221
-
222
- const health = await this.fetchHealth();
223
- if (!health.appId) {
224
- throw new Error('Smart host health endpoint did not return appId');
225
- }
226
-
227
- const challengeResponse = await this.fetchChallenge(health.appId);
228
- if (!challengeResponse.challenge) {
229
- throw new Error('Smart host challenge endpoint did not return challenge');
230
- }
231
-
232
- const signResult = await this.transactionService.signMessage(challengeResponse.challenge);
233
-
234
- const verifyResponse = await this.verifyChallenge(
235
- health.appId,
236
- account,
237
- challengeResponse.challenge,
238
- signResult,
239
- );
240
-
241
- if (!verifyResponse.bearer) {
242
- throw new Error('Smart host verify endpoint did not return bearer');
243
- }
244
-
245
- const expiresAt = this.resolveExpiry(verifyResponse);
246
- this.storeSession({ bearer: verifyResponse.bearer, expiresAt });
247
-
248
- logger.info('Smart-host login successful', {
249
- appId: health.appId,
250
- expiresAt,
251
- });
252
-
253
- return verifyResponse;
254
- }
255
-
256
- /**
257
- * Clears the stored session.
258
- */
259
- logout(): void {
260
- this.clearStoredSession();
261
- logger.info('Smart-host session cleared');
262
- }
263
-
264
- /**
265
- * Runs an HTTP operation with automatic 401 recovery.
266
- *
267
- * @description
268
- * Executes the provided operation. If it rejects with an HTTP 401 error,
269
- * the service clears the current bearer, performs a fresh login, and retries
270
- * the operation once. Any other error is propagated immediately.
271
- *
272
- * @param operation - Async operation that needs a valid session
273
- * @returns The result of the operation
274
- *
275
- * @throws {Error} The original error if retry is not possible or fails
276
- */
277
- async withSession<T>(operation: () => Promise<T>): Promise<T> {
278
- try {
279
- return await operation();
280
- } catch (error) {
281
- if (this.isUnauthorizedError(error)) {
282
- logger.warn('Operation received 401; attempting single session refresh');
283
- this.logout();
284
- await this.login();
285
- return await operation();
286
- }
287
- throw error;
288
- }
289
- }
290
-
291
- private async fetchHealth(): Promise<SmartHostHealth> {
292
- return firstValueFrom(this.http.get<SmartHostHealth>(`${this.baseUrl}${this.healthEndpoint}`));
293
- }
294
-
295
- private async fetchChallenge(appId: string): Promise<SmartHostChallenge> {
296
- return firstValueFrom(
297
- this.http.post<SmartHostChallenge>(`${this.baseUrl}${this.challengeEndpoint}`, { appId }),
298
- );
299
- }
300
-
301
- private async verifyChallenge(
302
- appId: string,
303
- account: import('../models/unified-account.model').UnifiedAccount,
304
- challenge: string,
305
- signResult: SignMessageResult,
306
- ): Promise<SmartHostVerifyResponse> {
307
- const payload: SmartHostVerifyRequest = {
308
- appId,
309
- accountAddress: account.address,
310
- publicKey: signResult.publicKey ?? account.publicKey,
311
- signature: signResult.signature,
312
- algorithm: signResult.algorithm,
313
- message: challenge,
314
- caipChainId: signResult.caipChainId,
315
- ledgerId: account.ledgerId,
316
- networkId: account.networkId,
317
- };
318
-
319
- return firstValueFrom(
320
- this.http.post<SmartHostVerifyResponse>(`${this.baseUrl}${this.verifyEndpoint}`, payload),
321
- );
322
- }
323
-
324
- private resolveExpiry(response: SmartHostVerifyResponse): number {
325
- if (response.expiresAt) {
326
- return response.expiresAt;
327
- }
328
- if (response.expiresIn) {
329
- return Date.now() + response.expiresIn * 1000;
330
- }
331
- // Default to 5 minutes if no expiry is provided
332
- return Date.now() + 5 * 60 * 1000;
333
- }
334
-
335
- private readStoredSession(): StoredSession | null {
336
- try {
337
- const raw = sessionStorage.getItem(this.storageKey);
338
- if (!raw) {
339
- return null;
340
- }
341
- const parsed = JSON.parse(raw) as StoredSession;
342
- if (!parsed.bearer || typeof parsed.expiresAt !== 'number') {
343
- return null;
344
- }
345
- return parsed;
346
- } catch {
347
- return null;
348
- }
349
- }
350
-
351
- private storeSession(session: StoredSession): void {
352
- try {
353
- sessionStorage.setItem(this.storageKey, JSON.stringify(session));
354
- } catch (error) {
355
- logger.warn('Failed to store smart session', { error });
356
- }
357
- }
358
-
359
- private clearStoredSession(): void {
360
- try {
361
- sessionStorage.removeItem(this.storageKey);
362
- } catch (error) {
363
- logger.warn('Failed to clear smart session', { error });
364
- }
365
- }
366
-
367
- private isUnauthorizedError(error: unknown): boolean {
368
- if (!error || typeof error !== 'object') {
369
- return false;
370
- }
371
- const status = (error as { status?: number }).status;
372
- if (typeof status === 'number') {
373
- return status === 401;
374
- }
375
- const message = String((error as { message?: unknown }).message ?? '');
376
- return /\b401\b|unauthorized/i.test(message);
377
- }
378
- }
@@ -1,75 +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
- * @fileoverview #5 decoupling. The Hedera transaction builder must resolve the
13
- * active account through the ACTIVE_ACCOUNT_SOURCE token, NOT by injecting
14
- * UnifiedWalletService directly. A default root provider keeps the token
15
- * pointing at UnifiedWalletService, so existing SDK consumers are unaffected
16
- * (the comprehensive hedera-transaction-builder.service.spec, which provides a
17
- * UnifiedWalletService mock, is the backward-compatibility proof). The embedded
18
- * shell overrides the token with a one-member account context, which is why the
19
- * stub-of-UnifiedWalletService and its Proxy guard can be deleted.
20
- */
21
-
22
- import { TestBed } from '@angular/core/testing';
23
- import { describe, it, expect } from 'vitest';
24
- import { signal } from '@angular/core';
25
-
26
- import { HederaTransactionBuilderService } from './hedera-transaction-builder.service';
27
- import { ACTIVE_ACCOUNT_SOURCE, type ActiveAccountSource } from './active-account-source';
28
- import { LoggerService } from '../logger.service';
29
- import { UnifiedWalletService } from '../unified-wallet.service';
30
- import type { UnifiedAccount } from '../../models/unified-account.model';
31
-
32
- const mockLogger = {
33
- scoped: () => ({ debug() {}, info() {}, warn() {}, error() {} }),
34
- };
35
-
36
- function testnetSource(networkId = 'hedera:testnet'): ActiveAccountSource {
37
- const account: UnifiedAccount = {
38
- id: `embedded:hedera:${networkId}:0.0.2193470`,
39
- address: '0.0.2193470',
40
- ledgerId: 'hedera',
41
- networkId,
42
- providerId: 'test',
43
- providerType: 'hsuite-native',
44
- metadata: {},
45
- };
46
- return { activeAccount: signal<UnifiedAccount | null>(account) };
47
- }
48
-
49
- describe('ACTIVE_ACCOUNT_SOURCE (Hedera builder decoupling, #5)', () => {
50
- it('builds a Hedera transaction from ACTIVE_ACCOUNT_SOURCE with NO UnifiedWalletService provided', async () => {
51
- TestBed.configureTestingModule({
52
- providers: [
53
- { provide: ACTIVE_ACCOUNT_SOURCE, useValue: testnetSource() },
54
- { provide: LoggerService, useValue: mockLogger },
55
- // UnifiedWalletService is deliberately NOT provided: the builder must
56
- // resolve its network purely from the account source.
57
- ],
58
- });
59
-
60
- const builder = TestBed.inject(HederaTransactionBuilderService);
61
- const payload = await builder.buildSendHbar('0.0.123', '0.0.456', 1);
62
-
63
- expect(typeof payload).toBe('string');
64
- expect(payload.length).toBeGreaterThan(0);
65
- });
66
-
67
- it('default provider falls back to UnifiedWalletService (backward compatible)', () => {
68
- const fakeUnified = { activeAccount: signal<UnifiedAccount | null>(null) };
69
- TestBed.configureTestingModule({
70
- providers: [{ provide: UnifiedWalletService, useValue: fakeUnified }],
71
- });
72
-
73
- expect(TestBed.inject(ACTIVE_ACCOUNT_SOURCE)).toBe(fakeUnified);
74
- });
75
- });
@@ -1,55 +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 ACTIVE_ACCOUNT_SOURCE: the minimal active-account read surface the
13
- * transaction builders need.
14
- *
15
- * @description
16
- * The Hedera transaction builder only reads `activeAccount()` from the wallet
17
- * (to pick the network and the entity key config). Injecting the whole
18
- * {@link UnifiedWalletService} couples the builder to a heavy root service that
19
- * also runs the dApp connect stack on construction. This token narrows that
20
- * dependency to a single member.
21
- *
22
- * The default provider points at {@link UnifiedWalletService}, so existing SDK
23
- * consumers that already provide it need NO wiring change (backward
24
- * compatible). The embedded widget shell overrides this token with a one-member
25
- * account context, which keeps the heavy root service from ever being
26
- * constructed inside the wallet.
27
- */
28
-
29
- import { InjectionToken, inject, type Signal } from '@angular/core';
30
-
31
- import type { UnifiedAccount } from '../../models/unified-account.model';
32
- import { UnifiedWalletService } from '../unified-wallet.service';
33
-
34
- /**
35
- * The only member the transaction builders read from the active wallet account.
36
- * Implemented by {@link UnifiedWalletService} (the default) and by the embedded
37
- * shell's one-member account context.
38
- */
39
- export interface ActiveAccountSource {
40
- readonly activeAccount: Signal<UnifiedAccount | null>;
41
- }
42
-
43
- /**
44
- * Injection token for the active-account read surface. Defaults to
45
- * {@link UnifiedWalletService} so consumers that already provide it need no
46
- * extra wiring; override it to supply a narrower source (the embedded shell
47
- * does this to avoid constructing the root service inside the wallet).
48
- */
49
- export const ACTIVE_ACCOUNT_SOURCE = new InjectionToken<ActiveAccountSource>(
50
- 'ACTIVE_ACCOUNT_SOURCE',
51
- {
52
- providedIn: 'root',
53
- factory: () => inject(UnifiedWalletService),
54
- },
55
- );