@meshconnect/uwc-injected-connector 0.23.3 → 0.24.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.
@@ -2,6 +2,60 @@ import { BitcoinNamespace, WalletStandardBitcoinAdapter, OkxBitcoinAdapter, byte
2
2
  import { bitcoinNetwork } from '@meshconnect/uwc-constants';
3
3
  import { getBitcoinWallets } from '../../wallet-standard-discovery';
4
4
  import { resolveInjectedProperty } from '../../legacy-injected-solana-adapter';
5
+ /**
6
+ * Bech32 human-readable parts for the bip122 networks this connector supports.
7
+ * Bech32/bech32m is case-INSENSITIVE by spec (BIP-173: a valid address is all
8
+ * lower or all upper), so folding case is correct for these and only these.
9
+ */
10
+ const BECH32_PREFIXES = ['bc1', 'tb1', 'bcrt1'];
11
+ /**
12
+ * Normalize one address for pin comparison.
13
+ *
14
+ * Case is folded ONLY for bech32. Base58Check (legacy `1…`/`3…`) is
15
+ * case-SENSITIVE: its characters carry different values per case, so a
16
+ * differently-cased string decodes to a different payload and fails its
17
+ * checksum. Folding those would let a mis-cased pin match a real address —
18
+ * silently accepting a corrupted allow-list entry instead of reporting the
19
+ * mismatch. (It could never equate two *valid* distinct addresses, which is why
20
+ * this is a correctness-hygiene fix rather than a live conflation bug.)
21
+ */
22
+ function normalizeAddress(address) {
23
+ const trimmed = address.trim();
24
+ const lower = trimmed.toLowerCase();
25
+ const isBech32 = BECH32_PREFIXES.some(prefix => lower.startsWith(prefix));
26
+ // BIP-173 forbids MIXED case outright ("Decoders MUST NOT accept strings
27
+ // where some characters are uppercase and some are lowercase"), so only a
28
+ // uniformly-cased string is a valid bech32 address worth folding. Folding a
29
+ // mixed-case one would let an INVALID pin match a valid wallet address —
30
+ // the same false-accept this function exists to prevent for base58.
31
+ const uniformCase = trimmed === lower || trimmed === trimmed.toUpperCase();
32
+ return isBech32 && uniformCase ? lower : trimmed;
33
+ }
34
+ /** Comparison key for an account-shaped value. */
35
+ const addressKey = (account) => normalizeAddress(account.address);
36
+ /**
37
+ * Normalize a caller's pinned address allow-list to a lower-cased lookup set,
38
+ * or `undefined` when there is no real constraint.
39
+ *
40
+ * Blank entries are dropped first: a stray `''` would otherwise match nothing
41
+ * while still making the list look non-empty, silently failing every account.
42
+ * An all-blank list therefore behaves exactly like no list at all.
43
+ *
44
+ * Entries are keyed with {@link normalizeAddress}, so bech32 compares
45
+ * case-insensitively (per BIP-173) while legacy Base58Check compares exactly.
46
+ */
47
+ export function normalizeRequiredAddresses(requiredAddresses) {
48
+ if (!requiredAddresses?.length)
49
+ return undefined;
50
+ const normalized = requiredAddresses
51
+ .filter(address => address.trim().length > 0)
52
+ .map(normalizeAddress);
53
+ return normalized.length > 0 ? new Set(normalized) : undefined;
54
+ }
55
+ /** Does `address` satisfy a normalized pin set? */
56
+ export function pinIncludes(pinned, address) {
57
+ return pinned.has(normalizeAddress(address));
58
+ }
5
59
  /**
6
60
  * Bitcoin (bip122) wallet service for the injected transport — the peer of
7
61
  * `EthereumWalletService` / `SolanaWalletService` / `TronWalletService` /
@@ -17,6 +71,7 @@ import { resolveInjectedProperty } from '../../legacy-injected-solana-adapter';
17
71
  */
18
72
  export class BitcoinWalletService {
19
73
  config;
74
+ reportReauthorize;
20
75
  detectedWallets = [];
21
76
  namespace = null;
22
77
  account = null;
@@ -40,8 +95,25 @@ export class BitcoinWalletService {
40
95
  * read and account-change subscription go through this provider instead.
41
96
  */
42
97
  connectedOkxProvider = null;
43
- constructor(config) {
98
+ /**
99
+ * Number of re-authorizations currently in flight — non-zero only while
100
+ * `connect()` is revoking a grant to re-prompt for a pinned address. Wallets
101
+ * emit an empty account list when a grant is revoked, and core reads `[]` as a
102
+ * namespace disconnect — see {@link guardReauthorizeTeardown}.
103
+ *
104
+ * A COUNTER, not a boolean, because two pinned connects can overlap: core
105
+ * supersedes a re-entrant `connect()` by aborting the previous attempt's
106
+ * wrapper (`connection-service.ts:106`), which cannot cancel the wallet prompt
107
+ * already open, and both attempts share this connector instance. With a
108
+ * boolean, the older attempt's `finally` cleared the newer attempt's guard and
109
+ * let the revoke teardown through — the exact event this exists to absorb.
110
+ */
111
+ reauthorizing = 0;
112
+ constructor(config,
113
+ /** Telemetry sink for re-authorization outcomes (see {@link BitcoinReauthorizeInfo}). */
114
+ reportReauthorize) {
44
115
  this.config = config;
116
+ this.reportReauthorize = reportReauthorize;
45
117
  }
46
118
  /**
47
119
  * Initialize wallet discovery from the Wallet Standard `bitcoin:*` registry,
@@ -60,13 +132,32 @@ export class BitcoinWalletService {
60
132
  * Check if a Bitcoin wallet is already authorized (non-prompting). Reads
61
133
  * the Wallet Standard wallet's already-exposed `accounts` directly — never
62
134
  * calls `bitcoin:connect`, which pops a wallet dialog.
135
+ *
136
+ * `requiredAddresses` (the caller's pinned allow-list, e.g. a verify flow's
137
+ * `addresses`) makes the probe address-AWARE. `wallet.accounts` is the
138
+ * PER-ORIGIN authorized set, not the wallet's current UI selection: MetaMask
139
+ * keeps serving the account this origin first authorized even after the user
140
+ * selects a different one in the extension. Returning `accounts[0]`
141
+ * unconditionally therefore pinned the session to that first-authorized
142
+ * account and left the user no way to reach any other one — the connect that
143
+ * could re-authorize was skipped precisely because this probe "succeeded".
144
+ *
145
+ * So: when the caller pinned addresses and none of the authorized accounts
146
+ * match, report NO existing connection. The caller then falls through to the
147
+ * prompting `connect()`, which is the only path that can authorize a
148
+ * different account. With no pins, behaviour is unchanged (`accounts[0]`).
63
149
  */
64
- async checkExistingConnection(detectedWallet) {
150
+ async checkExistingConnection(detectedWallet, requiredAddresses) {
65
151
  const wallet = detectedWallet.wallet;
66
- const account = wallet.accounts?.[0];
67
- return account?.address ?? null;
152
+ const accounts = wallet.accounts ?? [];
153
+ const pinned = normalizeRequiredAddresses(requiredAddresses);
154
+ if (pinned) {
155
+ const matched = accounts.find(account => pinned.has(addressKey(account)));
156
+ return matched?.address ?? null;
157
+ }
158
+ return accounts[0]?.address ?? null;
68
159
  }
69
- async connect(network, provider) {
160
+ async connect(network, provider, requiredAddresses) {
70
161
  // Resolve the SPECIFIC wallet the session matched by uuid (mirrors every
71
162
  // other service) — fails closed rather than picking an arbitrary wallet.
72
163
  const uuid = provider.namespaceMetaData?.bip122?.detectedWallet?.uuid;
@@ -78,8 +169,112 @@ export class BitcoinWalletService {
78
169
  // Wallet Standard vs OKX (legacy-injected) — build the matching adapter.
79
170
  const { namespace, okxProvider } = this.buildNamespace(detected);
80
171
  namespace.assertSupportedNetwork(network);
81
- const accounts = await namespace.getAccounts();
82
- const primary = accounts[0];
172
+ // Did this origin already hold a grant BEFORE this connect? Two sources,
173
+ // because neither alone is sufficient:
174
+ //
175
+ // - `wallet.accounts` must be read BEFORE `getAccounts()`. That calls
176
+ // `bitcoin:connect`, and a wallet's `accounts` reflects the authorization
177
+ // live (MetaMask sets its account before the connect resolves), so
178
+ // reading it afterwards always reports "granted" and the guard below
179
+ // would never gate anything.
180
+ // - FRAMED, `wallet.accounts` is a one-time snapshot marshaled by
181
+ // `BridgeChild` — proxied `bitcoin:connect` calls never update it. A
182
+ // bridge that started with no grant therefore reports empty forever, even
183
+ // after this session authorized an account. `this.account` is the
184
+ // connector's own live record and covers exactly that gap.
185
+ //
186
+ // Either signal means the origin was already granted, so a pin that the
187
+ // wallet won't satisfy needs a revoke rather than a silent stale account.
188
+ const previouslyGranted = (detected.wallet
189
+ .accounts?.length ?? 0) > 0 || this.account !== null;
190
+ let accounts = await namespace.getAccounts();
191
+ // Honour the caller's pinned allow-list when the wallet authorized more
192
+ // than one account. `accounts[0]` is the wallet's own ordering, which has
193
+ // no relationship to what the caller asked for — picking it blindly put
194
+ // the requested address in `availableAddresses` while making some OTHER
195
+ // account the session's active one. (MetaMask exposes only one account, so
196
+ // this preference is inert there; it matters for multi-account wallets.)
197
+ const pinned = normalizeRequiredAddresses(requiredAddresses);
198
+ const matches = (list) => pinned ? list.find(account => pinned.has(addressKey(account))) : undefined;
199
+ let primary = (pinned && matches(accounts)) || accounts[0];
200
+ // Pin unsatisfiable: re-authorize so the wallet can offer its account
201
+ // picker. `bitcoin:connect` alone cannot fix this — it is authorization,
202
+ // not account selection, so once an origin holds a grant the wallet
203
+ // answers from that grant and returns the SAME account no matter how many
204
+ // times it is called. Revoking first makes the next connect a real prompt,
205
+ // where the user can pick the pinned account.
206
+ //
207
+ // Gated on a PRE-EXISTING grant: only a cached grant can block the pin.
208
+ // With no grant, the `getAccounts()` above already showed the picker, and
209
+ // re-prompting would ask the user to choose again immediately after they
210
+ // just chose — confusing, and it cannot surface any account the first
211
+ // prompt did not already offer.
212
+ if (pinned && !matches(accounts) && previouslyGranted) {
213
+ // The revoke below makes the wallet emit an empty account list, which
214
+ // core would act on as a disconnect — mid-connect. Suppress just that
215
+ // for the duration; see `guardReauthorizeTeardown`.
216
+ this.reauthorizing++;
217
+ try {
218
+ // A REJECTED revoke means nothing happened at the wallet, so the grant
219
+ // is intact — the same situation as a wallet with no revoke feature.
220
+ // Treat it that way instead of letting it propagate: throwing here would
221
+ // fail a connect whose authorization is still perfectly good, which
222
+ // contradicts the branch-on-what-actually-happened rule below.
223
+ let revoked = false;
224
+ try {
225
+ ;
226
+ ({ revoked } = await namespace.disconnect());
227
+ }
228
+ catch {
229
+ revoked = false;
230
+ }
231
+ this.reportReauthorize?.({
232
+ walletName: detected.name,
233
+ revoked,
234
+ outcome: revoked ? 'revoked' : 'unsupported'
235
+ });
236
+ if (revoked) {
237
+ // Tear down any LIVE session before awaiting the new authorization.
238
+ // Session state is committed at the end of a successful connect, so a
239
+ // reconnect (the case this feature exists for) still holds the previous
240
+ // account here — and the revoke above just invalidated it at the wallet.
241
+ // Without this, a declined re-prompt throws while `isConnected()` still
242
+ // reports the revoked account as connected, and the next `signMessage`
243
+ // would address an account the wallet no longer authorizes.
244
+ this.setConnectionState(null, null);
245
+ // The grant is GONE. A rejection here has nothing to fall back to:
246
+ // committing the pre-revoke accounts would report a live session the
247
+ // wallet just revoked, and report success for a connect the user
248
+ // declined. So let it propagate.
249
+ try {
250
+ accounts = await namespace.getAccounts();
251
+ }
252
+ catch (error) {
253
+ this.reportReauthorize?.({
254
+ walletName: detected.name,
255
+ revoked: true,
256
+ outcome: 'declined'
257
+ });
258
+ throw error;
259
+ }
260
+ // Still no match (user picked something else, or the wallet exposes a
261
+ // single account): fall back to position rather than failing a connect
262
+ // that succeeded. The caller compares against its own pin and shows the
263
+ // mismatch — throwing here would lose `availableAddresses`.
264
+ primary = matches(accounts) || accounts[0];
265
+ }
266
+ // Not revoked (wallet exposes no `bitcoin:disconnect`, e.g. OKX, or a
267
+ // bridge that doesn't marshal it): the grant is intact, so re-connecting
268
+ // would return the same accounts. Keep what we have rather than burning a
269
+ // prompt — the caller surfaces the mismatch.
270
+ }
271
+ finally {
272
+ // Also on the declined-re-prompt throw above: that path already tore
273
+ // the session down, so later events must flow normally again. Decrement
274
+ // rather than clear, so an overlapping attempt keeps its own guard.
275
+ this.reauthorizing--;
276
+ }
277
+ }
83
278
  if (!primary) {
84
279
  throw new Error('Bitcoin wallet returned no accounts');
85
280
  }
@@ -213,12 +408,15 @@ export class BitcoinWalletService {
213
408
  * bridge-parent that predates this capability.
214
409
  */
215
410
  onAccountsChanged(listener) {
411
+ // Applied to every transport below, so a revoke-driven `[]` is dropped the
412
+ // same way whether it arrives via OKX, the bridge, or `standard:events`.
413
+ const guarded = this.guardReauthorizeTeardown(listener);
216
414
  // OKX (legacy-injected) is always in-frame — subscribe to its own
217
415
  // `accountsChanged` event directly, never the bridge. The provider emits
218
416
  // `accountsChanged` with the new address list.
219
417
  if (this.connectedOkxProvider) {
220
418
  const provider = this.connectedOkxProvider;
221
- const handler = (accounts) => listener(Array.isArray(accounts) ? accounts : []);
419
+ const handler = (accounts) => guarded(Array.isArray(accounts) ? accounts : []);
222
420
  provider.on('accountsChanged', handler);
223
421
  return () => {
224
422
  try {
@@ -232,19 +430,31 @@ export class BitcoinWalletService {
232
430
  if (typeof window !== 'undefined' &&
233
431
  window
234
432
  .UWCBridgeChildInitialized === true) {
235
- return this.subscribeAccountsChangedViaBridge(listener);
433
+ return this.subscribeAccountsChangedViaBridge(guarded);
236
434
  }
237
435
  const wallet = this
238
436
  .connectedWallet;
239
- const standardEvents = wallet?.features?.['standard:events'];
240
- if (!wallet || typeof standardEvents?.on !== 'function')
437
+ // Wallets disagree on where the bitcoin account-change stream lives: Trust
438
+ // publishes `standard:events`, MetaMask publishes `bitcoin:events`. Both
439
+ // expose the same `on('change', …)` contract, so try the standard key
440
+ // first and fall back to the namespaced one — without this, a MetaMask
441
+ // account switch was silently unobservable.
442
+ // Select on CALLABILITY, not presence: a wallet exposing a malformed
443
+ // `standard:events` (no `on`) alongside a working `bitcoin:events` would
444
+ // otherwise lose its subscription entirely. Same selection as the bridge's
445
+ // `subscribeBip122WalletEvent`, so framed and direct behave identically.
446
+ const features = wallet?.features;
447
+ const changeEvents = typeof features?.['standard:events']?.on === 'function'
448
+ ? features['standard:events']
449
+ : features?.['bitcoin:events'];
450
+ if (!wallet || typeof changeEvents?.on !== 'function')
241
451
  return undefined;
242
- const off = standardEvents.on('change', properties => {
452
+ const off = changeEvents.on('change', properties => {
243
453
  // React only to account-set changes; ignore pure chain/feature deltas.
244
454
  if (!properties || !('accounts' in properties))
245
455
  return;
246
456
  const address = wallet.accounts?.[0]?.address ?? null;
247
- listener(address ? [address] : []);
457
+ guarded(address ? [address] : []);
248
458
  });
249
459
  return () => {
250
460
  try {
@@ -255,6 +465,27 @@ export class BitcoinWalletService {
255
465
  }
256
466
  };
257
467
  }
468
+ /**
469
+ * Drop the empty-account event a wallet emits while `connect()` is revoking
470
+ * a grant in order to re-prompt for a pinned address.
471
+ *
472
+ * Core treats `[]` as a namespace disconnect and calls `finishDisconnect()`.
473
+ * During a pinned reconnect that teardown lands in the middle of the very
474
+ * connect that asked for the revoke, so the caller gets a resolved connect
475
+ * with no session behind it.
476
+ *
477
+ * Only `[]` is suppressed — a real account list still flows through, so an
478
+ * account switch during the window is not lost. A genuine user disconnect in
479
+ * that window is not lost either: a successful connect commits fresh state
480
+ * over it, and a declined one has already torn the session down itself.
481
+ */
482
+ guardReauthorizeTeardown(listener) {
483
+ return accounts => {
484
+ if (this.reauthorizing > 0 && accounts.length === 0)
485
+ return;
486
+ listener(accounts);
487
+ };
488
+ }
258
489
  /**
259
490
  * Bridge half of `onAccountsChanged`. `walletId` is `connectedWalletUuid`
260
491
  * — the SAME id `BridgeParent`'s `bip122Wallets[].uuid` publishes (see
@@ -343,16 +574,39 @@ export class BitcoinWalletService {
343
574
  this.connectedWalletUuid = detectedWallet.uuid;
344
575
  this.connectedWallet = wallet;
345
576
  }
346
- async disconnect() {
347
- if (this.namespace) {
348
- await this.namespace.disconnect();
349
- }
577
+ /**
578
+ * Drop local session state WITHOUT revoking at the wallet.
579
+ *
580
+ * `ConnectionManager.releaseOtherWalletConnections` runs on EVERY connect and
581
+ * releases whichever namespaces belong to a different wallet. Now that
582
+ * `disconnect()` genuinely revokes, calling it from there would revoke the
583
+ * user's Bitcoin grant as a side effect of connecting an unrelated wallet —
584
+ * connect Phantom, lose the bip122 authorization. Releasing is a local-state
585
+ * concern; only an explicit disconnect (or a pinned re-authorization) means to
586
+ * revoke. This keeps the release path behaving as it did before `disconnect`
587
+ * started reaching the wallet.
588
+ */
589
+ releaseLocalSession() {
350
590
  this.namespace = null;
351
591
  this.account = null;
352
592
  this.connectedWalletUuid = null;
353
593
  this.connectedWallet = null;
354
594
  this.connectedOkxProvider = null;
355
595
  }
596
+ async disconnect() {
597
+ if (this.namespace) {
598
+ try {
599
+ await this.namespace.disconnect();
600
+ }
601
+ catch {
602
+ // Best effort, mirroring `TonWalletService.disconnect`: the wallet may
603
+ // already be disconnected. Local state must be cleared either way —
604
+ // with the resets after an un-caught await, a rejected revoke left the
605
+ // service still reporting `isConnected()` on a dead session.
606
+ }
607
+ }
608
+ this.releaseLocalSession();
609
+ }
356
610
  /**
357
611
  * Build the namespace for a detected wallet, selecting the adapter by its
358
612
  * kind: OKX legacy-injected (`legacyInjectedId` set) → `OkxBitcoinAdapter`
@@ -1 +1 @@
1
- {"version":3,"file":"bitcoin-wallet-service.js","sourceRoot":"","sources":["../../../src/services/bitcoin/bitcoin-wallet-service.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC5B,iBAAiB,EACjB,UAAU,EAGX,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EACL,iBAAiB,EAElB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AAqB9E;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,oBAAoB;IAyBF,MAAM;IAxB3B,eAAe,GAA4B,EAAE,CAAA;IAC7C,SAAS,GAA4B,IAAI,CAAA;IACzC,OAAO,GAA0B,IAAI,CAAA;IAC7C;;6CAEyC;IACjC,mBAAmB,GAAkB,IAAI,CAAA;IACjD;;;;;;;OAOG;IACK,eAAe,GAAuC,IAAI,CAAA;IAClE;;;;;OAKG;IACK,oBAAoB,GAA8B,IAAI,CAAA;IAE9D,YAA6B,MAAsB;sBAAtB,MAAM;IAAmB,CAAC;IAEvD;;;OAGG;IACH,KAAK,CAAC,mBAAmB,CACvB,eAAkC,EAClC,sBAAsB,GAAG,KAAK;QAE9B,IAAI,CAAC,eAAe,GAAG,MAAM,iBAAiB,CAC5C,eAAe,EACf,sBAAsB,EACtB,IAAI,CAAC,MAAM,EAAE,cAAc,CAC5B,CAAA;IACH,CAAC;IAED,kBAAkB;QAChB,OAAO,IAAI,CAAC,eAAe,CAAA;IAC7B,CAAC;IAED,gBAAgB,CAAC,IAAY;QAC3B,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAA;IACxD,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,uBAAuB,CAC3B,cAAqC;QAErC,MAAM,MAAM,GACV,cAAc,CAAC,MA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;QACd,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAA;QACnC,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QACnB,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAA;QAC/B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAA;QAC3B,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAA;IAClC,CAAC;IAED;;;;;;OAMG;IACK,cAAc,CAAC,QAA+B;QAIpD,IAAI,QAAQ,CAAC,gBAAgB,EAAE,CAAC;YAC9B,MAAM,QAAQ,GAAG,uBAAuB,CACtC,QAAQ,CAAC,gBAAgB,CACG,CAAA;YAC9B,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,KAAK,CACb,sCAAsC,QAAQ,CAAC,gBAAgB,GAAG,CACnE,CAAA;YACH,CAAC;YACD,wEAAwE;YACxE,mEAAmE;YACnE,qEAAqE;YACrE,iCAAiC;YACjC,OAAO;gBACL,SAAS,EAAE,IAAI,gBAAgB,CAAC,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC;gBAChE,WAAW,EAAE,QAAQ;aACtB,CAAA;QACH,CAAC;QACD,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAgD,CAAA;QACxE,OAAO;YACL,SAAS,EAAE,IAAI,gBAAgB,CAAC,IAAI,4BAA4B,CAAC,MAAM,CAAC,CAAC;YACzE,WAAW,EAAE,IAAI;SAClB,CAAA;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"bitcoin-wallet-service.js","sourceRoot":"","sources":["../../../src/services/bitcoin/bitcoin-wallet-service.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC5B,iBAAiB,EACjB,UAAU,EAGX,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE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AAI,CAAC,eAAe,GAAG,IAAI,CAAA;QAC3B,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAA;IAClC,CAAC;IAED,KAAK,CAAC,UAAU;QACd,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAA;YACnC,CAAC;YAAC,MAAM,CAAC;gBACP,uEAAuE;gBACvE,oEAAoE;gBACpE,uEAAuE;gBACvE,6DAA6D;YAC/D,CAAC;QACH,CAAC;QACD,IAAI,CAAC,mBAAmB,EAAE,CAAA;IAC5B,CAAC;IAED;;;;;;OAMG;IACK,cAAc,CAAC,QAA+B;QAIpD,IAAI,QAAQ,CAAC,gBAAgB,EAAE,CAAC;YAC9B,MAAM,QAAQ,GAAG,uBAAuB,CACtC,QAAQ,CAAC,gBAAgB,CACG,CAAA;YAC9B,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,KAAK,CACb,sCAAsC,QAAQ,CAAC,gBAAgB,GAAG,CACnE,CAAA;YACH,CAAC;YACD,wEAAwE;YACxE,mEAAmE;YACnE,qEAAqE;YACrE,iCAAiC;YACjC,OAAO;gBACL,SAAS,EAAE,IAAI,gBAAgB,CAAC,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC;gBAChE,WAAW,EAAE,QAAQ;aACtB,CAAA;QACH,CAAC;QACD,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAgD,CAAA;QACxE,OAAO;YACL,SAAS,EAAE,IAAI,gBAAgB,CAAC,IAAI,4BAA4B,CAAC,MAAM,CAAC,CAAC;YACzE,WAAW,EAAE,IAAI;SAClB,CAAA;IACH,CAAC;CACF"}
@@ -185,7 +185,7 @@ export declare class ConnectionManager {
185
185
  /**
186
186
  * Check and add existing connections from other namespaces
187
187
  */
188
- checkExistingConnections(targetNamespace: Namespace, provider: ExtensionInjectedProvider | IntegratedBrowserInjectedProvider): Promise<{
188
+ checkExistingConnections(targetNamespace: Namespace, provider: ExtensionInjectedProvider | IntegratedBrowserInjectedProvider, requiredAddresses?: readonly string[]): Promise<{
189
189
  address: string | null;
190
190
  availableAddresses: AvailableAddress[];
191
191
  }>;
@@ -273,7 +273,7 @@ export declare class ConnectionManager {
273
273
  /**
274
274
  * Connect to a Bitcoin (bip122) wallet
275
275
  */
276
- connectBitcoin(network: Network, provider: ExtensionInjectedProvider | IntegratedBrowserInjectedProvider): Promise<ConnectorResult>;
276
+ connectBitcoin(network: Network, provider: ExtensionInjectedProvider | IntegratedBrowserInjectedProvider, requiredAddresses?: readonly string[]): Promise<ConnectorResult>;
277
277
  /**
278
278
  * Switch network
279
279
  */
@@ -1 +1 @@
1
- {"version":3,"file":"connection-manager.d.ts","sourceRoot":"","sources":["../../src/services/connection-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,SAAS,EACT,yBAAyB,EACzB,iCAAiC,EACjC,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAEhB,cAAc,EACf,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AAyHvE;;;;;;GAMG;AACH,MAAM,WAAW,iCAAiC;IAChD,4FAA4F;IAC5F,UAAU,EAAE,MAAM,CAAA;IAClB;;;;;OAKG;IACH,OAAO,EAAE,mBAAmB,GAAG,kBAAkB,CAAA;IACjD;;;OAGG;IACH,cAAc,EAAE,OAAO,CAAA;IACvB;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAA;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kCAAkC;IACjD,2F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yBAAyB,GAAG,iCAAiC,GACtE,OAAO,CAAC,eAAe,CAAC,CAuD1B;IAED;;OAEG;IACG,aAAa,CACjB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,yBAAyB,GAAG,iCAAiC,GACtE,OAAO,CAAC,eAAe,CAAC,CA4C1B;IAED;;OAEG;IACG,WAAW,CACf,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,yBAAyB,GAAG,iCAAiC,GACtE,OAAO,CAAC,eAAe,CAAC,CAuC1B;IAED;;OAEG;IACG,UAAU,CACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,yBAAyB,GAAG,iCAAiC,GACtE,OAAO,CAAC,eAAe,CAAC,CAqC1B;IAED;;OAEG;IACG,cAAc,CAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,yBAAyB,GAAG,iCAAiC,GACtE,OAAO,CAAC,eAAe,CAAC,CA0B1B;IAED;;OAEG;IACG,aAAa,CACjB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,yBAAyB,GAAG,iCAAiC,GACtE,OAAO,CAAC,mBAAmB,CAAC,CAoG9B;IAED;;OAEG;IACH,mBAAmB,IAAI,MAAM,GAAG,IAAI,CAEnC;IAED;;OAEG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAElD;IAED;;OAEG;IACH,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAgBjC;IAED;;;;;OAKG;YACW,qBAAqB;IAkBnC;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAShC;CACF"}
1
+ {"version":3,"file":"connection-manager.d.ts","sourceRoot":"","sources":["../../src/services/connection-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,SAAS,EACT,yBAAyB,EACzB,iCAAiC,EACjC,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAEhB,cAAc,EACf,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EAA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CACjB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,yBAAyB,GAAG,iCAAiC,GACtE,OAAO,CAAC,mBAAmB,CAAC,CAoG9B;IAED;;OAEG;IACH,mBAAmB,IAAI,MAAM,GAAG,IAAI,CAEnC;IAED;;OAEG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAElD;IAED;;OAEG;IACH,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAgBjC;IAED;;;;;OAKG;YACW,qBAAqB;IAkBnC;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAShC;CACF"}
@@ -4,7 +4,7 @@ import { EthereumWalletService } from './ethereum/ethereum-wallet-service';
4
4
  import { SolanaWalletService } from './solana/solana-wallet-service';
5
5
  import { TronWalletService } from './tron/tron-wallet-service';
6
6
  import { TonWalletService } from './ton/ton-wallet-service';
7
- import { BitcoinWalletService } from './bitcoin/bitcoin-wallet-service';
7
+ import { BitcoinWalletService, normalizeRequiredAddresses, pinIncludes } from './bitcoin/bitcoin-wallet-service';
8
8
  import { assertBitcoinNetwork } from '@meshconnect/uwc-bitcoin';
9
9
  import { parseError } from '../utils/error-utils';
10
10
  /**
@@ -128,6 +128,18 @@ function skipLegacyInjectedSolanaSecondaryConnect(solanaMeta, usingIntegratedBro
128
128
  * egress cap — so an oversized value can't bloat the Set or reach consumers.
129
129
  */
130
130
  const MAX_INJECTED_ID_LENGTH = 64;
131
+ /**
132
+ * Does `address` satisfy the caller's pinned allow-list?
133
+ *
134
+ * Shares `normalizeRequiredAddresses` with `BitcoinWalletService` so the
135
+ * normalization rule (trim, lower-case, drop blanks, all-blank means no
136
+ * constraint) is defined once — two copies would be free to drift apart and
137
+ * silently disagree about whether a given address matches.
138
+ */
139
+ function matchesExpectedAddress(address, requiredAddresses) {
140
+ const pinned = normalizeRequiredAddresses(requiredAddresses);
141
+ return !pinned || pinIncludes(pinned, address);
142
+ }
131
143
  /**
132
144
  * Default per-namespace cap for a secondary address gather (ONC-183).
133
145
  *
@@ -286,7 +298,11 @@ export class ConnectionManager {
286
298
  if (this.bitcoinService.isConnected()) {
287
299
  const uuid = provider.namespaceMetaData?.bip122?.detectedWallet?.uuid;
288
300
  if (!uuid || this.bitcoinService.getConnectedWalletUuid() !== uuid) {
289
- await this.bitcoinService.disconnect();
301
+ // LOCAL release only — never `disconnect()`, which now revokes at the
302
+ // wallet. This runs on every connect, so revoking here would drop the
303
+ // user's Bitcoin grant as a side effect of connecting an unrelated
304
+ // wallet (and a rejected revoke would fail that unrelated connect).
305
+ this.bitcoinService.releaseLocalSession();
290
306
  released.push('bip122');
291
307
  }
292
308
  }
@@ -300,7 +316,7 @@ export class ConnectionManager {
300
316
  /**
301
317
  * Check and add existing connections from other namespaces
302
318
  */
303
- async checkExistingConnections(targetNamespace, provider) {
319
+ async checkExistingConnections(targetNamespace, provider, requiredAddresses) {
304
320
  // A different wallet's live state must not be reused as "already
305
321
  // connected" — drop it first so every branch below only ever sees state
306
322
  // belonging to the wallet actually being connected.
@@ -407,16 +423,33 @@ export class ConnectionManager {
407
423
  await this.checkAndAddOtherNamespaceAddresses('tvm', provider, availableAddresses);
408
424
  }
409
425
  else if (targetNamespace === 'bip122') {
426
+ // A live session only counts as "already connected" when it satisfies the
427
+ // caller's pinned allow-list. Otherwise fall through so the prompting
428
+ // connect below can authorize the account actually asked for — adopting a
429
+ // non-matching live account leaves the caller stuck with an address it
430
+ // already told us is wrong, with no path to change it.
410
431
  const bitcoinAccount = this.bitcoinService.getAccount();
411
- if (bitcoinAccount) {
432
+ if (bitcoinAccount &&
433
+ matchesExpectedAddress(bitcoinAccount, requiredAddresses)) {
412
434
  currentAddress = bitcoinAccount;
413
435
  }
414
- else {
436
+ else if (!bitcoinAccount) {
437
+ // Probe the wallet's exposed accounts ONLY when there is no live
438
+ // session. A live account that misses the pin means the session has
439
+ // already moved past whatever the wallet handle reports — and FRAMED,
440
+ // that handle is a one-time snapshot marshaled by `BridgeChild` which
441
+ // proxied connects never update. Consulting it here could "find" the
442
+ // pin in an obsolete snapshot and restore an account the wallet has
443
+ // since revoked, skipping the real connect entirely. A live mismatch
444
+ // therefore falls straight through to `connect()`, which reads the
445
+ // wallet through the proxied feature.
415
446
  const walletUuid = provider.namespaceMetaData?.bip122?.detectedWallet?.uuid;
416
447
  if (walletUuid) {
417
448
  const wallet = this.bitcoinService.findWalletByUuid(walletUuid);
418
449
  if (wallet) {
419
- const address = await this.bitcoinService.checkExistingConnection(wallet);
450
+ // Address-aware, still non-prompting: returns null when pins are
451
+ // set and no ALREADY-AUTHORIZED account matches.
452
+ const address = await this.bitcoinService.checkExistingConnection(wallet, requiredAddresses);
420
453
  if (address) {
421
454
  currentAddress = address;
422
455
  this.bitcoinService.setConnectionState(wallet, address);
@@ -886,9 +919,9 @@ export class ConnectionManager {
886
919
  /**
887
920
  * Connect to a Bitcoin (bip122) wallet
888
921
  */
889
- async connectBitcoin(network, provider) {
922
+ async connectBitcoin(network, provider, requiredAddresses) {
890
923
  try {
891
- const connectResult = await this.bitcoinService.connect(network, provider);
924
+ const connectResult = await this.bitcoinService.connect(network, provider, requiredAddresses);
892
925
  this.currentNetworkId = network.id;
893
926
  const availableAddresses = [
894
927
  ...connectResult.availableAddresses