@lydianpay/sdk-web 3.18.6 → 3.18.7
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.
- package/dist/chunks/{browser-B0qw19vI.js → browser-B7Rxf-Bu.js} +1 -1
- package/dist/chunks/{connect-multichain-CxX-R6Op.js → connect-multichain-DmSOZ6si.js} +9 -9
- package/dist/chunks/{dist-iosQFALi.js → dist-BgxCOd2O.js} +3 -3
- package/dist/chunks/{dist-Bbpm9aAM.js → dist-CXSFu8-J.js} +2 -2
- package/dist/chunks/{index-8Jcg4CXU.js → index-BhTaLNkR.js} +2 -2
- package/dist/chunks/{index-Bvud7ciG.js → index-BmB5ME03.js} +1 -1
- package/dist/chunks/{index-DE33haRd.js → index-CpjSM5Xu.js} +1 -1
- package/dist/chunks/{index-CtSQPdDq.js → index-CqjYiCV9.js} +122 -110
- package/dist/chunks/{mountEngine-CwbM3qVk.js → mountEngine-CG_6rKvA.js} +9575 -9497
- package/dist/lydian.js +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/network/customer/index.d.ts +2 -1
- package/dist/types/types.d.ts +15 -0
- package/dist/types/ui/kycFlow.d.ts +7 -2
- package/dist/types/ui/kycValidation.d.ts +1 -0
- package/dist/types/ui/kycVerificationRequest.d.ts +2 -4
- package/dist/types/ui/react/FormField.d.ts +2 -1
- package/dist/types/ui/react/KycFields.d.ts +2 -0
- package/dist/types/ui/react/checkoutStore.d.ts +3 -4
- package/dist/types/ui/restoredCustomer.d.ts +21 -0
- package/dist/types/ui/sessionBootstrap.d.ts +5 -9
- package/dist/types/ui/sessionHelpers.d.ts +4 -4
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Base } from '../base';
|
|
2
|
-
import { AuthenticateCustomerOTPRequest, CustomerKYCValidationStatusResponse, SendCustomerOTPRequest } from '../../types';
|
|
2
|
+
import { AuthenticateCustomerOTPRequest, CustomerKYCValidationStatusResponse, RedactedCustomerPIIResponse, SendCustomerOTPRequest } from '../../types';
|
|
3
3
|
export declare class Customer extends Base {
|
|
4
4
|
sendCustomerOTP(sendOTPRequest: SendCustomerOTPRequest): Promise<string>;
|
|
5
5
|
authenticateCustomerOTP(authenticateOTPRequest: AuthenticateCustomerOTPRequest): Promise<CustomerKYCValidationStatusResponse>;
|
|
6
|
+
getCustomerPII(authenticateOTPRequest: AuthenticateCustomerOTPRequest): Promise<RedactedCustomerPIIResponse>;
|
|
6
7
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -136,6 +136,21 @@ export type CustomerKYCValidationStatusResponse = {
|
|
|
136
136
|
customerUUID: string;
|
|
137
137
|
kycValidated: boolean;
|
|
138
138
|
};
|
|
139
|
+
export type RedactedCustomerPIIResponse = {
|
|
140
|
+
customerUUID: string;
|
|
141
|
+
firstName: string;
|
|
142
|
+
lastName: string;
|
|
143
|
+
email: string;
|
|
144
|
+
nationalID: string;
|
|
145
|
+
address1: string;
|
|
146
|
+
address2: string;
|
|
147
|
+
stateProvince: string;
|
|
148
|
+
city: string;
|
|
149
|
+
subdivision: string;
|
|
150
|
+
country: string;
|
|
151
|
+
postalCode: string;
|
|
152
|
+
cityOfBirth: string;
|
|
153
|
+
};
|
|
139
154
|
export type PlaceCountry = {
|
|
140
155
|
name: string;
|
|
141
156
|
iso2: string;
|
|
@@ -8,7 +8,7 @@ import type { ScreenNavigator } from './screenNavigator';
|
|
|
8
8
|
import type { SessionLifecycle } from './sessionLifecycle';
|
|
9
9
|
import type { SessionQuoteWatcher } from './sessionQuoteWatcher';
|
|
10
10
|
import type { TransactionPoller } from './transactionPoller';
|
|
11
|
-
import type { CheckoutEventName, CheckoutInitOptions, PaymentFailureReason } from '../types';
|
|
11
|
+
import type { CheckoutEventName, CheckoutInitOptions, PaymentFailureReason, RedactedCustomerPIIResponse } from '../types';
|
|
12
12
|
export interface KycFlow {
|
|
13
13
|
/** The -3 screen. No-op without a transaction to attach the details to. */
|
|
14
14
|
showScreen(): void;
|
|
@@ -18,10 +18,15 @@ export interface KycFlow {
|
|
|
18
18
|
documentBack: File | null;
|
|
19
19
|
storeKyc: boolean;
|
|
20
20
|
}): Promise<void>;
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Re-promote the same session against a stored customer record and, when the
|
|
23
|
+
* form is still due, open it on what that record holds.
|
|
24
|
+
*/
|
|
22
25
|
restoreWithCustomerUUID(restored: {
|
|
23
26
|
customerUUID: string;
|
|
24
27
|
country: string;
|
|
28
|
+
email: string;
|
|
29
|
+
onFile: RedactedCustomerPIIResponse;
|
|
25
30
|
}): Promise<void>;
|
|
26
31
|
}
|
|
27
32
|
export interface KycFlowSeams {
|
|
@@ -23,6 +23,7 @@ export type KycFormValues = Record<KycFieldPart, string> & {
|
|
|
23
23
|
hasDocumentFront: boolean;
|
|
24
24
|
hasDocumentBack: boolean;
|
|
25
25
|
};
|
|
26
|
+
export declare const EMPTY_KYC_TEXT: Record<KycFieldPart, string>;
|
|
26
27
|
export type KycFieldGroup = {
|
|
27
28
|
fields: KycField[];
|
|
28
29
|
count: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type KycFormValues, type KycRequirements } from './kycValidation';
|
|
2
|
+
import type { RestoringCustomer } from './sessionHelpers';
|
|
2
3
|
import type { KYCVerificationRequest } from '../types';
|
|
3
4
|
export declare function getKycVerificationRequest({ requirements, values, asset, network, storeKyc, documentFront, documentBack, restoring, connectedWalletAddress, }: {
|
|
4
5
|
requirements: KycRequirements;
|
|
@@ -8,9 +9,6 @@ export declare function getKycVerificationRequest({ requirements, values, asset,
|
|
|
8
9
|
storeKyc: boolean;
|
|
9
10
|
documentFront: File | null;
|
|
10
11
|
documentBack: File | null;
|
|
11
|
-
restoring:
|
|
12
|
-
customerUUID: string;
|
|
13
|
-
country: string;
|
|
14
|
-
} | null;
|
|
12
|
+
restoring: RestoringCustomer | null;
|
|
15
13
|
connectedWalletAddress: string | null;
|
|
16
14
|
}): KYCVerificationRequest;
|
|
@@ -6,7 +6,7 @@ export declare function FieldShell({ id, label, labelFor, error, children, }: {
|
|
|
6
6
|
error?: string;
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
}): React.JSX.Element;
|
|
9
|
-
export default function FormField({ id, label, placeholder, value, onChange, type, autoComplete, maxLength, error, inputRef, }: {
|
|
9
|
+
export default function FormField({ id, label, placeholder, value, onChange, type, autoComplete, maxLength, error, inputRef, shouldSelectAllOnFocus, }: {
|
|
10
10
|
id: string;
|
|
11
11
|
label: string;
|
|
12
12
|
placeholder: string;
|
|
@@ -17,4 +17,5 @@ export default function FormField({ id, label, placeholder, value, onChange, typ
|
|
|
17
17
|
maxLength?: number;
|
|
18
18
|
error?: string;
|
|
19
19
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
20
|
+
shouldSelectAllOnFocus?: boolean;
|
|
20
21
|
}): React.JSX.Element;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type KycFieldPart, type KycFormValues } from '../kycValidation';
|
|
3
|
+
import { type KycPartsOnFile } from '../restoredCustomer';
|
|
3
4
|
import type { SelectOption } from '../optionFilter';
|
|
4
5
|
export type KycInputProps = {
|
|
5
6
|
values: KycFormValues;
|
|
6
7
|
countries: SelectOption[];
|
|
7
8
|
onChange: (part: KycFieldPart, value: string) => void;
|
|
9
|
+
onFile: KycPartsOnFile;
|
|
8
10
|
};
|
|
9
11
|
export declare function KycFieldList({ parts, ...inputProps }: KycInputProps & {
|
|
10
12
|
parts: KycFieldPart[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CreateTransactionResponse, DisplayAsset, GetSessionResponse, GetTransactionResponse, InitFlowOptions, SendReceiptRequest, WalletConnectWallet } from '../../types';
|
|
1
|
+
import type { CreateTransactionResponse, DisplayAsset, GetSessionResponse, GetTransactionResponse, InitFlowOptions, RedactedCustomerPIIResponse, SendReceiptRequest, WalletConnectWallet } from '../../types';
|
|
2
2
|
import type { CheckoutWallet } from '../../constants';
|
|
3
3
|
import type { RestoreContext } from '../sessionHelpers';
|
|
4
4
|
import type { SavedCustomer } from '../savedCustomer';
|
|
@@ -134,13 +134,12 @@ export interface CheckoutCallbacks {
|
|
|
134
134
|
email: string;
|
|
135
135
|
country: string;
|
|
136
136
|
otp: string;
|
|
137
|
-
}): Promise<
|
|
138
|
-
customerUUID?: string;
|
|
139
|
-
}>;
|
|
137
|
+
}): Promise<RedactedCustomerPIIResponse>;
|
|
140
138
|
onRestoreVerified(restored: {
|
|
141
139
|
customerUUID: string;
|
|
142
140
|
country: string;
|
|
143
141
|
email: string;
|
|
142
|
+
onFile: RedactedCustomerPIIResponse;
|
|
144
143
|
}): Promise<void>;
|
|
145
144
|
onRestoreClose(): void;
|
|
146
145
|
onRestoreDetails(opening: {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type KycFieldPart, type KycFormValues } from './kycValidation';
|
|
2
|
+
import type { KycDraft } from './react/checkoutStore';
|
|
3
|
+
import type { RedactedCustomerPIIResponse } from '../types';
|
|
4
|
+
export type KycPartsOnFile = Partial<Record<KycFieldPart, string>>;
|
|
5
|
+
export declare const NO_KYC_PARTS_ON_FILE: KycPartsOnFile;
|
|
6
|
+
export declare function getKycPartsOnFile(onFile: RedactedCustomerPIIResponse): KycPartsOnFile;
|
|
7
|
+
export declare function getRestoredKycDraft({ draft, partsOnFile, email, country, }: {
|
|
8
|
+
draft: KycDraft | null;
|
|
9
|
+
partsOnFile: KycPartsOnFile;
|
|
10
|
+
email: string;
|
|
11
|
+
country: string;
|
|
12
|
+
}): KycDraft;
|
|
13
|
+
export declare function isKycPartStillOnFile({ part, value, onFile, }: {
|
|
14
|
+
part: KycFieldPart;
|
|
15
|
+
value: string;
|
|
16
|
+
onFile: KycPartsOnFile;
|
|
17
|
+
}): boolean;
|
|
18
|
+
export declare function getKycPartsStillOnFile({ values, onFile, }: {
|
|
19
|
+
values: KycFormValues;
|
|
20
|
+
onFile: KycPartsOnFile;
|
|
21
|
+
}): KycFieldPart[];
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { API } from '../network';
|
|
2
2
|
import type { CheckoutEventName, CheckoutInitOptions, GetSessionResponse, GetTransactionResponse } from '../types';
|
|
3
3
|
export type SessionBootstrapApi = Pick<API, 'createSession' | 'getSession' | 'getCryptoTransaction'>;
|
|
4
|
-
export type SessionSnapshot = {
|
|
5
|
-
session: GetSessionResponse;
|
|
6
|
-
sessionPromoted: boolean;
|
|
7
|
-
};
|
|
8
4
|
export type SessionBootstrapResult = {
|
|
9
5
|
ok: true;
|
|
10
6
|
session: GetSessionResponse;
|
|
@@ -27,12 +23,12 @@ export declare function resolveSessionId({ api, options, }: {
|
|
|
27
23
|
api: SessionBootstrapApi;
|
|
28
24
|
options: CheckoutInitOptions;
|
|
29
25
|
}): Promise<string>;
|
|
30
|
-
export declare function readSession({ api, sessionID, }: {
|
|
31
|
-
api: SessionBootstrapApi;
|
|
32
|
-
sessionID: string;
|
|
33
|
-
}): Promise<SessionSnapshot>;
|
|
34
26
|
export declare function sessionLoadedEvent(session: GetSessionResponse): Record<string, unknown>;
|
|
35
|
-
export declare function
|
|
27
|
+
export declare function hasLinkedTransaction(session: GetSessionResponse): boolean;
|
|
28
|
+
export declare function shouldSkipPromotionOnResume({ session, linkedTransaction, }: {
|
|
29
|
+
session: GetSessionResponse;
|
|
30
|
+
linkedTransaction: GetTransactionResponse | null;
|
|
31
|
+
}): boolean;
|
|
36
32
|
export declare function fetchLinkedTransaction({ api, transactionID, }: {
|
|
37
33
|
api: SessionBootstrapApi;
|
|
38
34
|
transactionID: string | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CreateTransactionResponse, GetTransactionResponse } from '../types';
|
|
2
|
+
import type { KycPartsOnFile } from './restoredCustomer';
|
|
2
3
|
export declare function parseInstant(iso: string | undefined): number | null;
|
|
3
4
|
export declare function isFutureInstant(iso: string | undefined, now?: number): boolean;
|
|
4
5
|
export declare function isSessionPromotable(session: {
|
|
@@ -34,8 +35,7 @@ export type RestoreContext = {
|
|
|
34
35
|
customerUUID: string;
|
|
35
36
|
country: string;
|
|
36
37
|
transactionId: string;
|
|
38
|
+
onFile: KycPartsOnFile;
|
|
37
39
|
};
|
|
38
|
-
export
|
|
39
|
-
|
|
40
|
-
country: string;
|
|
41
|
-
} | null;
|
|
40
|
+
export type RestoringCustomer = Pick<RestoreContext, 'customerUUID' | 'country' | 'onFile'>;
|
|
41
|
+
export declare function restoreContextFor(context: RestoreContext | null, transactionId: string | undefined): RestoringCustomer | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lydianpay/sdk-web",
|
|
3
|
-
"version": "3.18.
|
|
3
|
+
"version": "3.18.7",
|
|
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": {
|