@unicitylabs/sphere-sdk 0.16.0-dev.1 → 0.16.0-dev.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.
@@ -210,7 +210,7 @@ var NETWORKS = {
210
210
  // old goggregator testnet spoke the removed v1 protocol — a v2 engine cannot
211
211
  // run against it. 'testnet2' stays as an alias of the same configuration.
212
212
  testnet: {
213
- name: "Testnet2",
213
+ name: "Testnet",
214
214
  networkId: 4,
215
215
  // v2 state-transition gateway (networkId 4 comes from the trust base). apiKey is env-injected.
216
216
  aggregatorUrl: "https://gateway.testnet2.unicity.network",
@@ -220,7 +220,7 @@ var NETWORKS = {
220
220
  tokenRegistryUrl: "https://raw.githubusercontent.com/unicitynetwork/unicity-ids/refs/heads/main/unicity-ids.testnet2.json"
221
221
  },
222
222
  testnet2: {
223
- name: "Testnet2",
223
+ name: "Testnet",
224
224
  networkId: 4,
225
225
  // v2 state-transition gateway (networkId 4 comes from the trust base). apiKey is env-injected.
226
226
  aggregatorUrl: "https://gateway.testnet2.unicity.network",
@@ -397,7 +397,7 @@ function checkCompatibility(input) {
397
397
  }
398
398
 
399
399
  // connect/version.ts
400
- var SDK_VERSION = "0.16.0-dev.1";
400
+ var SDK_VERSION = "0.16.0-dev.2";
401
401
 
402
402
  // connect/permissions.ts
403
403
  var PERMISSION_SCOPES = {
@@ -848,6 +848,16 @@ var ConnectHost = class {
848
848
  return;
849
849
  }
850
850
  if (this._walletState === "live") {
851
+ if (this.session?.active && (this.snapshot.networkId ?? null) !== (next.networkId ?? null)) {
852
+ logger.warn(
853
+ "ConnectHost",
854
+ `Network changed under a live session \u2014 revoking instead of rebinding (origin=${this.config.origin ?? "unverified"})`
855
+ );
856
+ this.sphere = next;
857
+ this.snapshot = buildWalletSnapshot(next);
858
+ this.revokeSession();
859
+ return;
860
+ }
851
861
  this.sphere = next;
852
862
  this.snapshot = buildWalletSnapshot(next);
853
863
  const existing = this.eventSubscriptions.get(WALLET_EVENTS.IDENTITY_CHANGED);