@meshconnect/uwc-core 2.7.2 → 2.7.3-snapshot.149a27e

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 (46) hide show
  1. package/dist/events.d.ts +25 -1
  2. package/dist/events.d.ts.map +1 -1
  3. package/dist/events.js.map +1 -1
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +1 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/observability/instrument-handoff.d.ts +5 -0
  9. package/dist/observability/instrument-handoff.d.ts.map +1 -1
  10. package/dist/observability/instrument-handoff.js +12 -0
  11. package/dist/observability/instrument-handoff.js.map +1 -1
  12. package/dist/observability/telemetry.d.ts +16 -1
  13. package/dist/observability/telemetry.d.ts.map +1 -1
  14. package/dist/observability/telemetry.js +15 -2
  15. package/dist/observability/telemetry.js.map +1 -1
  16. package/dist/services/connection-service.d.ts +16 -2
  17. package/dist/services/connection-service.d.ts.map +1 -1
  18. package/dist/services/connection-service.js +39 -17
  19. package/dist/services/connection-service.js.map +1 -1
  20. package/dist/services/index.d.ts +1 -0
  21. package/dist/services/index.d.ts.map +1 -1
  22. package/dist/services/index.js +1 -0
  23. package/dist/services/index.js.map +1 -1
  24. package/dist/services/network-selection.d.ts +34 -0
  25. package/dist/services/network-selection.d.ts.map +1 -0
  26. package/dist/services/network-selection.js +54 -0
  27. package/dist/services/network-selection.js.map +1 -0
  28. package/dist/universal-wallet-connector.d.ts +23 -1
  29. package/dist/universal-wallet-connector.d.ts.map +1 -1
  30. package/dist/universal-wallet-connector.js +2 -1
  31. package/dist/universal-wallet-connector.js.map +1 -1
  32. package/dist/version.d.ts +1 -1
  33. package/dist/version.js +1 -1
  34. package/package.json +5 -5
  35. package/src/events.ts +26 -1
  36. package/src/index.ts +4 -0
  37. package/src/observability/instrument-handoff.ts +17 -0
  38. package/src/observability/telemetry.test.ts +37 -0
  39. package/src/observability/telemetry.ts +33 -3
  40. package/src/services/connection-service.test.ts +112 -6
  41. package/src/services/connection-service.ts +69 -21
  42. package/src/services/index.ts +1 -0
  43. package/src/services/network-selection.test.ts +152 -0
  44. package/src/services/network-selection.ts +86 -0
  45. package/src/universal-wallet-connector.ts +25 -1
  46. package/src/version.ts +1 -1
@@ -30,6 +30,7 @@ import type { TronConnectorConfig } from '@meshconnect/uwc-tron-connector'
30
30
  import { SessionManager } from './managers/session-manager'
31
31
  import { EventManager } from './managers/event-manager'
32
32
  import { ConnectionService } from './services/connection-service'
33
+ import { DEFAULT_NAMESPACE_PRIORITY } from './services/network-selection'
33
34
  import { NetworkSwitchService } from './services/network-switch-service'
34
35
  import { SignatureService } from './services/signature-service'
35
36
  import { TransactionService } from './services/transaction-service'
@@ -109,6 +110,13 @@ export interface UWCConfig {
109
110
  * Default 15_000.
110
111
  */
111
112
  secondaryGatherTimeoutMs?: number
113
+ /**
114
+ * Namespace preference for a connect that names no `networkId`. Injected mode
115
+ * only, and only among namespaces whose provider detection found installed —
116
+ * an undetected namespace is never auto-picked. Catalog order breaks ties.
117
+ * Default `DEFAULT_NAMESPACE_PRIORITY` (eip155, solana, tron, tvm, bip122).
118
+ */
119
+ preferredNamespaces?: readonly Namespace[]
112
120
  }
113
121
 
114
122
  /** Common options for user-initiated async operations. */
@@ -137,6 +145,21 @@ export interface ConnectOptions extends OperationOptions {
137
145
  * rejects with a plain `Error` before reaching the wallet.
138
146
  */
139
147
  silentOnly?: boolean
148
+ /**
149
+ * Never open a first-time approval prompt for a secondary namespace.
150
+ * Forwarded to the connector as
151
+ * {@link ConnectorConnectOptions.quietSecondaries} — see there for the
152
+ * semantics. `'injected'` mode only; ignored by the other modes, which make
153
+ * no secondary requests.
154
+ */
155
+ quietSecondaries?: boolean
156
+ /**
157
+ * Wait this many ms before each secondary request that can prompt.
158
+ * Forwarded to the connector as
159
+ * {@link ConnectorConnectOptions.secondaryPromptGapMs} — see there for the
160
+ * semantics. `'injected'` mode only.
161
+ */
162
+ secondaryPromptGapMs?: number
140
163
  }
141
164
 
142
165
  export class UniversalWalletConnector {
@@ -443,7 +466,8 @@ export class UniversalWalletConnector {
443
466
  this.connectors,
444
467
  configuredUsingIntegratedBrowser,
445
468
  this.eventManager,
446
- this.walletResponseTimeoutMs
469
+ this.walletResponseTimeoutMs,
470
+ config.preferredNamespaces ?? DEFAULT_NAMESPACE_PRIORITY
447
471
  )
448
472
  this.networkSwitchService = new NetworkSwitchService(
449
473
  networks,
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated from package.json by scripts/generate-version.mjs — do not edit.
2
- export const UWC_CORE_VERSION = '2.7.2'
2
+ export const UWC_CORE_VERSION = '2.7.3'