@lydianpay/sdk-web 3.13.1 → 3.15.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.
@@ -66,6 +66,13 @@ type CommonInitOptions = {
66
66
  dev?: boolean;
67
67
  /** Target `api.sandbox.lydian.com`. Production is the default. */
68
68
  sandbox?: boolean;
69
+ /**
70
+ * A gateway at this origin instead of the deployed ones, e.g.
71
+ * `http://localhost:8000` for one running on this machine. An origin only:
72
+ * no path, query or fragment. Wins over `dev` and `sandbox`. For local
73
+ * development only.
74
+ */
75
+ gatewayUrl?: string;
69
76
  /** Required only when `flow.walletConnect` is on; unused otherwise. */
70
77
  walletConnectProjectId?: string;
71
78
  /**
@@ -15,6 +15,7 @@ export interface CheckoutPresentation {
15
15
  hideQRCode(): void;
16
16
  showSuccess(transaction: GetTransactionResponse | undefined, overpaidUSD: number): void;
17
17
  showUnderpaid(transaction: GetTransactionResponse): void;
18
+ showWalletPaymentProgress(transaction: GetTransactionResponse): void;
18
19
  showFailure(message: string): void;
19
20
  /** Terminal screen for a cancellation with nowhere to redirect to. */
20
21
  showCanceled(): void;
@@ -11,6 +11,9 @@ export declare function missingWalletConnectIdMessage(options: {
11
11
  };
12
12
  walletConnectProjectId?: string;
13
13
  }): string | null;
14
+ export declare function invalidGatewayUrlMessage(options: {
15
+ gatewayUrl?: string;
16
+ }): string | null;
14
17
  export declare function hasPublishableKey(options: CheckoutInitOptions | null): boolean;
15
18
  export declare function canReplaceSession(options: CheckoutInitOptions | null): boolean;
16
19
  export declare function shouldAutoStartCheckout({ options, session, settled, }: {
@@ -12,3 +12,4 @@ export declare function getLdkCheckoutSessionProperties({ isLDKEnabled, walletId
12
12
  hasTransaction: boolean;
13
13
  }): Record<string, string> | undefined;
14
14
  export declare function isLdkHandoff(checkout: Parameters<typeof getLdkCheckoutSessionProperties>[0]): boolean;
15
+ export declare function isLdkCheckoutSupported(approvedSessionProperties: Readonly<Record<string, string>> | undefined): boolean;
@@ -27,3 +27,8 @@ export declare function adoptWalletPayment({ transaction, store, paymentFlow, se
27
27
  presentation: Pick<CheckoutPresentation, 'clearErrorBanner'>;
28
28
  screenNavigator: Pick<ScreenNavigator, 'show' | 'setBack'>;
29
29
  }): void;
30
+ export declare function isWalletOwnedCheckout({ transaction, isLDKEnabled, wasHandedToWallet, }: {
31
+ transaction: GetTransactionResponse;
32
+ isLDKEnabled: boolean;
33
+ wasHandedToWallet: boolean;
34
+ }): boolean;
@@ -33,6 +33,7 @@ export interface PaymentFlowSeams {
33
33
  setPendingWalletSend(built: WalletRequest | null): void;
34
34
  hasPendingWalletSend(): boolean;
35
35
  resetCheckout(): void;
36
+ walletOwnsCheckout(): boolean;
36
37
  }
37
38
  export declare function createPaymentFlow({ store, presentation, screenNavigator, sessionLifecycle, hostCallbacks, poller, quoteWatcher, getApi, getOptions, emit, seams, }: {
38
39
  store: CheckoutStore;
@@ -0,0 +1,9 @@
1
+ export declare const clearWalletCheckoutRecord: ({ sessionId }: {
2
+ sessionId: string | null | undefined;
3
+ }) => void;
4
+ export declare function writeWalletCheckoutRecord({ sessionId, }: {
5
+ sessionId: string | null | undefined;
6
+ }): void;
7
+ export declare function wasCheckoutHandedToWallet({ sessionId, }: {
8
+ sessionId: string | null | undefined;
9
+ }): boolean;
@@ -0,0 +1 @@
1
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lydianpay/sdk-web",
3
- "version": "3.13.1",
3
+ "version": "3.15.0",
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": {
@@ -55,7 +55,10 @@
55
55
  "serve": "cp scripts/bundle-check.html dist/index.html && vite preview --outDir dist --port 9999 --strictPort",
56
56
  "dev": "run-p dev:css dev:vite",
57
57
  "dev:css": "tailwindcss -i src/ui/lydian.css -o src/ui/lydian.generated.css --minify --watch",
58
- "dev:vite": "vite"
58
+ "dev:vite": "vite",
59
+ "use:local": "node scripts/use-local.mjs",
60
+ "use:published": "npm install --no-audit --no-fund",
61
+ "dev:phone": "node scripts/dev-phone.mjs"
59
62
  },
60
63
  "devDependencies": {
61
64
  "@eslint/js": "^9.0.0",
@@ -76,6 +79,7 @@
76
79
  "postcss": "^8.4.6",
77
80
  "prettier": "3.9.5",
78
81
  "qrcode": "^1.5.4",
82
+ "qrcode-terminal": "^0.12.0",
79
83
  "tailwindcss": "^3.0.0",
80
84
  "typescript": "^5.0.0",
81
85
  "typescript-eslint": "^8.0.0",
@@ -84,8 +88,8 @@
84
88
  },
85
89
  "dependencies": {
86
90
  "@lydianpay/frontend-shared-helpers": "1.2.0",
87
- "@lydianpay/lydianconnect": "^1.8.1",
88
- "@lydianpay/lydianconnect-catalog": "^1.4.0",
91
+ "@lydianpay/lydianconnect": "^1.10.0",
92
+ "@lydianpay/lydianconnect-catalog": "^1.4.1",
89
93
  "@solana/qr-code-styling": "^1.6.0",
90
94
  "dompurify": "^3.4.12",
91
95
  "react": "^19.2.8",