@lydianpay/sdk-web 3.1.0 → 3.2.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.
@@ -9,6 +9,7 @@ export type Transaction = {
9
9
  };
10
10
  export type InitFlowOptions = {
11
11
  walletConnect?: boolean;
12
+ assetFirst?: boolean;
12
13
  };
13
14
  /**
14
15
  * Every `redirectURL` below is the merchant's own URL from the session, and is only
@@ -15,5 +15,4 @@ export declare const checkSmallIconSvg = "<svg width=\"22\" height=\"22\" viewBo
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
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>";
19
18
  export declare const otherWalletsIconSvg = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"8\" cy=\"16\" r=\"2.5\" fill=\"currentColor\"/>\n <circle cx=\"16\" cy=\"16\" r=\"2.5\" fill=\"currentColor\"/>\n <circle cx=\"24\" cy=\"16\" r=\"2.5\" fill=\"currentColor\"/>\n</svg>";
@@ -1,7 +1,8 @@
1
1
  import { CheckoutFlow, InitFlowOptions } from '../types';
2
2
  export type CheckoutFlowSettings = {
3
3
  walletConnect: boolean;
4
+ assetFirst: boolean;
4
5
  showApprovalPage: boolean;
5
- hideNoWalletOption: boolean;
6
+ hideOtherWallets: boolean;
6
7
  };
7
8
  export declare function resolveFlow(accountFlow?: CheckoutFlow, embedFlow?: InitFlowOptions): CheckoutFlowSettings;
@@ -6,13 +6,21 @@ export declare function hoistRecommendedNetwork({ networks, recommendedNetwork,
6
6
  recommendedNetwork: string | null | undefined;
7
7
  }): string[];
8
8
  export declare function filterAssetsByNetwork(allowedAssets: Asset[], networkCode: string): Asset[];
9
+ export declare function filterNetworksByAsset(allowedAssets: Asset[], assetCode: string): string[];
9
10
  type NetworkFeeSource = Pick<GetSessionResponse, 'customFlatFeePerNetwork' | 'customFeePercentagePerNetwork'>;
10
11
  type CryptoTotalSource = Pick<GetSessionResponse, 'calculatedCryptoTotals' | 'calculatedCryptoTotalsPerNetwork'>;
11
12
  export declare function getNetworkFeeLabel(session: NetworkFeeSource | undefined, networkName: string): string | null;
12
- export declare function getAssetCryptoTotal(session: CryptoTotalSource | undefined, networkName: string, assetCode: string): number | null;
13
+ export declare function getAssetCryptoTotal(session: CryptoTotalSource | undefined, networkName: string | null, assetCode: string): number | null;
13
14
  export declare function filterAllowedWallets<T extends {
14
15
  id: string;
15
16
  }>(wallets: T[], allowedWalletsConfig: AllowedWalletConfig[] | null | undefined): T[];
17
+ export declare function filterNetworksByWalletSupport({ networkCodes, walletId, }: {
18
+ networkCodes: string[];
19
+ walletId: string | null;
20
+ }): {
21
+ networkCodes: string[];
22
+ isWalletSupportKnown: boolean;
23
+ };
16
24
  export declare function matchesExpectedChain(reported: string, expected: readonly string[]): boolean;
17
25
  export declare function shouldWarnWrongChain({ connected, reported, expected, }: {
18
26
  connected: boolean;
@@ -104,4 +104,4 @@ export type CheckoutAction = {
104
104
  logoAlt: string;
105
105
  termNoticeHtml: string;
106
106
  };
107
- export declare const PRESERVED_ON_RESET: readonly ["brandLogoUrl", "brandLogoAlt", "termNoticeHtml", "session", "flowOverride", "walletConnectFlow", "hideNoWalletOption", "showApprovalPage", "restoreDialogSession", "kycStepSession", "kycFormSession"];
107
+ export declare const PRESERVED_ON_RESET: readonly ["brandLogoUrl", "brandLogoAlt", "termNoticeHtml", "session", "flowOverride", "walletConnectFlow", "assetFirstFlow", "hideOtherWallets", "showApprovalPage", "restoreDialogSession", "kycStepSession", "kycFormSession"];
@@ -5,7 +5,6 @@ import type { KycFieldValues } from '../kycValidation';
5
5
  export declare const SCREEN_NAMES: {
6
6
  readonly PAY_BUTTONS: "payButtons";
7
7
  readonly WALLETS: "wallets";
8
- readonly DOWNLOAD_WALLET: "downloadWallet";
9
8
  readonly NETWORKS: "networks";
10
9
  readonly CONNECTING: "connecting";
11
10
  readonly CONNECT_QR: "connectQr";
@@ -25,7 +24,8 @@ export interface CheckoutState {
25
24
  selectedNetwork: string | null;
26
25
  selectedWallet: WalletConnectWallet | null;
27
26
  walletConnectFlow: boolean;
28
- hideNoWalletOption: boolean;
27
+ assetFirstFlow: boolean;
28
+ hideOtherWallets: boolean;
29
29
  showApprovalPage: boolean;
30
30
  isCheckoutSettled: boolean;
31
31
  /** The embed's `flow` option. Kept so the reducer can derive the flags below. */
@@ -84,7 +84,6 @@ export interface IslandClickEvent {
84
84
  target: EventTarget | null;
85
85
  }
86
86
  export interface CheckoutCallbacks {
87
- onDownloadWalletBack(): void;
88
87
  onCountdownLapsed(): void;
89
88
  onCryptoPay(): void;
90
89
  onLoadingCancel(): void;
@@ -96,7 +95,6 @@ export interface CheckoutCallbacks {
96
95
  onSelectNetwork(networkCode: string): void;
97
96
  onSelectAsset(assetCode: string): void;
98
97
  onSelectWallet(wallet: CheckoutWallet): void;
99
- onNoWallet(): void;
100
98
  onDoneSuccess(): void;
101
99
  onCancelConnect(): void;
102
100
  onOpenWalletApp(): void;
@@ -136,6 +134,7 @@ export interface CheckoutCallbacks {
136
134
  onKycCoinSummaryRow(): void;
137
135
  onWalletSummaryRow(): void;
138
136
  onNetworkSummaryRow(): void;
137
+ onNetworkCoinSummaryRow(): void;
139
138
  onAssetWalletSummaryRow(): void;
140
139
  }
141
140
  export interface CheckoutStore {
@@ -24,8 +24,6 @@ export interface WalletConnection {
24
24
  signAndSubmit(built: BuiltSend): Promise<void>;
25
25
  openWallet(link?: 'universal'): void;
26
26
  showConnectWithQr(): void;
27
- showDownloadWallet(): void;
28
- showWalletSelectFromDownload(): void;
29
27
  teardown(): void;
30
28
  }
31
29
  export interface WalletConnectionSeams {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lydianpay/sdk-web",
3
- "version": "3.1.0",
3
+ "version": "3.2.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": {
@@ -1,2 +0,0 @@
1
- import * as React from 'react';
2
- export default function DownloadWalletScreen(): React.JSX.Element;