@lydianpay/sdk-web 3.19.4 → 3.20.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.
- package/dist/chunks/{browser-Gupuc6-M.js → browser-rxX-1RlV.js} +1 -1
- package/dist/chunks/{connect-multichain-Bch0gsrc.js → connect-multichain-BwOA1L8N.js} +9 -9
- package/dist/chunks/{dist-CczZUfp3.js → dist-BTA0E_b3.js} +2 -2
- package/dist/chunks/{dist-BNHS8iis.js → dist-Bnz-_T3x.js} +3 -3
- package/dist/chunks/{index-ilCIr0ZQ.js → index-C7WgU0CK.js} +317 -285
- package/dist/chunks/{index-DORsWhf1.js → index-DbCr6lts.js} +2 -2
- package/dist/chunks/{index-CTmDBwNd.js → index-_SoQft4L.js} +1 -1
- package/dist/chunks/{index-D5YydOtF.js → index-hVXeCXXz.js} +1 -1
- package/dist/chunks/{mountEngine-_G66fuAB.js → mountEngine-CjLQCm5Y.js} +11691 -11077
- package/dist/lydian.js +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/network/base.d.ts +1 -0
- package/dist/types/network/customer/index.d.ts +2 -2
- package/dist/types/types.d.ts +6 -0
- package/dist/types/ui/countries.d.ts +2 -0
- package/dist/types/ui/kycFlow.d.ts +11 -0
- package/dist/types/ui/kycValidation.d.ts +33 -9
- package/dist/types/ui/otpValidation.d.ts +5 -0
- package/dist/types/ui/react/ContactInfoSection/ContactInfoSection.d.ts +11 -0
- package/dist/types/ui/react/ContactInfoSection/EmailCodeCard.d.ts +10 -0
- package/dist/types/ui/react/ContactInfoSection/EmailEntryStep.d.ts +10 -0
- package/dist/types/ui/react/ContactInfoSection/NotYouButton.d.ts +6 -0
- package/dist/types/ui/react/ContactInfoSection/Reveal.d.ts +5 -0
- package/dist/types/ui/react/ContactInfoSection/SavedLoginStep.d.ts +9 -0
- package/dist/types/ui/react/ContactInfoSection/SendCodeButton.d.ts +5 -0
- package/dist/types/ui/react/ContactInfoSection/StepCard.d.ts +5 -0
- package/dist/types/ui/react/ContactInfoSection/VerifiedEmailCard.d.ts +5 -0
- package/dist/types/ui/react/ContactInfoSection/emailStep.d.ts +20 -0
- package/dist/types/ui/react/ContactInfoSection/useEmailVerification.d.ts +17 -0
- package/dist/types/ui/react/ErrorText.d.ts +5 -0
- package/dist/types/ui/react/FormField.d.ts +2 -1
- package/dist/types/ui/react/KycFields.d.ts +3 -3
- package/dist/types/ui/react/SearchSelect.d.ts +2 -1
- package/dist/types/ui/react/checkoutStore.d.ts +11 -0
- package/dist/types/ui/restoredCustomer.d.ts +23 -3
- package/dist/types/ui/sessionHelpers.d.ts +9 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export declare abstract class Base {
|
|
|
8
8
|
private publishableKey;
|
|
9
9
|
constructor(baseUri: string, publishableKey?: string);
|
|
10
10
|
private headers;
|
|
11
|
+
private send;
|
|
11
12
|
protected request<T>(endpoint: string, options?: GatewayRequestInit): Promise<T>;
|
|
12
13
|
protected requestText(endpoint: string, options?: GatewayRequestInit): Promise<string>;
|
|
13
14
|
protected requestWithFormData<T>(endpoint: string, options?: GatewayRequestInit): Promise<T>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Base } from '../base';
|
|
2
|
-
import { AuthenticateCustomerOTPRequest, CustomerKYCValidationStatusResponse, RedactedCustomerPIIResponse, SendCustomerOTPRequest, UpdateCustomerPIIRequest } from '../../types';
|
|
2
|
+
import { AuthenticateCustomerOTPRequest, CustomerKYCValidationStatusResponse, CustomerPIIRequest, RedactedCustomerPIIResponse, SendCustomerOTPRequest, UpdateCustomerPIIRequest } 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(
|
|
6
|
+
getCustomerPII(customerPIIRequest: CustomerPIIRequest): Promise<RedactedCustomerPIIResponse>;
|
|
7
7
|
updateCustomerPII(updatePIIRequest: UpdateCustomerPIIRequest): Promise<RedactedCustomerPIIResponse>;
|
|
8
8
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -126,12 +126,18 @@ export type CreateTransactionRequest = {
|
|
|
126
126
|
export type SendCustomerOTPRequest = {
|
|
127
127
|
email: string;
|
|
128
128
|
country: string;
|
|
129
|
+
transactionID?: string;
|
|
129
130
|
};
|
|
130
131
|
export type AuthenticateCustomerOTPRequest = {
|
|
131
132
|
otp: string;
|
|
132
133
|
email: string;
|
|
133
134
|
country: string;
|
|
134
135
|
};
|
|
136
|
+
export type CheckoutIdentifiers = {
|
|
137
|
+
sessionID?: string;
|
|
138
|
+
transactionID?: string;
|
|
139
|
+
};
|
|
140
|
+
export type CustomerPIIRequest = AuthenticateCustomerOTPRequest & CheckoutIdentifiers;
|
|
135
141
|
export type CustomerKYCValidationStatusResponse = {
|
|
136
142
|
customerUUID: string;
|
|
137
143
|
kycValidated: boolean;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { SelectOption } from './optionFilter';
|
|
2
2
|
import type { PlaceCountry } from '../types';
|
|
3
3
|
export declare function isSupportedCountryCode(countryCode: string): boolean;
|
|
4
|
+
export declare function getCountryCodeForAlpha3(alpha3: string): string | null;
|
|
5
|
+
export declare function getSupportedMerchantCountry(merchantCountry: string | undefined): string | null;
|
|
4
6
|
export declare function countryOptions(locale?: string): SelectOption[];
|
|
5
7
|
export declare function getCountryName(code: string, locale?: string): string;
|
|
6
8
|
export declare function getCountryNameInSentence(code: string, locale?: string): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type CheckoutStore } from './react/checkoutStore';
|
|
2
|
+
import { type VerifiedCustomer } from './restoredCustomer';
|
|
2
3
|
import type { API } from '../network';
|
|
3
4
|
import type { CheckoutPresentation } from './checkoutPresentation';
|
|
4
5
|
import type { KycFormValues } from './kycValidation';
|
|
@@ -29,6 +30,16 @@ export interface KycFlow {
|
|
|
29
30
|
otp: string;
|
|
30
31
|
onFile: RedactedCustomerPIIResponse;
|
|
31
32
|
}): Promise<void>;
|
|
33
|
+
sendEmailCode(details: {
|
|
34
|
+
email: string;
|
|
35
|
+
country: string;
|
|
36
|
+
}): Promise<void>;
|
|
37
|
+
verifyEmailCode(details: {
|
|
38
|
+
email: string;
|
|
39
|
+
country: string;
|
|
40
|
+
otp: string;
|
|
41
|
+
}): Promise<VerifiedCustomer>;
|
|
42
|
+
forgetVerifiedEmail(): void;
|
|
32
43
|
}
|
|
33
44
|
export interface KycFlowSeams {
|
|
34
45
|
reportFailure(message: string, reason: PaymentFailureReason, options?: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CreateTransactionResponse } from '../types';
|
|
2
|
-
export declare const KYC_PART_ORDER: readonly ["email", "country", "firstName", "lastName", "walletAddress", "cityOfBirth", "dateOfBirth", "nationalIDNumber", "customerIDNumber", "addressCountry", "street", "street2", "region", "city", "postalCode"];
|
|
2
|
+
export declare const KYC_PART_ORDER: readonly ["email", "country", "firstName", "lastName", "walletAddress", "cityOfBirth", "dateOfBirth", "nationalIDDocumentType", "nationalIDNumber", "customerIDNumber", "addressCountry", "street", "street2", "region", "city", "postalCode"];
|
|
3
3
|
export type KycFieldPart = (typeof KYC_PART_ORDER)[number];
|
|
4
|
-
export declare const KYC_FIELD_ORDER: readonly ["email", "firstName", "lastName", "walletAddress", "country", "dateAndPlaceOfBirth", "cityOfBirth", "dateOfBirth", "physicalAddress", "nationalIDNumber", "customerIDNumber"];
|
|
4
|
+
export declare const KYC_FIELD_ORDER: readonly ["email", "firstName", "lastName", "walletAddress", "country", "countryOfResidence", "dateAndPlaceOfBirth", "cityOfBirth", "dateOfBirth", "physicalAddress", "nationalIDNumber", "customerIDNumber"];
|
|
5
5
|
export type KycField = (typeof KYC_FIELD_ORDER)[number];
|
|
6
6
|
export declare const KYC_FIELD_PARTS: {
|
|
7
7
|
readonly email: readonly ["email"];
|
|
@@ -9,15 +9,18 @@ export declare const KYC_FIELD_PARTS: {
|
|
|
9
9
|
readonly lastName: readonly ["lastName"];
|
|
10
10
|
readonly walletAddress: readonly ["walletAddress"];
|
|
11
11
|
readonly country: readonly ["country"];
|
|
12
|
+
readonly countryOfResidence: readonly ["addressCountry"];
|
|
12
13
|
readonly dateAndPlaceOfBirth: readonly ["cityOfBirth", "dateOfBirth"];
|
|
13
14
|
readonly cityOfBirth: readonly ["cityOfBirth"];
|
|
14
15
|
readonly dateOfBirth: readonly ["dateOfBirth"];
|
|
15
|
-
readonly nationalIDNumber: readonly ["nationalIDNumber"];
|
|
16
|
+
readonly nationalIDNumber: readonly ["nationalIDDocumentType", "nationalIDNumber"];
|
|
16
17
|
readonly customerIDNumber: readonly ["customerIDNumber"];
|
|
17
18
|
readonly physicalAddress: readonly ["addressCountry", "street", "street2", "region", "city", "postalCode"];
|
|
18
19
|
};
|
|
19
20
|
declare const KYC_DOCUMENT_TYPES: readonly ["ID_CARD", "PASSPORT", "RESIDENCE_PERMIT", "DRIVERS"];
|
|
20
21
|
export type KycDocumentType = (typeof KYC_DOCUMENT_TYPES)[number];
|
|
22
|
+
export declare const NATIONAL_ID_DOCUMENT_TYPES: readonly ["PASSPORT", "SSS", "DRIVER_LICENSE", "TIN", "OTHER"];
|
|
23
|
+
export type NationalIdDocumentType = (typeof NATIONAL_ID_DOCUMENT_TYPES)[number];
|
|
21
24
|
export type KycFormValues = Record<KycFieldPart, string> & {
|
|
22
25
|
documentType: string;
|
|
23
26
|
hasDocumentFront: boolean;
|
|
@@ -47,18 +50,25 @@ export type KycRequirements = {
|
|
|
47
50
|
documentTypes: KycDocumentType[];
|
|
48
51
|
unsupportedFields: string[];
|
|
49
52
|
};
|
|
50
|
-
export declare function
|
|
53
|
+
export declare function isNationalIdDocumentType(name: string): name is NationalIdDocumentType;
|
|
54
|
+
export declare function getRevealedKycParts({ parts, values, }: {
|
|
55
|
+
parts: KycFieldPart[];
|
|
56
|
+
values: KycFormValues;
|
|
57
|
+
}): KycFieldPart[];
|
|
58
|
+
export declare function getKycRequirements({ transaction, hasConnectedWallet, isCountryAskedAsCitizenship, }: {
|
|
51
59
|
transaction: Partial<CreateTransactionResponse>;
|
|
52
60
|
hasConnectedWallet: boolean;
|
|
61
|
+
isCountryAskedAsCitizenship?: boolean;
|
|
53
62
|
}): KycRequirements;
|
|
54
63
|
export declare function getKycGroupChoices(group: KycFieldGroup): KycGroupChoice[];
|
|
55
64
|
export declare function getKycChoiceInputs({ group, chosenFields, }: {
|
|
56
65
|
group: KycFieldGroup;
|
|
57
66
|
chosenFields: KycField[];
|
|
58
67
|
}): KycGroupChoice[];
|
|
59
|
-
export declare function getInitialKycChoiceFields({ group, values, blankText, }: {
|
|
68
|
+
export declare function getInitialKycChoiceFields({ group, values, partsStillOnFile, blankText, }: {
|
|
60
69
|
group: KycFieldGroup;
|
|
61
70
|
values: KycFormValues;
|
|
71
|
+
partsStillOnFile: KycFieldPart[];
|
|
62
72
|
blankText?: Record<KycFieldPart, string>;
|
|
63
73
|
}): KycField[];
|
|
64
74
|
export declare function getHiddenFilledParts({ group, chosenFields, values, }: {
|
|
@@ -67,21 +77,35 @@ export declare function getHiddenFilledParts({ group, chosenFields, values, }: {
|
|
|
67
77
|
values: KycFormValues;
|
|
68
78
|
}): KycFieldPart[];
|
|
69
79
|
export declare function canFulfillKycRequirements({ requiredFields, fieldGroups, documentTypes, unsupportedFields, }: KycRequirements): boolean;
|
|
80
|
+
export declare function joinStreetLines({ street, street2, }: {
|
|
81
|
+
street: string | undefined;
|
|
82
|
+
street2: string | undefined;
|
|
83
|
+
}): string | undefined;
|
|
70
84
|
export declare function getRequestedKycFields({ requiredFields, fieldGroups, }: KycRequirements): KycField[];
|
|
71
85
|
export declare function isKycEmailCollected({ requiredParts, fieldGroups }: KycRequirements): boolean;
|
|
72
|
-
export declare function getKycPartError(part
|
|
73
|
-
|
|
86
|
+
export declare function getKycPartError({ part, values, partsStillOnFile, }: {
|
|
87
|
+
part: KycFieldPart;
|
|
88
|
+
values: KycFormValues;
|
|
89
|
+
partsStillOnFile: KycFieldPart[];
|
|
90
|
+
}): string | null;
|
|
91
|
+
export declare function isKycFieldComplete({ field, values, partsStillOnFile, }: {
|
|
92
|
+
field: KycField;
|
|
93
|
+
values: KycFormValues;
|
|
94
|
+
partsStillOnFile: KycFieldPart[];
|
|
95
|
+
}): boolean;
|
|
74
96
|
export declare function documentHasTwoSides(documentType: string): boolean;
|
|
75
|
-
export declare function getKycGroupGuidance({ group, values, }: {
|
|
97
|
+
export declare function getKycGroupGuidance({ group, values, partsStillOnFile, }: {
|
|
76
98
|
group: KycFieldGroup;
|
|
77
99
|
values: KycFormValues;
|
|
100
|
+
partsStillOnFile: KycFieldPart[];
|
|
78
101
|
}): {
|
|
79
102
|
requiredCount: number;
|
|
80
103
|
totalCount: number;
|
|
81
104
|
completedCount: number;
|
|
82
105
|
};
|
|
83
|
-
export declare function isKycFormComplete({ requirements, values, }: {
|
|
106
|
+
export declare function isKycFormComplete({ requirements, values, partsStillOnFile, }: {
|
|
84
107
|
requirements: KycRequirements;
|
|
85
108
|
values: KycFormValues;
|
|
109
|
+
partsStillOnFile: KycFieldPart[];
|
|
86
110
|
}): boolean;
|
|
87
111
|
export {};
|
|
@@ -2,6 +2,11 @@ export declare const EMAIL_PATTERN: RegExp;
|
|
|
2
2
|
export declare const OTP_LENGTH = 6;
|
|
3
3
|
export declare function isValidEmail(email: string): boolean;
|
|
4
4
|
export declare function isValidOtp(otp: string): boolean;
|
|
5
|
+
export declare function getOtpDigits(input: string): string;
|
|
6
|
+
export declare function canSendEmailCode({ email, country }: {
|
|
7
|
+
email: string;
|
|
8
|
+
country: string;
|
|
9
|
+
}): boolean;
|
|
5
10
|
export declare function validateRestoreDetails(email: string, country: string): string | null;
|
|
6
11
|
export type OtpVerificationOutcome = {
|
|
7
12
|
status: 'ok';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { VerifiedCustomer } from '../../restoredCustomer';
|
|
3
|
+
export default function ContactInfoSection({ email, country, citizenshipInput, verifiedCustomer, onEmailChange, onVerified, onVerifiedCustomerRejected, }: {
|
|
4
|
+
email: string;
|
|
5
|
+
country: string;
|
|
6
|
+
citizenshipInput: React.ReactNode;
|
|
7
|
+
verifiedCustomer: VerifiedCustomer | null;
|
|
8
|
+
onEmailChange: (email: string) => void;
|
|
9
|
+
onVerified: (customer: VerifiedCustomer) => void;
|
|
10
|
+
onVerifiedCustomerRejected: () => void;
|
|
11
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export default function EmailCodeCard({ recipientEmail, code, isBusy, error, onCodeChange, onSendAgain, onNotYou, }: {
|
|
3
|
+
recipientEmail: string;
|
|
4
|
+
code: string;
|
|
5
|
+
isBusy: boolean;
|
|
6
|
+
error: string;
|
|
7
|
+
onCodeChange: (code: string) => void;
|
|
8
|
+
onSendAgain: () => void;
|
|
9
|
+
onNotYou: () => void;
|
|
10
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export default function EmailEntryStep({ email, country, citizenshipInput, isBusy, error, onEmailChange, onSendCode, }: {
|
|
3
|
+
email: string;
|
|
4
|
+
country: string;
|
|
5
|
+
citizenshipInput: React.ReactNode;
|
|
6
|
+
isBusy: boolean;
|
|
7
|
+
error: string;
|
|
8
|
+
onEmailChange: (email: string) => void;
|
|
9
|
+
onSendCode: () => void;
|
|
10
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { SavedCustomer } from '../../savedCustomer';
|
|
3
|
+
export default function SavedLoginStep({ savedCustomer, isBusy, error, onSendCode, onNotYou, }: {
|
|
4
|
+
savedCustomer: SavedCustomer;
|
|
5
|
+
isBusy: boolean;
|
|
6
|
+
error: string;
|
|
7
|
+
onSendCode: () => void;
|
|
8
|
+
onNotYou: () => void;
|
|
9
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CodeRecipient } from './useEmailVerification';
|
|
2
|
+
import type { SavedCustomer } from '../../savedCustomer';
|
|
3
|
+
import type { VerifiedCustomer } from '../../restoredCustomer';
|
|
4
|
+
export type EmailStep = {
|
|
5
|
+
kind: 'verified';
|
|
6
|
+
customer: VerifiedCustomer;
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'code';
|
|
9
|
+
recipient: CodeRecipient;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'savedLogin';
|
|
12
|
+
savedCustomer: SavedCustomer;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'entry';
|
|
15
|
+
};
|
|
16
|
+
export declare function getEmailStep({ verifiedCustomer, codeRecipient, savedCustomer, }: {
|
|
17
|
+
verifiedCustomer: VerifiedCustomer | null;
|
|
18
|
+
codeRecipient: CodeRecipient | null;
|
|
19
|
+
savedCustomer: SavedCustomer | null;
|
|
20
|
+
}): EmailStep;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { VerifiedCustomer } from '../../restoredCustomer';
|
|
2
|
+
export type CodeRecipient = {
|
|
3
|
+
email: string;
|
|
4
|
+
country: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function useEmailVerification({ onVerified, }: {
|
|
7
|
+
onVerified: (customer: VerifiedCustomer) => void;
|
|
8
|
+
}): {
|
|
9
|
+
code: string;
|
|
10
|
+
codeRecipient: CodeRecipient | null;
|
|
11
|
+
isBusy: boolean;
|
|
12
|
+
error: string;
|
|
13
|
+
sendCode: (recipient: CodeRecipient) => Promise<void>;
|
|
14
|
+
sendCodeAgain: () => Promise<void>;
|
|
15
|
+
enterCode: (input: string) => void;
|
|
16
|
+
changeEmail: () => void;
|
|
17
|
+
};
|
|
@@ -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, shouldSelectAllOnFocus, isReadOnly, }: {
|
|
9
|
+
export default function FormField({ id, label, placeholder, value, onChange, type, autoComplete, inputMode, maxLength, error, inputRef, shouldSelectAllOnFocus, isReadOnly, }: {
|
|
10
10
|
id: string;
|
|
11
11
|
label: string;
|
|
12
12
|
placeholder: string;
|
|
@@ -14,6 +14,7 @@ export default function FormField({ id, label, placeholder, value, onChange, typ
|
|
|
14
14
|
onChange: (value: string) => void;
|
|
15
15
|
type?: string;
|
|
16
16
|
autoComplete?: string;
|
|
17
|
+
inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];
|
|
17
18
|
maxLength?: number;
|
|
18
19
|
error?: string;
|
|
19
20
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type KycFieldPart, type KycFormValues } from '../kycValidation';
|
|
3
|
-
import { type KycPartsOnFile } from '../restoredCustomer';
|
|
4
3
|
import type { SelectOption } from '../optionFilter';
|
|
5
4
|
export type KycInputProps = {
|
|
6
5
|
values: KycFormValues;
|
|
7
6
|
countries: SelectOption[];
|
|
8
7
|
merchantCountry: string | null;
|
|
9
8
|
onChange: (part: KycFieldPart, value: string) => void;
|
|
10
|
-
|
|
9
|
+
partsStillOnFile: KycFieldPart[];
|
|
11
10
|
isEmailReadOnly: boolean;
|
|
12
|
-
|
|
11
|
+
maskedAddressParts: KycFieldPart[];
|
|
12
|
+
isAddressCountryResidence: boolean;
|
|
13
13
|
};
|
|
14
14
|
export declare function KycFieldList({ parts, ...inputProps }: KycInputProps & {
|
|
15
15
|
parts: KycFieldPart[];
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { SelectOption } from '../optionFilter';
|
|
3
|
-
export default function SearchSelect({ id, label, placeholder, options, value, onChange, error, }: {
|
|
3
|
+
export default function SearchSelect({ id, label, placeholder, options, value, unlistedValueLabel, onChange, error, }: {
|
|
4
4
|
id: string;
|
|
5
5
|
label: string;
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
options: SelectOption[];
|
|
8
8
|
value: string;
|
|
9
|
+
unlistedValueLabel?: string;
|
|
9
10
|
onChange: (value: string) => void;
|
|
10
11
|
error?: string;
|
|
11
12
|
}): React.JSX.Element;
|
|
@@ -2,6 +2,7 @@ import type { CreateTransactionResponse, DisplayAsset, GetSessionResponse, GetTr
|
|
|
2
2
|
import type { CheckoutWallet } from '../../constants';
|
|
3
3
|
import type { RestoreContext } from '../sessionHelpers';
|
|
4
4
|
import type { SavedCustomer } from '../savedCustomer';
|
|
5
|
+
import type { VerifiedCustomer } from '../restoredCustomer';
|
|
5
6
|
import type { KycFormValues } from '../kycValidation';
|
|
6
7
|
import type { SelectOption } from '../optionFilter';
|
|
7
8
|
export declare const SCREEN_NAMES: {
|
|
@@ -147,6 +148,16 @@ export interface CheckoutCallbacks {
|
|
|
147
148
|
savedCustomer: SavedCustomer | null;
|
|
148
149
|
}): void;
|
|
149
150
|
onForgetSavedCustomer(): void;
|
|
151
|
+
onSendEmailCode(details: {
|
|
152
|
+
email: string;
|
|
153
|
+
country: string;
|
|
154
|
+
}): Promise<void>;
|
|
155
|
+
onVerifyEmailCode(details: {
|
|
156
|
+
email: string;
|
|
157
|
+
country: string;
|
|
158
|
+
otp: string;
|
|
159
|
+
}): Promise<VerifiedCustomer>;
|
|
160
|
+
onForgetVerifiedEmail(): void;
|
|
150
161
|
onGetCountryOptions(details: {
|
|
151
162
|
signal: AbortSignal;
|
|
152
163
|
}): Promise<SelectOption[]>;
|
|
@@ -12,6 +12,16 @@ export declare function getRestoredKycDraft({ draft, onFile, email, country, }:
|
|
|
12
12
|
email: string;
|
|
13
13
|
country: string;
|
|
14
14
|
}): KycDraft;
|
|
15
|
+
export type VerifiedCustomer = Pick<RestoringCustomer, 'email' | 'country' | 'onFile' | 'storedDateOfBirth'>;
|
|
16
|
+
export declare function getKycTextWithCustomerOnFile({ text, customer, }: {
|
|
17
|
+
text: KycTextFields;
|
|
18
|
+
customer: VerifiedCustomer;
|
|
19
|
+
}): KycTextFields;
|
|
20
|
+
export declare function getKycTextWithoutCustomerOnFile({ text, customer, blankText, }: {
|
|
21
|
+
text: KycTextFields;
|
|
22
|
+
customer: VerifiedCustomer;
|
|
23
|
+
blankText: KycTextFields;
|
|
24
|
+
}): KycTextFields;
|
|
15
25
|
export declare function isKycPartStillOnFile({ part, value, onFile, }: {
|
|
16
26
|
part: KycFieldPart;
|
|
17
27
|
value: string;
|
|
@@ -21,17 +31,27 @@ export declare function getKycPartsStillOnFile({ values, onFile, }: {
|
|
|
21
31
|
values: KycFormValues;
|
|
22
32
|
onFile: KycPartsOnFile;
|
|
23
33
|
}): KycFieldPart[];
|
|
34
|
+
export declare function getKycPartsLeftToRecord({ values, onFile, }: {
|
|
35
|
+
values: KycFormValues;
|
|
36
|
+
onFile: KycPartsOnFile;
|
|
37
|
+
}): KycFieldPart[];
|
|
38
|
+
export declare function getEditedKycPartValue({ part, currentValue, nextValue, onFile, }: {
|
|
39
|
+
part: KycFieldPart;
|
|
40
|
+
currentValue: string;
|
|
41
|
+
nextValue: string;
|
|
42
|
+
onFile: KycPartsOnFile;
|
|
43
|
+
}): string;
|
|
24
44
|
type AddressUpdateInputs = {
|
|
25
45
|
requirements: KycRequirements;
|
|
26
|
-
values:
|
|
46
|
+
values: KycFormValues;
|
|
27
47
|
restoring: Pick<RestoringCustomer, 'onFile' | 'country'>;
|
|
28
48
|
};
|
|
29
49
|
export declare function isAddressUpdated({ requirements, values, restoring, }: AddressUpdateInputs): boolean;
|
|
30
|
-
export declare function
|
|
50
|
+
export declare function getMaskedAddressParts(addressUpdateInputs: AddressUpdateInputs): KycFieldPart[];
|
|
31
51
|
export declare function getProfileUpdates({ requirements, request, values, restoring, }: {
|
|
32
52
|
requirements: KycRequirements;
|
|
33
53
|
request: KYCVerificationRequest;
|
|
34
|
-
values:
|
|
54
|
+
values: KycFormValues;
|
|
35
55
|
restoring: RestoringCustomer;
|
|
36
56
|
}): CustomerProfileUpdates | null;
|
|
37
57
|
export declare function getRestoreContextAfterSave({ restoring, transactionId, savedRecord, }: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CreateTransactionResponse, GetTransactionResponse } from '../types';
|
|
1
|
+
import type { CheckoutIdentifiers, CreateTransactionResponse, GetTransactionResponse } from '../types';
|
|
2
2
|
import type { KycPartsOnFile } from './restoredCustomer';
|
|
3
3
|
export declare function parseInstant(iso: string | undefined): number | null;
|
|
4
4
|
export declare function isFutureInstant(iso: string | undefined, now?: number): boolean;
|
|
@@ -10,6 +10,14 @@ export declare function getTransactionIdToRequote(session: {
|
|
|
10
10
|
} | null, cryptoTransaction: {
|
|
11
11
|
transactionId?: string;
|
|
12
12
|
} | null, promoted: boolean): string | null;
|
|
13
|
+
export declare function getCheckoutIdentifiers({ session, cryptoTransaction, }: {
|
|
14
|
+
session: {
|
|
15
|
+
sessionID?: string;
|
|
16
|
+
} | null;
|
|
17
|
+
cryptoTransaction: {
|
|
18
|
+
transactionId?: string;
|
|
19
|
+
} | null;
|
|
20
|
+
}): CheckoutIdentifiers;
|
|
13
21
|
export { transactionOutcome, type TransactionOutcome } from './transactionOutcome';
|
|
14
22
|
export declare const POLL_FAILURES_BEFORE_NOTICE = 5;
|
|
15
23
|
export declare function shouldReportPollFailure(consecutiveFailures: number): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lydianpay/sdk-web",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.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": {
|