@lydianpay/sdk-web 3.18.5 → 3.18.6

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.
@@ -3,6 +3,7 @@ import type { CheckoutCallbacks, CheckoutStore } from './react/checkoutStore';
3
3
  import type { CheckoutSelection } from './checkoutSelection';
4
4
  import type { DialogController } from './dialogController';
5
5
  import type { KycFlow } from './kycFlow';
6
+ import type { SavedCustomer, SavedCustomerMemory } from './savedCustomer';
6
7
  import type { ScreenNavigator } from './screenNavigator';
7
8
  import type { WalletConnection } from './walletConnection';
8
9
  /** The few exits that belong to the checkout as a whole rather than to one flow. */
@@ -10,16 +11,19 @@ export interface CheckoutCallbackSeams {
10
11
  confirmCloseTransaction(): void;
11
12
  endCheckout(): void;
12
13
  resetCheckout(): void;
13
- openRestoreDetails(): void;
14
+ openRestoreDetails(opening: {
15
+ savedCustomer: SavedCustomer | null;
16
+ }): void;
14
17
  notifyCountdownLapsed(): void;
15
18
  requireApi(): API;
16
19
  }
17
- export declare function createCheckoutCallbacks({ store, shadowRoot, screenNavigator, selection, kycFlow, wallet, dialogs, seams, }: {
20
+ export declare function createCheckoutCallbacks({ store, shadowRoot, screenNavigator, selection, kycFlow, savedCustomer, wallet, dialogs, seams, }: {
18
21
  store: CheckoutStore;
19
22
  shadowRoot: ShadowRoot;
20
23
  screenNavigator: ScreenNavigator;
21
24
  selection: CheckoutSelection;
22
25
  kycFlow: KycFlow;
26
+ savedCustomer: SavedCustomerMemory;
23
27
  wallet: WalletConnection;
24
28
  dialogs: DialogController;
25
29
  seams: CheckoutCallbackSeams;
@@ -3,6 +3,7 @@ import type { API } from '../network';
3
3
  import type { CheckoutPresentation } from './checkoutPresentation';
4
4
  import type { KycFormValues } from './kycValidation';
5
5
  import type { PaymentFlow } from './paymentFlow';
6
+ import type { SavedCustomerMemory } from './savedCustomer';
6
7
  import type { ScreenNavigator } from './screenNavigator';
7
8
  import type { SessionLifecycle } from './sessionLifecycle';
8
9
  import type { SessionQuoteWatcher } from './sessionQuoteWatcher';
@@ -30,8 +31,9 @@ export interface KycFlowSeams {
30
31
  }): void;
31
32
  closeRestoreDialog(): void;
32
33
  }
33
- export declare function createKycFlow({ store, presentation, screenNavigator, sessionLifecycle, paymentFlow, poller, quoteWatcher, getApi, getOptions, getWalletAccount, emit, seams, }: {
34
+ export declare function createKycFlow({ store, savedCustomer, presentation, screenNavigator, sessionLifecycle, paymentFlow, poller, quoteWatcher, getApi, getOptions, getWalletAccount, emit, seams, }: {
34
35
  store: CheckoutStore;
36
+ savedCustomer: SavedCustomerMemory;
35
37
  presentation: CheckoutPresentation;
36
38
  screenNavigator: ScreenNavigator;
37
39
  sessionLifecycle: SessionLifecycle;
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export default function RestoreDetailsEntry(): React.JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import type { ActiveScreen, CloseDialogVariant, KycDraft, WalletBalances } from './checkoutStore';
2
2
  import type { CreateTransactionResponse, DisplayAsset, GetSessionResponse, GetTransactionResponse, InitFlowOptions, WalletConnectWallet } from '../../types';
3
3
  import type { RestoreContext } from '../sessionHelpers';
4
+ import type { SavedCustomer } from '../savedCustomer';
4
5
  export type CheckoutAction = {
5
6
  type: 'session/loaded';
6
7
  session: GetSessionResponse | null;
@@ -101,6 +102,10 @@ export type CheckoutAction = {
101
102
  draft: KycDraft | null;
102
103
  } | {
103
104
  type: 'restore/dialogOpened';
105
+ savedCustomer: SavedCustomer | null;
106
+ } | {
107
+ type: 'savedCustomer/set';
108
+ customer: SavedCustomer | null;
104
109
  } | {
105
110
  type: 'dialog/closeVariant';
106
111
  variant: CloseDialogVariant;
@@ -113,4 +118,4 @@ export type CheckoutAction = {
113
118
  type: 'mode/applied';
114
119
  isEmbedded: boolean;
115
120
  };
116
- export declare const PRESERVED_ON_RESET: readonly ["brandLogoUrl", "brandLogoAlt", "termNoticeHtml", "session", "flowOverride", "isEmbedded", "walletConnectFlow", "assetFirstFlow", "isLDKEnabled", "hideOtherWallets", "showApprovalPage", "restoreDialogSession", "kycFormSession"];
121
+ export declare const PRESERVED_ON_RESET: readonly ["brandLogoUrl", "brandLogoAlt", "termNoticeHtml", "session", "flowOverride", "isEmbedded", "walletConnectFlow", "assetFirstFlow", "isLDKEnabled", "hideOtherWallets", "showApprovalPage", "restoreDialogSession", "savedCustomer", "kycFormSession"];
@@ -1,6 +1,7 @@
1
1
  import type { CreateTransactionResponse, DisplayAsset, GetSessionResponse, GetTransactionResponse, InitFlowOptions, SendReceiptRequest, WalletConnectWallet } from '../../types';
2
2
  import type { CheckoutWallet } from '../../constants';
3
3
  import type { RestoreContext } from '../sessionHelpers';
4
+ import type { SavedCustomer } from '../savedCustomer';
4
5
  import type { KycFormValues } from '../kycValidation';
5
6
  import type { SelectOption } from '../optionFilter';
6
7
  export declare const SCREEN_NAMES: {
@@ -76,6 +77,8 @@ export interface CheckoutState {
76
77
  kycDraft: KycDraft | null;
77
78
  restoreContext: RestoreContext | null;
78
79
  restoreDialogSession: number;
80
+ restoreDialogSavedCustomer: SavedCustomer | null;
81
+ savedCustomer: SavedCustomer | null;
79
82
  closeDialogVariant: CloseDialogVariant;
80
83
  }
81
84
  export type WalletBalances = {
@@ -137,9 +140,13 @@ export interface CheckoutCallbacks {
137
140
  onRestoreVerified(restored: {
138
141
  customerUUID: string;
139
142
  country: string;
143
+ email: string;
140
144
  }): Promise<void>;
141
145
  onRestoreClose(): void;
142
- onRestoreDetails(): void;
146
+ onRestoreDetails(opening: {
147
+ savedCustomer: SavedCustomer | null;
148
+ }): void;
149
+ onForgetSavedCustomer(): void;
143
150
  onGetCountryOptions(details: {
144
151
  signal: AbortSignal;
145
152
  }): Promise<SelectOption[]>;
@@ -0,0 +1,13 @@
1
+ import type { CheckoutStore } from './react/checkoutStore';
2
+ export type SavedCustomer = {
3
+ email: string;
4
+ country: string;
5
+ };
6
+ export interface SavedCustomerMemory {
7
+ load(): void;
8
+ remember(customer: SavedCustomer): void;
9
+ forget(): void;
10
+ }
11
+ export declare function createSavedCustomerMemory({ store, }: {
12
+ store: CheckoutStore;
13
+ }): SavedCustomerMemory;
@@ -1 +1,2 @@
1
1
  export declare function isRecord(value: unknown): value is Record<string, unknown>;
2
+ export declare function isNonBlankString(value: unknown): value is string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lydianpay/sdk-web",
3
- "version": "3.18.5",
3
+ "version": "3.18.6",
4
4
  "description": "Drop-in crypto payment checkout for the web — a <lydian-checkout> web component and window.Lydian API across 20+ chains and major stablecoins.",
5
5
  "license": "MIT",
6
6
  "repository": {