@yieldfabric/wallet 0.2.1 → 0.2.3
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/dist/index.cjs +155 -202
- package/dist/index.d.cts +18 -14
- package/dist/index.d.ts +18 -14
- package/dist/index.js +156 -203
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -524,6 +524,10 @@ interface WalletRuntimeConfig extends ModeConfig {
|
|
|
524
524
|
* cache reset + `userChanged` event dispatch here. Hosts that
|
|
525
525
|
* don't use Apollo can omit this. */
|
|
526
526
|
onSessionBootstrapped?: (userId: string) => void | Promise<void>;
|
|
527
|
+
/** Runs BEFORE the session is torn down on `logout` / `logoutAll`,
|
|
528
|
+
* while the token is still valid — the host forgets this device's push
|
|
529
|
+
* subscription here. Failures are swallowed; sign-out always proceeds. */
|
|
530
|
+
onBeforeLogout?: () => void | Promise<void>;
|
|
527
531
|
/** Optional toast / error reporting hooks for wallet-internal
|
|
528
532
|
* events that the host might want to surface (background poller
|
|
529
533
|
* failures, queue subscription drops, etc.). */
|
|
@@ -3469,7 +3473,8 @@ groupId?: string): Promise<string>;
|
|
|
3469
3473
|
*
|
|
3470
3474
|
* 1. Email not confirmed → 'email-required'
|
|
3471
3475
|
* (Averer signups skip this; Averer is already an identity gate)
|
|
3472
|
-
* 2. < 1 off-chain signing key
|
|
3476
|
+
* 2. < 1 off-chain signing key, not deferred → 'wallets-required'
|
|
3477
|
+
* ("Skip for now" defers it on this device: `deferKeyStep`)
|
|
3473
3478
|
* 3. Identity verification required but not done → 'identity-required'
|
|
3474
3479
|
* 4. Profile (display_name + avatar) not completed → 'profile-required'
|
|
3475
3480
|
* 5. Billing unavailable in a direct plan context → 'service-unavailable'
|
|
@@ -3493,11 +3498,13 @@ groupId?: string): Promise<string>;
|
|
|
3493
3498
|
* already a verified-identity ceremony, so we do not add a second
|
|
3494
3499
|
* email-code gate on top of it.
|
|
3495
3500
|
*
|
|
3496
|
-
* - **Signing key before identity
|
|
3497
|
-
* the
|
|
3498
|
-
*
|
|
3499
|
-
*
|
|
3500
|
-
*
|
|
3501
|
+
* - **Signing key before identity, and optional.** Offering the key first
|
|
3502
|
+
* gives the user something tangible before being asked for
|
|
3503
|
+
* government-issued ID. It can be skipped: an email user acts through
|
|
3504
|
+
* their platform-managed key, signing permission follows verification
|
|
3505
|
+
* (auth's capability gate), and auth stores a FIRST key for an
|
|
3506
|
+
* email-confirmed person without signing permission, so a key added
|
|
3507
|
+
* later needs no carve-out either.
|
|
3501
3508
|
*
|
|
3502
3509
|
* - **Identity second.** Stripe Identity returns first_name, last_name,
|
|
3503
3510
|
* dob, and address as `verified_outputs`, which the auth side projects
|
|
@@ -3539,6 +3546,11 @@ groupId?: string): Promise<string>;
|
|
|
3539
3546
|
interface OnboardingSnapshot {
|
|
3540
3547
|
profileCompleted: boolean;
|
|
3541
3548
|
keyCount: number;
|
|
3549
|
+
/** The person chose to add a key later (the key step's "Skip for now").
|
|
3550
|
+
* A key is optional: storing one is not an on-chain act, and signing
|
|
3551
|
+
* permission follows verification (auth's capability gate), never keys.
|
|
3552
|
+
* Absent reads as not deferred. */
|
|
3553
|
+
keyDeferred?: boolean;
|
|
3542
3554
|
/** Current auth email ownership state. Synthetic wallet-only emails
|
|
3543
3555
|
* must be replaced before they can be confirmed. */
|
|
3544
3556
|
emailVerified: boolean;
|
|
@@ -3575,14 +3587,6 @@ interface OnboardingSnapshot {
|
|
|
3575
3587
|
* fetch failed (treated as NOT exempt — fail-safe). */
|
|
3576
3588
|
role: string | null;
|
|
3577
3589
|
}
|
|
3578
|
-
/** Drop the cache and notify every mounted hook instance to re-fetch.
|
|
3579
|
-
* Call after any mutation that could change the user's onboarding
|
|
3580
|
-
* state — wallet add/remove, profile patch, lockdown finalize,
|
|
3581
|
-
* identity-verification submission, etc.
|
|
3582
|
-
*
|
|
3583
|
-
* The subscriber fan-out is critical: without it, sibling consumers
|
|
3584
|
-
* of `useOnboardingState` keep their stale React state and continue
|
|
3585
|
-
* rendering against an out-of-date decision. */
|
|
3586
3590
|
declare function invalidateOnboardingState(): void;
|
|
3587
3591
|
/** Backwards-compatible alias for the now-removed wallet-only API.
|
|
3588
3592
|
* Callers don't need to know the cache covers both signals now. */
|
package/dist/index.d.ts
CHANGED
|
@@ -524,6 +524,10 @@ interface WalletRuntimeConfig extends ModeConfig {
|
|
|
524
524
|
* cache reset + `userChanged` event dispatch here. Hosts that
|
|
525
525
|
* don't use Apollo can omit this. */
|
|
526
526
|
onSessionBootstrapped?: (userId: string) => void | Promise<void>;
|
|
527
|
+
/** Runs BEFORE the session is torn down on `logout` / `logoutAll`,
|
|
528
|
+
* while the token is still valid — the host forgets this device's push
|
|
529
|
+
* subscription here. Failures are swallowed; sign-out always proceeds. */
|
|
530
|
+
onBeforeLogout?: () => void | Promise<void>;
|
|
527
531
|
/** Optional toast / error reporting hooks for wallet-internal
|
|
528
532
|
* events that the host might want to surface (background poller
|
|
529
533
|
* failures, queue subscription drops, etc.). */
|
|
@@ -3469,7 +3473,8 @@ groupId?: string): Promise<string>;
|
|
|
3469
3473
|
*
|
|
3470
3474
|
* 1. Email not confirmed → 'email-required'
|
|
3471
3475
|
* (Averer signups skip this; Averer is already an identity gate)
|
|
3472
|
-
* 2. < 1 off-chain signing key
|
|
3476
|
+
* 2. < 1 off-chain signing key, not deferred → 'wallets-required'
|
|
3477
|
+
* ("Skip for now" defers it on this device: `deferKeyStep`)
|
|
3473
3478
|
* 3. Identity verification required but not done → 'identity-required'
|
|
3474
3479
|
* 4. Profile (display_name + avatar) not completed → 'profile-required'
|
|
3475
3480
|
* 5. Billing unavailable in a direct plan context → 'service-unavailable'
|
|
@@ -3493,11 +3498,13 @@ groupId?: string): Promise<string>;
|
|
|
3493
3498
|
* already a verified-identity ceremony, so we do not add a second
|
|
3494
3499
|
* email-code gate on top of it.
|
|
3495
3500
|
*
|
|
3496
|
-
* - **Signing key before identity
|
|
3497
|
-
* the
|
|
3498
|
-
*
|
|
3499
|
-
*
|
|
3500
|
-
*
|
|
3501
|
+
* - **Signing key before identity, and optional.** Offering the key first
|
|
3502
|
+
* gives the user something tangible before being asked for
|
|
3503
|
+
* government-issued ID. It can be skipped: an email user acts through
|
|
3504
|
+
* their platform-managed key, signing permission follows verification
|
|
3505
|
+
* (auth's capability gate), and auth stores a FIRST key for an
|
|
3506
|
+
* email-confirmed person without signing permission, so a key added
|
|
3507
|
+
* later needs no carve-out either.
|
|
3501
3508
|
*
|
|
3502
3509
|
* - **Identity second.** Stripe Identity returns first_name, last_name,
|
|
3503
3510
|
* dob, and address as `verified_outputs`, which the auth side projects
|
|
@@ -3539,6 +3546,11 @@ groupId?: string): Promise<string>;
|
|
|
3539
3546
|
interface OnboardingSnapshot {
|
|
3540
3547
|
profileCompleted: boolean;
|
|
3541
3548
|
keyCount: number;
|
|
3549
|
+
/** The person chose to add a key later (the key step's "Skip for now").
|
|
3550
|
+
* A key is optional: storing one is not an on-chain act, and signing
|
|
3551
|
+
* permission follows verification (auth's capability gate), never keys.
|
|
3552
|
+
* Absent reads as not deferred. */
|
|
3553
|
+
keyDeferred?: boolean;
|
|
3542
3554
|
/** Current auth email ownership state. Synthetic wallet-only emails
|
|
3543
3555
|
* must be replaced before they can be confirmed. */
|
|
3544
3556
|
emailVerified: boolean;
|
|
@@ -3575,14 +3587,6 @@ interface OnboardingSnapshot {
|
|
|
3575
3587
|
* fetch failed (treated as NOT exempt — fail-safe). */
|
|
3576
3588
|
role: string | null;
|
|
3577
3589
|
}
|
|
3578
|
-
/** Drop the cache and notify every mounted hook instance to re-fetch.
|
|
3579
|
-
* Call after any mutation that could change the user's onboarding
|
|
3580
|
-
* state — wallet add/remove, profile patch, lockdown finalize,
|
|
3581
|
-
* identity-verification submission, etc.
|
|
3582
|
-
*
|
|
3583
|
-
* The subscriber fan-out is critical: without it, sibling consumers
|
|
3584
|
-
* of `useOnboardingState` keep their stale React state and continue
|
|
3585
|
-
* rendering against an out-of-date decision. */
|
|
3586
3590
|
declare function invalidateOnboardingState(): void;
|
|
3587
3591
|
/** Backwards-compatible alias for the now-removed wallet-only API.
|
|
3588
3592
|
* Callers don't need to know the cache covers both signals now. */
|