@lydianpay/sdk-web 3.17.1 → 3.18.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-D-wITOYv.js → browser-CpRXBrlm.js} +1 -1
- package/dist/chunks/{connect-multichain-BhbBjXAb.js → connect-multichain-CJf52rh9.js} +9 -9
- package/dist/chunks/{index-C7spYyCi.js → index-97Gtx-8y.js} +2 -2
- package/dist/chunks/{index-DtsHVAzb.js → index-BBjqv--5.js} +2 -2
- package/dist/chunks/{index-DPMWeBay.js → index-BkSKEmfK.js} +1 -1
- package/dist/chunks/{index-DynJfu9S.js → index-CC6lwg0u.js} +159 -128
- package/dist/chunks/{index-CwLxCtBs.js → index-CfbOkWrq.js} +1 -1
- package/dist/chunks/{index-BtfXd3M2.js → index-Df3XemZg.js} +3 -3
- package/dist/chunks/{mountEngine-Dv4yxjrJ.js → mountEngine-Bm7mzS_d.js} +10019 -9600
- package/dist/lydian.js +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/network/base.d.ts +3 -1
- package/dist/types/network/index.d.ts +2 -1
- package/dist/types/network/places/index.d.ts +6 -0
- package/dist/types/types.d.ts +25 -0
- package/dist/types/ui/components/googleMapsLogo.d.ts +1 -0
- package/dist/types/ui/countries.d.ts +1 -0
- package/dist/types/ui/kycPlaceAddress.d.ts +11 -0
- package/dist/types/ui/kycValidation.d.ts +18 -0
- package/dist/types/ui/react/AddressSearch/AddressSearch.d.ts +3 -0
- package/dist/types/ui/react/AddressSearch/AddressSearch.helpers.d.ts +21 -0
- package/dist/types/ui/react/AddressSearch/useAddressSearch.d.ts +21 -0
- package/dist/types/ui/react/KycFieldGroupCard.d.ts +6 -0
- package/dist/types/ui/react/KycFields.d.ts +10 -6
- package/dist/types/ui/react/RadioField.d.ts +8 -0
- package/dist/types/ui/react/checkoutStore.d.ts +9 -0
- package/package.json +1 -1
|
@@ -3,7 +3,9 @@ export declare abstract class Base {
|
|
|
3
3
|
private publishableKey;
|
|
4
4
|
constructor(baseUri: string, publishableKey?: string);
|
|
5
5
|
private headers;
|
|
6
|
-
protected request<T>(endpoint: string, options?: RequestInit
|
|
6
|
+
protected request<T>(endpoint: string, options?: Omit<RequestInit, 'headers'> & {
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
}): Promise<T>;
|
|
7
9
|
protected requestText(endpoint: string, options?: RequestInit): Promise<string>;
|
|
8
10
|
protected requestWithFormData<T>(endpoint: string, options?: RequestInit): Promise<T>;
|
|
9
11
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Base } from './base';
|
|
2
2
|
import { CryptoTransactions } from './cryptotransaction';
|
|
3
3
|
import { Customer } from './customer';
|
|
4
|
+
import { Places } from './places';
|
|
4
5
|
import { Sessions } from './session';
|
|
5
|
-
export type API = Base & CryptoTransactions & Customer & Sessions;
|
|
6
|
+
export type API = Base & CryptoTransactions & Customer & Places & Sessions;
|
|
6
7
|
export declare const API: new (baseUri: string, publishableKey?: string) => API;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Base } from '../base';
|
|
2
|
+
import type { PlaceAutocompleteResponse, PlaceDetailsResponse } from '../../types';
|
|
3
|
+
export declare class Places extends Base {
|
|
4
|
+
autocompleteAddress(input: string, signal?: AbortSignal): Promise<PlaceAutocompleteResponse>;
|
|
5
|
+
getPlaceDetails(placeId: string, signal?: AbortSignal): Promise<PlaceDetailsResponse>;
|
|
6
|
+
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -136,6 +136,31 @@ export type CustomerKYCValidationStatusResponse = {
|
|
|
136
136
|
customerUUID: string;
|
|
137
137
|
kycValidated: boolean;
|
|
138
138
|
};
|
|
139
|
+
export type PlaceAutocompleteResponse = {
|
|
140
|
+
suggestions?: Array<{
|
|
141
|
+
placePrediction?: {
|
|
142
|
+
placeId?: string;
|
|
143
|
+
text?: {
|
|
144
|
+
text?: string;
|
|
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;
|
|
163
|
+
};
|
|
139
164
|
export type CreateSessionRequest = {
|
|
140
165
|
amount: number;
|
|
141
166
|
amountCurrency: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const googleMapsLogoSvg = "<svg aria-hidden=\"true\" focusable=\"false\" version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"105px\" height=\"22px\" viewBox=\"0 0 105 22\" enable-background=\"new 0 0 105 22\" xml:space=\"preserve\"> <g id=\"Logo\"> <g id=\"Outline\" opacity=\"0.8\"> <path fill=\"#FFFFFF\" d=\"M59.77,11.44l-0.93-2.32c-0.16-0.4-0.36-0.81-0.61-1.22c-0.26-0.42-0.6-0.85-1.01-1.27 c-0.49-0.5-1.1-0.9-1.8-1.2c-0.71-0.3-1.49-0.46-2.3-0.46c-1.16,0-2.25,0.3-3.19,0.87V0.48h-5.98v4.77H42 c-0.54-0.18-1.12-0.27-1.72-0.27c-1.68,0-3.21,0.66-4.44,1.92c-0.09,0.09-0.18,0.19-0.26,0.29c-0.1-0.12-0.21-0.24-0.33-0.35 c-1.26-1.23-2.81-1.86-4.6-1.86c-1.77,0-3.36,0.64-4.6,1.86c-0.11,0.11-0.22,0.22-0.32,0.34c-0.1-0.12-0.21-0.23-0.32-0.34 c-1.26-1.23-2.81-1.86-4.6-1.86c-1.55,0-2.91,0.46-4.06,1.38h-2.47l2.46-2.46l-1.48-1.41C13.53,0.83,11.46,0,9.08,0 C6.62,0,4.47,0.88,2.7,2.62C0.91,4.38,0,6.51,0,8.98s0.91,4.61,2.7,6.36c1.78,1.74,3.93,2.62,6.39,2.62 c2.56,0,4.68-0.87,6.28-2.54c0.04-0.04,0.08-0.08,0.12-0.13c0.21,0.29,0.44,0.56,0.7,0.81c1.24,1.22,2.83,1.86,4.6,1.86 c1.8,0,3.34-0.62,4.6-1.86c0.11-0.11,0.22-0.22,0.32-0.34c0.1,0.12,0.21,0.23,0.32,0.34c1.24,1.22,2.83,1.86,4.6,1.86 c1.26,0,2.4-0.31,3.4-0.92l0.45,1.07c0.43,1.02,1.13,1.91,2.08,2.66c1.04,0.81,2.3,1.23,3.75,1.23c1.78,0,3.29-0.58,4.47-1.73 c0.71-0.69,1.21-1.55,1.5-2.58h3.64v-0.67c1,0.62,2.16,0.94,3.42,0.94c1.3,0,2.44-0.32,3.39-0.94c0.85-0.55,1.53-1.21,2.02-1.94 l1.11-1.66l-1.87-1.25L59.77,11.44z\"/> <path fill=\"#FFFFFF\" d=\"M105,10.11l-0.74-1.84c-0.42-1.05-1.13-1.86-2.1-2.43c-0.89-0.51-1.89-0.77-2.98-0.77 c-1.31,0-2.48,0.35-3.48,1.05c-0.24,0.17-0.45,0.36-0.65,0.56c-1.11-1.05-2.46-1.61-3.95-1.61c-0.63,0-1.22,0.09-1.78,0.27h-4.63 v0.6c-0.93-0.58-2-0.87-3.21-0.87c-1.26,0-2.34,0.31-3.22,0.9V1.5h-4.73l-3.11,5.45l-3.1-5.45H62.6v16.19h5.57V15.1h0.65h3.24 h0.65v2.59h5.57v-0.37c0.77,0.42,1.65,0.64,2.62,0.64c0.64,0,1.23-0.09,1.78-0.27h2.03v3.68h5.57v-3.46 c0.27,0.04,0.56,0.06,0.84,0.06c1.5,0,2.87-0.57,3.98-1.64c0.2,0.2,0.42,0.39,0.65,0.56c0.96,0.72,2.14,1.08,3.51,1.08 c1.43,0,2.65-0.4,3.63-1.2c1.08-0.88,1.66-2.07,1.66-3.42c0-0.97-0.32-1.89-0.93-2.66L105,10.11z\"/> </g> <g id=\"Inner_text\"> <g> <path fill=\"#474747\" d=\"M9.08,8.35v1.9h4.58c-0.14,1.04-0.48,1.84-1.04,2.4c-0.94,0.93-2.11,1.4-3.53,1.4 c-1.4,0-2.58-0.49-3.55-1.48c-0.97-0.98-1.46-2.18-1.46-3.59c0-1.41,0.48-2.6,1.45-3.59C6.5,4.4,7.68,3.91,9.08,3.91 c1.33,0,2.47,0.45,3.44,1.36l1.35-1.35C12.53,2.64,10.93,2,9.08,2C7.15,2,5.49,2.68,4.09,4.05C2.7,5.42,2,7.06,2,8.98 c0,1.92,0.7,3.56,2.09,4.93c1.4,1.37,3.06,2.05,4.99,2.05c2,0,3.63-0.65,4.87-1.96c1.1-1.1,1.65-2.59,1.65-4.46 c0-0.45-0.03-0.85-0.1-1.19H9.08z\"/> <path fill=\"#474747\" d=\"M42.72,7.97h-0.07c-0.24-0.29-0.57-0.53-0.98-0.72c-0.42-0.19-0.88-0.29-1.39-0.29 c-1.14,0-2.15,0.44-3.01,1.32c-0.86,0.88-1.29,1.94-1.29,3.19c0,1.24,0.43,2.3,1.29,3.17c0.86,0.87,1.86,1.31,3.01,1.31 c1.02,0,1.81-0.34,2.37-1.02h0.07v0.65c0,0.85-0.21,1.51-0.64,1.96c-0.42,0.45-1.01,0.68-1.76,0.68c-0.55,0-1.02-0.16-1.41-0.48 c-0.38-0.31-0.67-0.69-0.85-1.12l-1.72,0.72c0.29,0.71,0.78,1.33,1.46,1.86c0.68,0.53,1.52,0.8,2.52,0.8 c1.25,0,2.27-0.39,3.07-1.17c0.8-0.78,1.2-1.95,1.2-3.52V7.24h-1.87V7.97z M42.16,13.42c-0.46,0.51-1.03,0.77-1.71,0.77 c-0.69,0-1.28-0.26-1.77-0.78c-0.49-0.51-0.73-1.16-0.73-1.93c0-0.78,0.24-1.44,0.73-1.96c0.49-0.52,1.08-0.78,1.77-0.78 c0.68,0,1.25,0.26,1.71,0.79c0.46,0.52,0.69,1.18,0.69,1.96C42.85,12.26,42.62,12.9,42.16,13.42z\"/> <path fill=\"#474747\" d=\"M20.8,6.97c-1.26,0-2.33,0.43-3.2,1.29s-1.31,1.93-1.31,3.21c0,1.28,0.44,2.35,1.31,3.21 s1.94,1.29,3.2,1.29s2.33-0.43,3.2-1.29c0.88-0.86,1.31-1.93,1.31-3.21c0-1.28-0.44-2.35-1.31-3.21S22.06,6.97,20.8,6.97z M22.59,13.42c-0.5,0.51-1.1,0.77-1.79,0.77s-1.29-0.25-1.79-0.77c-0.5-0.52-0.75-1.17-0.75-1.95c0-0.8,0.25-1.45,0.74-1.96 c0.5-0.51,1.1-0.77,1.8-0.77S22.1,9,22.6,9.51c0.49,0.51,0.74,1.17,0.74,1.96C23.34,12.25,23.09,12.9,22.59,13.42z\"/> <rect x=\"45.95\" y=\"2.48\" fill=\"#474747\" width=\"1.98\" height=\"13.21\"/> <path fill=\"#474747\" d=\"M53.34,14.2c-0.99,0-1.71-0.45-2.18-1.36l6.01-2.49l-0.2-0.51c-0.11-0.3-0.26-0.59-0.44-0.89 c-0.18-0.29-0.42-0.6-0.73-0.91c-0.31-0.32-0.69-0.57-1.16-0.77c-0.47-0.2-0.97-0.3-1.52-0.3c-1.19,0-2.19,0.42-3.01,1.26 c-0.82,0.84-1.23,1.92-1.23,3.24c0,1.27,0.43,2.34,1.28,3.2c0.85,0.86,1.91,1.29,3.18,1.29c0.91,0,1.68-0.2,2.29-0.6 c0.63-0.41,1.11-0.87,1.45-1.38l-1.53-1.02C54.99,13.79,54.25,14.2,53.34,14.2z M51.56,9.43c0.51-0.48,1.05-0.72,1.63-0.72 c0.39,0,0.73,0.08,1.04,0.26c0.31,0.18,0.52,0.41,0.63,0.69l-4.02,1.67C50.82,10.54,51.06,9.9,51.56,9.43z\"/> <path fill=\"#474747\" d=\"M30.65,6.97c-1.26,0-2.33,0.43-3.2,1.29s-1.31,1.93-1.31,3.21c0,1.28,0.44,2.35,1.31,3.21 s1.94,1.29,3.2,1.29c1.26,0,2.33-0.43,3.2-1.29c0.87-0.86,1.31-1.93,1.31-3.21c0-1.28-0.44-2.35-1.31-3.21S31.91,6.97,30.65,6.97 z M32.44,13.42c-0.5,0.51-1.1,0.77-1.79,0.77s-1.29-0.25-1.79-0.77c-0.5-0.52-0.75-1.17-0.75-1.95c0-0.8,0.25-1.45,0.74-1.96 c0.5-0.51,1.1-0.77,1.8-0.77c0.71,0,1.31,0.26,1.8,0.77s0.74,1.17,0.74,1.96C33.19,12.25,32.94,12.9,32.44,13.42z\"/> </g> <g> <polygon fill=\"#474747\" points=\"70.48,10.92 70.41,10.92 66.17,3.5 64.6,3.5 64.6,15.69 66.17,15.69 66.17,8.45 66.1,6.41 66.17,6.41 69.98,13.1 70.9,13.1 74.72,6.41 74.79,6.41 74.72,8.45 74.72,15.69 76.29,15.69 76.29,3.5 74.72,3.5 \t\t\t\"/> <path fill=\"#474747\" d=\"M81.5,7.07c-0.93,0-1.68,0.21-2.25,0.64S78.3,8.6,78.11,9.1l1.44,0.61c0.14-0.38,0.39-0.67,0.76-0.89 c0.36-0.21,0.78-0.32,1.23-0.32c0.61,0,1.13,0.18,1.55,0.55c0.42,0.37,0.63,0.86,0.63,1.47v0.24c-0.59-0.34-1.34-0.51-2.26-0.51 c-1.04,0-1.91,0.25-2.61,0.77c-0.71,0.52-1.06,1.23-1.06,2.14c0,0.84,0.29,1.52,0.89,2.03c0.59,0.51,1.33,0.77,2.22,0.77 c1.21,0,2.12-0.47,2.75-1.43h0.07v1.16h1.5v-5.04c0-1.14-0.36-2.02-1.06-2.64C83.45,7.38,82.57,7.07,81.5,7.07z M82.92,13.81 c-0.53,0.48-1.11,0.72-1.76,0.72c-0.46,0-0.86-0.12-1.21-0.35c-0.35-0.24-0.53-0.56-0.53-0.97c0-0.44,0.19-0.83,0.58-1.16 s0.96-0.49,1.72-0.49c0.88,0,1.55,0.18,1.99,0.54C83.71,12.76,83.45,13.33,82.92,13.81z\"/> <path fill=\"#474747\" d=\"M91.12,7.08c-0.63,0-1.2,0.14-1.71,0.41c-0.5,0.27-0.88,0.61-1.13,1.02h-0.07V7.35h-1.5v12.02h1.57v-3.68 l-0.07-1.16h0.07c0.25,0.41,0.62,0.75,1.13,1.02c0.5,0.27,1.07,0.41,1.71,0.41c1.08,0,2.01-0.42,2.79-1.26 c0.79-0.85,1.18-1.91,1.18-3.17c0-1.26-0.4-2.32-1.18-3.17C93.13,7.51,92.2,7.08,91.12,7.08z M92.73,13.7 c-0.52,0.55-1.14,0.83-1.87,0.83c-0.73,0-1.36-0.27-1.88-0.82c-0.51-0.55-0.77-1.28-0.77-2.2s0.25-1.66,0.77-2.2 c0.51-0.55,1.14-0.82,1.88-0.82c0.72,0,1.35,0.28,1.87,0.83c0.52,0.55,0.78,1.28,0.78,2.19C93.51,12.42,93.25,13.15,92.73,13.7z\" /> <path fill=\"#474747\" d=\"M101.96,11.84c-0.38-0.45-0.96-0.76-1.74-0.94l-1.65-0.39c-0.74-0.17-1.11-0.49-1.11-0.97 c0-0.33,0.16-0.59,0.48-0.78s0.71-0.29,1.18-0.29c0.97,0,1.6,0.37,1.91,1.11l1.36-0.56c-0.25-0.63-0.66-1.1-1.24-1.44 c-0.58-0.33-1.24-0.5-1.98-0.5c-0.89,0-1.67,0.23-2.32,0.69c-0.65,0.46-0.98,1.06-0.98,1.8c0,0.65,0.24,1.16,0.72,1.54 s0.99,0.63,1.52,0.77l1.69,0.41c0.76,0.2,1.14,0.57,1.14,1.11c0,0.35-0.16,0.63-0.47,0.85c-0.31,0.21-0.71,0.32-1.2,0.32 c-1.06,0-1.82-0.53-2.26-1.57l-1.4,0.58c0.29,0.68,0.73,1.25,1.34,1.7c0.61,0.45,1.38,0.68,2.31,0.68c0.96,0,1.75-0.25,2.34-0.75 c0.61-0.5,0.92-1.12,0.92-1.87C102.52,12.78,102.33,12.28,101.96,11.84z\"/> </g> </g> </g> </svg>";
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -25,6 +25,10 @@ export type KycFieldGroup = {
|
|
|
25
25
|
count: number;
|
|
26
26
|
shownParts: KycFieldPart[];
|
|
27
27
|
};
|
|
28
|
+
export type KycGroupChoice = {
|
|
29
|
+
field: KycField;
|
|
30
|
+
parts: KycFieldPart[];
|
|
31
|
+
};
|
|
28
32
|
export type KycRequirements = {
|
|
29
33
|
requiredFields: KycField[];
|
|
30
34
|
requiredParts: KycFieldPart[];
|
|
@@ -36,6 +40,20 @@ export declare function getKycRequirements({ transaction, hasConnectedWallet, }:
|
|
|
36
40
|
transaction: Partial<CreateTransactionResponse>;
|
|
37
41
|
hasConnectedWallet: boolean;
|
|
38
42
|
}): KycRequirements;
|
|
43
|
+
export declare function getKycGroupChoices(group: KycFieldGroup): KycGroupChoice[];
|
|
44
|
+
export declare function getKycChoiceInputs({ group, chosenFields, }: {
|
|
45
|
+
group: KycFieldGroup;
|
|
46
|
+
chosenFields: KycField[];
|
|
47
|
+
}): KycGroupChoice[];
|
|
48
|
+
export declare function getInitialKycChoiceFields({ group, values, }: {
|
|
49
|
+
group: KycFieldGroup;
|
|
50
|
+
values: KycFormValues;
|
|
51
|
+
}): KycField[];
|
|
52
|
+
export declare function getHiddenFilledParts({ group, chosenFields, values, }: {
|
|
53
|
+
group: KycFieldGroup;
|
|
54
|
+
chosenFields: KycField[];
|
|
55
|
+
values: KycFormValues;
|
|
56
|
+
}): KycFieldPart[];
|
|
39
57
|
export declare function canFulfillKycRequirements({ requiredFields, fieldGroups, documentTypes, unsupportedFields, }: KycRequirements): boolean;
|
|
40
58
|
export declare function isKycEmailCollected({ requiredParts, fieldGroups }: KycRequirements): boolean;
|
|
41
59
|
export declare function getKycPartError(part: KycFieldPart, values: KycFormValues): string | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type KycFieldListProps } from './KycFields';
|
|
3
|
+
import { type KycFieldGroup } from '../kycValidation';
|
|
4
|
+
export default function KycFieldGroupCard({ group, ...inputProps }: KycFieldListProps & {
|
|
5
|
+
group: KycFieldGroup;
|
|
6
|
+
}): React.JSX.Element;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import type { AddressFillTarget } from './AddressSearch/useAddressSearch';
|
|
3
|
+
import { type KycFieldPart, type KycFormValues } from '../kycValidation';
|
|
3
4
|
import type { SelectOption } from '../optionFilter';
|
|
4
|
-
type KycInputProps = {
|
|
5
|
+
export type KycInputProps = {
|
|
5
6
|
values: KycFormValues;
|
|
6
7
|
countries: SelectOption[];
|
|
7
8
|
onChange: (part: KycFieldPart, value: string) => void;
|
|
8
9
|
};
|
|
9
|
-
export
|
|
10
|
+
export type KycFieldListProps = KycInputProps & {
|
|
11
|
+
addressFillTarget: AddressFillTarget;
|
|
12
|
+
};
|
|
13
|
+
export declare function KycFieldList({ parts, addressFillTarget, ...inputProps }: KycFieldListProps & {
|
|
10
14
|
parts: KycFieldPart[];
|
|
11
15
|
}): React.JSX.Element;
|
|
12
|
-
export declare function
|
|
13
|
-
|
|
16
|
+
export declare function KycSection({ title, children }: {
|
|
17
|
+
title: string;
|
|
18
|
+
children: React.ReactNode;
|
|
14
19
|
}): React.JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -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 { KycFormValues } from '../kycValidation';
|
|
5
|
+
import type { AddressSuggestion, KycAddress } from '../kycPlaceAddress';
|
|
5
6
|
export declare const SCREEN_NAMES: {
|
|
6
7
|
readonly PAY_BUTTONS: "payButtons";
|
|
7
8
|
readonly WALLETS: "wallets";
|
|
@@ -139,6 +140,14 @@ export interface CheckoutCallbacks {
|
|
|
139
140
|
}): Promise<void>;
|
|
140
141
|
onRestoreClose(): void;
|
|
141
142
|
onRestoreDetails(): void;
|
|
143
|
+
onSearchAddresses(details: {
|
|
144
|
+
input: string;
|
|
145
|
+
signal: AbortSignal;
|
|
146
|
+
}): Promise<AddressSuggestion[]>;
|
|
147
|
+
onGetPlaceAddress(details: {
|
|
148
|
+
placeId: string;
|
|
149
|
+
signal: AbortSignal;
|
|
150
|
+
}): Promise<KycAddress | null>;
|
|
142
151
|
onKycSubmit(submission: {
|
|
143
152
|
values: KycFormValues;
|
|
144
153
|
documentFront: File | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lydianpay/sdk-web",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.18.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": {
|