@lydianpay/sdk-web 3.18.1 → 3.18.2
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-BUlIfLHb.js → browser-ByUw6qxL.js} +1 -1
- package/dist/chunks/{connect-multichain-DVWN1OPV.js → connect-multichain-B5TudJIg.js} +9 -9
- package/dist/chunks/{dist-DXXffMpA.js → dist-CgyqdZZP.js} +3 -3
- package/dist/chunks/{dist-GH_eP8Tg.js → dist-DxDvLdBX.js} +2 -2
- package/dist/chunks/{index-BMzgW9kD.js → index-BJAiOYNA.js} +89 -98
- package/dist/chunks/{index-Cxvsb1M_.js → index-BMvT5fJ_.js} +2 -2
- package/dist/chunks/{index-CwXeUlav.js → index-CF-D_uxJ.js} +1 -1
- package/dist/chunks/{index-aLCprMse.js → index-CxHFTZ5V.js} +1 -1
- package/dist/chunks/{mountEngine-C_tda95f.js → mountEngine-DURf9AtR.js} +8958 -9128
- package/dist/lydian.js +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/network/places/index.d.ts +3 -3
- package/dist/types/types.d.ts +8 -24
- package/dist/types/ui/countries.d.ts +6 -0
- package/dist/types/ui/kycRegions.d.ts +12 -0
- package/dist/types/ui/kycValidation.d.ts +7 -2
- package/dist/types/ui/react/KycFieldGroupCard.d.ts +2 -2
- package/dist/types/ui/react/KycFields.d.ts +1 -5
- package/dist/types/ui/react/checkoutStore.d.ts +6 -7
- package/dist/types/ui/react/useCountryOptions.d.ts +2 -0
- package/dist/types/ui/react/useRegionOptions.d.ts +5 -0
- package/dist/types/ui/regionDirectory.d.ts +14 -0
- package/package.json +1 -1
- package/dist/types/ui/kycPlaceAddress.d.ts +0 -11
- package/dist/types/ui/react/AddressSearch/AddressSearch.d.ts +0 -3
- package/dist/types/ui/react/AddressSearch/AddressSearch.helpers.d.ts +0 -21
- package/dist/types/ui/react/AddressSearch/useAddressSearch.d.ts +0 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Base } from '../base';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PlaceCountry, PlaceState } from '../../types';
|
|
3
3
|
export declare class Places extends Base {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
getCountries(signal?: AbortSignal): Promise<PlaceCountry[] | null>;
|
|
5
|
+
getStates(countryCode: string, signal?: AbortSignal): Promise<PlaceState[] | null>;
|
|
6
6
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -136,30 +136,13 @@ export type CustomerKYCValidationStatusResponse = {
|
|
|
136
136
|
customerUUID: string;
|
|
137
137
|
kycValidated: boolean;
|
|
138
138
|
};
|
|
139
|
-
export type
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
types?: string[] | null;
|
|
147
|
-
};
|
|
148
|
-
}> | null;
|
|
149
|
-
};
|
|
150
|
-
export type PlaceDetailsResponse = {
|
|
151
|
-
postalAddress?: {
|
|
152
|
-
regionCode?: string;
|
|
153
|
-
postalCode?: string;
|
|
154
|
-
administrativeArea?: string;
|
|
155
|
-
locality?: string;
|
|
156
|
-
addressLines?: string[] | null;
|
|
157
|
-
};
|
|
158
|
-
addressComponents?: Array<{
|
|
159
|
-
longText: string;
|
|
160
|
-
shortText: string;
|
|
161
|
-
types?: string[] | null;
|
|
162
|
-
}> | null;
|
|
139
|
+
export type PlaceState = {
|
|
140
|
+
name: string;
|
|
141
|
+
iso2: string;
|
|
142
|
+
};
|
|
143
|
+
export type PlaceCountry = {
|
|
144
|
+
name: string;
|
|
145
|
+
iso2: string;
|
|
163
146
|
};
|
|
164
147
|
export type CreateSessionRequest = {
|
|
165
148
|
amount: number;
|
|
@@ -272,6 +255,7 @@ export type KYCVerificationRequest = {
|
|
|
272
255
|
email?: string;
|
|
273
256
|
street?: string;
|
|
274
257
|
city?: string;
|
|
258
|
+
subdivision?: string;
|
|
275
259
|
region?: string;
|
|
276
260
|
postalCode?: string;
|
|
277
261
|
country?: string;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import type { SelectOption } from './optionFilter';
|
|
2
|
+
import type { PlaceCountry } from '../types';
|
|
2
3
|
export declare function isSupportedCountryCode(countryCode: string): boolean;
|
|
3
4
|
export declare function countryOptions(locale?: string): SelectOption[];
|
|
5
|
+
export declare function getCountryOptions({ countries, locale, }: {
|
|
6
|
+
countries: PlaceCountry[];
|
|
7
|
+
locale?: string;
|
|
8
|
+
}): SelectOption[];
|
|
9
|
+
export declare function getValidCountries(response: unknown): PlaceCountry[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SelectOption } from './optionFilter';
|
|
2
|
+
import type { PlaceState } from '../types';
|
|
3
|
+
export declare function applyKycPartChange<Fields extends {
|
|
4
|
+
country: string;
|
|
5
|
+
region: string;
|
|
6
|
+
}>({ fields, part, value, }: {
|
|
7
|
+
fields: Fields;
|
|
8
|
+
part: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}): Fields;
|
|
11
|
+
export declare function getValidStates(response: unknown): PlaceState[];
|
|
12
|
+
export declare function getRegionOptions(states: PlaceState[]): SelectOption[];
|
|
@@ -5,11 +5,12 @@ export declare const KYC_FIELD_PARTS: {
|
|
|
5
5
|
readonly lastName: readonly ["lastName"];
|
|
6
6
|
readonly walletAddress: readonly ["walletAddress"];
|
|
7
7
|
readonly country: readonly ["country"];
|
|
8
|
-
readonly dateAndPlaceOfBirth: readonly ["cityOfBirth", "
|
|
8
|
+
readonly dateAndPlaceOfBirth: readonly ["cityOfBirth", "dateOfBirth"];
|
|
9
|
+
readonly cityOfBirth: readonly ["cityOfBirth"];
|
|
9
10
|
readonly dateOfBirth: readonly ["dateOfBirth"];
|
|
10
11
|
readonly nationalIDNumber: readonly ["nationalIDNumber"];
|
|
11
12
|
readonly customerIDNumber: readonly ["customerIDNumber"];
|
|
12
|
-
readonly physicalAddress: readonly ["
|
|
13
|
+
readonly physicalAddress: readonly ["country", "region", "city", "subdivision", "postalCode", "street"];
|
|
13
14
|
};
|
|
14
15
|
export type KycField = keyof typeof KYC_FIELD_PARTS;
|
|
15
16
|
export type KycFieldPart = (typeof KYC_FIELD_PARTS)[KycField][number];
|
|
@@ -56,6 +57,10 @@ export declare function getHiddenFilledParts({ group, chosenFields, values, }: {
|
|
|
56
57
|
}): KycFieldPart[];
|
|
57
58
|
export declare function canFulfillKycRequirements({ requiredFields, fieldGroups, documentTypes, unsupportedFields, }: KycRequirements): boolean;
|
|
58
59
|
export declare function isKycEmailCollected({ requiredParts, fieldGroups }: KycRequirements): boolean;
|
|
60
|
+
export declare function isKycPartRevealed({ part, values, }: {
|
|
61
|
+
part: KycFieldPart;
|
|
62
|
+
values: KycFormValues;
|
|
63
|
+
}): boolean;
|
|
59
64
|
export declare function getKycPartError(part: KycFieldPart, values: KycFormValues): string | null;
|
|
60
65
|
export declare function isKycFieldComplete(field: KycField, values: KycFormValues): boolean;
|
|
61
66
|
export declare function documentHasTwoSides(documentType: string): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type KycInputProps } from './KycFields';
|
|
3
3
|
import { type KycFieldGroup } from '../kycValidation';
|
|
4
|
-
export default function KycFieldGroupCard({ group, ...inputProps }:
|
|
4
|
+
export default function KycFieldGroupCard({ group, ...inputProps }: KycInputProps & {
|
|
5
5
|
group: KycFieldGroup;
|
|
6
6
|
}): React.JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { AddressFillTarget } from './AddressSearch/useAddressSearch';
|
|
3
2
|
import { type KycFieldPart, type KycFormValues } from '../kycValidation';
|
|
4
3
|
import type { SelectOption } from '../optionFilter';
|
|
5
4
|
export type KycInputProps = {
|
|
@@ -7,10 +6,7 @@ export type KycInputProps = {
|
|
|
7
6
|
countries: SelectOption[];
|
|
8
7
|
onChange: (part: KycFieldPart, value: string) => void;
|
|
9
8
|
};
|
|
10
|
-
export
|
|
11
|
-
addressFillTarget: AddressFillTarget;
|
|
12
|
-
};
|
|
13
|
-
export declare function KycFieldList({ parts, addressFillTarget, ...inputProps }: KycFieldListProps & {
|
|
9
|
+
export declare function KycFieldList({ parts, ...inputProps }: KycInputProps & {
|
|
14
10
|
parts: KycFieldPart[];
|
|
15
11
|
}): React.JSX.Element;
|
|
16
12
|
export declare function KycSection({ title, children }: {
|
|
@@ -2,7 +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 { KycFormValues } from '../kycValidation';
|
|
5
|
-
import type {
|
|
5
|
+
import type { SelectOption } from '../optionFilter';
|
|
6
6
|
export declare const SCREEN_NAMES: {
|
|
7
7
|
readonly PAY_BUTTONS: "payButtons";
|
|
8
8
|
readonly WALLETS: "wallets";
|
|
@@ -140,14 +140,13 @@ export interface CheckoutCallbacks {
|
|
|
140
140
|
}): Promise<void>;
|
|
141
141
|
onRestoreClose(): void;
|
|
142
142
|
onRestoreDetails(): void;
|
|
143
|
-
|
|
144
|
-
input: string;
|
|
143
|
+
onGetCountryOptions(details: {
|
|
145
144
|
signal: AbortSignal;
|
|
146
|
-
}): Promise<
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
}): Promise<SelectOption[]>;
|
|
146
|
+
onGetRegionOptions(details: {
|
|
147
|
+
countryCode: string;
|
|
149
148
|
signal: AbortSignal;
|
|
150
|
-
}): Promise<
|
|
149
|
+
}): Promise<SelectOption[]>;
|
|
151
150
|
onKycSubmit(submission: {
|
|
152
151
|
values: KycFormValues;
|
|
153
152
|
documentFront: File | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PlaceCountry, PlaceState } from '../types';
|
|
2
|
+
export type RegionDirectory = {
|
|
3
|
+
getCountries(details: {
|
|
4
|
+
signal?: AbortSignal;
|
|
5
|
+
}): Promise<PlaceCountry[]>;
|
|
6
|
+
getStates(details: {
|
|
7
|
+
countryCode: string;
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
}): Promise<PlaceState[]>;
|
|
10
|
+
};
|
|
11
|
+
export declare function createRegionDirectory({ fetchCountries, fetchStates, }: {
|
|
12
|
+
fetchCountries: (signal?: AbortSignal) => Promise<unknown>;
|
|
13
|
+
fetchStates: (countryCode: string, signal?: AbortSignal) => Promise<unknown>;
|
|
14
|
+
}): RegionDirectory;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lydianpay/sdk-web",
|
|
3
|
-
"version": "3.18.
|
|
3
|
+
"version": "3.18.2",
|
|
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,11 +0,0 @@
|
|
|
1
|
-
import { type KycFormValues } from './kycValidation';
|
|
2
|
-
import type { PlaceAutocompleteResponse, PlaceDetailsResponse } from '../types';
|
|
3
|
-
export declare const KYC_ADDRESS_PARTS: readonly ["street", "city", "region", "postalCode", "country"];
|
|
4
|
-
export type KycAddress = Pick<KycFormValues, (typeof KYC_ADDRESS_PARTS)[number]>;
|
|
5
|
-
export type AddressSuggestion = {
|
|
6
|
-
placeId: string;
|
|
7
|
-
description: string;
|
|
8
|
-
};
|
|
9
|
-
export declare function getAddressSuggestions(response: PlaceAutocompleteResponse): AddressSuggestion[];
|
|
10
|
-
export declare function getKycAddressFromPlace(place: PlaceDetailsResponse): KycAddress | null;
|
|
11
|
-
export declare function hasSameAddressParts(first: KycAddress, second: KycAddress): boolean;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type KycAddress } from '../../kycPlaceAddress';
|
|
2
|
-
export declare const FIELD_ID = "addressSearch";
|
|
3
|
-
declare const AUTO_FOCUSED_PARTS: readonly ["street", "city", "region", "postalCode"];
|
|
4
|
-
export type AutoFocusedAddressPart = (typeof AUTO_FOCUSED_PARTS)[number];
|
|
5
|
-
export type AddressSearchStatus = 'idle' | 'searching' | 'suggesting' | 'fetching' | 'filled' | 'filledWithBlanks' | 'editsKept' | 'unavailable';
|
|
6
|
-
export declare function getStatusText({ status, isOpen, suggestionCount, }: {
|
|
7
|
-
status: AddressSearchStatus;
|
|
8
|
-
isOpen: boolean;
|
|
9
|
-
suggestionCount: number;
|
|
10
|
-
}): string;
|
|
11
|
-
export declare function getRowId(rowIndex: number): string;
|
|
12
|
-
export declare function getFillOutcome(address: KycAddress): {
|
|
13
|
-
status: AddressSearchStatus;
|
|
14
|
-
partToFocus: AutoFocusedAddressPart | undefined;
|
|
15
|
-
};
|
|
16
|
-
export declare function focusPartIfStillInSearch({ searchInput, part, }: {
|
|
17
|
-
searchInput: HTMLInputElement;
|
|
18
|
-
part: AutoFocusedAddressPart;
|
|
19
|
-
}): void;
|
|
20
|
-
export declare function isCountryInputFocused(searchInput: HTMLInputElement): boolean;
|
|
21
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type AddressSuggestion, type KycAddress } from '../../kycPlaceAddress';
|
|
2
|
-
import { type AddressSearchStatus, type AutoFocusedAddressPart } from './AddressSearch.helpers';
|
|
3
|
-
export type AddressFillTarget = {
|
|
4
|
-
readAddress: () => KycAddress;
|
|
5
|
-
fillAddress: (address: KycAddress) => void;
|
|
6
|
-
};
|
|
7
|
-
export declare function useAddressSearch({ readAddress, fillAddress, focusPart, isTypingCountry, }: AddressFillTarget & {
|
|
8
|
-
focusPart: (part: AutoFocusedAddressPart) => void;
|
|
9
|
-
isTypingCountry: () => boolean;
|
|
10
|
-
}): {
|
|
11
|
-
query: string;
|
|
12
|
-
suggestions: AddressSuggestion[];
|
|
13
|
-
status: AddressSearchStatus;
|
|
14
|
-
isOpen: boolean;
|
|
15
|
-
activeIndex: number | null;
|
|
16
|
-
changeQuery: (nextQuery: string) => void;
|
|
17
|
-
selectRow: (rowIndex: number) => void;
|
|
18
|
-
closeList: () => void;
|
|
19
|
-
reopenList: () => void;
|
|
20
|
-
moveActiveRow: (step: 1 | -1) => void;
|
|
21
|
-
};
|