@hsuite/native-connect-angular 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coverage/coverage-summary.json +25 -21
- package/coverage/index.html +108 -108
- package/coverage/lcov-report/index.html +108 -108
- package/coverage/lcov-report/lib/components/account-selector/account-actions/account-actions.component.ts.html +1 -1
- package/coverage/lcov-report/lib/components/account-selector/account-actions/index.html +1 -1
- package/coverage/lcov-report/lib/components/account-selector/account-filter/account-filter.component.ts.html +1 -1
- package/coverage/lcov-report/lib/components/account-selector/account-filter/index.html +1 -1
- package/coverage/lcov-report/lib/components/account-selector/account-formatting.service.ts.html +13 -19
- package/coverage/lcov-report/lib/components/account-selector/account-grouping.service.ts.html +1 -1
- package/coverage/lcov-report/lib/components/account-selector/account-list/account-list.component.ts.html +1 -1
- package/coverage/lcov-report/lib/components/account-selector/account-list/index.html +1 -1
- package/coverage/lcov-report/lib/components/account-selector/account-selector.component.ts.html +1 -1
- package/coverage/lcov-report/lib/components/account-selector/account-selector.service.ts.html +1 -1
- package/coverage/lcov-report/lib/components/account-selector/index.html +5 -5
- package/coverage/lcov-report/lib/components/wallet-account-display/index.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-account-display/wallet-account-display.component.ts.html +10 -10
- package/coverage/lcov-report/lib/components/wallet-connect-button/index.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-connect-button/wallet-connect-button.component.ts.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-connect-prompt/index.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-connected-guard/index.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-connection-modal/connection-method-step/index.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-connection-modal/index.html +15 -15
- package/coverage/lcov-report/lib/components/wallet-connection-modal/qr-pairing-step/index.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts.html +84 -36
- package/coverage/lcov-report/lib/components/wallet-session-display/index.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-session-display/wallet-session-display.component.ts.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-transaction-status/index.html +1 -1
- package/coverage/lcov-report/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts.html +1 -1
- package/coverage/lcov-report/lib/directives/index.html +1 -1
- package/coverage/lcov-report/lib/directives/wallet-connected.directive.ts.html +1 -1
- package/coverage/lcov-report/lib/directives/wallet-context.directive.ts.html +1 -1
- package/coverage/lcov-report/lib/directives/wallet-events.directive.ts.html +1 -1
- package/coverage/lcov-report/lib/hsuite-wallet.module.ts.html +1 -1
- package/coverage/lcov-report/lib/index.html +1 -1
- package/coverage/lcov-report/lib/models/connection-config.model.ts.html +1 -1
- package/coverage/lcov-report/lib/models/index.html +7 -7
- package/coverage/lcov-report/lib/models/provider-types.ts.html +11 -5
- package/coverage/lcov-report/lib/providers/base-wallet-provider.ts.html +20 -20
- package/coverage/lcov-report/lib/providers/hsuite-native/channel-client.service.ts.html +639 -636
- package/coverage/lcov-report/lib/providers/hsuite-native/index.html +19 -19
- package/coverage/lcov-report/lib/providers/hsuite-native-provider.ts.html +1 -1
- package/coverage/lcov-report/lib/providers/index.html +18 -18
- package/coverage/lcov-report/lib/providers/p2p-native/index.html +22 -22
- package/coverage/lcov-report/lib/providers/p2p-native/p2p-native.provider.ts.html +993 -993
- package/coverage/lcov-report/lib/providers/p2p-native/p2p-session-manager.ts.html +7 -4
- package/coverage/lcov-report/lib/providers/wallet-error-handler.ts.html +1 -1
- package/coverage/lcov-report/lib/providers/walletconnect/core/index.html +65 -65
- package/coverage/lcov-report/lib/providers/walletconnect/core/session-health.ts.html +240 -240
- package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-client-manager.ts.html +559 -559
- package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-provider.ts.html +1108 -1105
- package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-session-store.ts.html +493 -493
- package/coverage/lcov-report/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts.html +366 -366
- package/coverage/lcov-report/lib/providers/walletconnect/signers/hedera-signer.ts.html +730 -730
- package/coverage/lcov-report/lib/providers/walletconnect/signers/index.html +43 -43
- package/coverage/lcov-report/lib/providers/walletconnect/signers/signer-factory.ts.html +234 -234
- package/coverage/lcov-report/lib/providers/walletconnect/signers/xrpl-signer.ts.html +650 -650
- package/coverage/lcov-report/lib/services/hsuite-auth.interceptor.ts.html +568 -0
- package/coverage/lcov-report/lib/services/index.html +50 -20
- package/coverage/lcov-report/lib/services/logger.service.ts.html +1 -1
- package/coverage/lcov-report/lib/services/smart-session.service.ts.html +1264 -0
- package/coverage/lcov-report/lib/services/transaction-builders/active-account-source.ts.html +250 -0
- package/coverage/lcov-report/lib/services/transaction-builders/base-transaction-builder.service.ts.html +1 -1
- package/coverage/lcov-report/lib/services/transaction-builders/hedera-amount-utils.ts.html +155 -155
- package/coverage/lcov-report/lib/services/transaction-builders/hedera-transaction-builder.service.ts.html +2156 -2156
- package/coverage/lcov-report/lib/services/transaction-builders/index.html +58 -43
- package/coverage/lcov-report/lib/services/transaction-builders/xrpl-transaction-builder.service.ts.html +1674 -1674
- package/coverage/lcov-report/lib/services/transaction.service.ts.html +4 -4
- package/coverage/lcov-report/lib/services/unified-wallet.service.ts.html +3 -3
- package/coverage/lcov-report/lib/services/wallet-context.service.ts.html +1 -1
- package/coverage/lcov-report/lib/services/wallet-event-bus.service.ts.html +249 -249
- package/coverage/lcov-report/lib/services/wallet-providers.service.ts.html +1 -1
- package/coverage/lcov-report/lib/transports/chrome-extension-transport.ts.html +1 -1
- package/coverage/lcov-report/lib/transports/index.html +1 -1
- package/coverage/lcov-report/lib/utils/index.html +36 -21
- package/coverage/lcov-report/lib/utils/ledger-icons.util.ts.html +254 -161
- package/coverage/lcov-report/lib/utils/ledger-ui-registry.ts.html +676 -0
- package/coverage/lcov.info +8567 -6896
- package/coverage/lib/components/account-selector/account-actions/account-actions.component.ts.html +1 -1
- package/coverage/lib/components/account-selector/account-actions/index.html +1 -1
- package/coverage/lib/components/account-selector/account-filter/account-filter.component.ts.html +1 -1
- package/coverage/lib/components/account-selector/account-filter/index.html +1 -1
- package/coverage/lib/components/account-selector/account-formatting.service.ts.html +13 -19
- package/coverage/lib/components/account-selector/account-grouping.service.ts.html +1 -1
- package/coverage/lib/components/account-selector/account-list/account-list.component.ts.html +1 -1
- package/coverage/lib/components/account-selector/account-list/index.html +1 -1
- package/coverage/lib/components/account-selector/account-selector.component.ts.html +1 -1
- package/coverage/lib/components/account-selector/account-selector.service.ts.html +1 -1
- package/coverage/lib/components/account-selector/index.html +5 -5
- package/coverage/lib/components/wallet-account-display/index.html +1 -1
- package/coverage/lib/components/wallet-account-display/wallet-account-display.component.ts.html +10 -10
- package/coverage/lib/components/wallet-connect-button/index.html +1 -1
- package/coverage/lib/components/wallet-connect-button/wallet-connect-button.component.ts.html +1 -1
- package/coverage/lib/components/wallet-connect-prompt/index.html +1 -1
- package/coverage/lib/components/wallet-connect-prompt/wallet-connect-prompt.component.ts.html +1 -1
- package/coverage/lib/components/wallet-connected-guard/index.html +1 -1
- package/coverage/lib/components/wallet-connected-guard/wallet-connected-guard.component.ts.html +1 -1
- package/coverage/lib/components/wallet-connection-modal/connection-method-step/connection-method-step.component.ts.html +1 -1
- package/coverage/lib/components/wallet-connection-modal/connection-method-step/index.html +1 -1
- package/coverage/lib/components/wallet-connection-modal/index.html +15 -15
- package/coverage/lib/components/wallet-connection-modal/qr-pairing-step/index.html +1 -1
- package/coverage/lib/components/wallet-connection-modal/qr-pairing-step/qr-pairing-step.component.ts.html +1 -1
- package/coverage/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts.html +84 -36
- package/coverage/lib/components/wallet-session-display/index.html +1 -1
- package/coverage/lib/components/wallet-session-display/wallet-session-display.component.ts.html +1 -1
- package/coverage/lib/components/wallet-transaction-status/index.html +1 -1
- package/coverage/lib/components/wallet-transaction-status/wallet-transaction-status.component.ts.html +1 -1
- package/coverage/lib/directives/index.html +1 -1
- package/coverage/lib/directives/wallet-connected.directive.ts.html +1 -1
- package/coverage/lib/directives/wallet-context.directive.ts.html +1 -1
- package/coverage/lib/directives/wallet-events.directive.ts.html +1 -1
- package/coverage/lib/hsuite-wallet.module.ts.html +1 -1
- package/coverage/lib/index.html +1 -1
- package/coverage/lib/models/connection-config.model.ts.html +1 -1
- package/coverage/lib/models/index.html +7 -7
- package/coverage/lib/models/provider-types.ts.html +11 -5
- package/coverage/lib/providers/base-wallet-provider.ts.html +20 -20
- package/coverage/lib/providers/hsuite-native/channel-client.service.ts.html +639 -636
- package/coverage/lib/providers/hsuite-native/index.html +19 -19
- package/coverage/lib/providers/hsuite-native-provider.ts.html +1 -1
- package/coverage/lib/providers/index.html +18 -18
- package/coverage/lib/providers/p2p-native/index.html +22 -22
- package/coverage/lib/providers/p2p-native/p2p-native.provider.ts.html +993 -993
- package/coverage/lib/providers/p2p-native/p2p-session-manager.ts.html +7 -4
- package/coverage/lib/providers/wallet-error-handler.ts.html +1 -1
- package/coverage/lib/providers/walletconnect/core/index.html +65 -65
- package/coverage/lib/providers/walletconnect/core/session-health.ts.html +240 -240
- package/coverage/lib/providers/walletconnect/core/walletconnect-client-manager.ts.html +559 -559
- package/coverage/lib/providers/walletconnect/core/walletconnect-provider.ts.html +1108 -1105
- package/coverage/lib/providers/walletconnect/core/walletconnect-session-store.ts.html +493 -493
- package/coverage/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts.html +366 -366
- package/coverage/lib/providers/walletconnect/signers/hedera-signer.ts.html +730 -730
- package/coverage/lib/providers/walletconnect/signers/index.html +43 -43
- package/coverage/lib/providers/walletconnect/signers/signer-factory.ts.html +234 -234
- package/coverage/lib/providers/walletconnect/signers/xrpl-signer.ts.html +650 -650
- package/coverage/lib/services/hsuite-auth.interceptor.ts.html +568 -0
- package/coverage/lib/services/index.html +50 -20
- package/coverage/lib/services/logger.service.ts.html +1 -1
- package/coverage/lib/services/smart-session.service.ts.html +1264 -0
- package/coverage/lib/services/transaction-builders/active-account-source.ts.html +250 -0
- package/coverage/lib/services/transaction-builders/base-transaction-builder.service.ts.html +1 -1
- package/coverage/lib/services/transaction-builders/hedera-amount-utils.ts.html +155 -155
- package/coverage/lib/services/transaction-builders/hedera-transaction-builder.service.ts.html +2156 -2156
- package/coverage/lib/services/transaction-builders/index.html +58 -43
- package/coverage/lib/services/transaction-builders/xrpl-transaction-builder.service.ts.html +1674 -1674
- package/coverage/lib/services/transaction.service.ts.html +4 -4
- package/coverage/lib/services/unified-wallet.service.ts.html +3 -3
- package/coverage/lib/services/wallet-context.service.ts.html +1 -1
- package/coverage/lib/services/wallet-event-bus.service.ts.html +249 -249
- package/coverage/lib/services/wallet-providers.service.ts.html +1 -1
- package/coverage/lib/transports/chrome-extension-transport.ts.html +1 -1
- package/coverage/lib/transports/index.html +1 -1
- package/coverage/lib/utils/index.html +36 -21
- package/coverage/lib/utils/ledger-icons.util.ts.html +254 -161
- package/coverage/lib/utils/ledger-ui-registry.ts.html +676 -0
- package/dist/fesm2022/hsuite-native-connect-angular.mjs +854 -308
- package/dist/fesm2022/hsuite-native-connect-angular.mjs.map +1 -1
- package/dist/index.d.ts +456 -30
- package/package.json +4 -4
- package/src/index.ts +26 -0
- package/src/lib/components/account-selector/account-formatting.service.ts +8 -10
- package/src/lib/components/wallet-account-display/wallet-account-display.component.ts +9 -9
- package/src/lib/components/wallet-connection-modal/wallet-connection-modal.component.ts +34 -18
- package/src/lib/models/provider-types.ts +3 -1
- package/src/lib/models/unified-account.model.ts +4 -1
- package/src/lib/providers/hsuite-native/channel-client.service.ts +1 -0
- package/src/lib/providers/p2p-native/p2p-session-manager.ts +1 -0
- package/src/lib/providers/walletconnect/core/walletconnect-provider.ts +2 -1
- package/src/lib/services/hsuite-auth.interceptor.ts +159 -0
- package/src/lib/services/smart-session.service.ts +378 -0
- package/src/lib/services/transaction-builders/active-account-source.spec.ts +75 -0
- package/src/lib/services/transaction-builders/active-account-source.ts +55 -0
- package/src/lib/services/transaction-builders/hedera-transaction-builder.service.ts +4 -4
- package/src/lib/services/transaction-builders/index.ts +1 -0
- package/src/lib/services/transaction.service.ts +7 -3
- package/src/lib/services/unified-wallet.service.spec.ts +1 -1
- package/src/lib/services/unified-wallet.service.ts +2 -2
- package/src/lib/utils/index.ts +1 -0
- package/src/lib/utils/ledger-icons.util.ts +61 -30
- package/src/lib/utils/ledger-ui-registry.ts +197 -0
package/coverage/lib/providers/walletconnect/core/walletconnect-signing-orchestrator.ts.html
CHANGED
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">59.53% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>178/299</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">71.42% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>5/7</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">55.55% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>5/9</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">59.53% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>178/299</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line medium'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -362,7 +362,138 @@
|
|
|
362
362
|
<a name='L297'></a><a href='#L297'>297</a>
|
|
363
363
|
<a name='L298'></a><a href='#L298'>298</a>
|
|
364
364
|
<a name='L299'></a><a href='#L299'>299</a>
|
|
365
|
-
<a name='L300'></a><a href='#L300'>300</a></td><td class="line-coverage quiet"><span class="cline-any cline-
|
|
365
|
+
<a name='L300'></a><a href='#L300'>300</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
366
|
+
<span class="cline-any cline-yes">1x</span>
|
|
367
|
+
<span class="cline-any cline-yes">1x</span>
|
|
368
|
+
<span class="cline-any cline-yes">1x</span>
|
|
369
|
+
<span class="cline-any cline-yes">1x</span>
|
|
370
|
+
<span class="cline-any cline-yes">1x</span>
|
|
371
|
+
<span class="cline-any cline-yes">1x</span>
|
|
372
|
+
<span class="cline-any cline-yes">1x</span>
|
|
373
|
+
<span class="cline-any cline-yes">1x</span>
|
|
374
|
+
<span class="cline-any cline-yes">1x</span>
|
|
375
|
+
<span class="cline-any cline-yes">1x</span>
|
|
376
|
+
<span class="cline-any cline-yes">1x</span>
|
|
377
|
+
<span class="cline-any cline-yes">1x</span>
|
|
378
|
+
<span class="cline-any cline-yes">1x</span>
|
|
379
|
+
<span class="cline-any cline-yes">1x</span>
|
|
380
|
+
<span class="cline-any cline-yes">1x</span>
|
|
381
|
+
<span class="cline-any cline-yes">1x</span>
|
|
382
|
+
<span class="cline-any cline-yes">1x</span>
|
|
383
|
+
<span class="cline-any cline-yes">1x</span>
|
|
384
|
+
<span class="cline-any cline-yes">1x</span>
|
|
385
|
+
<span class="cline-any cline-yes">1x</span>
|
|
386
|
+
<span class="cline-any cline-yes">1x</span>
|
|
387
|
+
<span class="cline-any cline-yes">1x</span>
|
|
388
|
+
<span class="cline-any cline-yes">1x</span>
|
|
389
|
+
<span class="cline-any cline-yes">1x</span>
|
|
390
|
+
<span class="cline-any cline-yes">1x</span>
|
|
391
|
+
<span class="cline-any cline-yes">1x</span>
|
|
392
|
+
<span class="cline-any cline-yes">1x</span>
|
|
393
|
+
<span class="cline-any cline-yes">1x</span>
|
|
394
|
+
<span class="cline-any cline-yes">1x</span>
|
|
395
|
+
<span class="cline-any cline-yes">1x</span>
|
|
396
|
+
<span class="cline-any cline-yes">1x</span>
|
|
397
|
+
<span class="cline-any cline-yes">1x</span>
|
|
398
|
+
<span class="cline-any cline-yes">1x</span>
|
|
399
|
+
<span class="cline-any cline-yes">1x</span>
|
|
400
|
+
<span class="cline-any cline-yes">1x</span>
|
|
401
|
+
<span class="cline-any cline-yes">1x</span>
|
|
402
|
+
<span class="cline-any cline-yes">1x</span>
|
|
403
|
+
<span class="cline-any cline-yes">1x</span>
|
|
404
|
+
<span class="cline-any cline-yes">1x</span>
|
|
405
|
+
<span class="cline-any cline-yes">1x</span>
|
|
406
|
+
<span class="cline-any cline-yes">1x</span>
|
|
407
|
+
<span class="cline-any cline-yes">1x</span>
|
|
408
|
+
<span class="cline-any cline-yes">1x</span>
|
|
409
|
+
<span class="cline-any cline-yes">1x</span>
|
|
410
|
+
<span class="cline-any cline-yes">1x</span>
|
|
411
|
+
<span class="cline-any cline-yes">1x</span>
|
|
412
|
+
<span class="cline-any cline-yes">1x</span>
|
|
413
|
+
<span class="cline-any cline-yes">1x</span>
|
|
414
|
+
<span class="cline-any cline-yes">1x</span>
|
|
415
|
+
<span class="cline-any cline-yes">1x</span>
|
|
416
|
+
<span class="cline-any cline-yes">1x</span>
|
|
417
|
+
<span class="cline-any cline-yes">1x</span>
|
|
418
|
+
<span class="cline-any cline-yes">1x</span>
|
|
419
|
+
<span class="cline-any cline-yes">1x</span>
|
|
420
|
+
<span class="cline-any cline-yes">1x</span>
|
|
421
|
+
<span class="cline-any cline-yes">16x</span>
|
|
422
|
+
<span class="cline-any cline-yes">16x</span>
|
|
423
|
+
<span class="cline-any cline-yes">16x</span>
|
|
424
|
+
<span class="cline-any cline-yes">16x</span>
|
|
425
|
+
<span class="cline-any cline-yes">16x</span>
|
|
426
|
+
<span class="cline-any cline-yes">16x</span>
|
|
427
|
+
<span class="cline-any cline-yes">16x</span>
|
|
428
|
+
<span class="cline-any cline-yes">16x</span>
|
|
429
|
+
<span class="cline-any cline-yes">16x</span>
|
|
430
|
+
<span class="cline-any cline-yes">16x</span>
|
|
431
|
+
<span class="cline-any cline-yes">16x</span>
|
|
432
|
+
<span class="cline-any cline-yes">16x</span>
|
|
433
|
+
<span class="cline-any cline-yes">16x</span>
|
|
434
|
+
<span class="cline-any cline-yes">16x</span>
|
|
435
|
+
<span class="cline-any cline-yes">16x</span>
|
|
436
|
+
<span class="cline-any cline-yes">16x</span>
|
|
437
|
+
<span class="cline-any cline-yes">16x</span>
|
|
438
|
+
<span class="cline-any cline-yes">16x</span>
|
|
439
|
+
<span class="cline-any cline-yes">16x</span>
|
|
440
|
+
<span class="cline-any cline-yes">16x</span>
|
|
441
|
+
<span class="cline-any cline-yes">16x</span>
|
|
442
|
+
<span class="cline-any cline-yes">16x</span>
|
|
443
|
+
<span class="cline-any cline-yes">2x</span>
|
|
444
|
+
<span class="cline-any cline-yes">2x</span>
|
|
445
|
+
<span class="cline-any cline-yes">2x</span>
|
|
446
|
+
<span class="cline-any cline-yes">2x</span>
|
|
447
|
+
<span class="cline-any cline-yes">2x</span>
|
|
448
|
+
<span class="cline-any cline-yes">2x</span>
|
|
449
|
+
<span class="cline-any cline-yes">2x</span>
|
|
450
|
+
<span class="cline-any cline-yes">2x</span>
|
|
451
|
+
<span class="cline-any cline-yes">2x</span>
|
|
452
|
+
<span class="cline-any cline-yes">2x</span>
|
|
453
|
+
<span class="cline-any cline-yes">2x</span>
|
|
454
|
+
<span class="cline-any cline-yes">2x</span>
|
|
455
|
+
<span class="cline-any cline-yes">2x</span>
|
|
456
|
+
<span class="cline-any cline-yes">2x</span>
|
|
457
|
+
<span class="cline-any cline-yes">2x</span>
|
|
458
|
+
<span class="cline-any cline-yes">2x</span>
|
|
459
|
+
<span class="cline-any cline-yes">2x</span>
|
|
460
|
+
<span class="cline-any cline-yes">2x</span>
|
|
461
|
+
<span class="cline-any cline-yes">2x</span>
|
|
462
|
+
<span class="cline-any cline-yes">2x</span>
|
|
463
|
+
<span class="cline-any cline-yes">16x</span>
|
|
464
|
+
<span class="cline-any cline-yes">16x</span>
|
|
465
|
+
<span class="cline-any cline-yes">16x</span>
|
|
466
|
+
<span class="cline-any cline-yes">16x</span>
|
|
467
|
+
<span class="cline-any cline-yes">16x</span>
|
|
468
|
+
<span class="cline-any cline-yes">16x</span>
|
|
469
|
+
<span class="cline-any cline-yes">16x</span>
|
|
470
|
+
<span class="cline-any cline-yes">2x</span>
|
|
471
|
+
<span class="cline-any cline-yes">2x</span>
|
|
472
|
+
<span class="cline-any cline-yes">2x</span>
|
|
473
|
+
<span class="cline-any cline-yes">2x</span>
|
|
474
|
+
<span class="cline-any cline-yes">2x</span>
|
|
475
|
+
<span class="cline-any cline-yes">2x</span>
|
|
476
|
+
<span class="cline-any cline-yes">2x</span>
|
|
477
|
+
<span class="cline-any cline-yes">2x</span>
|
|
478
|
+
<span class="cline-any cline-yes">2x</span>
|
|
479
|
+
<span class="cline-any cline-yes">2x</span>
|
|
480
|
+
<span class="cline-any cline-yes">2x</span>
|
|
481
|
+
<span class="cline-any cline-yes">2x</span>
|
|
482
|
+
<span class="cline-any cline-yes">2x</span>
|
|
483
|
+
<span class="cline-any cline-yes">2x</span>
|
|
484
|
+
<span class="cline-any cline-yes">2x</span>
|
|
485
|
+
<span class="cline-any cline-yes">2x</span>
|
|
486
|
+
<span class="cline-any cline-yes">2x</span>
|
|
487
|
+
<span class="cline-any cline-yes">2x</span>
|
|
488
|
+
<span class="cline-any cline-yes">2x</span>
|
|
489
|
+
<span class="cline-any cline-yes">2x</span>
|
|
490
|
+
<span class="cline-any cline-yes">16x</span>
|
|
491
|
+
<span class="cline-any cline-yes">16x</span>
|
|
492
|
+
<span class="cline-any cline-yes">16x</span>
|
|
493
|
+
<span class="cline-any cline-yes">16x</span>
|
|
494
|
+
<span class="cline-any cline-yes">16x</span>
|
|
495
|
+
<span class="cline-any cline-yes">16x</span>
|
|
496
|
+
<span class="cline-any cline-yes">16x</span>
|
|
366
497
|
<span class="cline-any cline-no"> </span>
|
|
367
498
|
<span class="cline-any cline-no"> </span>
|
|
368
499
|
<span class="cline-any cline-no"> </span>
|
|
@@ -406,6 +537,13 @@
|
|
|
406
537
|
<span class="cline-any cline-no"> </span>
|
|
407
538
|
<span class="cline-any cline-no"> </span>
|
|
408
539
|
<span class="cline-any cline-no"> </span>
|
|
540
|
+
<span class="cline-any cline-yes">16x</span>
|
|
541
|
+
<span class="cline-any cline-yes">16x</span>
|
|
542
|
+
<span class="cline-any cline-yes">16x</span>
|
|
543
|
+
<span class="cline-any cline-yes">16x</span>
|
|
544
|
+
<span class="cline-any cline-yes">16x</span>
|
|
545
|
+
<span class="cline-any cline-yes">16x</span>
|
|
546
|
+
<span class="cline-any cline-yes">16x</span>
|
|
409
547
|
<span class="cline-any cline-no"> </span>
|
|
410
548
|
<span class="cline-any cline-no"> </span>
|
|
411
549
|
<span class="cline-any cline-no"> </span>
|
|
@@ -428,6 +566,26 @@
|
|
|
428
566
|
<span class="cline-any cline-no"> </span>
|
|
429
567
|
<span class="cline-any cline-no"> </span>
|
|
430
568
|
<span class="cline-any cline-no"> </span>
|
|
569
|
+
<span class="cline-any cline-yes">16x</span>
|
|
570
|
+
<span class="cline-any cline-yes">16x</span>
|
|
571
|
+
<span class="cline-any cline-yes">16x</span>
|
|
572
|
+
<span class="cline-any cline-yes">16x</span>
|
|
573
|
+
<span class="cline-any cline-yes">16x</span>
|
|
574
|
+
<span class="cline-any cline-yes">16x</span>
|
|
575
|
+
<span class="cline-any cline-yes">16x</span>
|
|
576
|
+
<span class="cline-any cline-yes">16x</span>
|
|
577
|
+
<span class="cline-any cline-yes">16x</span>
|
|
578
|
+
<span class="cline-any cline-yes">16x</span>
|
|
579
|
+
<span class="cline-any cline-yes">16x</span>
|
|
580
|
+
<span class="cline-any cline-yes">16x</span>
|
|
581
|
+
<span class="cline-any cline-yes">16x</span>
|
|
582
|
+
<span class="cline-any cline-yes">16x</span>
|
|
583
|
+
<span class="cline-any cline-yes">16x</span>
|
|
584
|
+
<span class="cline-any cline-yes">16x</span>
|
|
585
|
+
<span class="cline-any cline-yes">16x</span>
|
|
586
|
+
<span class="cline-any cline-yes">16x</span>
|
|
587
|
+
<span class="cline-any cline-yes">16x</span>
|
|
588
|
+
<span class="cline-any cline-yes">16x</span>
|
|
431
589
|
<span class="cline-any cline-no"> </span>
|
|
432
590
|
<span class="cline-any cline-no"> </span>
|
|
433
591
|
<span class="cline-any cline-no"> </span>
|
|
@@ -450,6 +608,17 @@
|
|
|
450
608
|
<span class="cline-any cline-no"> </span>
|
|
451
609
|
<span class="cline-any cline-no"> </span>
|
|
452
610
|
<span class="cline-any cline-no"> </span>
|
|
611
|
+
<span class="cline-any cline-yes">16x</span>
|
|
612
|
+
<span class="cline-any cline-yes">16x</span>
|
|
613
|
+
<span class="cline-any cline-yes">16x</span>
|
|
614
|
+
<span class="cline-any cline-yes">16x</span>
|
|
615
|
+
<span class="cline-any cline-yes">16x</span>
|
|
616
|
+
<span class="cline-any cline-yes">16x</span>
|
|
617
|
+
<span class="cline-any cline-yes">16x</span>
|
|
618
|
+
<span class="cline-any cline-yes">4x</span>
|
|
619
|
+
<span class="cline-any cline-yes">4x</span>
|
|
620
|
+
<span class="cline-any cline-yes">4x</span>
|
|
621
|
+
<span class="cline-any cline-yes">4x</span>
|
|
453
622
|
<span class="cline-any cline-no"> </span>
|
|
454
623
|
<span class="cline-any cline-no"> </span>
|
|
455
624
|
<span class="cline-any cline-no"> </span>
|
|
@@ -469,6 +638,13 @@
|
|
|
469
638
|
<span class="cline-any cline-no"> </span>
|
|
470
639
|
<span class="cline-any cline-no"> </span>
|
|
471
640
|
<span class="cline-any cline-no"> </span>
|
|
641
|
+
<span class="cline-any cline-yes">4x</span>
|
|
642
|
+
<span class="cline-any cline-yes">16x</span>
|
|
643
|
+
<span class="cline-any cline-yes">16x</span>
|
|
644
|
+
<span class="cline-any cline-yes">16x</span>
|
|
645
|
+
<span class="cline-any cline-yes">16x</span>
|
|
646
|
+
<span class="cline-any cline-yes">16x</span>
|
|
647
|
+
<span class="cline-any cline-yes">16x</span>
|
|
472
648
|
<span class="cline-any cline-no"> </span>
|
|
473
649
|
<span class="cline-any cline-no"> </span>
|
|
474
650
|
<span class="cline-any cline-no"> </span>
|
|
@@ -484,315 +660,139 @@
|
|
|
484
660
|
<span class="cline-any cline-no"> </span>
|
|
485
661
|
<span class="cline-any cline-no"> </span>
|
|
486
662
|
<span class="cline-any cline-no"> </span>
|
|
487
|
-
<span class="cline-any cline-
|
|
488
|
-
<span class="cline-any cline-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
<span class="
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
<span class="
|
|
620
|
-
<span class="cline-any cline-no"> </span>
|
|
621
|
-
<span class="cline-any cline-no"> </span>
|
|
622
|
-
<span class="cline-any cline-no"> </span>
|
|
623
|
-
<span class="cline-any cline-no"> </span>
|
|
624
|
-
<span class="cline-any cline-no"> </span>
|
|
625
|
-
<span class="cline-any cline-no"> </span>
|
|
626
|
-
<span class="cline-any cline-no"> </span>
|
|
627
|
-
<span class="cline-any cline-no"> </span>
|
|
628
|
-
<span class="cline-any cline-no"> </span>
|
|
629
|
-
<span class="cline-any cline-no"> </span>
|
|
630
|
-
<span class="cline-any cline-no"> </span>
|
|
631
|
-
<span class="cline-any cline-no"> </span>
|
|
632
|
-
<span class="cline-any cline-no"> </span>
|
|
633
|
-
<span class="cline-any cline-no"> </span>
|
|
634
|
-
<span class="cline-any cline-no"> </span>
|
|
635
|
-
<span class="cline-any cline-no"> </span>
|
|
636
|
-
<span class="cline-any cline-no"> </span>
|
|
637
|
-
<span class="cline-any cline-no"> </span>
|
|
638
|
-
<span class="cline-any cline-no"> </span>
|
|
639
|
-
<span class="cline-any cline-no"> </span>
|
|
640
|
-
<span class="cline-any cline-no"> </span>
|
|
641
|
-
<span class="cline-any cline-no"> </span>
|
|
642
|
-
<span class="cline-any cline-no"> </span>
|
|
643
|
-
<span class="cline-any cline-no"> </span>
|
|
644
|
-
<span class="cline-any cline-no"> </span>
|
|
645
|
-
<span class="cline-any cline-no"> </span>
|
|
646
|
-
<span class="cline-any cline-no"> </span>
|
|
647
|
-
<span class="cline-any cline-no"> </span>
|
|
648
|
-
<span class="cline-any cline-no"> </span>
|
|
649
|
-
<span class="cline-any cline-no"> </span>
|
|
650
|
-
<span class="cline-any cline-no"> </span>
|
|
651
|
-
<span class="cline-any cline-no"> </span>
|
|
652
|
-
<span class="cline-any cline-no"> </span>
|
|
653
|
-
<span class="cline-any cline-no"> </span>
|
|
654
|
-
<span class="cline-any cline-no"> </span>
|
|
655
|
-
<span class="cline-any cline-no"> </span>
|
|
656
|
-
<span class="cline-any cline-no"> </span>
|
|
657
|
-
<span class="cline-any cline-no"> </span>
|
|
658
|
-
<span class="cline-any cline-no"> </span>
|
|
659
|
-
<span class="cline-any cline-no"> </span>
|
|
660
|
-
<span class="cline-any cline-no"> </span>
|
|
661
|
-
<span class="cline-any cline-no"> </span>
|
|
662
|
-
<span class="cline-any cline-no"> </span>
|
|
663
|
-
<span class="cline-any cline-no"> </span>
|
|
664
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js"><span class="cstat-no" title="statement not covered" >/**<span class="fstat-no" title="function not covered" ><span class="branch-0 cbranch-no" title="branch not covered" ></span></span></span>
|
|
665
|
-
<span class="cstat-no" title="statement not covered" > * HSuite Native Connect</span>
|
|
666
|
-
<span class="cstat-no" title="statement not covered" > * Copyright 2024-2025 HSuite (https://hsuite.finance)</span>
|
|
667
|
-
<span class="cstat-no" title="statement not covered" > *</span>
|
|
668
|
-
<span class="cstat-no" title="statement not covered" > * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0</span>
|
|
669
|
-
<span class="cstat-no" title="statement not covered" > *</span>
|
|
670
|
-
<span class="cstat-no" title="statement not covered" > * This file is part of HSuite Native Connect. For commercial licensing,</span>
|
|
671
|
-
<span class="cstat-no" title="statement not covered" > * visit https://hsuite.finance/licensing</span>
|
|
672
|
-
<span class="cstat-no" title="statement not covered" > */</span>
|
|
673
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
674
|
-
<span class="cstat-no" title="statement not covered" >/**</span>
|
|
675
|
-
<span class="cstat-no" title="statement not covered" > * @file walletconnect-signing-orchestrator.ts</span>
|
|
676
|
-
<span class="cstat-no" title="statement not covered" > * @description Signing orchestration for WalletConnect provider</span>
|
|
677
|
-
<span class="cstat-no" title="statement not covered" > *</span>
|
|
678
|
-
<span class="cstat-no" title="statement not covered" > * Handles:</span>
|
|
679
|
-
<span class="cstat-no" title="statement not covered" > * - Finding sessions for accounts</span>
|
|
680
|
-
<span class="cstat-no" title="statement not covered" > * - Session validation in WC SDK</span>
|
|
681
|
-
<span class="cstat-no" title="statement not covered" > * - Routing sign/submit requests to appropriate signers</span>
|
|
682
|
-
<span class="cstat-no" title="statement not covered" > *</span>
|
|
683
|
-
<span class="cstat-no" title="statement not covered" > * Extracted from WalletConnectV2Provider to reduce file size.</span>
|
|
684
|
-
<span class="cstat-no" title="statement not covered" > */</span>
|
|
685
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
686
|
-
<span class="cstat-no" title="statement not covered" >import { getLogger } from '@hsuite/native-connect-sdk';</span>
|
|
687
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
688
|
-
<span class="cstat-no" title="statement not covered" >import type { WalletEventBus } from '../../../services/wallet-event-bus.service';</span>
|
|
689
|
-
<span class="cstat-no" title="statement not covered" >import type {</span>
|
|
690
|
-
<span class="cstat-no" title="statement not covered" > SignTransactionOptions,</span>
|
|
691
|
-
<span class="cstat-no" title="statement not covered" > SubmitTransactionOptions,</span>
|
|
692
|
-
<span class="cstat-no" title="statement not covered" > SignResult,</span>
|
|
693
|
-
<span class="cstat-no" title="statement not covered" > SubmitResult,</span>
|
|
694
|
-
<span class="cstat-no" title="statement not covered" > SignMessageOptions,</span>
|
|
695
|
-
<span class="cstat-no" title="statement not covered" > SignMessageResult,</span>
|
|
696
|
-
<span class="cstat-no" title="statement not covered" >} from '../../base-wallet-provider';</span>
|
|
697
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
698
|
-
<span class="cstat-no" title="statement not covered" >import type { WalletConnectClientManager } from './walletconnect-client-manager';</span>
|
|
699
|
-
<span class="cstat-no" title="statement not covered" >import type { WalletConnectSessionStore } from './walletconnect-session-store';</span>
|
|
700
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
701
|
-
<span class="cstat-no" title="statement not covered" >const logger = getLogger().scoped?.('WCSigningOrchestrator') ?? getLogger();</span>
|
|
702
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
703
|
-
<span class="cstat-no" title="statement not covered" >/**</span>
|
|
704
|
-
<span class="cstat-no" title="statement not covered" > * Signing orchestration configuration</span>
|
|
705
|
-
<span class="cstat-no" title="statement not covered" > */</span>
|
|
706
|
-
<span class="cstat-no" title="statement not covered" >export interface SigningOrchestratorConfig {</span>
|
|
707
|
-
<span class="cstat-no" title="statement not covered" > providerId: string;</span>
|
|
708
|
-
<span class="cstat-no" title="statement not covered" > sessionStore: WalletConnectSessionStore;</span>
|
|
709
|
-
<span class="cstat-no" title="statement not covered" > clientManager: WalletConnectClientManager;</span>
|
|
710
|
-
<span class="cstat-no" title="statement not covered" > eventBus: WalletEventBus;</span>
|
|
711
|
-
<span class="cstat-no" title="statement not covered" >}</span>
|
|
712
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
713
|
-
<span class="cstat-no" title="statement not covered" >/**</span>
|
|
714
|
-
<span class="cstat-no" title="statement not covered" > * Signing Orchestrator</span>
|
|
715
|
-
<span class="cstat-no" title="statement not covered" > *</span>
|
|
716
|
-
<span class="cstat-no" title="statement not covered" > * Routes signing requests to the appropriate session and signer.</span>
|
|
717
|
-
<span class="cstat-no" title="statement not covered" > * Handles session validation and error emission.</span>
|
|
718
|
-
<span class="cstat-no" title="statement not covered" > */</span>
|
|
719
|
-
<span class="cstat-no" title="statement not covered" >export class WalletConnectSigningOrchestrator {</span>
|
|
720
|
-
<span class="cstat-no" title="statement not covered" > private readonly providerId: string;</span>
|
|
721
|
-
<span class="cstat-no" title="statement not covered" > private readonly sessionStore: WalletConnectSessionStore;</span>
|
|
722
|
-
<span class="cstat-no" title="statement not covered" > private readonly clientManager: WalletConnectClientManager;</span>
|
|
723
|
-
<span class="cstat-no" title="statement not covered" > private readonly eventBus: WalletEventBus;</span>
|
|
724
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
725
|
-
<span class="cstat-no" title="statement not covered" > /**</span>
|
|
726
|
-
<span class="cstat-no" title="statement not covered" > *</span>
|
|
727
|
-
<span class="cstat-no" title="statement not covered" > * @param config</span>
|
|
728
|
-
<span class="cstat-no" title="statement not covered" > */</span>
|
|
729
|
-
<span class="cstat-no" title="statement not covered" > constructor(config: SigningOrchestratorConfig) {</span>
|
|
730
|
-
<span class="cstat-no" title="statement not covered" > this.providerId = config.providerId;</span>
|
|
731
|
-
<span class="cstat-no" title="statement not covered" > this.sessionStore = config.sessionStore;</span>
|
|
732
|
-
<span class="cstat-no" title="statement not covered" > this.clientManager = config.clientManager;</span>
|
|
733
|
-
<span class="cstat-no" title="statement not covered" > this.eventBus = config.eventBus;</span>
|
|
734
|
-
<span class="cstat-no" title="statement not covered" > }</span>
|
|
735
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
736
|
-
<span class="cstat-no" title="statement not covered" > /**</span>
|
|
737
|
-
<span class="cstat-no" title="statement not covered" > * Sign a transaction without submitting.</span>
|
|
738
|
-
<span class="cstat-no" title="statement not covered" > * Uses the user's selected network from the session for the signing request.</span>
|
|
739
|
-
<span class="cstat-no" title="statement not covered" > * @param options</span>
|
|
740
|
-
<span class="cstat-no" title="statement not covered" > */</span>
|
|
741
|
-
<span class="cstat-no" title="statement not covered" > async signTransaction(options: SignTransactionOptions): Promise<SignResult> {</span>
|
|
742
|
-
<span class="cstat-no" title="statement not covered" > const sessionInfo = this.findAndValidateSession(options.accountAddress, 'signTransaction');</span>
|
|
743
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
744
|
-
<span class="cstat-no" title="statement not covered" > // Use user's selected network from session, with fallback to options.networkId</span>
|
|
745
|
-
<span class="cstat-no" title="statement not covered" > const networkId = this.resolveNetworkId(sessionInfo, options.networkId);</span>
|
|
746
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
747
|
-
<span class="cstat-no" title="statement not covered" > logger.debug('Routing sign to signer', {</span>
|
|
748
|
-
<span class="cstat-no" title="statement not covered" > ledgerId: sessionInfo.signer.ledgerId,</span>
|
|
749
|
-
<span class="cstat-no" title="statement not covered" > topic: sessionInfo.session.topic.substring(0, 16) + '...',</span>
|
|
750
|
-
<span class="cstat-no" title="statement not covered" > networkId,</span>
|
|
751
|
-
<span class="cstat-no" title="statement not covered" > userSelectedNetwork: sessionInfo.userSelectedNetwork,</span>
|
|
752
|
-
<span class="cstat-no" title="statement not covered" > });</span>
|
|
753
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
754
|
-
<span class="cstat-no" title="statement not covered" > return sessionInfo.signer.signTransaction({</span>
|
|
755
|
-
<span class="cstat-no" title="statement not covered" > client: this.clientManager.getClient(),</span>
|
|
756
|
-
<span class="cstat-no" title="statement not covered" > topic: sessionInfo.session.topic,</span>
|
|
757
|
-
<span class="cstat-no" title="statement not covered" > accountAddress: options.accountAddress,</span>
|
|
758
|
-
<span class="cstat-no" title="statement not covered" > payload: options.payload,</span>
|
|
759
|
-
<span class="cstat-no" title="statement not covered" > networkId,</span>
|
|
760
|
-
<span class="cstat-no" title="statement not covered" > });</span>
|
|
761
|
-
<span class="cstat-no" title="statement not covered" > }</span>
|
|
762
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
763
|
-
<span class="cstat-no" title="statement not covered" > /**</span>
|
|
764
|
-
<span class="cstat-no" title="statement not covered" > * Sign and submit a transaction.</span>
|
|
765
|
-
<span class="cstat-no" title="statement not covered" > * Uses the user's selected network from the session for the signing request.</span>
|
|
766
|
-
<span class="cstat-no" title="statement not covered" > * @param options</span>
|
|
767
|
-
<span class="cstat-no" title="statement not covered" > */</span>
|
|
768
|
-
<span class="cstat-no" title="statement not covered" > async submitTransaction(options: SubmitTransactionOptions): Promise<SubmitResult> {</span>
|
|
769
|
-
<span class="cstat-no" title="statement not covered" > const sessionInfo = this.findAndValidateSession(options.accountAddress, 'submitTransaction');</span>
|
|
770
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
771
|
-
<span class="cstat-no" title="statement not covered" > // Use user's selected network from session, with fallback to options.networkId</span>
|
|
772
|
-
<span class="cstat-no" title="statement not covered" > const networkId = this.resolveNetworkId(sessionInfo, options.networkId);</span>
|
|
773
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
774
|
-
<span class="cstat-no" title="statement not covered" > logger.debug('Routing submit to signer', {</span>
|
|
775
|
-
<span class="cstat-no" title="statement not covered" > ledgerId: sessionInfo.signer.ledgerId,</span>
|
|
776
|
-
<span class="cstat-no" title="statement not covered" > topic: sessionInfo.session.topic.substring(0, 16) + '...',</span>
|
|
777
|
-
<span class="cstat-no" title="statement not covered" > networkId,</span>
|
|
778
|
-
<span class="cstat-no" title="statement not covered" > userSelectedNetwork: sessionInfo.userSelectedNetwork,</span>
|
|
779
|
-
<span class="cstat-no" title="statement not covered" > });</span>
|
|
780
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
781
|
-
<span class="cstat-no" title="statement not covered" > return sessionInfo.signer.submitTransaction({</span>
|
|
782
|
-
<span class="cstat-no" title="statement not covered" > client: this.clientManager.getClient(),</span>
|
|
783
|
-
<span class="cstat-no" title="statement not covered" > topic: sessionInfo.session.topic,</span>
|
|
784
|
-
<span class="cstat-no" title="statement not covered" > accountAddress: options.accountAddress,</span>
|
|
785
|
-
<span class="cstat-no" title="statement not covered" > payload: options.payload,</span>
|
|
786
|
-
<span class="cstat-no" title="statement not covered" > networkId,</span>
|
|
787
|
-
<span class="cstat-no" title="statement not covered" > });</span>
|
|
788
|
-
<span class="cstat-no" title="statement not covered" > }</span>
|
|
789
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
790
|
-
<span class="cstat-no" title="statement not covered" > /**</span>
|
|
791
|
-
<span class="cstat-no" title="statement not covered" > * Sign and execute a transaction (single wallet prompt).</span>
|
|
792
|
-
<span class="cstat-no" title="statement not covered" > * Uses the user's selected network from the session for the signing request.</span>
|
|
793
|
-
<span class="cstat-no" title="statement not covered" > * @param options</span>
|
|
794
|
-
<span class="cstat-no" title="statement not covered" > */</span>
|
|
795
|
-
<span class="cstat-no" title="statement not covered" > async signAndExecuteTransaction(options: SubmitTransactionOptions): Promise<SubmitResult> {</span>
|
|
663
|
+
<span class="cline-any cline-yes">16x</span>
|
|
664
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">/**
|
|
665
|
+
* HSuite Native Connect
|
|
666
|
+
* Copyright 2024-2025 HSuite (https://hsuite.finance)
|
|
667
|
+
*
|
|
668
|
+
* SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
|
|
669
|
+
*
|
|
670
|
+
* This file is part of HSuite Native Connect. For commercial licensing,
|
|
671
|
+
* visit https://hsuite.finance/licensing
|
|
672
|
+
*/
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* @file walletconnect-signing-orchestrator.ts
|
|
676
|
+
* @description Signing orchestration for WalletConnect provider
|
|
677
|
+
*
|
|
678
|
+
* Handles:
|
|
679
|
+
* - Finding sessions for accounts
|
|
680
|
+
* - Session validation in WC SDK
|
|
681
|
+
* - Routing sign/submit requests to appropriate signers
|
|
682
|
+
*
|
|
683
|
+
* Extracted from WalletConnectV2Provider to reduce file size.
|
|
684
|
+
*/
|
|
685
|
+
|
|
686
|
+
import { getLogger } from '@hsuite/native-connect-sdk';
|
|
687
|
+
|
|
688
|
+
import type { WalletEventBus } from '../../../services/wallet-event-bus.service';
|
|
689
|
+
import type {
|
|
690
|
+
SignTransactionOptions,
|
|
691
|
+
SubmitTransactionOptions,
|
|
692
|
+
SignResult,
|
|
693
|
+
SubmitResult,
|
|
694
|
+
SignMessageOptions,
|
|
695
|
+
SignMessageResult,
|
|
696
|
+
} from '../../base-wallet-provider';
|
|
697
|
+
|
|
698
|
+
import type { WalletConnectClientManager } from './walletconnect-client-manager';
|
|
699
|
+
import type { WalletConnectSessionStore } from './walletconnect-session-store';
|
|
700
|
+
|
|
701
|
+
const logger = getLogger().scoped?.('WCSigningOrchestrator'<span class="branch-0 cbranch-no" title="branch not covered" >) ?? getLogger();</span>
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Signing orchestration configuration
|
|
705
|
+
*/
|
|
706
|
+
export interface SigningOrchestratorConfig {
|
|
707
|
+
providerId: string;
|
|
708
|
+
sessionStore: WalletConnectSessionStore;
|
|
709
|
+
clientManager: WalletConnectClientManager;
|
|
710
|
+
eventBus: WalletEventBus;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Signing Orchestrator
|
|
715
|
+
*
|
|
716
|
+
* Routes signing requests to the appropriate session and signer.
|
|
717
|
+
* Handles session validation and error emission.
|
|
718
|
+
*/
|
|
719
|
+
export class WalletConnectSigningOrchestrator {
|
|
720
|
+
private readonly providerId: string;
|
|
721
|
+
private readonly sessionStore: WalletConnectSessionStore;
|
|
722
|
+
private readonly clientManager: WalletConnectClientManager;
|
|
723
|
+
private readonly eventBus: WalletEventBus;
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
*
|
|
727
|
+
* @param config
|
|
728
|
+
*/
|
|
729
|
+
constructor(config: SigningOrchestratorConfig) {
|
|
730
|
+
this.providerId = config.providerId;
|
|
731
|
+
this.sessionStore = config.sessionStore;
|
|
732
|
+
this.clientManager = config.clientManager;
|
|
733
|
+
this.eventBus = config.eventBus;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* Sign a transaction without submitting.
|
|
738
|
+
* Uses the user's selected network from the session for the signing request.
|
|
739
|
+
* @param options
|
|
740
|
+
*/
|
|
741
|
+
async signTransaction(options: SignTransactionOptions): Promise<SignResult> {
|
|
742
|
+
const sessionInfo = this.findAndValidateSession(options.accountAddress, 'signTransaction');
|
|
743
|
+
|
|
744
|
+
// Use user's selected network from session, with fallback to options.networkId
|
|
745
|
+
const networkId = this.resolveNetworkId(sessionInfo, options.networkId);
|
|
746
|
+
|
|
747
|
+
logger.debug('Routing sign to signer', {
|
|
748
|
+
ledgerId: sessionInfo.signer.ledgerId,
|
|
749
|
+
topic: sessionInfo.session.topic.substring(0, 16) + '...',
|
|
750
|
+
networkId,
|
|
751
|
+
userSelectedNetwork: sessionInfo.userSelectedNetwork,
|
|
752
|
+
});
|
|
753
|
+
|
|
754
|
+
return sessionInfo.signer.signTransaction({
|
|
755
|
+
client: this.clientManager.getClient(),
|
|
756
|
+
topic: sessionInfo.session.topic,
|
|
757
|
+
accountAddress: options.accountAddress,
|
|
758
|
+
payload: options.payload,
|
|
759
|
+
networkId,
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Sign and submit a transaction.
|
|
765
|
+
* Uses the user's selected network from the session for the signing request.
|
|
766
|
+
* @param options
|
|
767
|
+
*/
|
|
768
|
+
async submitTransaction(options: SubmitTransactionOptions): Promise<SubmitResult> {
|
|
769
|
+
const sessionInfo = this.findAndValidateSession(options.accountAddress, 'submitTransaction');
|
|
770
|
+
|
|
771
|
+
// Use user's selected network from session, with fallback to options.networkId
|
|
772
|
+
const networkId = this.resolveNetworkId(sessionInfo, options.networkId);
|
|
773
|
+
|
|
774
|
+
logger.debug('Routing submit to signer', {
|
|
775
|
+
ledgerId: sessionInfo.signer.ledgerId,
|
|
776
|
+
topic: sessionInfo.session.topic.substring(0, 16) + '...',
|
|
777
|
+
networkId,
|
|
778
|
+
userSelectedNetwork: sessionInfo.userSelectedNetwork,
|
|
779
|
+
});
|
|
780
|
+
|
|
781
|
+
return sessionInfo.signer.submitTransaction({
|
|
782
|
+
client: this.clientManager.getClient(),
|
|
783
|
+
topic: sessionInfo.session.topic,
|
|
784
|
+
accountAddress: options.accountAddress,
|
|
785
|
+
payload: options.payload,
|
|
786
|
+
networkId,
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Sign and execute a transaction (single wallet prompt).
|
|
792
|
+
* Uses the user's selected network from the session for the signing request.
|
|
793
|
+
* @param options
|
|
794
|
+
*/
|
|
795
|
+
<span class="fstat-no" title="function not covered" > async signAndExecuteTransaction(options: SubmitTransactionOptions): Promise<SubmitResult> {</span>
|
|
796
796
|
<span class="cstat-no" title="statement not covered" > const sessionInfo = this.findAndValidateSession(</span>
|
|
797
797
|
<span class="cstat-no" title="statement not covered" > options.accountAddress,</span>
|
|
798
798
|
<span class="cstat-no" title="statement not covered" > 'signAndExecuteTransaction',</span>
|
|
@@ -836,13 +836,13 @@
|
|
|
836
836
|
<span class="cstat-no" title="statement not covered" > networkId,</span>
|
|
837
837
|
<span class="cstat-no" title="statement not covered" > });</span>
|
|
838
838
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
<span class="
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* Sign a message.
|
|
842
|
+
* Uses the user's selected network from the session for the signing request.
|
|
843
|
+
* @param options
|
|
844
|
+
*/
|
|
845
|
+
<span class="fstat-no" title="function not covered" > async signMessage(options: SignMessageOptions): Promise<SignMessageResult> {</span>
|
|
846
846
|
<span class="cstat-no" title="statement not covered" > const sessionInfo = this.findAndValidateSession(options.accountAddress, 'signMessage');</span>
|
|
847
847
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
848
848
|
<span class="cstat-no" title="statement not covered" > // Use user's selected network from session, with fallback to options.networkId</span>
|
|
@@ -865,26 +865,26 @@
|
|
|
865
865
|
<span class="cstat-no" title="statement not covered" > encoding: options.encoding,</span>
|
|
866
866
|
<span class="cstat-no" title="statement not covered" > });</span>
|
|
867
867
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
<span class="
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Resolve the network ID to use for signing.
|
|
871
|
+
*
|
|
872
|
+
* Priority:
|
|
873
|
+
* 1. User's selected network from session (userSelectedNetwork)
|
|
874
|
+
* 2. Session's networkId
|
|
875
|
+
* 3. options.networkId from the caller
|
|
876
|
+
* 4. Empty string (let signer handle default)
|
|
877
|
+
*
|
|
878
|
+
* This ensures we always use the network the user selected when connecting,
|
|
879
|
+
* regardless of what the caller passes in.
|
|
880
|
+
*
|
|
881
|
+
* @param sessionInfo - Session info containing network selections
|
|
882
|
+
* @param sessionInfo.userSelectedNetwork
|
|
883
|
+
* @param optionsNetworkId - Network ID from caller options
|
|
884
|
+
* @param sessionInfo.networkId
|
|
885
|
+
* @returns Resolved network ID to use
|
|
886
|
+
*/
|
|
887
|
+
private <span class="fstat-no" title="function not covered" >resolveNetworkId(</span>
|
|
888
888
|
<span class="cstat-no" title="statement not covered" > sessionInfo: { userSelectedNetwork: string; networkId: string },</span>
|
|
889
889
|
<span class="cstat-no" title="statement not covered" > optionsNetworkId?: string,</span>
|
|
890
890
|
<span class="cstat-no" title="statement not covered" > ): string {</span>
|
|
@@ -907,17 +907,17 @@
|
|
|
907
907
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
908
908
|
<span class="cstat-no" title="statement not covered" > return resolvedNetwork;</span>
|
|
909
909
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
<span class="
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Find session for account and validate it exists in SDK.
|
|
913
|
+
* @param accountAddress
|
|
914
|
+
* @param context
|
|
915
|
+
*/
|
|
916
|
+
private findAndValidateSession(accountAddress: string, context: string) {
|
|
917
|
+
const sessionInfo = this.sessionStore.findSessionByAccount(accountAddress);
|
|
918
|
+
if (!sessionInfo) {
|
|
919
|
+
throw new Error(`No WalletConnect session found for account: ${accountAddress}`);
|
|
920
|
+
<span class="branch-0 cbranch-no" title="branch not covered" > }</span>
|
|
921
921
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
922
922
|
<span class="cstat-no" title="statement not covered" > // Validate session exists in WC SDK</span>
|
|
923
923
|
<span class="cstat-no" title="statement not covered" > if (!this.validateSessionInSdk(sessionInfo.session.topic)) {</span>
|
|
@@ -937,13 +937,13 @@
|
|
|
937
937
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
938
938
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
939
939
|
<span class="cstat-no" title="statement not covered" > return sessionInfo;</span>
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
<span class="
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Validate session exists in WC SDK storage.
|
|
944
|
+
* @param topic
|
|
945
|
+
*/
|
|
946
|
+
private <span class="fstat-no" title="function not covered" >validateSessionInSdk(topic: string): boolean {</span>
|
|
947
947
|
<span class="cstat-no" title="statement not covered" > if (!this.clientManager.isInitialized()) {</span>
|
|
948
948
|
<span class="cstat-no" title="statement not covered" > return false;</span>
|
|
949
949
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
@@ -959,7 +959,7 @@
|
|
|
959
959
|
<span class="cstat-no" title="statement not covered" > return false;</span>
|
|
960
960
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
961
961
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
962
|
-
|
|
962
|
+
}
|
|
963
963
|
</pre></td></tr></table></pre>
|
|
964
964
|
|
|
965
965
|
<div class='push'></div><!-- for sticky footer -->
|
|
@@ -967,7 +967,7 @@
|
|
|
967
967
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
968
968
|
Code coverage generated by
|
|
969
969
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
970
|
-
at 2026-06-
|
|
970
|
+
at 2026-06-27T21:00:37.209Z
|
|
971
971
|
</div>
|
|
972
972
|
<script src="../../../../prettify.js"></script>
|
|
973
973
|
<script>
|