@lydianpay/sdk-web 2.0.0 → 2.0.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.
@@ -9,8 +9,6 @@ export type Transaction = {
9
9
  };
10
10
  export type InitFlowOptions = {
11
11
  walletConnect?: boolean;
12
- skipConfirmationPage?: boolean;
13
- hideNoWalletOption?: boolean;
14
12
  };
15
13
  /**
16
14
  * Every `redirectURL` below is the merchant's own URL from the session, and is only
@@ -74,7 +74,7 @@ export declare class Checkout extends HTMLElement {
74
74
  private qrCodeLink;
75
75
  private pendingWalletSend;
76
76
  private countdownBanner;
77
- private checkoutSettled;
77
+ private isCheckoutSettled;
78
78
  private btnAppPayment;
79
79
  private btnCryptoPayment;
80
80
  private selectedAsset;
@@ -168,6 +168,8 @@ export declare class Checkout extends HTMLElement {
168
168
  private enterCryptoFlow;
169
169
  private emit;
170
170
  private handleWalletChainChanged;
171
+ private expectedChains;
172
+ private warnWrongChain;
171
173
  private showButtons;
172
174
  private hideButtons;
173
175
  private showQRCode;
@@ -182,6 +184,8 @@ export declare class Checkout extends HTMLElement {
182
184
  private flashCopyFeedback;
183
185
  private attachListeners;
184
186
  private startListeningCryptoTransaction;
187
+ private readTransactionOnce;
188
+ private collectUnderpaidBalance;
185
189
  private clearInterval;
186
190
  private settleTerminalTransaction;
187
191
  private updatePaymentHeader;
@@ -1,2 +1,5 @@
1
1
  import { CheckoutWallet } from '../../constants';
2
- export default function WalletButton(wallet: CheckoutWallet): string;
2
+ export default function WalletButton({ wallet, badgeLabel, }: {
3
+ wallet: CheckoutWallet;
4
+ badgeLabel?: string;
5
+ }): string;
@@ -0,0 +1 @@
1
+ export default function ChangePaymentMethodRow(): string;
@@ -0,0 +1,3 @@
1
+ export default function FeaturedWalletBanner({ note }: {
2
+ note: string;
3
+ }): string;
@@ -14,3 +14,5 @@ export declare const fileIconSvg = "<svg width=\"28\" height=\"28\" viewBox=\"0
14
14
  export declare const checkSmallIconSvg = "<svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"11\" fill=\"currentColor\" opacity=\"0.15\"/>\n <path d=\"M7.5 12.5 10.5 15.5 16.5 9\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
15
15
  export declare const checkMarkIconSvg = "<svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5 12.5 10 17.5 19 7\" stroke=\"currentColor\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
16
16
  export declare const xCircleIconSvg = "<svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"11\" stroke=\"currentColor\" stroke-width=\"1.6\"/>\n <path d=\"M9 9l6 6M15 9l-6 6\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\"/>\n</svg>";
17
+ export declare const alertCircleOutlineIconSvg = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"1.6\"/>\n <path d=\"M12 7v6\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\"/>\n <circle cx=\"12\" cy=\"16.5\" r=\"1.1\" fill=\"currentColor\"/>\n</svg>";
18
+ export declare const walletIconSvg = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M18 7V5.5A1.5 1.5 0 0 0 16.5 4H5a2 2 0 0 0 0 4h13a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <circle cx=\"16.5\" cy=\"13.5\" r=\"1.25\" fill=\"currentColor\"/>\n</svg>";
@@ -0,0 +1,15 @@
1
+ import { AllowedWalletConfig } from '../types';
2
+ export type FeaturedWallet = {
3
+ id: string;
4
+ note?: string;
5
+ };
6
+ export declare const FEATURED_NOTE_MAX_LENGTH = 60;
7
+ export declare function resolveFeaturedWallet({ allowedWalletsConfig, }: {
8
+ allowedWalletsConfig: AllowedWalletConfig[] | null | undefined;
9
+ }): FeaturedWallet | null;
10
+ export declare function hoistWallet<T extends {
11
+ id: string;
12
+ }>({ wallets, id, }: {
13
+ wallets: T[];
14
+ id: string | undefined;
15
+ }): T[];
@@ -0,0 +1 @@
1
+ export declare function maskEmail(email: string): string;
@@ -10,6 +10,11 @@ export declare function filterAllowedWallets<T extends {
10
10
  id: string;
11
11
  }>(wallets: T[], allowedWalletsConfig: AllowedWalletConfig[] | null | undefined): T[];
12
12
  export declare function matchesExpectedChain(reported: string, expected: readonly string[]): boolean;
13
+ export declare function shouldWarnWrongChain({ connected, reported, expected, }: {
14
+ connected: boolean;
15
+ reported: string;
16
+ expected: readonly string[] | undefined;
17
+ }): boolean;
13
18
  export type OpenInWalletButton = {
14
19
  labelKey: 'scan.openWalletToPay' | 'scan.payWithWallet';
15
20
  walletName: string;
@@ -15,11 +15,14 @@ export declare class RestoreDetailsController {
15
15
  private readonly otpError;
16
16
  private readonly otpEmailLabel;
17
17
  private readonly processingMessage;
18
+ private readonly errorTitle;
18
19
  private readonly errorMessage;
19
20
  private readonly retryButton;
21
+ private readonly sendAgainButton;
20
22
  private readonly otpBoxes;
21
23
  private email;
22
24
  private country;
25
+ private resending;
23
26
  constructor(root: ShadowRoot, deps: RestoreDetailsDeps);
24
27
  private el;
25
28
  private wireControls;
@@ -35,7 +38,10 @@ export declare class RestoreDetailsController {
35
38
  private setFieldError;
36
39
  private setProcessing;
37
40
  private showError;
41
+ private returnToEmailStep;
38
42
  private open;
39
43
  private sendOtp;
44
+ private showOtpStep;
45
+ private sendOtpAgain;
40
46
  private verifyOtp;
41
47
  }
@@ -25,6 +25,10 @@ export declare function getCountdownExpiry({ transaction, session, }: {
25
25
  expiration?: string;
26
26
  } | null;
27
27
  }): number | null;
28
+ export declare function hasOutstandingPaymentRequest(payments: {
29
+ status: number;
30
+ expiration?: string;
31
+ }[], now?: number): boolean;
28
32
  export type RestoreContext = {
29
33
  customerUUID: string;
30
34
  country: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lydianpay/sdk-web",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
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": {