@lydianpay/sdk-web 1.1.5 → 1.1.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.
Files changed (62) hide show
  1. package/dist/lydian.iife.js +57 -50
  2. package/dist/types/.tsbuildinfo +1 -0
  3. package/dist/types/chains/adapters.d.ts +18 -0
  4. package/dist/types/constants.d.ts +85 -0
  5. package/dist/types/i18n/index.d.ts +5 -0
  6. package/dist/types/index.d.ts +14 -0
  7. package/dist/types/network/base.d.ts +9 -0
  8. package/dist/types/network/cryptotransaction/index.d.ts +8 -0
  9. package/dist/types/network/customer/index.d.ts +6 -0
  10. package/dist/types/network/index.d.ts +6 -0
  11. package/dist/types/network/session/index.d.ts +8 -0
  12. package/dist/types/network/utils.d.ts +10 -0
  13. package/dist/types/services/lydianConnectService.d.ts +23 -0
  14. package/dist/types/types.d.ts +324 -0
  15. package/dist/types/ui/Checkout.d.ts +216 -0
  16. package/dist/types/ui/brandingHelpers.d.ts +6 -0
  17. package/dist/types/ui/buttons/assetButton.d.ts +2 -0
  18. package/dist/types/ui/buttons/networkButton.d.ts +2 -0
  19. package/dist/types/ui/buttons/optionButton.d.ts +11 -0
  20. package/dist/types/ui/buttons/walletButton.d.ts +2 -0
  21. package/dist/types/ui/components/additionalInfoContent.d.ts +1 -0
  22. package/dist/types/ui/components/alertBanner.d.ts +8 -0
  23. package/dist/types/ui/components/assetSelectContent.d.ts +1 -0
  24. package/dist/types/ui/components/closeTransactionModal.d.ts +1 -0
  25. package/dist/types/ui/components/connectWithQrContent.d.ts +1 -0
  26. package/dist/types/ui/components/connectingWalletContent.d.ts +1 -0
  27. package/dist/types/ui/components/copyField.d.ts +9 -0
  28. package/dist/types/ui/components/detailCard.d.ts +6 -0
  29. package/dist/types/ui/components/detailRow.d.ts +9 -0
  30. package/dist/types/ui/components/downloadWalletContent.d.ts +1 -0
  31. package/dist/types/ui/components/fileDropzone.d.ts +8 -0
  32. package/dist/types/ui/components/formField.d.ts +8 -0
  33. package/dist/types/ui/components/formSelect.d.ts +12 -0
  34. package/dist/types/ui/components/icons.d.ts +10 -0
  35. package/dist/types/ui/components/loadingContent.d.ts +1 -0
  36. package/dist/types/ui/components/networkPill.d.ts +5 -0
  37. package/dist/types/ui/components/networkSelectContent.d.ts +1 -0
  38. package/dist/types/ui/components/payButtons.d.ts +1 -0
  39. package/dist/types/ui/components/paymentFailureContent.d.ts +1 -0
  40. package/dist/types/ui/components/paymentHeader.d.ts +1 -0
  41. package/dist/types/ui/components/paymentSuccessContent.d.ts +1 -0
  42. package/dist/types/ui/components/restoreDetailsModal.d.ts +1 -0
  43. package/dist/types/ui/components/scanToPayContent.d.ts +1 -0
  44. package/dist/types/ui/components/summaryRow.d.ts +7 -0
  45. package/dist/types/ui/components/timerBanner.d.ts +1 -0
  46. package/dist/types/ui/components/underpaidContent.d.ts +3 -0
  47. package/dist/types/ui/components/walletSelectContent.d.ts +1 -0
  48. package/dist/types/ui/countries.d.ts +2 -0
  49. package/dist/types/ui/domHelpers.d.ts +3 -0
  50. package/dist/types/ui/flowConfig.d.ts +7 -0
  51. package/dist/types/ui/initConfig.d.ts +20 -0
  52. package/dist/types/ui/kycValidation.d.ts +23 -0
  53. package/dist/types/ui/networkListHelpers.d.ts +26 -0
  54. package/dist/types/ui/otpValidation.d.ts +20 -0
  55. package/dist/types/ui/redirectUrl.d.ts +1 -0
  56. package/dist/types/ui/restoreDetailsController.d.ts +41 -0
  57. package/dist/types/ui/sessionHelpers.d.ts +27 -0
  58. package/dist/types/ui/sessionQuoteWatcher.d.ts +15 -0
  59. package/dist/types/ui/telemetry.d.ts +2 -0
  60. package/dist/types/ui/walletInstallLink.d.ts +5 -0
  61. package/dist/types/utils/index.d.ts +16 -0
  62. package/package.json +4 -2
@@ -0,0 +1,6 @@
1
+ export type DetailCardProps = {
2
+ heading: string;
3
+ rows: string[];
4
+ rowsId?: string;
5
+ };
6
+ export default function DetailCard({ heading, rows, rowsId }: DetailCardProps): string;
@@ -0,0 +1,9 @@
1
+ export type DetailRowProps = {
2
+ label: string;
3
+ valueId?: string;
4
+ value?: string;
5
+ emphasis?: boolean;
6
+ rowId?: string;
7
+ rowClass?: string;
8
+ };
9
+ export default function DetailRow({ label, valueId, value, emphasis, rowId, rowClass, }: DetailRowProps): string;
@@ -0,0 +1 @@
1
+ export default function DownloadWalletContent(): string;
@@ -0,0 +1,8 @@
1
+ export type FileDropzoneProps = {
2
+ inputId: string;
3
+ label: string;
4
+ hint?: string;
5
+ };
6
+ export default function FileDropzone({ inputId, label, hint }: FileDropzoneProps): string;
7
+ export declare function resetFileDropzones(root: ParentNode): void;
8
+ export declare function wireFileDropzones(root: ShadowRoot): void;
@@ -0,0 +1,8 @@
1
+ export type TextFieldProps = {
2
+ id: string;
3
+ label: string;
4
+ placeholder: string;
5
+ type?: string;
6
+ autocomplete?: string;
7
+ };
8
+ export default function TextField({ id, label, placeholder, type, autocomplete, }: TextFieldProps): string;
@@ -0,0 +1,12 @@
1
+ export type SelectOption = {
2
+ value: string;
3
+ label: string;
4
+ };
5
+ export type SelectFieldProps = {
6
+ id: string;
7
+ label: string;
8
+ options: SelectOption[];
9
+ placeholder?: string;
10
+ ariaLabel?: string;
11
+ };
12
+ export default function SelectField({ id, label, options, placeholder, ariaLabel, }: SelectFieldProps): string;
@@ -0,0 +1,10 @@
1
+ export declare const caretDownIconSvg = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M2.5 5.5L8 11L13.5 5.5\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
2
+ export declare const warningTriangleIconSvg = "<svg width=\"20\" height=\"18\" viewBox=\"0 0 21 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M10.5 2.23152L18.7952 16.7657H2.20476L10.5 2.23152ZM0.298949 15.6485C-0.549302 17.1344 0.508258 19 2.20476 19H18.7952C20.4917 19 21.5493 17.1344 20.7011 15.6485L12.4058 1.11436C11.5576 -0.371454 9.44244 -0.371454 8.59419 1.11436L0.298949 15.6485ZM9.39837 7.82846V10.0628C9.39837 10.6772 9.89411 11.1799 10.5 11.1799C11.1059 11.1799 11.6016 10.6772 11.6016 10.0628V7.82846C11.6016 7.21402 11.1059 6.7113 10.5 6.7113C9.89411 6.7113 9.39837 7.21402 9.39837 7.82846ZM9.39837 13.4142H11.6016V15.6485H9.39837Z\" fill=\"currentColor\"/>\n</svg>";
3
+ export declare const clockIconSvg = "<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=\"9\" stroke=\"currentColor\" stroke-width=\"2\"/>\n <path d=\"M12 7.5V12L15 14\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
4
+ export declare const checkCircleIconSvg = "<svg width=\"72\" height=\"72\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"32\" cy=\"32\" r=\"32\" fill=\"currentColor\"/>\n <path d=\"M19 33L28 42L45 24\" stroke=\"#ffffff\" stroke-width=\"5.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
5
+ export declare const copyIconSvg = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M15 1H4C2.9 1 2 1.9 2 3V16C2 16.55 2.45 17 3 17C3.55 17 4 16.55 4 16V4C4 3.45 4.45 3 5 3H15C15.55 3 16 2.55 16 2C16 1.45 15.55 1 15 1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM18 21H9C8.45 21 8 20.55 8 20V8C8 7.45 8.45 7 9 7H18C18.55 7 19 7.45 19 8V20C19 20.55 18.55 21 18 21Z\"/>\n</svg>";
6
+ export declare const uploadIconSvg = "<svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 16V4M12 4L7 9M12 4L17 9\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
7
+ export declare const fileIconSvg = "<svg width=\"28\" height=\"28\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6Z\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linejoin=\"round\"/>\n <path d=\"M14 2v6h6M8 13h8M8 17h5\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
8
+ 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>";
9
+ 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>";
10
+ 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>";
@@ -0,0 +1 @@
1
+ export default function LoadingContent(): string;
@@ -0,0 +1,5 @@
1
+ export type NetworkPillProps = {
2
+ logoId: string;
3
+ nameId: string;
4
+ };
5
+ export default function NetworkPill({ logoId, nameId }: NetworkPillProps): string;
@@ -0,0 +1 @@
1
+ export default function NetworkSelectContent(): string;
@@ -0,0 +1 @@
1
+ export default function PayButtons(): string;
@@ -0,0 +1 @@
1
+ export default function PaymentFailureContent(): string;
@@ -0,0 +1 @@
1
+ export default function PaymentHeader(): string;
@@ -0,0 +1 @@
1
+ export default function PaymentSuccessContent(): string;
@@ -0,0 +1 @@
1
+ export default function RestoreDetailsModal(): string;
@@ -0,0 +1 @@
1
+ export default function ScanToPayContent(): string;
@@ -0,0 +1,7 @@
1
+ export type SummaryRowProps = {
2
+ id: string;
3
+ leadingLabel: string;
4
+ logoId: string;
5
+ nameId: string;
6
+ };
7
+ export default function SummaryRow({ id, leadingLabel, logoId, nameId }: SummaryRowProps): string;
@@ -0,0 +1 @@
1
+ export default function TimerBanner(): string;
@@ -0,0 +1,3 @@
1
+ export declare function UnderpaidNotice(): string;
2
+ export default function UnderpaidContent(): string;
3
+ export declare function UnderpaidActions(): string;
@@ -0,0 +1 @@
1
+ export default function WalletSelectContent(): string;
@@ -0,0 +1,2 @@
1
+ import type { SelectOption } from './components/formSelect';
2
+ export declare function countryOptions(locale?: string): SelectOption[];
@@ -0,0 +1,3 @@
1
+ export declare function setText(root: ShadowRoot | null | undefined, elementId: string, text: string): void;
2
+ export declare function revealScreen(isEmbedded: boolean, embedded: HTMLElement | null, modal: HTMLElement | null): void;
3
+ export declare function hideScreen(embedded: HTMLElement | null, modal: HTMLElement | null): void;
@@ -0,0 +1,7 @@
1
+ import { CheckoutFlow, InitFlowOptions } from '../types';
2
+ export type CheckoutFlowSettings = {
3
+ walletConnect: boolean;
4
+ skipConfirmationPage: boolean;
5
+ hideNoWalletOption: boolean;
6
+ };
7
+ export declare function resolveFlow(accountFlow?: CheckoutFlow, embedFlow?: InitFlowOptions): CheckoutFlowSettings;
@@ -0,0 +1,20 @@
1
+ import { CheckoutInitOptions } from '../types';
2
+ export declare function resolveBaseUri(options: CheckoutInitOptions): string;
3
+ export declare function getUnsupportedOptionsMessage({ options, unsupportedKeys, entryPoint, }: {
4
+ options: Record<string, unknown>;
5
+ unsupportedKeys: readonly string[];
6
+ entryPoint: string;
7
+ }): string | null;
8
+ export declare function missingWalletConnectIdMessage(options: {
9
+ flow?: {
10
+ walletConnect?: boolean;
11
+ };
12
+ walletConnectProjectId?: string;
13
+ }): string | null;
14
+ export declare function hasPublishableKey(options: CheckoutInitOptions | null): boolean;
15
+ export declare function canReplaceSession(options: CheckoutInitOptions | null): boolean;
16
+ export declare function shouldAutoStartCheckout({ options, session, settled, }: {
17
+ options: CheckoutInitOptions | null;
18
+ session: object | null;
19
+ settled: boolean;
20
+ }): boolean;
@@ -0,0 +1,23 @@
1
+ export type KycStep = 'basic' | 'address' | 'document';
2
+ export type KycFieldValues = {
3
+ email: string;
4
+ firstName: string;
5
+ lastName: string;
6
+ street: string;
7
+ city: string;
8
+ region: string;
9
+ postalCode: string;
10
+ country: string;
11
+ documentType: string;
12
+ hasDocumentFront: boolean;
13
+ hasDocumentBack: boolean;
14
+ };
15
+ export type KycFieldError = {
16
+ fieldId: string;
17
+ message: string;
18
+ };
19
+ export declare const BASIC_FIELDS: readonly ["email", "firstName", "lastName"];
20
+ export declare function computeKycSteps(requiredFields: string[], supportedDocumentTypes: string[], { documentOnly }?: {
21
+ documentOnly?: boolean;
22
+ }): KycStep[];
23
+ export declare function validateKycStep(step: KycStep, values: KycFieldValues, requiredFields: string[], supportedDocumentTypes: string[]): KycFieldError | null;
@@ -0,0 +1,26 @@
1
+ import { AllowedWalletConfig, Asset, GetSessionResponse } from '../types';
2
+ export declare function resolveAllowedAssets(allowedCrypto: string[] | null | undefined): Asset[];
3
+ export declare function collectNetworksFromAssets(allowedAssets: Asset[]): string[];
4
+ export declare function filterAssetsByNetwork(allowedAssets: Asset[], networkCode: string): Asset[];
5
+ type NetworkFeeSource = Pick<GetSessionResponse, 'customFlatFeePerNetwork' | 'customFeePercentagePerNetwork'>;
6
+ type CryptoTotalSource = Pick<GetSessionResponse, 'calculatedCryptoTotals' | 'calculatedCryptoTotalsPerNetwork'>;
7
+ export declare function getNetworkFeeLabel(session: NetworkFeeSource | undefined, networkName: string): string | null;
8
+ export declare function getAssetCryptoTotal(session: CryptoTotalSource | undefined, networkName: string, assetCode: string): number | null;
9
+ export declare function filterAllowedWallets<T extends {
10
+ id: string;
11
+ }>(wallets: T[], allowedWalletsConfig: AllowedWalletConfig[] | null | undefined): T[];
12
+ export declare function matchesExpectedChain(reported: string, expected: readonly string[]): boolean;
13
+ export type OpenInWalletButton = {
14
+ labelKey: 'scan.openWalletToPay' | 'scan.payWithWallet' | 'scan.openInWallet';
15
+ walletName: string;
16
+ deepLink: boolean;
17
+ mobileOnly: boolean;
18
+ };
19
+ export declare function getOpenInWalletButton({ canSignWithConnectedWallet, selectedWallet, }: {
20
+ canSignWithConnectedWallet: boolean;
21
+ selectedWallet: {
22
+ id: string;
23
+ name: string;
24
+ } | null;
25
+ }): OpenInWalletButton;
26
+ export {};
@@ -0,0 +1,20 @@
1
+ export declare const EMAIL_PATTERN: RegExp;
2
+ export declare const OTP_LENGTH = 6;
3
+ export declare function isValidEmail(email: string): boolean;
4
+ export declare function isValidOtp(otp: string): boolean;
5
+ export declare function validateRestoreDetails(email: string, country: string): string | null;
6
+ export type OtpVerificationOutcome = {
7
+ status: 'ok';
8
+ customerUUID: string;
9
+ } | {
10
+ status: 'documentRequired';
11
+ customerUUID: string;
12
+ } | {
13
+ status: 'error';
14
+ message: string;
15
+ allowRetry: boolean;
16
+ };
17
+ export declare function resolveOtpVerification(result: {
18
+ customerUUID?: string;
19
+ kycValidated?: boolean;
20
+ }): OtpVerificationOutcome;
@@ -0,0 +1 @@
1
+ export declare function safeRedirectUrl(url: string | undefined): string | undefined;
@@ -0,0 +1,41 @@
1
+ import type { API } from '../network';
2
+ export interface RestoreDetailsDeps {
3
+ api: Pick<API, 'sendCustomerOTP' | 'authenticateCustomerOTP'>;
4
+ onRestored: (customerUUID: string) => Promise<void>;
5
+ onDocumentRequired: (customerUUID: string, country: string) => void;
6
+ }
7
+ export declare class RestoreDetailsController {
8
+ private readonly root;
9
+ private readonly deps;
10
+ private readonly dialog;
11
+ private readonly views;
12
+ private readonly emailInput;
13
+ private readonly countrySelect;
14
+ private readonly emailError;
15
+ private readonly otpError;
16
+ private readonly otpEmailLabel;
17
+ private readonly processingMessage;
18
+ private readonly errorMessage;
19
+ private readonly retryButton;
20
+ private readonly otpBoxes;
21
+ private email;
22
+ private country;
23
+ constructor(root: ShadowRoot, deps: RestoreDetailsDeps);
24
+ private el;
25
+ private wireControls;
26
+ private readOtp;
27
+ private clearOtp;
28
+ private focusBox;
29
+ private fillOtpFrom;
30
+ private wireOtpBoxes;
31
+ private handleOtpInput;
32
+ private handleOtpKeydown;
33
+ private handleOtpPaste;
34
+ private showView;
35
+ private setFieldError;
36
+ private setProcessing;
37
+ private showError;
38
+ private open;
39
+ private sendOtp;
40
+ private verifyOtp;
41
+ }
@@ -0,0 +1,27 @@
1
+ export declare function parseInstant(iso: string | undefined): number | null;
2
+ export declare function isFutureInstant(iso: string | undefined, now?: number): boolean;
3
+ export declare function isSessionPromotable(session: {
4
+ expiration?: string;
5
+ } | null, promoted: boolean, now?: number): boolean;
6
+ export declare function getTransactionIdToRequote(session: {
7
+ transactionID?: string;
8
+ } | null, cryptoTransaction: {
9
+ transactionId?: string;
10
+ } | null, promoted: boolean): string | null;
11
+ export type TransactionOutcome = 'succeeded' | 'failed' | 'active';
12
+ export declare function transactionOutcome(status: number): TransactionOutcome;
13
+ export declare const POLL_FAILURES_BEFORE_NOTICE = 5;
14
+ export declare function shouldReportPollFailure(consecutiveFailures: number): boolean;
15
+ export declare function getSessionQuoteExpiry(session: {
16
+ cryptoFXRateExpiration?: string;
17
+ expiration?: string;
18
+ } | null): number | null;
19
+ export type RestoreContext = {
20
+ customerUUID: string;
21
+ country: string;
22
+ transactionId: string;
23
+ };
24
+ export declare function restoreContextFor(context: RestoreContext | null, transactionId: string | undefined): {
25
+ customerUUID: string;
26
+ country: string;
27
+ } | null;
@@ -0,0 +1,15 @@
1
+ export type SessionQuoteWatcherOptions = {
2
+ getExpiry: () => number | null;
3
+ onExpired: () => Promise<void>;
4
+ };
5
+ export declare class SessionQuoteWatcher {
6
+ private readonly options;
7
+ private timeoutID;
8
+ private consecutiveRefreshes;
9
+ constructor(options: SessionQuoteWatcherOptions);
10
+ start(): void;
11
+ stop(): void;
12
+ get isRunning(): boolean;
13
+ private schedule;
14
+ private onDeadline;
15
+ }
@@ -0,0 +1,2 @@
1
+ import { CheckoutEventName } from '../types';
2
+ export declare function emitCheckoutEvent(onEvent: ((name: CheckoutEventName, data?: Record<string, unknown>) => void) | undefined, name: CheckoutEventName, data?: Record<string, unknown>): void;
@@ -0,0 +1,5 @@
1
+ export type WalletStoreLinks = {
2
+ ios?: string;
3
+ android?: string;
4
+ };
5
+ export declare function resolveInstallHref(store?: WalletStoreLinks, userAgent?: string): string | undefined;
@@ -0,0 +1,16 @@
1
+ export declare function capitalizeFirstLetter(str: string): string;
2
+ /**
3
+ * Formats a number as currency using Intl.NumberFormat
4
+ * @param amount - The numeric amount to format
5
+ * @param currency - The currency code (USD or TRY)
6
+ * @returns Formatted currency string
7
+ */
8
+ export declare function formatCurrency(amount: number, currency?: string | null): string;
9
+ export declare function formatExchangeRate(asset: string, cryptoRatePerUSD: number, fxRateToUSD: number, currency: string): string;
10
+ export declare function formatDateForTransactionDetails(isoDateString: string): string;
11
+ export declare function formatDateShort(isoDateString?: string | null): string;
12
+ export declare function formatCryptoAmount(num: number): string;
13
+ export declare function trimTrailingZeros(decimal: string): string;
14
+ export declare function formatToTwoDecimals(num: number): string;
15
+ export declare function formatToNDecimals(num: number, precision: number): string;
16
+ export declare function canvasSafeImageUrl(imageUrl: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lydianpay/sdk-web",
3
- "version": "1.1.5",
3
+ "version": "1.1.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": {
@@ -24,6 +24,7 @@
24
24
  ],
25
25
  "type": "module",
26
26
  "main": "dist/lydian.iife.js",
27
+ "types": "dist/types/index.d.ts",
27
28
  "files": [
28
29
  "dist"
29
30
  ],
@@ -39,7 +40,8 @@
39
40
  "test": "vitest run",
40
41
  "test:coverage": "vitest run --coverage --coverage.provider=v8 --coverage.reporter=lcov --coverage.reporter=text",
41
42
  "build:css": "npx tailwindcss -i src/ui/lydian.css -o ./src/ui/lydian.generated.css --minify",
42
- "build": "npm run build:css && vite build",
43
+ "build:types": "tsc -p tsconfig.build.json",
44
+ "build": "npm run build:css && vite build && npm run build:types",
43
45
  "build:watch": "npm run build:css && vite build --watch",
44
46
  "serve": "live-server --cors --no-browser --port=9999 dist",
45
47
  "dev": "run-p dev:css dev:vite",