@hsuite/native-connect-angular 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/LICENSE +146 -0
  2. package/dist/fesm2022/hsuite-native-connect-angular.mjs +854 -308
  3. package/dist/fesm2022/hsuite-native-connect-angular.mjs.map +1 -1
  4. package/dist/index.d.ts +456 -30
  5. package/package.json +30 -13
  6. package/USAGE_EXAMPLES.md +0 -476
  7. package/assets/wallets/extension.svg +0 -7
  8. package/assets/wallets/hashpack.svg +0 -6
  9. package/assets/wallets/hsuite.svg +0 -11
  10. package/assets/wallets/kabila.svg +0 -11
  11. package/assets/wallets/walletconnect.svg +0 -13
  12. package/coverage/base.css +0 -224
  13. package/coverage/block-navigation.js +0 -87
  14. package/coverage/coverage-summary.json +0 -50
  15. package/coverage/favicon.png +0 -0
  16. package/coverage/index.html +0 -476
  17. package/coverage/lcov-report/base.css +0 -224
  18. package/coverage/lcov-report/block-navigation.js +0 -87
  19. package/coverage/lcov-report/favicon.png +0 -0
  20. package/coverage/lcov-report/index.html +0 -476
  21. package/coverage/lcov-report/lib/components/account-selector/account-actions/account-actions.component.ts.html +0 -868
  22. package/coverage/lcov-report/lib/components/account-selector/account-actions/index.html +0 -116
  23. package/coverage/lcov-report/lib/components/account-selector/account-filter/account-filter.component.ts.html +0 -1288
  24. package/coverage/lcov-report/lib/components/account-selector/account-filter/index.html +0 -116
  25. package/coverage/lcov-report/lib/components/account-selector/account-formatting.service.ts.html +0 -685
  26. package/coverage/lcov-report/lib/components/account-selector/account-grouping.service.ts.html +0 -766
  27. package/coverage/lcov-report/lib/components/account-selector/account-list/account-list.component.ts.html +0 -1495
  28. package/coverage/lcov-report/lib/components/account-selector/account-list/index.html +0 -116
  29. package/coverage/lcov-report/lib/components/account-selector/account-selector.component.ts.html +0 -1495
  30. package/coverage/lcov-report/lib/components/account-selector/account-selector.service.ts.html +0 -1588
  31. package/coverage/lcov-report/lib/components/account-selector/index.html +0 -161
  32. package/coverage/lcov-report/lib/components/wallet-account-display/index.html +0 -116
  33. package/coverage/lcov-report/lib/components/wallet-account-display/wallet-account-display.component.ts.html +0 -505
  34. package/coverage/lcov-report/lib/components/wallet-connect-button/index.html +0 -116
  35. package/coverage/lcov-report/lib/components/wallet-connect-button/wallet-connect-button.component.ts.html +0 -829
  36. package/coverage/lcov-report/lib/components/wallet-connect-prompt/index.html +0 -116
  37. package/coverage/lcov-report/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts.html +0 -409
  38. package/coverage/lcov-report/lib/components/wallet-connected-guard/index.html +0 -116
  39. package/coverage/lcov-report/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts.html +0 -304
  40. package/coverage/lcov-report/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts.html +0 -436
  41. package/coverage/lcov-report/lib/components/wallet-connection-modal/connection-method-step/index.html +0 -116
  42. package/coverage/lcov-report/lib/components/wallet-connection-modal/index.html +0 -116
  43. package/coverage/lcov-report/lib/components/wallet-connection-modal/qr-pairing-step/index.html +0 -116
  44. package/coverage/lcov-report/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts.html +0 -2287
  45. package/coverage/lcov-report/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts.html +0 -2470
  46. package/coverage/lcov-report/lib/components/wallet-session-display/index.html +0 -116
  47. package/coverage/lcov-report/lib/components/wallet-session-display/wallet-session-display.component.ts.html +0 -676
  48. package/coverage/lcov-report/lib/components/wallet-transaction-status/index.html +0 -116
  49. package/coverage/lcov-report/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts.html +0 -703
  50. package/coverage/lcov-report/lib/directives/index.html +0 -146
  51. package/coverage/lcov-report/lib/directives/wallet-connected.directive.ts.html +0 -670
  52. package/coverage/lcov-report/lib/directives/wallet-context.directive.ts.html +0 -547
  53. package/coverage/lcov-report/lib/directives/wallet-events.directive.ts.html +0 -781
  54. package/coverage/lcov-report/lib/hsuite-wallet.module.ts.html +0 -715
  55. package/coverage/lcov-report/lib/index.html +0 -116
  56. package/coverage/lcov-report/lib/models/connection-config.model.ts.html +0 -280
  57. package/coverage/lcov-report/lib/models/index.html +0 -131
  58. package/coverage/lcov-report/lib/models/provider-types.ts.html +0 -577
  59. package/coverage/lcov-report/lib/providers/base-wallet-provider.ts.html +0 -1138
  60. package/coverage/lcov-report/lib/providers/hsuite-native/channel-client.service.ts.html +0 -2671
  61. package/coverage/lcov-report/lib/providers/hsuite-native/index.html +0 -116
  62. package/coverage/lcov-report/lib/providers/hsuite-native-provider.ts.html +0 -2347
  63. package/coverage/lcov-report/lib/providers/index.html +0 -146
  64. package/coverage/lcov-report/lib/providers/p2p-native/index.html +0 -131
  65. package/coverage/lcov-report/lib/providers/p2p-native/p2p-native.provider.ts.html +0 -2254
  66. package/coverage/lcov-report/lib/providers/p2p-native/p2p-session-manager.ts.html +0 -2170
  67. package/coverage/lcov-report/lib/providers/wallet-error-handler.ts.html +0 -1132
  68. package/coverage/lcov-report/lib/providers/walletconnect/core/index.html +0 -176
  69. package/coverage/lcov-report/lib/providers/walletconnect/core/session-health.ts.html +0 -673
  70. package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-client-manager.ts.html +0 -1177
  71. package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-provider.ts.html +0 -2563
  72. package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-session-store.ts.html +0 -904
  73. package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts.html +0 -982
  74. package/coverage/lcov-report/lib/providers/walletconnect/signers/hedera-signer.ts.html +0 -1915
  75. package/coverage/lcov-report/lib/providers/walletconnect/signers/index.html +0 -146
  76. package/coverage/lcov-report/lib/providers/walletconnect/signers/signer-factory.ts.html +0 -445
  77. package/coverage/lcov-report/lib/providers/walletconnect/signers/xrpl-signer.ts.html +0 -1519
  78. package/coverage/lcov-report/lib/services/index.html +0 -191
  79. package/coverage/lcov-report/lib/services/logger.service.ts.html +0 -463
  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 -161
  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 -116
  93. package/coverage/lcov-report/lib/utils/ledger-icons.util.ts.html +0 -319
  94. package/coverage/lcov-report/prettify.css +0 -1
  95. package/coverage/lcov-report/prettify.js +0 -2
  96. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  97. package/coverage/lcov-report/sorter.js +0 -210
  98. package/coverage/lcov.info +0 -18695
  99. package/coverage/lib/components/account-selector/account-actions/account-actions.component.ts.html +0 -868
  100. package/coverage/lib/components/account-selector/account-actions/index.html +0 -116
  101. package/coverage/lib/components/account-selector/account-filter/account-filter.component.ts.html +0 -1288
  102. package/coverage/lib/components/account-selector/account-filter/index.html +0 -116
  103. package/coverage/lib/components/account-selector/account-formatting.service.ts.html +0 -685
  104. package/coverage/lib/components/account-selector/account-grouping.service.ts.html +0 -766
  105. package/coverage/lib/components/account-selector/account-list/account-list.component.ts.html +0 -1495
  106. package/coverage/lib/components/account-selector/account-list/index.html +0 -116
  107. package/coverage/lib/components/account-selector/account-selector.component.ts.html +0 -1495
  108. package/coverage/lib/components/account-selector/account-selector.service.ts.html +0 -1588
  109. package/coverage/lib/components/account-selector/index.html +0 -161
  110. package/coverage/lib/components/wallet-account-display/index.html +0 -116
  111. package/coverage/lib/components/wallet-account-display/wallet-account-display.component.ts.html +0 -505
  112. package/coverage/lib/components/wallet-connect-button/index.html +0 -116
  113. package/coverage/lib/components/wallet-connect-button/wallet-connect-button.component.ts.html +0 -829
  114. package/coverage/lib/components/wallet-connect-prompt/index.html +0 -116
  115. package/coverage/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts.html +0 -409
  116. package/coverage/lib/components/wallet-connected-guard/index.html +0 -116
  117. package/coverage/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts.html +0 -304
  118. package/coverage/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts.html +0 -436
  119. package/coverage/lib/components/wallet-connection-modal/connection-method-step/index.html +0 -116
  120. package/coverage/lib/components/wallet-connection-modal/index.html +0 -116
  121. package/coverage/lib/components/wallet-connection-modal/qr-pairing-step/index.html +0 -116
  122. package/coverage/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts.html +0 -2287
  123. package/coverage/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts.html +0 -2470
  124. package/coverage/lib/components/wallet-session-display/index.html +0 -116
  125. package/coverage/lib/components/wallet-session-display/wallet-session-display.component.ts.html +0 -676
  126. package/coverage/lib/components/wallet-transaction-status/index.html +0 -116
  127. package/coverage/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts.html +0 -703
  128. package/coverage/lib/directives/index.html +0 -146
  129. package/coverage/lib/directives/wallet-connected.directive.ts.html +0 -670
  130. package/coverage/lib/directives/wallet-context.directive.ts.html +0 -547
  131. package/coverage/lib/directives/wallet-events.directive.ts.html +0 -781
  132. package/coverage/lib/hsuite-wallet.module.ts.html +0 -715
  133. package/coverage/lib/index.html +0 -116
  134. package/coverage/lib/models/connection-config.model.ts.html +0 -280
  135. package/coverage/lib/models/index.html +0 -131
  136. package/coverage/lib/models/provider-types.ts.html +0 -577
  137. package/coverage/lib/providers/base-wallet-provider.ts.html +0 -1138
  138. package/coverage/lib/providers/hsuite-native/channel-client.service.ts.html +0 -2671
  139. package/coverage/lib/providers/hsuite-native/index.html +0 -116
  140. package/coverage/lib/providers/hsuite-native-provider.ts.html +0 -2347
  141. package/coverage/lib/providers/index.html +0 -146
  142. package/coverage/lib/providers/p2p-native/index.html +0 -131
  143. package/coverage/lib/providers/p2p-native/p2p-native.provider.ts.html +0 -2254
  144. package/coverage/lib/providers/p2p-native/p2p-session-manager.ts.html +0 -2170
  145. package/coverage/lib/providers/wallet-error-handler.ts.html +0 -1132
  146. package/coverage/lib/providers/walletconnect/core/index.html +0 -176
  147. package/coverage/lib/providers/walletconnect/core/session-health.ts.html +0 -673
  148. package/coverage/lib/providers/walletconnect/core/walletconnect-client-manager.ts.html +0 -1177
  149. package/coverage/lib/providers/walletconnect/core/walletconnect-provider.ts.html +0 -2563
  150. package/coverage/lib/providers/walletconnect/core/walletconnect-session-store.ts.html +0 -904
  151. package/coverage/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts.html +0 -982
  152. package/coverage/lib/providers/walletconnect/signers/hedera-signer.ts.html +0 -1915
  153. package/coverage/lib/providers/walletconnect/signers/index.html +0 -146
  154. package/coverage/lib/providers/walletconnect/signers/signer-factory.ts.html +0 -445
  155. package/coverage/lib/providers/walletconnect/signers/xrpl-signer.ts.html +0 -1519
  156. package/coverage/lib/services/index.html +0 -191
  157. package/coverage/lib/services/logger.service.ts.html +0 -463
  158. package/coverage/lib/services/transaction-builders/base-transaction-builder.service.ts.html +0 -1840
  159. package/coverage/lib/services/transaction-builders/hedera-amount-utils.ts.html +0 -337
  160. package/coverage/lib/services/transaction-builders/hedera-transaction-builder.service.ts.html +0 -3940
  161. package/coverage/lib/services/transaction-builders/index.html +0 -161
  162. package/coverage/lib/services/transaction-builders/xrpl-transaction-builder.service.ts.html +0 -2581
  163. package/coverage/lib/services/transaction.service.ts.html +0 -1120
  164. package/coverage/lib/services/unified-wallet.service.ts.html +0 -2638
  165. package/coverage/lib/services/wallet-context.service.ts.html +0 -637
  166. package/coverage/lib/services/wallet-event-bus.service.ts.html +0 -643
  167. package/coverage/lib/services/wallet-providers.service.ts.html +0 -493
  168. package/coverage/lib/transports/chrome-extension-transport.ts.html +0 -823
  169. package/coverage/lib/transports/index.html +0 -116
  170. package/coverage/lib/utils/index.html +0 -116
  171. package/coverage/lib/utils/ledger-icons.util.ts.html +0 -319
  172. package/coverage/prettify.css +0 -1
  173. package/coverage/prettify.js +0 -2
  174. package/coverage/sort-arrow-sprite.png +0 -0
  175. package/coverage/sorter.js +0 -210
  176. package/examples/minimal-connect.ts +0 -178
  177. package/examples/multi-protocol.ts +0 -495
  178. package/examples/transaction-signing.ts +0 -361
  179. package/jest.config.json +0 -45
  180. package/karma.conf.js +0 -42
  181. package/ng-package.json +0 -20
  182. package/src/index.ts +0 -203
  183. package/src/lib/components/account-selector/account-actions/account-actions.component.ts +0 -261
  184. package/src/lib/components/account-selector/account-filter/account-filter.component.ts +0 -401
  185. package/src/lib/components/account-selector/account-formatting.service.ts +0 -200
  186. package/src/lib/components/account-selector/account-grouping.service.ts +0 -227
  187. package/src/lib/components/account-selector/account-list/account-list.component.ts +0 -470
  188. package/src/lib/components/account-selector/account-selector.component.html +0 -135
  189. package/src/lib/components/account-selector/account-selector.component.scss +0 -2039
  190. package/src/lib/components/account-selector/account-selector.component.ts +0 -470
  191. package/src/lib/components/account-selector/account-selector.service.ts +0 -501
  192. package/src/lib/components/wallet-account-display/wallet-account-display.component.html +0 -34
  193. package/src/lib/components/wallet-account-display/wallet-account-display.component.scss +0 -99
  194. package/src/lib/components/wallet-account-display/wallet-account-display.component.ts +0 -140
  195. package/src/lib/components/wallet-connect-button/wallet-connect-button.component.html +0 -14
  196. package/src/lib/components/wallet-connect-button/wallet-connect-button.component.scss +0 -272
  197. package/src/lib/components/wallet-connect-button/wallet-connect-button.component.spec.ts +0 -89
  198. package/src/lib/components/wallet-connect-button/wallet-connect-button.component.ts +0 -248
  199. package/src/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.html +0 -24
  200. package/src/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.scss +0 -50
  201. package/src/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts +0 -108
  202. package/src/lib/components/wallet-connected-guard/wallet-connected-guard.component.html +0 -24
  203. package/src/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts +0 -73
  204. package/src/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.html +0 -56
  205. package/src/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.scss +0 -218
  206. package/src/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts +0 -117
  207. package/src/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.html +0 -94
  208. package/src/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.scss +0 -272
  209. package/src/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts +0 -734
  210. package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.html +0 -192
  211. package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.scss +0 -678
  212. package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.spec.ts +0 -173
  213. package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts +0 -795
  214. package/src/lib/components/wallet-session-display/wallet-session-display.component.html +0 -110
  215. package/src/lib/components/wallet-session-display/wallet-session-display.component.scss +0 -179
  216. package/src/lib/components/wallet-session-display/wallet-session-display.component.ts +0 -197
  217. package/src/lib/components/wallet-transaction-status/wallet-transaction-status.component.html +0 -65
  218. package/src/lib/components/wallet-transaction-status/wallet-transaction-status.component.scss +0 -254
  219. package/src/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts +0 -206
  220. package/src/lib/directives/wallet-connected.directive.ts +0 -195
  221. package/src/lib/directives/wallet-context.directive.ts +0 -154
  222. package/src/lib/directives/wallet-events.directive.ts +0 -232
  223. package/src/lib/hsuite-wallet.module.ts +0 -210
  224. package/src/lib/models/connection-config.model.ts +0 -65
  225. package/src/lib/models/provider-types.ts +0 -164
  226. package/src/lib/models/unified-account.model.ts +0 -76
  227. package/src/lib/models/wallet-context.model.ts +0 -121
  228. package/src/lib/models/wallet-events.model.ts +0 -158
  229. package/src/lib/providers/base-wallet-provider.ts +0 -351
  230. package/src/lib/providers/hsuite-native/channel-client.service.spec.ts +0 -73
  231. package/src/lib/providers/hsuite-native/channel-client.service.ts +0 -862
  232. package/src/lib/providers/hsuite-native/index.ts +0 -8
  233. package/src/lib/providers/hsuite-native-provider.ts +0 -754
  234. package/src/lib/providers/mobile-native/mobile-native.provider.spec.ts +0 -19
  235. package/src/lib/providers/p2p-native/index.ts +0 -30
  236. package/src/lib/providers/p2p-native/p2p-native.provider.spec.ts +0 -523
  237. package/src/lib/providers/p2p-native/p2p-native.provider.ts +0 -723
  238. package/src/lib/providers/p2p-native/p2p-session-manager.ts +0 -695
  239. package/src/lib/providers/wallet-error-handler.ts +0 -349
  240. package/src/lib/providers/walletconnect/core/base-signer.interface.ts +0 -122
  241. package/src/lib/providers/walletconnect/core/session-health.ts +0 -196
  242. package/src/lib/providers/walletconnect/core/walletconnect-client-manager.ts +0 -364
  243. package/src/lib/providers/walletconnect/core/walletconnect-provider.integration.spec.ts +0 -348
  244. package/src/lib/providers/walletconnect/core/walletconnect-provider.ts +0 -826
  245. package/src/lib/providers/walletconnect/core/walletconnect-session-store.ts +0 -273
  246. package/src/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts +0 -299
  247. package/src/lib/providers/walletconnect/core/walletconnect-types.ts +0 -48
  248. package/src/lib/providers/walletconnect/index.ts +0 -33
  249. package/src/lib/providers/walletconnect/signers/hedera-signer.spec.ts +0 -367
  250. package/src/lib/providers/walletconnect/signers/hedera-signer.ts +0 -610
  251. package/src/lib/providers/walletconnect/signers/signer-factory.spec.ts +0 -62
  252. package/src/lib/providers/walletconnect/signers/signer-factory.ts +0 -120
  253. package/src/lib/providers/walletconnect/signers/xrpl-signer.spec.ts +0 -296
  254. package/src/lib/providers/walletconnect/signers/xrpl-signer.ts +0 -478
  255. package/src/lib/services/logger.service.ts +0 -126
  256. package/src/lib/services/transaction-builders/base-transaction-builder.service.ts +0 -585
  257. package/src/lib/services/transaction-builders/hedera-amount-utils.ts +0 -84
  258. package/src/lib/services/transaction-builders/hedera-transaction-builder.service.spec.ts +0 -741
  259. package/src/lib/services/transaction-builders/hedera-transaction-builder.service.ts +0 -1285
  260. package/src/lib/services/transaction-builders/index.ts +0 -54
  261. package/src/lib/services/transaction-builders/xrpl-transaction-builder.service.spec.ts +0 -937
  262. package/src/lib/services/transaction-builders/xrpl-transaction-builder.service.ts +0 -832
  263. package/src/lib/services/transaction.service.ts +0 -345
  264. package/src/lib/services/unified-wallet.service.spec.ts +0 -1382
  265. package/src/lib/services/unified-wallet.service.ts +0 -851
  266. package/src/lib/services/wallet-context.service.ts +0 -184
  267. package/src/lib/services/wallet-event-bus.service.ts +0 -186
  268. package/src/lib/services/wallet-providers.service.ts +0 -136
  269. package/src/lib/transports/chrome-extension-transport.ts +0 -246
  270. package/src/lib/utils/index.ts +0 -14
  271. package/src/lib/utils/ledger-icons.util.ts +0 -78
  272. package/test/test-setup.ts +0 -21
  273. package/test-setup.ts +0 -63
  274. package/tsconfig.build.json +0 -11
  275. package/tsconfig.json +0 -29
  276. package/tsconfig.spec.json +0 -15
  277. package/vitest.config.ts +0 -48
@@ -1,164 +0,0 @@
1
- /**
2
- * @file Type definitions for wallet connection providers.
3
- *
4
- * @module models/provider-types
5
- *
6
- * @description
7
- * Defines the core type definitions used throughout the Angular SDK for wallet
8
- * provider management. Includes provider types, connection status, metadata
9
- * interfaces, and configuration interfaces for each supported protocol.
10
- *
11
- * **Provider Types:**
12
- * - `hsuite-native` - HSuite Native Connect protocol
13
- * - `walletconnect-v2` - WalletConnect v2 protocol
14
- * - `mobile-native` - P2P Native mobile connections
15
- *
16
- * **Connection Status Lifecycle:**
17
- * ```
18
- * idle -> connecting -> connected -> disconnecting -> disconnected
19
- * \-> error
20
- * ```
21
- */
22
-
23
- /**
24
- * Supported wallet connection protocol types.
25
- *
26
- * @description
27
- * Identifies the wallet connection protocol used by a provider.
28
- * Each type has different capabilities and configuration requirements.
29
- *
30
- * - `hsuite-native` - Direct HSuite wallet connections via Nostr/WebRTC
31
- * - `walletconnect-v2` - WalletConnect v2 protocol for mobile wallets
32
- * - `mobile-native` - Direct P2P connections to mobile wallets
33
- */
34
- export type ProviderType = 'hsuite-native' | 'walletconnect-v2' | 'mobile-native';
35
-
36
- /**
37
- * Connection status for a provider.
38
- *
39
- * @description
40
- * Tracks the lifecycle state of a wallet connection. UI components can
41
- * use this to show appropriate feedback (loading spinners, error messages, etc.).
42
- *
43
- * **Status Values:**
44
- * - `idle` - Not connected, no connection attempt in progress
45
- * - `connecting` - Connection attempt in progress
46
- * - `connected` - Successfully connected to wallet
47
- * - `disconnecting` - Disconnection in progress
48
- * - `disconnected` - Previously connected, now disconnected
49
- * - `error` - Connection failed
50
- */
51
- export type ConnectionStatus =
52
- | 'idle'
53
- | 'connecting'
54
- | 'connected'
55
- | 'disconnecting'
56
- | 'disconnected'
57
- | 'error';
58
-
59
- /**
60
- * Provider metadata for display purposes.
61
- *
62
- * @description
63
- * Contains display information about a wallet provider, used by UI components
64
- * to show provider information in connection dialogs and account selectors.
65
- */
66
- export interface ProviderMetadata {
67
- id?: string;
68
- name: string;
69
- type: ProviderType;
70
- description: string;
71
- iconUrl?: string;
72
- icon?: string;
73
- supportsMultipleAccounts?: boolean;
74
- features?: string[];
75
- }
76
-
77
- /**
78
- * Production HSuite Wallet URL.
79
- *
80
- * @description
81
- * Single source of truth for the wallet origin the SDK targets when a consuming
82
- * dApp does not supply its own `walletUrl`. Point local development at a dev
83
- * server by passing an explicit `walletUrl` (e.g. `http://localhost:8100`) on the
84
- * connection config or UI component; the SDK default must stay production-safe so
85
- * published dApps never open the wallet on localhost.
86
- */
87
- export const DEFAULT_WALLET_URL = 'https://wallet.hsuite.app';
88
-
89
- /**
90
- * HSuite Native Connect configuration.
91
- *
92
- * @description
93
- * Configuration for connecting via the HSuite Native protocol. This protocol
94
- * uses Nostr for discovery and WebRTC for direct P2P communication.
95
- *
96
- * **Required Fields:**
97
- * - `type` - Must be 'hsuite-native'
98
- * - `appId` - Unique identifier for your dApp
99
- * - `appName` - Display name for your dApp
100
- * - `ledgerId` - Target blockchain ('hedera' or 'xrpl')
101
- * - `networkId` - Target network (e.g., 'testnet', 'mainnet')
102
- */
103
- export interface HsuiteNativeConfig {
104
- type: 'hsuite-native';
105
- appId: string;
106
- appName: string;
107
- ledgerId: string;
108
- networkId: string;
109
- appUrl?: string;
110
- appIconUrl?: string;
111
- /** Wallet origin to open. Defaults to {@link DEFAULT_WALLET_URL} (production); set to a dev server for local testing. */
112
- walletUrl?: string;
113
- metadata?: Record<string, unknown>;
114
- }
115
-
116
- /**
117
- * WalletConnect v2 configuration.
118
- *
119
- * @description
120
- * Configuration for connecting via WalletConnect v2 protocol. Requires a
121
- * WalletConnect Cloud project ID obtained from https://cloud.walletconnect.com.
122
- *
123
- * **Required Fields:**
124
- * - `type` - Must be 'walletconnect-v2'
125
- * - `projectId` - WalletConnect Cloud project ID
126
- * - `ledgerId` - Target blockchain ('hedera' or 'xrpl')
127
- * - `networkId` - Target network (e.g., 'hedera:testnet')
128
- */
129
- export interface WalletConnectV2Config {
130
- type: 'walletconnect-v2';
131
- projectId: string; // WalletConnect Cloud project ID - REQUIRED
132
- ledgerId: 'hedera' | 'xrpl'; // Which ledger to connect to
133
- networkId: string; // e.g., 'hedera:testnet' or 'xrpl:testnet'
134
- appName?: string;
135
- appDescription?: string;
136
- appIconUrl?: string;
137
- }
138
-
139
- /**
140
- * Mobile Native P2P configuration.
141
- *
142
- * @description
143
- * Configuration for direct P2P connections to mobile wallets. This protocol
144
- * bypasses relay servers for direct device-to-device communication.
145
- *
146
- * All fields are optional as the P2P provider can operate with defaults.
147
- */
148
- export interface MobileNativeConfig {
149
- type: 'mobile-native';
150
- appId?: string;
151
- appName?: string;
152
- ledgerId?: string;
153
- networkId?: string;
154
- metadata?: Record<string, unknown>;
155
- }
156
-
157
- /**
158
- * Union type of all connection configurations.
159
- *
160
- * @description
161
- * Represents any valid connection configuration for the supported wallet providers.
162
- * Use type guards from connection-config.model.ts to narrow to specific config types.
163
- */
164
- export type ConnectionConfig = HsuiteNativeConfig | WalletConnectV2Config | MobileNativeConfig;
@@ -1,76 +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 Unified account model that works across all wallet providers.
13
- *
14
- * @module models/unified-account
15
- *
16
- * @description
17
- * Defines the UnifiedAccount interface that provides a consistent representation
18
- * of blockchain accounts regardless of the underlying wallet provider or ledger type.
19
- * This normalization allows dApps to work with accounts uniformly whether they come
20
- * from HSuite Native, WalletConnect, or P2P Native connections.
21
- *
22
- * **Key Properties:**
23
- * - `id` - Unique identifier combining provider and address
24
- * - `address` - Blockchain-specific account identifier
25
- * - `ledgerId` - Which blockchain ('hedera', 'xrpl')
26
- * - `networkId` - Which network ('testnet', 'mainnet')
27
- * - `providerId` - Which provider manages this account
28
- * - `metadata` - Provider-specific additional data
29
- */
30
-
31
- import type { ProviderType } from './provider-types';
32
-
33
- /**
34
- * Unified account representation across all wallet providers.
35
- *
36
- * @description
37
- * A normalized account interface that provides consistent access to account
38
- * properties regardless of the underlying wallet type. All connected accounts
39
- * from all providers are represented using this interface.
40
- */
41
- export interface UnifiedAccount {
42
- /** Unique identifier for this account */
43
- id: string;
44
-
45
- /** Account address/public key */
46
- address: string;
47
-
48
- /** Human-readable label */
49
- label?: string;
50
-
51
- /** Ledger ID (e.g., 'hedera', 'xrpl') */
52
- ledgerId: string;
53
-
54
- /** Network ID (e.g., 'hedera:testnet', 'xrpl:mainnet') */
55
- networkId: string;
56
-
57
- /** Provider that manages this account */
58
- providerId: string;
59
- providerType: ProviderType;
60
-
61
- /** Optional metadata from the provider */
62
- metadata?: Record<string, unknown>;
63
- }
64
-
65
- /**
66
- * Account with balance information.
67
- *
68
- * @description
69
- * Extension of UnifiedAccount that includes balance data for display purposes.
70
- * Used by UI components that need to show account balances.
71
- */
72
- export interface AccountWithBalance extends UnifiedAccount {
73
- balance?: string;
74
- balanceFormatted?: string;
75
- currencySymbol?: string;
76
- }
@@ -1,121 +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 Unified wallet context model for declarative state access.
13
- *
14
- * @module models/wallet-context
15
- *
16
- * @description
17
- * Defines the WalletContext interface that provides a single, cohesive interface
18
- * for all wallet state. This model eliminates the need to manually track multiple
19
- * signals across different services by aggregating all wallet information.
20
- *
21
- * The WalletContext is the primary data structure used by:
22
- * - {@link WalletContextService} to compute and expose wallet state
23
- * - {@link WalletContextDirective} to provide context to templates
24
- * - {@link WalletConnectedDirective} for conditional rendering
25
- */
26
-
27
- import type { UnifiedAccount } from './unified-account.model';
28
- import type { BaseWalletProvider } from '../providers/base-wallet-provider';
29
-
30
- /**
31
- * Unified wallet context interface.
32
- *
33
- * @description
34
- * Aggregates all wallet state into a single, reactive context object.
35
- * Used by `*walletContext` and `*walletConnected` directives to provide
36
- * declarative state access in templates.
37
- *
38
- * **Properties:**
39
- * - `isConnected` - True if any account is available
40
- * - `activeAccount` - Currently selected account (null if none)
41
- * - `allAccounts` - All accounts from all providers
42
- * - `sessions` - Active sessions with metadata
43
- * - `providers` - All registered providers
44
- * - `connectedProviders` - Only providers with active connections
45
- */
46
- export interface WalletContext {
47
- /**
48
- * Whether unknown wallet provider is currently connected
49
- */
50
- isConnected: boolean;
51
-
52
- /**
53
- * The currently active account across all providers
54
- * Null if no account is selected
55
- */
56
- activeAccount: UnifiedAccount | null;
57
-
58
- /**
59
- * All accounts from all connected providers
60
- * Empty array if no providers are connected
61
- */
62
- allAccounts: UnifiedAccount[];
63
-
64
- /**
65
- * All active sessions across providers
66
- * For HSuite Native: single session with multiple accounts
67
- * For WalletConnect: multiple sessions, one per wallet
68
- */
69
- sessions: WalletSession[];
70
-
71
- /**
72
- * All registered wallet providers
73
- * Includes both connected and disconnected providers
74
- */
75
- providers: BaseWalletProvider[];
76
-
77
- /**
78
- * Only the currently connected providers
79
- */
80
- connectedProviders: BaseWalletProvider[];
81
- }
82
-
83
- /**
84
- * Session information for display and management.
85
- *
86
- * @description
87
- * Represents a single wallet session, which may contain multiple accounts.
88
- * For HSuite Native, there's typically one session with multiple accounts.
89
- * For WalletConnect, there may be multiple sessions (one per paired wallet).
90
- */
91
- export interface WalletSession {
92
- /**
93
- * Unique provider identifier
94
- */
95
- providerId: string;
96
-
97
- /**
98
- * Provider type (hsuite-native, walletconnect-v2)
99
- */
100
- providerType: string;
101
-
102
- /**
103
- * Human-readable provider name
104
- */
105
- providerName: string;
106
-
107
- /**
108
- * Accounts in this session
109
- */
110
- accounts: UnifiedAccount[];
111
-
112
- /**
113
- * Additional session metadata
114
- */
115
- metadata?: {
116
- sessionKey?: string;
117
- topic?: string;
118
- networkId?: string;
119
- [key: string]: any;
120
- };
121
- }
@@ -1,158 +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 Event types for the WalletEventBus system.
13
- *
14
- * @module models/wallet-events
15
- *
16
- * @description
17
- * Defines the event interfaces used by the WalletEventBus system. These events
18
- * allow dApps to react to wallet-level changes that happen outside direct user
19
- * interaction, such as wallet-initiated disconnects, session restorations,
20
- * and account switches.
21
- *
22
- * **Event Types:**
23
- * - {@link ConnectionEvent} - Provider connected
24
- * - {@link DisconnectionEvent} - Provider disconnected
25
- * - {@link AccountChangeEvent} - Active account changed
26
- * - {@link AccountsUpdateEvent} - Account list updated
27
- * - {@link SessionEvent} - Session created/deleted/restored
28
- * - {@link ProviderStatusEvent} - Provider status changed
29
- * - {@link ProviderErrorEvent} - Provider error occurred
30
- *
31
- * All events include a `timestamp` field (Unix milliseconds) for ordering
32
- * and debugging purposes.
33
- */
34
-
35
- import type { UnifiedAccount } from './unified-account.model';
36
-
37
- /**
38
- * Emitted when a provider successfully connects.
39
- *
40
- * @description
41
- * Fired after a wallet connection is established and accounts are available.
42
- * Use this event to update UI, fetch balances, or perform post-connection logic.
43
- */
44
- export interface ConnectionEvent {
45
- providerId: string;
46
- providerType: 'hsuite-native' | 'walletconnect-v2';
47
- accounts: UnifiedAccount[];
48
- timestamp: number;
49
- }
50
-
51
- /**
52
- * Emitted when a provider disconnects.
53
- *
54
- * @description
55
- * Fired when a wallet connection is terminated. Can be user-initiated
56
- * (via disconnect button) or wallet-initiated (remote disconnect).
57
- *
58
- * **Reason Values:**
59
- * - `'user_initiated'` - User clicked disconnect in dApp
60
- * - `'wallet_initiated_disconnect'` - Wallet app terminated session
61
- * - `'session_terminated'` - Session ended by protocol
62
- * - `'session_expired'` - Session timed out
63
- */
64
- export interface DisconnectionEvent {
65
- providerId: string;
66
- providerType: string;
67
- sessionKey?: string;
68
- reason?:
69
- | 'user_initiated'
70
- | 'wallet_initiated_disconnect'
71
- | 'session_terminated'
72
- | 'session_expired'
73
- | string;
74
- timestamp: number;
75
- }
76
-
77
- /**
78
- * Emitted when the active account changes.
79
- *
80
- * @description
81
- * Fired when the user switches between accounts via setActiveAccount() or
82
- * account selector UI. Includes both the previous and new account for
83
- * comparison and transition logic.
84
- */
85
- export interface AccountChangeEvent {
86
- previousAccount: UnifiedAccount | null;
87
- newAccount: UnifiedAccount | null;
88
- timestamp: number;
89
- }
90
-
91
- /**
92
- * Emitted when a provider's account list updates.
93
- *
94
- * @description
95
- * Fired when accounts are added or removed from a provider. This can happen
96
- * when the wallet adds new accounts or when the user grants access to
97
- * additional accounts.
98
- */
99
- export interface AccountsUpdateEvent {
100
- providerId: string;
101
- accounts: UnifiedAccount[];
102
- totalAccounts: number;
103
- timestamp: number;
104
- }
105
-
106
- /**
107
- * Emitted for session lifecycle events (created, deleted, restored).
108
- *
109
- * @description
110
- * Fired when a session is created, deleted, or restored. Sessions represent
111
- * a logical connection to a wallet, which may contain multiple accounts.
112
- *
113
- * This same interface is used for:
114
- * - `sessionCreated` - New session established
115
- * - `sessionDeleted` - Session terminated
116
- * - `sessionRestored` - Session restored from storage
117
- */
118
- export interface SessionEvent {
119
- providerId: string;
120
- sessionKey: string;
121
- accounts: UnifiedAccount[];
122
- metadata?: Record<string, unknown>;
123
- timestamp: number;
124
- }
125
-
126
- /**
127
- * Emitted when a provider's status changes.
128
- *
129
- * @description
130
- * Fired when a provider transitions between connection states. Useful for
131
- * showing loading indicators or status badges.
132
- *
133
- * **Status Values:**
134
- * - `'connecting'` - Connection attempt in progress
135
- * - `'connected'` - Successfully connected
136
- * - `'disconnected'` - Not connected
137
- * - `'error'` - Connection failed
138
- */
139
- export interface ProviderStatusEvent {
140
- providerId: string;
141
- status: 'connecting' | 'connected' | 'disconnected' | 'error';
142
- timestamp: number;
143
- }
144
-
145
- /**
146
- * Emitted when a provider encounters an error.
147
- *
148
- * @description
149
- * Fired when a wallet operation fails. Includes the error details and
150
- * optional context about what operation failed. Use this to display
151
- * error messages to users or for debugging.
152
- */
153
- export interface ProviderErrorEvent {
154
- providerId: string;
155
- error: Error | string;
156
- context?: string;
157
- timestamp: number;
158
- }