@etherplay/connect 0.11.2 → 0.13.0

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/README.md CHANGED
@@ -90,11 +90,63 @@ const signedInState = await connection.ensureConnected('SignedIn');
90
90
  console.log('Session account:', signedInState.account.signer.address);
91
91
  ```
92
92
 
93
- `ensureConnected` always ends up doing one of three things: initiate a connection attempt, resolve at the target step, or reject with a `ConnectionFailure`. It never sits doing nothing.
93
+ #### What the target is
94
94
 
95
- - It initiates from `Idle`, and from a picker step (`MechanismToChoose`, `WalletToChoose`) that still carries the `error` of a previous failed attempt, so retrying after a rejected wallet prompt prompts again.
95
+ `ensureConnected` promises a **target**, not a step comparison, and does whatever reaching it takes. The target is reached when the connection is:
96
+
97
+ - **at or beyond `step`.** The steps are ordered (`SignedIn` implies `WalletConnected` implies `WalletChosen`), so a signed-in connection satisfies `ensureConnected('WalletConnected')` and resolves as itself.
98
+ - **on the wallet you named**, if you named one.
99
+ - **able to act as the address you named**, if you named one: connected, not locked, and actually holding that account. A connection already at the requested step but on a _different_ account initiates an attempt rather than resolving with somebody else.
100
+ - **on the right chain** — but only for a `WalletConnected` target, and unless you pass `{skipChainCheck: true}`. A `SignedIn` target does not check the chain (a session signer is chain-independent), so `skipChainCheck` does nothing there; read `wallet.invalidChainId` and offer `switchWalletChain()` if your signed-in app also sends through the wallet.
101
+
102
+ Anything you did not name is not part of the target, so a bare `ensureConnected()` behaves exactly as before.
103
+
104
+ An address or a wallet name **you** pass is a requirement. An address the library **replays** from the connection's own state (its locked-wallet reconnect does this) stays a preference and degrades to an ordinary connect, because nobody asked for it.
105
+
106
+ #### It always answers
107
+
108
+ There is no timeout, deliberately: a human is in the loop, so any timer is either long enough to be useless or short enough to cut a user off mid-decision, and it would report "timed out" about a wallet dialog that is open and healthy. The rule is narrower instead: **waiting is only legitimate while something is actually in progress.** It stays pending only while one of these is true, and every one of them is published on the connection so your app can render it and the user can answer it:
109
+
110
+ | Still pending because | What the state says | What ends it |
111
+ | -------------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------ |
112
+ | an attempt is running | `step` is `WaitingForWalletConnection` / `PopupLaunched` | the wallet or the host answers |
113
+ | the wallet is holding a signature prompt | `step: 'WaitingForSignature'` | the user answers it |
114
+ | the user is choosing | `step` is `MechanismToChoose` / `WalletToChoose` | they pick, or `cancel()` |
115
+ | the user is picking an account | `step: 'ChooseWalletAccount'` | `connectToAddress(...)`, or `cancel()` |
116
+ | the wallet is on another account | `connection.addressUnavailable` (see below) | they switch in the wallet, or acknowledge it |
117
+ | the wallet is on another chain (`WalletConnected` target only) | `wallet.invalidChainId` | `switchWalletChain()`, or they switch themselves |
118
+ | the signature has not been asked for | `step: 'WalletConnected'` with a `SignedIn` target | `requestSignature()`, or see the note below |
119
+
120
+ If the target is not satisfied, nothing is in progress and nothing can be initiated, that is an answer and it is delivered immediately rather than awaited. "In progress" includes an attempt this call has started that has not come back yet, even before that attempt has published anything. Every resting entry state is enumerated against this, crossed with every target and every kind of mechanism, in `test/ensure-connected-settles.test.ts`.
121
+
122
+ The last row is the one worth knowing about: with the default `requestSignatureAutomaticallyIfPossible: false`, a `SignedIn` target rests at `WalletConnected` waiting for **your** "sign in" button, because prompting over the top of it would ask for a signature you deliberately deferred. Pass `{requestSignatureRightAway: true}` (or set the store option) and `ensureConnected` asks for it itself.
123
+
124
+ #### How it initiates
125
+
126
+ - It initiates from `Idle`, from `WalletChosen` (the wallet is chosen; upgrading it is what you asked for), and from any resting state that does not satisfy the target, including one holding the wrong account.
127
+ - It initiates from a picker step (`MechanismToChoose`, `WalletToChoose`) that still carries the `error` of a previous failed attempt, so retrying after a rejected wallet prompt prompts again.
96
128
  - It does not initiate from a picker step without an `error`: that means the user is making a choice right now and connecting would hijack it. It waits for the user to pick (or cancel) and settles then. Pass `{forceConnect: true}` to connect anyway.
97
129
  - It rejects with a `ConnectionFailure` when the attempt fails. `cause` and the convenience `code` carry the underlying wallet error, so a user rejection is `code === 4001`.
130
+ - It rejects with `ConnectionFailure('Connection cancelled')` when the user backs out, including by acknowledging an `addressUnavailable`.
131
+
132
+ #### Why it failed: `reason`
133
+
134
+ **Read `reason`, not `message`, and not "is there a `cause`".** Every `ConnectionFailure` carries a `reason` from a closed set of string literals, and the connection's own resting `error` carries the same field, with the same value for the same event: the thrown failure copies it, so the banner your app renders and the error your `await` caught cannot disagree.
135
+
136
+ This replaces the older advice to tell a cancellation from a failure by whether an underlying error is present. That test was all there was, and it was not enough: several outcomes carry no `cause` and mean completely different things, so "no cause" collapsed "the user closed the dialog" (say nothing) together with "the connection came to rest and cannot get there" (report it) and "your own app asked for a different account" (retry it).
137
+
138
+ | `reason` | What happened | What to do |
139
+ | ---------------------------------- | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
140
+ | `cancelled` | The user closed or dismissed the connect flow (`cancel()`, `back()`, closed the popup). | Nothing. Do not show an error: they decided. |
141
+ | `address-unavailable-acknowledged` | The user read `addressUnavailable` and chose not to switch account. | Nothing, or re-offer the action. Also a decision, also not an error. |
142
+ | `superseded` | A newer `ensureConnected` naming a **different** address took the account slot. | Retry, if you still want it. The user decided nothing; your app asked for two things at once. |
143
+ | `unreachable` | Came to rest, nothing in progress, nothing can be initiated from here. | **Report it.** "Could not connect, try again." This is an outcome, not a silent no-op. |
144
+ | `wallet-rejected` | The wallet prompt was declined (EIP-1193 `4001`). | Offer a retry; the same prompt can succeed next time. |
145
+ | `wallet-unavailable` | The wallet cannot authorise accounts (EIP-1193 `4100`): read-only, locked, unconfigured. | Retrying will not help. Tell the user to unlock or configure their wallet. |
146
+ | `no-accounts` | The wallet answered with an empty account list. | Report it. It looks like a refusal and is not one. |
147
+ | `cross-origin-blocked` | The wallet host refused a cross-origin request. | Offer the onchain delegate path, not another popup. See "Cross-origin requests" below. |
148
+ | `host-refused` | The wallet host refused for a reason of **its** own. | Show `message`; read `(err.cause as {type?: string})?.type` if you need to tell refusals apart. |
149
+ | `failed` | Anything else. The underlying error is on `cause`. | Show `message`, offer a retry. |
98
150
 
99
151
  ```typescript
100
152
  import {ConnectionFailure} from '@etherplay/connect';
@@ -102,12 +154,123 @@ import {ConnectionFailure} from '@etherplay/connect';
102
154
  try {
103
155
  const state = await connection.ensureConnected('WalletConnected');
104
156
  } catch (err) {
105
- if (err instanceof ConnectionFailure && err.code === 4001) {
106
- // the user rejected the wallet prompt, they can just try again
157
+ if (!(err instanceof ConnectionFailure)) throw err;
158
+ switch (err.reason) {
159
+ case 'cancelled':
160
+ case 'address-unavailable-acknowledged':
161
+ break; // the user decided: say nothing
162
+ case 'wallet-rejected':
163
+ toast('Connection declined. Try again when you are ready.');
164
+ break;
165
+ case 'superseded':
166
+ break; // your own app asked for another account; retry if you still want this one
167
+ default:
168
+ toast(err.message); // unreachable, no-accounts, host refusals, anything new
107
169
  }
108
170
  }
109
171
  ```
110
172
 
173
+ **Host refusals are deliberately not modelled further.** The wallet host is deployed separately and chooses its own vocabulary, so this library pins only the refusal types it can verify: `cross-origin-blocked`, minted by `@etherplay/connect-core`, and its own popup's `cancelation`, which is not a refusal at all and surfaces as `cancelled`. Anything else passes through as `host-refused` with the host's `type` intact on `cause`. A member per host word would be a claim this package cannot check, and would go stale the day the host shipped a new one.
174
+
175
+ **A dismissed `addressUnavailable` keeps the shape of a cancellation.** Its `message` is still `'Connection cancelled'`, exactly as `cancel()` produces, so every path you already wrote that maps a refusal to "the user chose not to" keeps working and nobody paints a red banner over a decision. `reason` is what tells the two apart, and it is the only thing that does.
176
+
177
+ **New members may appear in a MINOR version, so keep a `default` branch.** A union the type system can exhaust is worth having, and it comes with that cost: an exhaustive `switch` with no default is the one shape a new member breaks. The trade was taken deliberately (see [ADR-0004](../../docs/adr/0004-a-failure-says-why-with-a-safe-default-shape.md)). `failed` is the catch-all, so most future causes will need no new member at all, and anything that does get one was indistinguishable from a generic failure before it existed.
178
+
179
+ `reason` is **additive**: `message`, `cause` and `code` are unchanged on every path, so code that ignores it behaves exactly as it did.
180
+
181
+ ### Asking for a specific account
182
+
183
+ Some sends only mean anything for one account. Replacing or cancelling a stuck transaction reuses its **original nonce**, so it has to be signed by the same key, and a signature from any other account is not a lesser answer, it is a wrong one. Name the account, and the wallet if you recorded it:
184
+
185
+ ```typescript
186
+ await connection.ensureConnected(
187
+ 'WalletConnected',
188
+ {type: 'wallet', name: 'Rabby', address: payerOfTheStuckTransaction},
189
+ {doNotStoreLocally: true},
190
+ );
191
+ ```
192
+
193
+ Call it **unconditionally**. Do not put an "are we already there" check in front of it: `connection.account.address` is the address the connection _agreed on_, not the one that can sign right now, and it is deliberately left untouched when the wallet locks, is revoked, or the user switches account behind the connection's back (`wallet.status` and `wallet.accountChanged` record those). A hand-written check on it passes for a locked wallet, skips the call that would have prompted the unlock, and the send then comes back `{code: 4001}` from the always-on provider, which is easy to report as "rejected by user" about a prompt nobody was shown.
194
+
195
+ To **render** readiness without initiating anything, ask `canActAs`:
196
+
197
+ ```typescript
198
+ import {canActAs} from '@etherplay/connect';
199
+
200
+ // in an event handler, against the store's current state
201
+ const ready = connection.canActAs(address);
202
+ // in markup or a reactive block, against a state you already hold: it takes `$connection`, so it
203
+ // re-evaluates when the wallet locks. The method form would not, since a method call gives a
204
+ // reactive block nothing to depend on.
205
+ const readyToo = canActAs($connection, address);
206
+ ```
207
+
208
+ It is false for a locked wallet, for a revoked one, and for a connection on another account, and it starts no flow. It reads `wallet.status` and the accounts the wallet is offering, so it is right about a wallet that has never been asked for accounts (a `WalletChosen` connection) as well as one that has been. Chain is not part of the answer: signing as an address is chain-independent, and `wallet.invalidChainId` is the separate question.
209
+
210
+ #### When the wallet is not on that account: `connection.addressUnavailable`
211
+
212
+ If the wallet cannot offer the address you named, the connection does **not** throw and does **not** tear the wallet down. It connects to what the wallet _does_ offer and comes to rest with a structured reason:
213
+
214
+ ```typescript
215
+ type AddressUnavailable = {
216
+ requested: `0x${string}`; // the address you asked for
217
+ walletName?: string; // the wallet it went to
218
+ selected?: `0x${string}`; // the account that wallet is on instead; absent if it offers none
219
+ available: `0x${string}`[]; // the accounts it is exposing; empty if it has since locked
220
+ message: string; // a sentence you can render as an instruction
221
+ };
222
+ ```
223
+
224
+ The last three describe the wallet **as it is now**, not as it was when the attempt ran: they are re-derived whenever the wallet announces a change, because "switch to the account we need" is not advice anyone can follow if it names an account they have already left. If the wallet ends up offering `requested`, the state clears itself, since it has stopped being true.
225
+
226
+ It sits beside `error` rather than in it, because nothing failed: the wallet works, it is on another account, and only the user can move it. Render it as an instruction, not as a red banner:
227
+
228
+ ```svelte
229
+ {#if $connection.addressUnavailable}
230
+ <p>{$connection.addressUnavailable.message}</p>
231
+ <button onclick={() => connection.acknowledgeAddressUnavailable()}>Cancel</button>
232
+ {/if}
233
+ ```
234
+
235
+ Two ways out, and you have to offer both:
236
+
237
+ - **The user switches account in their wallet.** The original request then proceeds on its own and the promise resolves: somebody who has just done what was asked should not have to press anything in your app.
238
+ - **The user acknowledges it.** `acknowledgeAddressUnavailable()` clears the state and settles the pending `ensureConnected` as `ConnectionFailure('Connection cancelled')`, the same shape as any other "the user chose not to", so existing refusal handling covers it and nobody sees an error for a decision. The connection stays connected on the account the wallet is offering. To tell this dismissal from the user closing the connect dialog, read [`reason`](#why-it-failed-reason): it is `'address-unavailable-acknowledged'`, where a `cancel()` is `'cancelled'`. The message is identical on purpose, so nothing else distinguishes them.
239
+
240
+ Only an address **you** named produces this. A replayed one degrades to an ordinary connect as it always did.
241
+
242
+ **One request at a time.** A connection has one wallet, one account and one such state, so two `ensureConnected` calls naming _different_ accounts cannot both stand: the newer supersedes, and the older is answered with a `ConnectionFailure` carrying [`reason: 'superseded'`](#why-it-failed-reason) and naming where the connection came to rest. It is **not** answered with `Connection cancelled`, because the user decided nothing — that message is reserved for `acknowledgeAddressUnavailable()`, and a dismissal answers only the request for the address it was showing. If you need two accounts ready at once, use two connections with different `storagePrefix`es (see "Running more than one connection in a page").
243
+
244
+ ##### Wallets that only expose one account
245
+
246
+ `available` is **what the wallet is exposing right now, not what the user owns**, and the difference is not an edge case: MetaMask answers `eth_accounts` with every account the user has permitted, while Rabby (among others) answers with the one account it is currently on. So for a large share of users `available` has a single entry, the requested address is not in it, and the user is holding that address all along.
247
+
248
+ Two consequences for your UI:
249
+
250
+ - **Do not render `available` as an exhaustive account picker**, and do not read "the requested address is absent" as "the user does not have it". Show it as detail, and only when it has more than one entry. If you do offer its entries as a choice, say what choosing one MEANS: connecting to a different account abandons the request that produced this state, so the pending `ensureConnected` settles (with `reason: 'unreachable'`, since the user acknowledged nothing and no newer request took the slot).
251
+ - **The instruction is the remedy.** `message` asks the user to switch to that account in their wallet, which is the only thing that works when the wallet exposes one at a time. Nothing in the app can pick an account the wallet is not offering.
252
+
253
+ That path is fully automatic on the library side: every wallet emits `accountsChanged` when the user switches, so the pending `ensureConnected` picks it up and proceeds to satisfy the original request. There is no "retry" button to wire, and pressing one would be redundant — at most one attempt is made per announcement the wallet makes, and an attempt never starts another off its own result.
254
+
255
+ There is deliberately no call that asks the wallet to open its own account picker (EIP-2255 `wallet_requestPermissions`). It would be a better remedy where it works, and it is a candidate for a later release, but it needs a new optional capability on the wallet-provider interface and support that varies per wallet; a button that silently does nothing on the wallets that lack it is worse than the sentence that works everywhere.
256
+
257
+ ### What your UI has to render
258
+
259
+ `ensureConnected` has no timeout, on purpose, so a state where it waits is a state your app must **show**. These are cross-cutting: they are about the wallet, not about the step, so render them above your step switch rather than inside one branch. The demo does this in one component (`demoes/sveltekit/src/lib/NeedsTheUser.svelte`), which is the shortest description of the whole list:
260
+
261
+ | Read | Show | Remedy to offer |
262
+ | ---------------------------------------------------- | --------------------------------- | ------------------------------------------------------ |
263
+ | `wallet.status === 'locked'` | "your wallet is locked" | `unlock()` (not `connect()`, which drops the wallet) |
264
+ | `wallet.status === 'disconnected'`, `accountChanged` | "your wallet moved to 0x…" | `connectToAddress(wallet.accountChanged)` |
265
+ | `wallet.invalidChainId` | "your wallet is on another chain" | `switchWalletChain()`, showing `wallet.switchingChain` |
266
+ | `connection.addressUnavailable` | its `message`, as an instruction | the user switches in the wallet, or acknowledge it |
267
+ | `connection.pendingRequests` | what the wallet is asking for | the user answers it in the wallet |
268
+ | `connection.error` | its `message`, per `error.reason` | `clearError()` and retry |
269
+
270
+ `connection.error` carries the same `reason` as the `ConnectionFailure` a pending `ensureConnected` rejects with, and for the same event it is the same value, so the two cannot tell the user different stories: see [Why it failed: `reason`](#why-it-failed-reason) for the table. It is the field to branch on before you decide to render a red banner at all, since some of what lands there is a decision the user made rather than a failure.
271
+
272
+ **A locked wallet is the one most likely to be missed**, and it became more visible with the target semantics: `step` stays `WalletConnected`, `account.address` still names the account that was agreed on, and only `wallet.status` (and `canActAs`) knows it cannot sign. A signed-in app is not exempt: its session account keeps working, but anything sent from the **wallet** account cannot be signed until the user unlocks.
273
+
111
274
  ## Supported connection shapes
112
275
 
113
276
  There are three supported shapes. Pick one deliberately: they differ in what the user ends up with, and in what infrastructure you have to run.
@@ -245,15 +408,15 @@ const hasSigner = connection.targetStep === 'SignedIn';
245
408
 
246
409
  **Cross-origin requests are blocked by default.** The wallet host honours one only when the signing origin has recorded that it accepts requests from that origin, and even then the user is still asked (twice, where the consent was a blanket one rather than a naming of this specific site). With no consent recorded there is no prompt, because a screen asking someone to compare two domain names is not a decision they can make well.
247
410
 
248
- A blocked request comes back as an error rather than as a cancellation, so an app can tell it from the user closing the popup:
411
+ A blocked request comes back as an error rather than as a cancellation, so an app can tell it from the user closing the popup. `reason` says so directly (`'cross-origin-blocked'`); `cause` still carries the host's own object, which names both origins:
249
412
 
250
413
  ```typescript
251
414
  try {
252
415
  await connection.ensureConnected();
253
416
  } catch (err) {
254
- // err is a ConnectionFailure; the wallet host's reason is on `cause`
255
- if ((err as ConnectionFailure).cause?.type === 'cross-origin-blocked') {
256
- // {type, message, windowOrigin, signingOrigin}
417
+ if ((err as ConnectionFailure).reason === 'cross-origin-blocked') {
418
+ // `cause` is the host's own object, which names both origins:
419
+ // {type: 'cross-origin-blocked', message, windowOrigin, signingOrigin}
257
420
  }
258
421
  }
259
422
  ```
@@ -297,8 +460,18 @@ export const payment = createConnection({
297
460
 
298
461
  // At checkout:
299
462
  const payer = await payment.ensureConnected({doNotStoreLocally: true});
463
+
464
+ // Later, to replace or cancel a stuck payment: it reuses the original nonce, so it must be signed
465
+ // by the SAME key. Name the account (and the wallet, if you recorded which one paid).
466
+ await payment.ensureConnected(
467
+ 'WalletConnected',
468
+ {type: 'wallet', name: walletThatPaid, address: payerOfTheStuckTransaction},
469
+ {doNotStoreLocally: true},
470
+ );
300
471
  ```
301
472
 
473
+ A payment rail whose wallet is re-picked per payment is the case that most needs the named account, and the one where the user is most likely to be on a different one by the time it matters. See "Asking for a specific account" above, including `connection.addressUnavailable`, which is what the flow rests on when the wallet is not on the account the replacement needs.
474
+
302
475
  ### What `storagePrefix` does
303
476
 
304
477
  Each connection persists two entries, in both `localStorage` and `sessionStorage`:
@@ -499,7 +672,9 @@ reproduce it and then drift from it.
499
672
  | `connectToAddress(address, options?)` | Connect to specific wallet address |
500
673
  | `switchWalletChain(chainInfo?)` | Switch wallet to different chain |
501
674
  | `unlock()` | Prompt a locked wallet, keeping step, account and wallet (see "What to call on a locked wallet") |
502
- | `ensureConnected(step?, mechanism?, options?)` | Promise-based connection; reconnects a locked wallet, since it promises a usable one |
675
+ | `ensureConnected(step?, mechanism?, options?)` | Promise-based connection to a TARGET: step, wallet, account, chain. Reconnects a locked wallet |
676
+ | `canActAs(address)` | Can this connection sign as that address right now? Reads state, initiates nothing |
677
+ | `acknowledgeAddressUnavailable()` | Dismiss `connection.addressUnavailable`; settles a waiting `ensureConnected` as cancelled |
503
678
  | `isTargetStepReached(connection)` | Check if target step is reached |
504
679
  | `getSignatureForPublicKeyPublication()` | Get signature for public key |
505
680
  | `getDelegation(target)` | Get a delegation credential |
@@ -570,7 +745,12 @@ One consequence worth stating plainly, because it used to be worse than it is: t
570
745
 
571
746
  The reasoning, including the version of this that made `connect()` reconnect too and why it was rejected, is in `docs/adr/0002-connect-ensure-connected-and-unlock-are-three-promises.md`.
572
747
 
573
- **On accounts.** `ensureConnected()`'s reconnect replays the address the connection was on, so an ordinary unlock comes back to the same account rather than bouncing a multi-account user into `ChooseWalletAccount`. If the user unlocks on a _different_ account, the replayed address is treated as a preference and the reconnect lands on the account the wallet actually offers, with `mechanism.address` and `account` updated to say so. An address YOU name (`connectToAddress(a)`, `connect({type: 'wallet', address: a})`) is a demand, and still fails the attempt if the wallet cannot offer it.
748
+ **On accounts.** `ensureConnected()`'s reconnect replays the address the connection was on, so an ordinary unlock comes back to the same account rather than bouncing a multi-account user into `ChooseWalletAccount`. If the user unlocks on a _different_ account, the replayed address is treated as a preference and the reconnect lands on the account the wallet actually offers, with `mechanism.address` and `account` updated to say so.
749
+
750
+ An address YOU name is a requirement, and the two entry points answer an impossible one differently, on purpose:
751
+
752
+ - `connectToAddress(a)` and `connect({type: 'wallet', address: a})` **fail the attempt**, unchanged. `connect` drives the flow from the user's choice and has no promise to settle, so a demand it cannot meet is an error.
753
+ - `ensureConnected(step, {type: 'wallet', address: a})` **rests on `connection.addressUnavailable`** instead: it connects to what the wallet does offer, keeps the wallet, and publishes what was asked for beside what the wallet is on, so the app can tell the user which account to switch to. Switching resolves the original call; acknowledging settles it as cancelled. See "Asking for a specific account" above.
574
754
 
575
755
  ### Connect Options
576
756
 
@@ -587,9 +767,14 @@ interface ConnectOptions {
587
767
  ```typescript
588
768
  interface EnsureConnectedOptions extends ConnectOptions {
589
769
  skipChainCheck?: boolean; // Skip chain validation for WalletConnected step
770
+ forceConnect?: boolean; // Initiate even from a picker the user is mid-choice on
590
771
  }
591
772
  ```
592
773
 
774
+ `ConnectOptions.requestSignatureRightAway` is worth knowing here too: with a `SignedIn` target on an
775
+ already-connected wallet it is what lets `ensureConnected` ask for the signature itself, instead of
776
+ resting at `WalletConnected` waiting for your own "sign in" button.
777
+
593
778
  ## Origin Account Structure
594
779
 
595
780
  When fully signed in, the account includes:
package/dist/index.d.ts CHANGED
@@ -96,6 +96,58 @@ export type WalletMechanism<WalletName extends string | undefined, Address exten
96
96
  export type Mechanism = AuthMechanism | WalletMechanism<string | undefined, `0x${string}` | undefined>;
97
97
  export type FullfilledMechanism = AuthMechanism | WalletMechanism<string, `0x${string}`>;
98
98
  export type TargetStep = 'WalletChosen' | 'WalletConnected' | 'SignedIn';
99
+ /**
100
+ * The wallet is not on the account a caller asked this connection to act as.
101
+ *
102
+ * A RESTING STATE RATHER THAN AN ERROR, because it is not one: the user has a wallet, it works,
103
+ * and it is simply on a different account than the one this request needs (replacing a stuck
104
+ * transaction reuses its nonce, so it must be signed by the same key, and no other account will
105
+ * do). There is a remedy and the user is the only one who can apply it, so this is published as an
106
+ * instruction to render — "this was paid from 0xabc…, your wallet is on 0xdef…, switch or cancel" —
107
+ * next to a connection that is still usable.
108
+ *
109
+ * Only a CALLER-SUPPLIED address produces it. An address this library replayed from the connection's
110
+ * own state is a preference and keeps degrading to an ordinary connect, because the user never asked
111
+ * for it.
112
+ *
113
+ * Two ways out, and the app has to offer both:
114
+ * - the user switches account in their wallet, and the original request proceeds on its own (driven
115
+ * by `accountsChanged`, which is what makes this work on wallets that expose one account at a
116
+ * time and can therefore never offer the requested one in a list);
117
+ * - the user acknowledges it (`acknowledgeAddressUnavailable()`), which is a CANCELLATION: the
118
+ * pending `ensureConnected` rejects with `ConnectionFailure('Connection cancelled')`, the same
119
+ * shape as any other "the user chose not to".
120
+ */
121
+ export type AddressUnavailable = {
122
+ /** The address the caller asked the connection to be able to act as. */
123
+ requested: `0x${string}`;
124
+ /** The wallet the request went to, by the name this connection knows it by, when known. */
125
+ walletName?: string;
126
+ /**
127
+ * The account that wallet is on instead. Absent only when the wallet is offering none at all,
128
+ * which is what a wallet that has since been LOCKED reports: this state is kept up to date as
129
+ * the wallet moves, so it can go from naming an account to naming none.
130
+ */
131
+ selected?: `0x${string}`;
132
+ /**
133
+ * What the wallet is EXPOSING right now. Not what the user owns, and not a picker.
134
+ *
135
+ * MetaMask answers `eth_accounts` with every account the user permitted; Rabby (among others)
136
+ * answers with the one account it is currently on. So this list is frequently a single entry that
137
+ * does not contain `requested`, while the user is holding `requested` all along. An app that
138
+ * renders it as an exhaustive choice, or reads "absent" as "the user does not have it", is wrong
139
+ * for those wallets. `message` is the remedy that works everywhere: switch in the wallet.
140
+ *
141
+ * Empty when the wallet is offering no account at all, which is what a locked wallet reports.
142
+ */
143
+ available: `0x${string}`[];
144
+ /**
145
+ * A sentence an app can render as an INSTRUCTION rather than an error. Addresses are not
146
+ * shortened here: how to abbreviate an address is the app's decision, and every field the
147
+ * sentence is built from is on this object.
148
+ */
149
+ message: string;
150
+ };
99
151
  type WalletStateCommon<WalletProviderType> = {
100
152
  provider: WalletProvider<WalletProviderType>;
101
153
  accounts: `0x${string}`[];
@@ -159,11 +211,84 @@ type SignedIn<WalletProviderType, WS = WalletState<WalletProviderType>> = {
159
211
  account: OriginAccount;
160
212
  wallet: WS;
161
213
  };
214
+ /**
215
+ * WHY a connection attempt ended without reaching what was asked for.
216
+ *
217
+ * A machine-readable discriminant, so an app never has to parse `message` or infer from which
218
+ * fields happen to be absent. It is called `reason` and not `code` because `ConnectionFailure.code`
219
+ * is taken: that one carries the EIP-1193 code off `cause`, and the two answer different questions
220
+ * ("what did the wallet say" versus "what happened to my call").
221
+ *
222
+ * FORWARD COMPATIBILITY, decided rather than left implicit. This is a closed union so the type
223
+ * system can exhaust it, but **new members may appear in a MINOR version**, because a reason this
224
+ * library cannot yet tell apart is a reason it may learn to tell apart. That is why `'failed'`
225
+ * exists as a catch-all: most future causes land there and need no new member, and anything that
226
+ * does get one was previously indistinguishable from a generic failure anyway. **Keep a `default`
227
+ * branch in your switch.** An exhaustive switch with no default is the one shape a new member can
228
+ * break, and the trade was taken knowingly: a union you cannot switch on is worth less than one
229
+ * that may grow.
230
+ *
231
+ * - `cancelled` — the user closed or dismissed the connect flow (`cancel()`, `back(...)`, closing
232
+ * the hosted popup, or a disconnect while the call was waiting). Nothing failed and nothing is
233
+ * worth showing: they decided. **Say nothing.**
234
+ * - `address-unavailable-acknowledged` — the user read `connection.addressUnavailable` ("your
235
+ * wallet is not on that account") and chose not to switch. Also a decision, also not an error,
236
+ * and deliberately carrying the SAME `message` as `cancelled` (`'Connection cancelled'`) so that
237
+ * every existing "a refusal maps to cancelled" path keeps working untouched. Tell the two apart
238
+ * by THIS field, not by the shape.
239
+ * - `superseded` — a newer `ensureConnected` naming a DIFFERENT address took the connection's one
240
+ * account slot. The user decided nothing; the app asked for two things at once. Retry it, or use
241
+ * two connections with different `storagePrefix`es.
242
+ * - `unreachable` — the connection came to rest, nothing is in progress, and nothing can be
243
+ * initiated from here, so the target cannot be reached without a fresh gesture. An outcome to
244
+ * REPORT ("could not connect, try again"), not a silent no-op.
245
+ * - `wallet-rejected` — the wallet prompt was declined (EIP-1193 4001). Offer a retry.
246
+ * - `wallet-unavailable` — the wallet cannot authorise accounts (EIP-1193 4100): read-only,
247
+ * locked, or not configured. Retrying the same prompt will not help; the user must act in the
248
+ * wallet.
249
+ * - `no-accounts` — the wallet answered the request with an empty account list. It looks like a
250
+ * refusal and is not one, which is why it does not alias onto `cancelled`.
251
+ * - `cross-origin-blocked` — the wallet host refused a cross-origin request. The remedy is a
252
+ * registered delegate, not retrying the same popup. `cause` is the host's
253
+ * `{type: 'cross-origin-blocked', windowOrigin, signingOrigin}`.
254
+ * - `host-refused` — the wallet host refused for a reason of ITS own, which this library does not
255
+ * model. The host is deployed separately and chooses its own vocabulary, so its `type` is passed
256
+ * through untouched on `cause` rather than being mapped to a member this library cannot verify:
257
+ * read `(err.cause as {type?: string})?.type` and `err.message` to distinguish them.
258
+ * - `failed` — anything else, with the underlying error on `cause`. The catch-all: treat it as "it
259
+ * did not work", show `message`, offer a retry.
260
+ */
261
+ export type ConnectionFailureReason = 'cancelled' | 'address-unavailable-acknowledged' | 'superseded' | 'unreachable' | 'wallet-rejected' | 'wallet-unavailable' | 'no-accounts' | 'cross-origin-blocked' | 'host-refused' | 'failed';
262
+ /**
263
+ * The error a connection comes to rest carrying, which an app renders.
264
+ *
265
+ * `reason` is REQUIRED, and that is the whole design: it makes the compiler enumerate every place
266
+ * that can put an error on the connection, rather than leaving the next one to remember. This
267
+ * codebase has twice fixed bugs whose root cause was an invariant maintained at N call sites
268
+ * instead of one.
269
+ *
270
+ * It is the same vocabulary as the `ConnectionFailure` a pending `ensureConnected` rejects with,
271
+ * and not by coincidence: that failure COPIES this field, so the state an app renders and the
272
+ * error a caller catches cannot disagree about what happened.
273
+ */
274
+ export type ConnectionError = {
275
+ message: string;
276
+ cause?: any;
277
+ reason: ConnectionFailureReason;
278
+ };
162
279
  type ConnectionCommon<WalletProviderType> = {
163
- error?: {
164
- message: string;
165
- cause?: any;
166
- };
280
+ error?: ConnectionError;
281
+ /**
282
+ * Set when a caller asked this connection to act as an address the wallet is not offering.
283
+ *
284
+ * It sits BESIDE `error` rather than in it, and for the same reason it is not a throw: nothing
285
+ * failed. It is a resting reason with a remedy only the user can apply, so an app renders it as
286
+ * an instruction (see `AddressUnavailable`), not as a red banner.
287
+ *
288
+ * Like `error`, it survives a state built by spreading the current one and is dropped by any
289
+ * fresh transition, so a new attempt clears it without anybody remembering to.
290
+ */
291
+ addressUnavailable?: AddressUnavailable;
167
292
  wallets: WalletHandle<WalletProviderType>[];
168
293
  /**
169
294
  * Requests the user's wallet is holding right now, whatever the connection is doing.
@@ -225,6 +350,26 @@ export type SignedInState<WalletProviderType> = Extract<Connection<WalletProvide
225
350
  step: 'SignedIn';
226
351
  }>;
227
352
  export declare function isTargetStepReached<WalletProviderType, Target extends TargetStep, WalletOnly extends boolean = false>(connection: Connection<WalletProviderType>, targetStep: Target, walletOnly?: WalletOnly): connection is Target extends 'WalletChosen' ? ChosenOrBetter<WalletProviderType> : Target extends 'WalletConnected' ? ConnectedWithWallet<WalletProviderType> : WalletOnly extends true ? SignedInWithWallet<WalletProviderType> : SignedInState<WalletProviderType>;
353
+ /**
354
+ * Can this connection sign as `address` RIGHT NOW, with no flow initiated and nothing prompted?
355
+ *
356
+ * The question `connection.account.address` does not answer. That field is the address the
357
+ * connection AGREED ON, which is the right thing for it to be: it survives the user locking their
358
+ * wallet, revoking the site, or switching account behind the connection's back, all of which keep
359
+ * `step: 'WalletConnected'` and change nothing about who was agreed on. What they change is whether
360
+ * anybody can sign, and that is what this reads (`wallet.status`, and the accounts the wallet is
361
+ * actually offering).
362
+ *
363
+ * It exists because a consumer needed it, wrote the comparison itself against `account.address`,
364
+ * and got a locked wallet wrong: it skipped its `ensureConnected` call, let the transaction out,
365
+ * and reported the provider's `{code: 4001}` as "transaction rejected by user" about a prompt
366
+ * nobody was ever shown. Use this to RENDER readiness (enable a button, show "unlock to pay"), and
367
+ * `ensureConnected(step, {type: 'wallet', address})` to actually reach it.
368
+ *
369
+ * Chain is deliberately not part of the answer: signing as an address is chain-independent, and
370
+ * `wallet.invalidChainId` is the separate question with its own separate remedy.
371
+ */
372
+ export declare function canActAs<WalletProviderType>(connection: Connection<WalletProviderType>, address: `0x${string}`): boolean;
228
373
  export type ConnectOptions = {
229
374
  requireUserConfirmationBeforeSignatureRequest?: boolean;
230
375
  doNotStoreLocally?: boolean;
@@ -234,10 +379,31 @@ export type EnsureConnectedOptions = ConnectOptions & {
234
379
  skipChainCheck?: boolean;
235
380
  forceConnect?: boolean;
236
381
  };
382
+ /**
383
+ * Error thrown by `ensureConnected` when a connection attempt ends without reaching the target step.
384
+ *
385
+ * Three fields, answering three different questions:
386
+ *
387
+ * - `reason` — WHAT HAPPENED TO THIS CALL, in a closed vocabulary this library controls. Read this
388
+ * one to decide what to do. See `ConnectionFailureReason`, including its note on new members.
389
+ * - `cause` — the underlying error, exactly as whoever raised it wrote it (a wallet's EIP-1193
390
+ * error, the wallet host's `{type, message}` refusal). Unchanged by the arrival of `reason`.
391
+ * - `code` — the convenience copy of `cause.code`, so a user rejection is still `code === 4001`.
392
+ * `reason === 'wallet-rejected'` now says the same thing without the reach into `cause`.
393
+ *
394
+ * `message` is unchanged on every path, deliberately, including `'Connection cancelled'` for a
395
+ * dismissed `addressUnavailable`: the shape stays the safe one every consumer already maps to "the
396
+ * user chose not to", and `reason` says which of those it was.
397
+ *
398
+ * The third constructor argument is optional so that constructing one by hand (a test double, a
399
+ * consumer's own re-throw) keeps compiling; inside this library every failure comes from one place
400
+ * that always supplies it.
401
+ */
237
402
  export declare class ConnectionFailure extends Error {
238
403
  name: string;
239
404
  readonly code?: unknown;
240
- constructor(message: string, cause?: unknown);
405
+ readonly reason: ConnectionFailureReason;
406
+ constructor(message: string, cause?: unknown, reason?: ConnectionFailureReason);
241
407
  }
242
408
  export type ConnectionStore<WalletProviderType, Target extends TargetStep = 'SignedIn', WalletOnly extends boolean = false> = {
243
409
  subscribe: (run: (value: Connection<WalletProviderType>) => void) => () => void;
@@ -245,6 +411,8 @@ export type ConnectionStore<WalletProviderType, Target extends TargetStep = 'Sig
245
411
  cancel: () => void;
246
412
  back: (step: 'MechanismToChoose' | 'Idle' | 'WalletToChoose') => void;
247
413
  clearError: () => void;
414
+ acknowledgeAddressUnavailable: () => void;
415
+ canActAs: (address: `0x${string}`) => boolean;
248
416
  requestSignature: () => Promise<void>;
249
417
  connectToAddress: (address: `0x${string}`, options?: {
250
418
  requireUserConfirmationBeforeSignatureRequest: boolean;
@@ -265,15 +433,15 @@ export type ConnectionStore<WalletProviderType, Target extends TargetStep = 'Sig
265
433
  (options?: EnsureConnectedOptions): Promise<ChosenOrBetter<WalletProviderType>>;
266
434
  (step: 'WalletChosen', mechanism?: WalletMechanism<string | undefined, `0x${string}` | undefined>, options?: EnsureConnectedOptions): Promise<ChosenOrBetter<WalletProviderType>>;
267
435
  } : Target extends 'WalletConnected' ? {
268
- (options?: EnsureConnectedOptions): Promise<WalletConnected<WalletProviderType>>;
269
- (step: 'WalletConnected', mechanism?: WalletMechanism<string | undefined, `0x${string}` | undefined>, options?: EnsureConnectedOptions): Promise<WalletConnected<WalletProviderType>>;
436
+ (options?: EnsureConnectedOptions): Promise<ConnectedWithWallet<WalletProviderType>>;
437
+ (step: 'WalletConnected', mechanism?: WalletMechanism<string | undefined, `0x${string}` | undefined>, options?: EnsureConnectedOptions): Promise<ConnectedWithWallet<WalletProviderType>>;
270
438
  } : WalletOnly extends true ? {
271
439
  (options?: EnsureConnectedOptions): Promise<SignedInWithWallet<WalletProviderType>>;
272
- (step: 'WalletConnected', mechanism?: WalletMechanism<string | undefined, `0x${string}` | undefined>, options?: EnsureConnectedOptions): Promise<WalletConnected<WalletProviderType>>;
440
+ (step: 'WalletConnected', mechanism?: WalletMechanism<string | undefined, `0x${string}` | undefined>, options?: EnsureConnectedOptions): Promise<ConnectedWithWallet<WalletProviderType>>;
273
441
  (step: 'SignedIn', mechanism?: WalletMechanism<string | undefined, `0x${string}` | undefined>, options?: EnsureConnectedOptions): Promise<SignedInWithWallet<WalletProviderType>>;
274
442
  } : {
275
443
  (options?: EnsureConnectedOptions): Promise<SignedIn<WalletProviderType>>;
276
- (step: 'WalletConnected', mechanism?: WalletMechanism<string | undefined, `0x${string}` | undefined>, options?: EnsureConnectedOptions): Promise<WalletConnected<WalletProviderType>>;
444
+ (step: 'WalletConnected', mechanism?: WalletMechanism<string | undefined, `0x${string}` | undefined>, options?: EnsureConnectedOptions): Promise<ConnectedWithWallet<WalletProviderType>>;
277
445
  (step: 'SignedIn', mechanism?: Mechanism, options?: EnsureConnectedOptions): Promise<SignedIn<WalletProviderType>>;
278
446
  };
279
447
  isTargetStepReached: (connection: Connection<WalletProviderType>) => connection is Target extends 'WalletChosen' ? ChosenOrBetter<WalletProviderType> : Target extends 'WalletConnected' ? ConnectedWithWallet<WalletProviderType> : WalletOnly extends true ? SignedInWithWallet<WalletProviderType> : SignedInState<WalletProviderType>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,eAAe,EACf,YAAY,EACZ,cAAc,EACd,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,MA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