@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,349 +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 High-level transaction service with automatic state management.
13
- *
14
- * @module services/transaction
15
- *
16
- * @description
17
- * TransactionService provides simplified methods for common transaction operations
18
- * with built-in state management, error handling, and UI feedback. It wraps
19
- * UnifiedWalletService operations with additional convenience features.
20
- *
21
- * **Key Features:**
22
- * - Automatic processing state tracking via Angular signals
23
- * - Toast notifications for success and error states
24
- * - Error propagation with proper error types
25
- * - Result and error state tracking for UI binding
26
- * - Support for batch transactions
27
- *
28
- * **Signal-based State:**
29
- * - `isProcessing()` - True while a transaction is in progress
30
- * - `lastResult()` - The result of the last successful transaction
31
- * - `lastError()` - The error from the last failed transaction
32
- *
33
- * @Component({
34
- * template: `
35
- * <button [disabled]="txService.isProcessing()" (click)="send()">
36
- * {{ txService.isProcessing() ? 'Processing...' : 'Send' }}
37
- * </button>
38
- * `
39
- * })
40
- * export class MyComponent {
41
- * txService = inject(TransactionService);
42
- *
43
- * async send() {
44
- * const result = await this.txService.signAndSubmit(payload);
45
- * console.log('Transaction ID:', result.transactionId);
46
- * }
47
- * }
48
- * ```
49
- */
50
-
51
- import { Injectable, inject, signal, type Signal, type WritableSignal } from '@angular/core';
52
- import { getLogger } from '@hsuite/native-connect-sdk';
53
- import { ToastController } from '@ionic/angular/standalone';
54
-
55
- import type {
56
- SignMessageResult,
57
- SignResult,
58
- SubmitResult,
59
- } from '../providers/base-wallet-provider';
60
-
61
- import { UnifiedWalletService } from './unified-wallet.service';
62
- import { WalletEventBus } from './wallet-event-bus.service';
63
-
64
- const logger = getLogger().scoped?.('TransactionService') ?? getLogger();
65
-
66
- /**
67
- * High-level transaction service with automatic state management.
68
- *
69
- * @service TransactionService
70
- *
71
- * @description
72
- * Simplifies common transaction operations with built-in features:
73
- * - Automatic processing state management via Angular signals
74
- * - Error propagation with toast notifications
75
- * - Event emission for tracking and debugging
76
- * - Signal-based reactive state (modern Angular pattern)
77
- *
78
- * This service is the recommended way to perform transactions in dApps,
79
- * as it handles all the boilerplate around state management and user feedback.
80
- *
81
- * @providedIn root
82
- */
83
- @Injectable({ providedIn: 'root' })
84
- export class TransactionService {
85
- private readonly walletService = inject(UnifiedWalletService);
86
- private readonly eventBus = inject(WalletEventBus);
87
- private readonly toastController = inject(ToastController);
88
-
89
- // Internal writable signals for state management
90
- private readonly _isProcessing: WritableSignal<boolean> = signal(false);
91
- private readonly _lastResult: WritableSignal<unknown> = signal(null);
92
- private readonly _lastError: WritableSignal<Error | null> = signal(null);
93
-
94
- /**
95
- * Signal indicating if a transaction is currently processing
96
- */
97
- readonly isProcessing: Signal<boolean> = this._isProcessing.asReadonly();
98
-
99
- /**
100
- * Signal of the last transaction result
101
- */
102
- readonly lastResult: Signal<unknown> = this._lastResult.asReadonly();
103
-
104
- /**
105
- * Signal of the last error
106
- */
107
- readonly lastError: Signal<Error | null> = this._lastError.asReadonly();
108
-
109
- /**
110
- * Sign a transaction
111
- *
112
- * Automatically handles:
113
- * - Processing state
114
- * - Error propagation
115
- * - Success toast notification
116
- *
117
- * @param payload - Transaction payload (base64 or transaction bytes)
118
- * @returns Sign result
119
- */
120
- async signTransaction(payload: string): Promise<SignResult> {
121
- return this.executeTransaction(async () => {
122
- const result = (await this.walletService.signTransaction(payload)) as SignResult;
123
- logger.info('Transaction signed', {
124
- hasSignature: !!(result as { signedTransaction?: string }).signedTransaction,
125
- });
126
- await this.showSuccessToast(
127
- 'Transaction Signed',
128
- 'Your transaction has been signed successfully.',
129
- );
130
- return result;
131
- });
132
- }
133
-
134
- /**
135
- * Submit a transaction
136
- *
137
- * Automatically handles:
138
- * - Processing state
139
- * - Error propagation
140
- * - Success toast notification
141
- *
142
- * @param payload - Transaction payload (base64 or transaction bytes)
143
- * @returns Submit result
144
- */
145
- async submitTransaction(payload: string): Promise<SubmitResult> {
146
- return this.executeTransaction(async () => {
147
- const result = (await this.walletService.submitTransaction(payload)) as SubmitResult;
148
- logger.info('Transaction submitted', { transactionId: result.transactionId });
149
- await this.showSuccessToast(
150
- 'Transaction Submitted',
151
- `Transaction ID: ${result.transactionId || 'Success'}`,
152
- );
153
- return result;
154
- });
155
- }
156
-
157
- /**
158
- * Sign and submit a transaction in one call
159
- *
160
- * Uses the wallet's native sign+submit method when available (e.g., WalletConnect's signAndExecuteTransaction).
161
- * This prevents double prompts and provides a better UX.
162
- *
163
- * @param payload - Transaction payload
164
- * @returns Submit result
165
- */
166
- async signAndSubmit(payload: string): Promise<SubmitResult> {
167
- return this.executeTransaction(async () => {
168
- // Use the wallet's signAndExecuteTransaction method directly
169
- // This uses hedera_signAndExecuteTransaction for WalletConnect (one prompt!)
170
- const result = (await this.walletService.signAndExecuteTransaction(payload)) as SubmitResult;
171
- logger.info('Transaction signed and submitted', { transactionId: result.transactionId });
172
- await this.showSuccessToast(
173
- 'Transaction Complete',
174
- `Transaction ID: ${result.transactionId || 'Success'}`,
175
- );
176
- return result;
177
- });
178
- }
179
-
180
- /**
181
- * Submit a batch transaction
182
- *
183
- * Batch transactions require unsigned inner transactions that the wallet will sign.
184
- * The wallet signs each inner transaction with the account's key, then builds and
185
- * executes the BatchTransaction.
186
- *
187
- * @param options - Batch transaction options
188
- * @param options.batchKey - Public key for batch (typically account's public key)
189
- * @param options.innerTransactions - Array of unsigned inner transactions
190
- * @returns Submit result
191
- */
192
- async submitBatchTransaction(options: {
193
- batchKey: string;
194
- innerTransactions: Array<{ payload: string; description?: string }>;
195
- }): Promise<SubmitResult> {
196
- return this.executeTransaction(async () => {
197
- const result = (await this.walletService.submitTransaction('', {
198
- isBatch: true,
199
- batchKey: options.batchKey,
200
- innerTransactions: options.innerTransactions,
201
- })) as SubmitResult;
202
- logger.info('Batch transaction submitted', { transactionId: result.transactionId });
203
- await this.showSuccessToast(
204
- 'Batch Transaction Complete',
205
- `Transaction ID: ${result.transactionId || 'Success'}`,
206
- );
207
- return result;
208
- });
209
- }
210
-
211
- /**
212
- * Sign a message
213
- *
214
- * @param message - Message to sign
215
- * @returns Sign result with signature
216
- */
217
- async signMessage(message: string): Promise<SignMessageResult> {
218
- return this.executeTransaction(async () => {
219
- const result = await this.walletService.signMessage(message);
220
- logger.info('Message signed', { hasSignature: !!result.signature });
221
- await this.showSuccessToast('Message Signed', 'Your message has been signed successfully.');
222
- return result;
223
- });
224
- }
225
-
226
- /**
227
- * Show a success toast notification
228
- * Uses cssClass-only styling (no Ionic color property) for theme compatibility.
229
- * @param header
230
- * @param message
231
- */
232
- private async showSuccessToast(header: string, message: string): Promise<void> {
233
- const toast = await this.toastController.create({
234
- header,
235
- message,
236
- icon: 'checkmark-circle-outline',
237
- cssClass: 'toast-success toast-compact',
238
- duration: 4000,
239
- position: 'top',
240
- buttons: [{ icon: 'close', role: 'cancel' }],
241
- });
242
- await toast.present();
243
- }
244
-
245
- /**
246
- * Show an error toast notification
247
- * Uses cssClass-only styling (no Ionic color property) for theme compatibility.
248
- * @param header
249
- * @param message
250
- */
251
- private async showErrorToast(header: string, message: string): Promise<void> {
252
- const toast = await this.toastController.create({
253
- header,
254
- message,
255
- icon: 'close-circle-outline',
256
- cssClass: 'toast-danger toast-compact',
257
- duration: 6000,
258
- position: 'top',
259
- buttons: [{ icon: 'close', role: 'cancel' }],
260
- });
261
- await toast.present();
262
- }
263
-
264
- /**
265
- * Execute a transaction with automatic state management
266
- *
267
- * Internal helper that wraps transaction operations with:
268
- * - Processing state updates
269
- * - Error handling with toast notifications
270
- * - Result tracking
271
- * @param operation
272
- */
273
- private async executeTransaction<T>(operation: () => Promise<T>): Promise<T> {
274
- // Set processing state
275
- this.setProcessing(true);
276
- this.clearError();
277
-
278
- try {
279
- // Execute the operation
280
- const result = await operation();
281
-
282
- // Update result state
283
- this.setResult(result);
284
-
285
- return result;
286
- } catch (error) {
287
- // Update error state
288
- const err = error instanceof Error ? error : new Error(String(error));
289
- this.setError(err);
290
-
291
- // Show error toast
292
- await this.showErrorToast(
293
- 'Transaction Failed',
294
- err.message || 'An error occurred during the transaction.',
295
- );
296
-
297
- // Re-throw for caller to handle
298
- throw err;
299
- } finally {
300
- // Clear processing state
301
- this.setProcessing(false);
302
- }
303
- }
304
-
305
- /**
306
- * Update processing state
307
- * @param processing
308
- */
309
- private setProcessing(processing: boolean): void {
310
- this._isProcessing.set(processing);
311
- }
312
-
313
- /**
314
- * Update result state
315
- * @param result
316
- */
317
- private setResult(result: unknown): void {
318
- this._lastResult.set(result);
319
- }
320
-
321
- /**
322
- * Update error state
323
- * @param error
324
- */
325
- private setError(error: Error): void {
326
- this._lastError.set(error);
327
- }
328
-
329
- /**
330
- * Clear error state
331
- */
332
- private clearError(): void {
333
- this._lastError.set(null);
334
- }
335
-
336
- /**
337
- * Resets all transaction state to initial values.
338
- *
339
- * @description
340
- * Clears the processing flag, last result, and last error.
341
- * Useful when navigating away from a transaction page or
342
- * starting a fresh transaction flow.
343
- */
344
- resetState(): void {
345
- this.setProcessing(false);
346
- this.setResult(null);
347
- this.clearError();
348
- }
349
- }