@fairmint/canton-node-sdk 0.0.282 → 0.0.284

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 (72) hide show
  1. package/README.md +129 -155
  2. package/build/src/utils/external-signing/wallet-ownership-challenger.d.ts.map +1 -1
  3. package/build/src/utils/external-signing/wallet-ownership-challenger.js +2 -3
  4. package/build/src/utils/external-signing/wallet-ownership-challenger.js.map +1 -1
  5. package/build/src/utils/external-signing/wallet-ownership.d.ts.map +1 -1
  6. package/build/src/utils/external-signing/wallet-ownership.js +8 -18
  7. package/build/src/utils/external-signing/wallet-ownership.js.map +1 -1
  8. package/build/src/wallets/acs.d.ts +2 -1
  9. package/build/src/wallets/acs.d.ts.map +1 -1
  10. package/build/src/wallets/acs.js +6 -31
  11. package/build/src/wallets/acs.js.map +1 -1
  12. package/build/src/wallets/cip103.d.ts +32 -68
  13. package/build/src/wallets/cip103.d.ts.map +1 -1
  14. package/build/src/wallets/cip103.js +112 -230
  15. package/build/src/wallets/cip103.js.map +1 -1
  16. package/build/src/wallets/commands.d.ts +39 -6
  17. package/build/src/wallets/commands.d.ts.map +1 -1
  18. package/build/src/wallets/commands.js +50 -5
  19. package/build/src/wallets/commands.js.map +1 -1
  20. package/build/src/wallets/contracts.d.ts +12 -0
  21. package/build/src/wallets/contracts.d.ts.map +1 -1
  22. package/build/src/wallets/contracts.js +21 -5
  23. package/build/src/wallets/contracts.js.map +1 -1
  24. package/build/src/wallets/da-utilities/client.d.ts +61 -29
  25. package/build/src/wallets/da-utilities/client.d.ts.map +1 -1
  26. package/build/src/wallets/da-utilities/client.js +78 -75
  27. package/build/src/wallets/da-utilities/client.js.map +1 -1
  28. package/build/src/wallets/errors.d.ts +11 -8
  29. package/build/src/wallets/errors.d.ts.map +1 -1
  30. package/build/src/wallets/errors.js +13 -3
  31. package/build/src/wallets/errors.js.map +1 -1
  32. package/build/src/wallets/holdings.d.ts +14 -4
  33. package/build/src/wallets/holdings.d.ts.map +1 -1
  34. package/build/src/wallets/holdings.js +27 -47
  35. package/build/src/wallets/holdings.js.map +1 -1
  36. package/build/src/wallets/index.d.ts +17 -21
  37. package/build/src/wallets/index.d.ts.map +1 -1
  38. package/build/src/wallets/index.js +14 -23
  39. package/build/src/wallets/index.js.map +1 -1
  40. package/build/src/wallets/instrument.js +1 -1
  41. package/build/src/wallets/instrument.js.map +1 -1
  42. package/build/src/wallets/ownership.d.ts +20 -26
  43. package/build/src/wallets/ownership.d.ts.map +1 -1
  44. package/build/src/wallets/ownership.js +33 -27
  45. package/build/src/wallets/ownership.js.map +1 -1
  46. package/build/src/wallets/session.d.ts +30 -68
  47. package/build/src/wallets/session.d.ts.map +1 -1
  48. package/build/src/wallets/session.js +119 -167
  49. package/build/src/wallets/session.js.map +1 -1
  50. package/build/src/wallets/store.d.ts +148 -86
  51. package/build/src/wallets/store.d.ts.map +1 -1
  52. package/build/src/wallets/store.js +267 -99
  53. package/build/src/wallets/store.js.map +1 -1
  54. package/build/src/wallets/templates.d.ts +10 -23
  55. package/build/src/wallets/templates.d.ts.map +1 -1
  56. package/build/src/wallets/templates.js +9 -33
  57. package/build/src/wallets/templates.js.map +1 -1
  58. package/build/src/wallets/types.d.ts +6 -20
  59. package/build/src/wallets/types.d.ts.map +1 -1
  60. package/build/src/wallets/wallet.d.ts +130 -74
  61. package/build/src/wallets/wallet.d.ts.map +1 -1
  62. package/build/src/wallets/wallet.js +347 -185
  63. package/build/src/wallets/wallet.js.map +1 -1
  64. package/package.json +2 -2
  65. package/build/src/wallets/cip56-core.d.ts +0 -175
  66. package/build/src/wallets/cip56-core.d.ts.map +0 -1
  67. package/build/src/wallets/cip56-core.js +0 -325
  68. package/build/src/wallets/cip56-core.js.map +0 -1
  69. package/build/src/wallets/token-registry.d.ts +0 -97
  70. package/build/src/wallets/token-registry.d.ts.map +0 -1
  71. package/build/src/wallets/token-registry.js +0 -19
  72. package/build/src/wallets/token-registry.js.map +0 -1
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createCip103Session = createCip103Session;
4
4
  /**
5
- * A CIP-0103 wallet session for a dApp: which wallet is connected, as which party, and whether a reply still belongs to
6
- * the session that asked. It works with any CIP-0103 provider and holds no wallet SDK: the dApp obtains the provider
7
- * (Loop's `loop.getCip103Provider()`, `window.canton`, …) and reports the wallet's own callbacks to it.
5
+ * A CIP-0103 wallet session for a dApp on one DA network: which wallet is connected, as which party, and whether a
6
+ * reply still belongs to the session that asked. It works with any CIP-0103 provider and holds no wallet SDK: the dApp
7
+ * obtains the provider and hands it to `connect` (a user's click) or `restore` (page load).
8
8
  *
9
9
  * Observable for any UI framework: `subscribe` and `getSnapshot` (React: `useSyncExternalStore`).
10
10
  */
@@ -12,9 +12,9 @@ const notify_1 = require("./notify");
12
12
  const cip103_1 = require("./cip103");
13
13
  const errors_1 = require("./errors");
14
14
  const json_1 = require("./json");
15
- /** How long after an `end('user')` disconnect was sent a `connect()` to the same provider still waits for it. */
15
+ /** How long after a disconnect was sent a `connect()` to the same provider still waits for it. */
16
16
  const DISCONNECT_WAIT_MS = 3000;
17
- const NEVER_CONNECTED = { status: 'disconnected', endedBy: null, error: null };
17
+ const DISCONNECTED = { status: 'disconnected', error: null };
18
18
  const CONNECTING = { status: 'connecting' };
19
19
  /** Whether a CIP-0103 `isConnected` answer or `statusChanged` connection says connected (`undefined`: it says nothing). */
20
20
  function connectionFlag(connection) {
@@ -39,33 +39,32 @@ function lookupError(error) {
39
39
  return (0, errors_1.describeWalletError)(error);
40
40
  }
41
41
  /**
42
- * A CIP-0103 wallet session. While connected it listens on the provider: `accountsChanged` reads the primary account
43
- * again (another party becomes a new `ConnectedWallet`), and a `statusChanged` whose `connection.isConnected` is false
44
- * ends the session (`wallet`). A wallet that never emits these events loses nothing.
42
+ * A CIP-0103 wallet session on `options.network`. While connected it listens on the provider: `accountsChanged` reads
43
+ * the primary account again (another party becomes a new `ConnectedWallet`), and a `statusChanged` whose
44
+ * `connection.isConnected` is false (the wallet ended the session) leaves it disconnected without an error.
45
45
  */
46
- function createCip103Session() {
46
+ function createCip103Session(options) {
47
+ const { network } = options;
48
+ if (!(0, cip103_1.isDaNetwork)(network))
49
+ throw new TypeError('createCip103Session: network must be devnet or mainnet');
47
50
  const listeners = new Set();
48
- let state = NEVER_CONNECTED;
49
- // Every party lookup, and every interrupt(), takes the next number. A reply counts only while its number is at least
50
- // `floor`: an interrupt() or a connect() or accountsChanged lookup raises the floor when it starts, a connected()
51
- // lookup only when it acts on its answer, so a callback whose failure is ignored supersedes nothing.
51
+ let state = DISCONNECTED;
52
+ // Bumped by connect(), disconnect(), fail(), a wallet-side end and dispose(): work started before is dropped.
53
+ let epoch = 0;
54
+ // Every account read takes the next number; only the newest one's reply counts.
52
55
  let lookups = 0;
53
- let floor = 0;
54
- // Every connected(..., { ifConnected: true }) takes a new number: only the latest restore may start its lookup.
56
+ // Every restore() takes the next number; only the newest one may connect.
55
57
  let restores = 0;
56
- // Bumped by connect(), end(), fail() and dispose(): a connect() whose epoch is no longer current stops.
57
- let epoch = 0;
58
- // Set by end(): connected() is ignored until the user connects again.
59
- let closed = false;
60
58
  let disposed = false;
61
59
  // Numbers each ConnectedWallet's `key`.
62
60
  let connections = 0;
63
- // The provider the pending connect() signs in to, until that connect() settles or is superseded, whatever state is
64
- // published meanwhile (a failed callback may publish an error while it waits), for end('user')'s disconnect.
61
+ // The provider a pending connect() signs in to, and whether it has sent CIP-0103 `connect` yet.
65
62
  let signingIn = null;
66
- // Whether that connect() has sent CIP-0103 `connect` (only then has the wallet anything to sign out of).
67
63
  let signInSent = false;
68
- // end('user')'s disconnects in flight, per provider: a connect() to that provider waits for them until `deadline`.
64
+ // Wallets the user signed out of (disconnect(), or a switch to another wallet): restore() leaves them alone until
65
+ // connect() signs in to them again, also when their CIP-0103 disconnect failed and they still report a session.
66
+ const signedOut = new WeakSet();
67
+ // Disconnects in flight, per provider: a connect() to that provider waits for them until `deadline`.
69
68
  const disconnecting = new Map();
70
69
  let attachment = null;
71
70
  function publish(next) {
@@ -82,6 +81,14 @@ function createCip103Session() {
82
81
  current.provider.removeListener('accountsChanged', current.onAccountsChanged);
83
82
  current.provider.removeListener('statusChanged', current.onStatusChanged);
84
83
  }
84
+ /** Supersede every pending reply and connect(), and stop following the provider. */
85
+ function interrupt() {
86
+ epoch += 1;
87
+ lookups += 1;
88
+ signingIn = null;
89
+ signInSent = false;
90
+ detach();
91
+ }
85
92
  function attach(provider) {
86
93
  if (attachment?.provider === provider)
87
94
  return;
@@ -89,19 +96,17 @@ function createCip103Session() {
89
96
  const own = {
90
97
  provider,
91
98
  onAccountsChanged: () => {
92
- // Only for this provider's own published wallet, whose network it reads again: a provider that answers a new
93
- // listener at once (a sticky event) does so before its wallet is published, while `state` is still the
94
- // previous wallet's (the lookup that attaches it has just read the account anyway).
99
+ // Only for this provider's published wallet: a provider that answers a new listener at once does so before its
100
+ // wallet is published (the lookup that attaches it has just read the account anyway).
95
101
  if (attachment !== own || state.status !== 'connected' || state.wallet.provider !== provider)
96
102
  return;
97
- const { network } = state.wallet;
98
- void lookup(provider, network === undefined ? {} : { network });
103
+ void lookup(provider, false);
99
104
  },
100
105
  onStatusChanged: (status) => {
101
- if (attachment !== own || !(0, json_1.isRecord)(status))
106
+ if (attachment !== own || !(0, json_1.isRecord)(status) || connectionFlag(status['connection']) !== false)
102
107
  return;
103
- if (connectionFlag(status['connection']) === false)
104
- end('wallet');
108
+ interrupt();
109
+ publish(DISCONNECTED);
105
110
  },
106
111
  };
107
112
  attachment = own;
@@ -109,30 +114,17 @@ function createCip103Session() {
109
114
  provider.on('statusChanged', own.onStatusChanged);
110
115
  }
111
116
  /**
112
- * Read the primary account and connect as its party, unless a newer lookup or session change superseded it.
113
- * `passive`: a wallet callback (`connected()`). It supersedes pending lookups only once it acts on its answer, and
114
- * its failure leaves an already connected session alone (unless that wallet itself reports the other network), and
115
- * never interrupts a pending connect(). `stillWanted`: false once whatever started it no longer wants its answer (a
116
- * restore's lookup, once a newer restore started).
117
+ * Read the primary account and connect as its party, unless something newer superseded it. A failure, or an account
118
+ * on the other DA network, leaves the session disconnected with `error`; `quiet` (a restore) publishes nothing then.
117
119
  */
118
- async function lookup(provider, context, passive = false, stillWanted = () => true) {
120
+ async function lookup(provider, quiet, stillWanted = () => true) {
119
121
  const attempt = ++lookups;
120
- if (!passive)
121
- floor = attempt;
122
- const current = () => attempt >= floor && !disposed && stillWanted();
123
- const failed = (error, otherNetwork) => {
124
- // A stale callback, or another wallet that cannot be read, does not drop a healthy session, nor does it cancel a
125
- // pending lookup. The connected wallet reporting the other network is no stale callback: the session ends.
126
- // While a connect() is pending, its own lookup decides (it always reads the account again), so a callback's
127
- // failure must not flash an error over `connecting`.
128
- const ownWallet = state.status === 'connected' && state.wallet.provider === provider;
129
- if (passive && state.status === 'connecting')
130
- return;
131
- if (passive && state.status === 'connected' && !(otherNetwork && ownWallet))
122
+ const current = () => attempt === lookups && !disposed && stillWanted();
123
+ const failed = (error) => {
124
+ if (quiet)
132
125
  return;
133
- floor = attempt;
134
- detach();
135
- publish({ status: 'disconnected', endedBy: null, error });
126
+ interrupt();
127
+ publish({ status: 'disconnected', error });
136
128
  };
137
129
  let account;
138
130
  try {
@@ -140,47 +132,30 @@ function createCip103Session() {
140
132
  }
141
133
  catch (error) {
142
134
  if (current())
143
- failed(lookupError(error), false);
135
+ failed(lookupError(error));
144
136
  return;
145
137
  }
146
138
  if (!current())
147
139
  return;
148
- const { network } = context;
149
140
  const { partyId, networkId } = account;
150
- if (network !== undefined && networkId !== undefined && reportsOtherNetwork(networkId, network)) {
141
+ if ((0, cip103_1.reportsOtherNetwork)(networkId, network)) {
151
142
  // DA's registry and ledger for `network` would refuse every call of a wallet on another network.
152
- const message = `The wallet is on ${networkId}, not ${(0, cip103_1.cip103NetworkId)(network)}: switch networks in the wallet, then connect again.`;
153
- failed({ kind: 'other', message }, true);
143
+ failed({
144
+ kind: 'other',
145
+ message: `The wallet is on ${String(networkId)}, not ${(0, cip103_1.cip103NetworkId)(network)}: switch networks in the wallet, then connect again.`,
146
+ });
154
147
  return;
155
148
  }
156
- floor = attempt;
157
- if (state.status === 'connected' &&
158
- state.wallet.provider === provider &&
159
- state.wallet.partyId === partyId &&
160
- state.wallet.network === network) {
149
+ if (state.status === 'connected' && state.wallet.provider === provider && state.wallet.partyId === partyId) {
161
150
  return; // the same session: keep its object
162
151
  }
163
- const key = String(++connections);
164
- const wallet = { provider, partyId, key, ...(network !== undefined && { network }) };
152
+ const wallet = { provider, partyId, network, key: String(++connections) };
165
153
  attach(provider);
166
- // A provider may answer a new listener at once (a sticky `statusChanged`), and that may have ended the session:
167
- // then this lookup was superseded and publishes nothing.
168
- if (!current() || closed)
154
+ // A provider may answer a new listener at once (a sticky `statusChanged`) and so end the session.
155
+ if (!current())
169
156
  return;
170
157
  publish({ status: 'connected', wallet });
171
158
  }
172
- /** Whether connected() is followed: not disposed, and not ended since the last connect(). Read after an await. */
173
- function armed() {
174
- return !disposed && !closed;
175
- }
176
- /** Supersede every pending reply and pending connect(), and stop following the provider. */
177
- function interrupt() {
178
- epoch += 1;
179
- floor = ++lookups;
180
- signingIn = null;
181
- signInSent = false;
182
- detach();
183
- }
184
159
  /** The providers the session is on: the connected wallet's, and the one a pending connect() signs in to. */
185
160
  function sessionProviders() {
186
161
  const providers = new Set();
@@ -200,20 +175,25 @@ function createCip103Session() {
200
175
  clearTimeout(timer);
201
176
  });
202
177
  }
178
+ /** The in-flight disconnect of `provider` still within its deadline, if any. */
179
+ function pendingDisconnect(provider) {
180
+ const pending = disconnecting.get(provider);
181
+ if (pending === undefined || pending.deadline > Date.now())
182
+ return pending;
183
+ disconnecting.delete(provider); // it never answered in time: never wait for it again
184
+ return undefined;
185
+ }
203
186
  /**
204
187
  * Record a CIP-0103 `disconnect` of `provider`, so a `connect()` to it waits for it, and return the function that
205
- * sends it (best-effort). Recorded before anything is sent: a `connect()` that sending sets off (a wallet that calls
206
- * back synchronously) finds it.
188
+ * sends it (best-effort). Recorded before anything is sent: a `connect()` that sending sets off finds it.
207
189
  */
208
190
  function recordDisconnect(provider) {
209
191
  let answered = () => undefined;
210
192
  const sent = new Promise((resolve) => {
211
193
  answered = resolve;
212
194
  });
213
- // An earlier disconnect of the same provider still in flight must settle too, but only until its own deadline: one
214
- // that never answers must not delay later connect() calls past it, even when chained to this one.
215
- const found = disconnecting.get(provider);
216
- const earlier = found !== undefined && found.deadline > Date.now() ? found : undefined;
195
+ // An earlier disconnect of the same provider must settle too, but only until its own deadline.
196
+ const earlier = pendingDisconnect(provider);
217
197
  const settled = earlier === undefined ? sent : Promise.all([settledOrDue(earlier), sent]).then(() => undefined);
218
198
  const own = { settled, deadline: Date.now() + DISCONNECT_WAIT_MS };
219
199
  disconnecting.set(provider, own);
@@ -225,42 +205,8 @@ function createCip103Session() {
225
205
  void (async () => provider.request({ method: 'disconnect' }))().then(answered, answered);
226
206
  };
227
207
  }
228
- function end(by) {
229
- if (disposed)
230
- return;
231
- const providers = by === 'user' ? sessionProviders() : new Set();
232
- interrupt();
233
- const own = epoch;
234
- closed = true;
235
- // Before publishing: a listener that connects again in response must find the disconnect in flight. Every
236
- // disconnect is recorded before the first is sent, so a connect() that sending sets off waits for each.
237
- const sends = [...providers].map(recordDisconnect);
238
- for (const send of sends)
239
- send();
240
- // A connect() that sending set off owns the state now (it is signing in). A nested end() or fail() does not (it
241
- // cleared `signingIn`): this end() still publishes, so a user's disconnect is never reported as the wallet's. (A
242
- // nested dispose() leaves nothing to publish.)
243
- if (epoch !== own && signingIn !== null)
244
- return;
245
- publish({ status: 'disconnected', endedBy: by, error: null });
246
- }
247
- /**
248
- * An in-flight disconnect of `provider`, settled or past its deadline; `null` when there is none (or its deadline
249
- * passed), so `connect()` then sends `connect` in the same tick (inside the user's click, where a wallet may open a
250
- * popup).
251
- */
252
- function disconnectSettled(provider) {
253
- const pending = disconnecting.get(provider);
254
- if (pending === undefined)
255
- return null;
256
- if (pending.deadline <= Date.now()) {
257
- // It never answered in time: never wait for it again.
258
- disconnecting.delete(provider);
259
- return null;
260
- }
261
- return settledOrDue(pending);
262
- }
263
208
  return {
209
+ network,
264
210
  subscribe(listener) {
265
211
  listeners.add(listener);
266
212
  return () => {
@@ -268,76 +214,50 @@ function createCip103Session() {
268
214
  };
269
215
  },
270
216
  getSnapshot: () => state,
271
- async connected(provider, context = {}) {
272
- if (disposed || closed)
273
- return;
274
- const { network } = context;
275
- if (context.ifConnected === true) {
276
- // Dropped when a newer restore started, or anything started a lookup or changed the session meanwhile (that
277
- // newer call decides). Taking a restore number rather than a lookup number supersedes no pending lookup while
278
- // `isConnected` is in flight, so a restore that finds no session cannot strand a `connect()` in `connecting`.
279
- const restore = ++restores;
280
- const seen = lookups;
281
- let answer = null;
282
- try {
283
- answer = await provider.request({ method: 'isConnected' });
284
- }
285
- catch {
286
- // 4200 or any other failure: not connected.
287
- }
288
- if (restore !== restores || seen !== lookups || !armed() || connectionFlag(answer) !== true)
289
- return;
290
- // The lookup stays the latest restore's: a newer restore (one that finds no session included) drops it.
291
- await lookup(provider, network === undefined ? {} : { network }, true, () => restore === restores);
292
- return;
293
- }
294
- await lookup(provider, network === undefined ? {} : { network }, true);
295
- },
296
- async connect(provider, context = {}) {
217
+ async connect(provider) {
297
218
  if (disposed)
298
219
  return;
299
- // Another wallet the session is on (connected, or signing in) is signed out: the user switched wallets.
220
+ // Another wallet the session is on is signed out: the user switched wallets.
300
221
  const previous = [...sessionProviders()].filter((other) => other !== provider);
301
222
  interrupt();
302
223
  const own = epoch;
303
224
  const current = () => own === epoch && !disposed;
304
- // connected() stays ignored until `connect` is sent: a stale callback must not connect while this one waits.
305
- closed = true;
306
225
  signingIn = provider;
226
+ for (const other of previous)
227
+ signedOut.add(other);
307
228
  const sends = previous.map(recordDisconnect);
308
229
  for (const send of sends)
309
230
  send();
310
231
  if (!current())
311
- return; // sending set off an end(), fail(), dispose() or another connect()
232
+ return; // sending set off a disconnect(), fail(), dispose() or another connect()
312
233
  publish(CONNECTING);
313
- // A listener of that publish may have ended, superseded or disposed the session: send nothing to the wallet then.
314
234
  if (!current())
315
- return;
235
+ return; // a listener of that publish changed the session
316
236
  try {
317
237
  try {
318
238
  // A disconnect the user sent this wallet just before must not land after the new sign-in.
319
- const disconnected = disconnectSettled(provider);
320
- if (disconnected !== null) {
321
- await disconnected;
239
+ const pending = pendingDisconnect(provider);
240
+ if (pending !== undefined) {
241
+ await settledOrDue(pending);
322
242
  if (!current())
323
243
  return;
324
244
  }
325
- closed = false;
326
245
  signInSent = true;
327
246
  await provider.request({ method: 'connect' });
328
247
  }
329
248
  catch (error) {
330
249
  if (current()) {
331
- // The wallet's accept callback may have connected meanwhile: drop its pending lookup and stop following it.
332
250
  interrupt();
333
- publish({ status: 'disconnected', endedBy: null, error: connectError(error) });
251
+ publish({ status: 'disconnected', error: connectError(error) });
334
252
  }
335
253
  return;
336
254
  }
337
255
  if (!current())
338
256
  return;
339
- // Always read the account again, even when the wallet was already connected and sends no new accept callback.
340
- await lookup(provider, context.network === undefined ? {} : { network: context.network });
257
+ // Signed in again: restore() may reconnect it from now on. A sign-in that failed or was cancelled keeps it out.
258
+ signedOut.delete(provider);
259
+ // Read the account even when the wallet was already connected.
260
+ await lookup(provider, false);
341
261
  }
342
262
  finally {
343
263
  if (own === epoch) {
@@ -346,12 +266,49 @@ function createCip103Session() {
346
266
  }
347
267
  }
348
268
  },
349
- end,
269
+ async restore(provider) {
270
+ if (disposed || state.status !== 'disconnected' || signedOut.has(provider))
271
+ return;
272
+ const own = epoch;
273
+ const attempt = ++restores;
274
+ const wanted = () => !disposed && own === epoch && attempt === restores && state.status === 'disconnected';
275
+ let answer = null;
276
+ try {
277
+ answer = await provider.request({ method: 'isConnected' });
278
+ }
279
+ catch {
280
+ return; // 4200 or any other failure: not connected
281
+ }
282
+ if (!wanted() || connectionFlag(answer) !== true)
283
+ return;
284
+ await lookup(provider, true, wanted);
285
+ },
286
+ disconnect() {
287
+ if (disposed)
288
+ return;
289
+ const providers = sessionProviders();
290
+ // A wallet whose sign-in was cancelled before CIP-0103 `connect` was sent stays out of restore() too.
291
+ const cancelled = signingIn;
292
+ interrupt();
293
+ const own = epoch;
294
+ for (const provider of providers)
295
+ signedOut.add(provider);
296
+ if (cancelled !== null)
297
+ signedOut.add(cancelled);
298
+ // Every disconnect is recorded before the first is sent, so a connect() that sending sets off waits for each.
299
+ const sends = [...providers].map(recordDisconnect);
300
+ for (const send of sends)
301
+ send();
302
+ // Whatever sending set off (a connect(), fail() or dispose()) owns the state now.
303
+ if (epoch !== own)
304
+ return;
305
+ publish(DISCONNECTED);
306
+ },
350
307
  fail(error) {
351
308
  if (disposed)
352
309
  return;
353
310
  interrupt();
354
- publish({ status: 'disconnected', endedBy: null, error: (0, errors_1.describeWalletError)(error) });
311
+ publish({ status: 'disconnected', error: (0, errors_1.describeWalletError)(error) });
355
312
  },
356
313
  isCurrent: (wallet) => !disposed && state.status === 'connected' && state.wallet === wallet,
357
314
  dispose() {
@@ -363,9 +320,4 @@ function createCip103Session() {
363
320
  },
364
321
  };
365
322
  }
366
- const DA_NETWORKS = ['devnet', 'mainnet'];
367
- /** Whether `networkId` is the CIP-0103 id of a DA network other than `network`. */
368
- function reportsOtherNetwork(networkId, network) {
369
- return DA_NETWORKS.some((other) => other !== network && networkId === (0, cip103_1.cip103NetworkId)(other));
370
- }
371
323
  //# sourceMappingURL=session.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../../src/wallets/session.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,qCAA2C;AAC3C,qCAQkB;AAElB,qCAA6F;AAC7F,iCAAkC;AAsGlC,iHAAiH;AACjH,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,MAAM,eAAe,GAAuB,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACnG,MAAM,UAAU,GAAuB,EAAE,MAAM,EAAE,YAAY,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